From b3c84f3a4462a22054109fc9697bccc66247ac10 Mon Sep 17 00:00:00 2001 From: SDE Date: Sat, 6 Jan 2024 00:00:54 +0300 Subject: [PATCH] 0.4.43 title and description --- GeneralApp/models.py | 12 +++++++++--- templates/blocks/b_sections_buttons.html | 4 +++- templates/head_includes/fonts_include.html | 8 ++++++++ templates/head_includes/meta_names.html | 19 +++++++++++++++++++ templates/tb_base.html | 8 +------- 5 files changed, 40 insertions(+), 11 deletions(-) create mode 100644 templates/head_includes/meta_names.html diff --git a/GeneralApp/models.py b/GeneralApp/models.py index 47db03c..01eb505 100644 --- a/GeneralApp/models.py +++ b/GeneralApp/models.py @@ -203,9 +203,15 @@ class Office(BaseModelViewPage): # footer_info = RichTextUploadingField(verbose_name=_('Информация в подвале'), null=True, blank=True) def __str__(self): - if self.name: - return self.name - return self.address + name_list = [] + if self.city: + name_list.append(self.city) + if self.address: + name_list.append(self.address) + if name_list: + return ' '.join(name_list) + + return self.id def save(self, *args, **kwargs): # self.order = 0 diff --git a/templates/blocks/b_sections_buttons.html b/templates/blocks/b_sections_buttons.html index 2e4dbd5..d2fa395 100644 --- a/templates/blocks/b_sections_buttons.html +++ b/templates/blocks/b_sections_buttons.html @@ -6,7 +6,9 @@
{{ section.name }}
-
{{ section.description }}
+ {% if section.description %} +
{{ section.description }}
+ {% endif %}
перейти в раздел
diff --git a/templates/head_includes/fonts_include.html b/templates/head_includes/fonts_include.html index d2cec2a..3cc5cf2 100644 --- a/templates/head_includes/fonts_include.html +++ b/templates/head_includes/fonts_include.html @@ -1,4 +1,12 @@ {% load static %} + + + + +{# #} + +{# #} + {##} {##} {##} diff --git a/templates/head_includes/meta_names.html b/templates/head_includes/meta_names.html new file mode 100644 index 0000000..7184830 --- /dev/null +++ b/templates/head_includes/meta_names.html @@ -0,0 +1,19 @@ +{% if page.seo_title %} + {{ page.seo_title }} +{% elif page.title %} + {{ page.title }} +{% elif page.name %} + {{ page.name }} +{% endif %} + +{% if page.seo_description %} + +{% elif page.description %} + +{% endif %} + +{% if page.seo_keywords %} + +{% elif page.description %} + +{% endif %} \ No newline at end of file diff --git a/templates/tb_base.html b/templates/tb_base.html index 051bd5d..54fa3ce 100644 --- a/templates/tb_base.html +++ b/templates/tb_base.html @@ -4,15 +4,9 @@ - AerBim + {% include 'head_includes/meta_names.html' %} {% include 'head_includes/fonts_include.html' %} - - - - -{# #} -