From 3a7501dcc6970acd435235f9d68ae4c56d1fb565 Mon Sep 17 00:00:00 2001 From: eraden Date: Fri, 29 Jul 2022 19:29:15 +0200 Subject: [PATCH] Add account id to every view --- server/assets/templates/businesses/editor.html | 2 +- server/assets/templates/businesses/index.html | 2 +- server/assets/templates/marketplace/edit.html | 2 +- server/assets/templates/marketplace/index.html | 8 +------- server/assets/templates/marketplace/new.html | 2 +- server/assets/templates/news.html | 2 +- server/assets/templates/offers/index.html | 2 +- server/assets/templates/privacy-policy.html | 2 +- server/assets/templates/register.html | 2 +- server/assets/templates/sign-in.html | 2 +- server/assets/templates/terms-and-condition.html | 4 ++-- server/src/view/mod.rs | 7 +++++++ 12 files changed, 19 insertions(+), 18 deletions(-) diff --git a/server/assets/templates/businesses/editor.html b/server/assets/templates/businesses/editor.html index f5d9d23..0f8bafc 100644 --- a/server/assets/templates/businesses/editor.html +++ b/server/assets/templates/businesses/editor.html @@ -1,7 +1,7 @@ {% extends "../base.html" %} {% block content %} - + {% for contact in contacts %} diff --git a/server/assets/templates/businesses/index.html b/server/assets/templates/businesses/index.html index e0dcfa5..06cb51b 100644 --- a/server/assets/templates/businesses/index.html +++ b/server/assets/templates/businesses/index.html @@ -1,7 +1,7 @@ {% extends "../base.html" %} {% block content %}

Lokalne usługi

- + {% for business in businesses %} +

Edycja oferty

+

Rzeczy wystawione na sprzedaż

{% for offer in my_offers %} diff --git a/server/assets/templates/marketplace/new.html b/server/assets/templates/marketplace/new.html index 994eadc..ba9452a 100644 --- a/server/assets/templates/marketplace/new.html +++ b/server/assets/templates/marketplace/new.html @@ -1,6 +1,6 @@ {% extends "../base.html" %} {% block content %} - +

Tworzenie oferty

diff --git a/server/assets/templates/news.html b/server/assets/templates/news.html index cdef87b..670b7fc 100644 --- a/server/assets/templates/news.html +++ b/server/assets/templates/news.html @@ -1,6 +1,6 @@ {% extends "base.html" %} {% block content %} - + {% for article in news %} +

Sprzedaż niepotrzebnych rzeczy

diff --git a/server/assets/templates/privacy-policy.html b/server/assets/templates/privacy-policy.html index 00dc2c7..d512703 100644 --- a/server/assets/templates/privacy-policy.html +++ b/server/assets/templates/privacy-policy.html @@ -1,6 +1,6 @@ {% extends "base.html" %} {% block content %} - +

POLITYKA PRYWATNOŚCI STRONY INTERNETOWEJ
https://oswilno.pl/

  1. diff --git a/server/assets/templates/register.html b/server/assets/templates/register.html index 5707c77..be928e5 100644 --- a/server/assets/templates/register.html +++ b/server/assets/templates/register.html @@ -1,6 +1,6 @@ {% extends "base.html" %} {% block content %} - + diff --git a/server/assets/templates/sign-in.html b/server/assets/templates/sign-in.html index a3a7fbc..1080b89 100644 --- a/server/assets/templates/sign-in.html +++ b/server/assets/templates/sign-in.html @@ -1,6 +1,6 @@ {% extends "base.html" %} {% block content %} - + {% endblock %} diff --git a/server/assets/templates/terms-and-condition.html b/server/assets/templates/terms-and-condition.html index ba0dd1c..47e71bd 100644 --- a/server/assets/templates/terms-and-condition.html +++ b/server/assets/templates/terms-and-condition.html @@ -1,6 +1,6 @@ {% extends "base.html" %} {% block content %} - +

    REGULAMIN SERIWSU INTERNETOWEGO
    oswilno.pl

     

    § 1. DEFINICJE

    @@ -16,7 +16,7 @@ Mieszkaniec - osoba zamieszkująca dzielnicę Elsnerów w Warszawie.
  2. - Upoważniony użytkownik - osoba zarejestrowana i nie będąca Mieszkańcem. + Upoważniony użytkownik — osoba zarejestrowana i nie będąca Mieszkańcem.
  3. Gość - osoba niezarejestrowana korzystająca z serwisu. diff --git a/server/src/view/mod.rs b/server/src/view/mod.rs index dd0d4bc..88a8850 100644 --- a/server/src/view/mod.rs +++ b/server/src/view/mod.rs @@ -29,6 +29,13 @@ impl Helper { .unwrap_or_default() } + pub fn account_id_tag(&self, account: &Option) -> String { + account + .as_ref() + .map(|a| format!("account-id={}", a.id)) + .unwrap_or_default() + } + pub fn email<'a>(&self, account: &'a Option) -> &'a str { account .as_ref()