From 16e7ea3109755e1efbe1b48d663ed0dae5991192 Mon Sep 17 00:00:00 2001 From: SDE Date: Wed, 29 Nov 2023 17:50:59 +0300 Subject: [PATCH] 0.7.93 meta names --- ArticlesApp/views.py | 4 +-- GeneralApp/admin.py | 6 ++++ templates/inter/meta_names.html | 19 ++++++++++ templates/pages/p_article.html | 62 ++++++++++++++++---------------- templates/pages/p_main.html | 25 +++++++------ templates/pages/p_user_page.html | 8 ++--- templates/tb_base.html | 3 +- 7 files changed, 78 insertions(+), 49 deletions(-) create mode 100644 templates/inter/meta_names.html diff --git a/ArticlesApp/views.py b/ArticlesApp/views.py index ea4f70c..dbed331 100644 --- a/ArticlesApp/views.py +++ b/ArticlesApp/views.py @@ -108,7 +108,7 @@ def UserPageView(request, page_url): # print('article_breadcrumbs',article_breadcrumbs) Dict = { - 'art' : art, + 'page' : art, 'user_page' : True, # 'service' : service, # 'article_breadcrumbs' : article_breadcrumbs @@ -139,7 +139,7 @@ def ArticlesOnePageView(request, art_url): # print('article_breadcrumbs',article_breadcrumbs) Dict = { - 'art' : art, + 'page' : art, } Dict.update(get_article_breadcrumbs(request, art)) diff --git a/GeneralApp/admin.py b/GeneralApp/admin.py index daa9135..e724391 100644 --- a/GeneralApp/admin.py +++ b/GeneralApp/admin.py @@ -14,6 +14,12 @@ class Admin_StaticPage(Admin_Trans_BaseModelViewPage): 'order', ) }), + ('Настройки', { + 'classes': ['wide', 'collapse'], + 'fields': ( + 'FAQ_title', + ) + }), ('SEO', { 'classes': ['wide', 'collapse'], 'fields': ( diff --git a/templates/inter/meta_names.html b/templates/inter/meta_names.html new file mode 100644 index 0000000..7184830 --- /dev/null +++ b/templates/inter/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/pages/p_article.html b/templates/pages/p_article.html index f649ecc..b91d222 100644 --- a/templates/pages/p_article.html +++ b/templates/pages/p_article.html @@ -11,10 +11,10 @@
-
{{ art.name }}
-
-
{{ art.description }}
-
{{ art.text|safe }}
+
{{ page.name }}
+
+
{{ page.description }}
+
{{ page.text|safe }}
@@ -28,46 +28,46 @@ {% for item in arts_top %} -
- -
-
{{ item.name }}
-
- {{ item.description|truncatechars:100 }} -
-
-
+ {#
{{ art.text|safe }}
#} {% endfor %}
-
-
{{ art.name }}
-
- {{ art.description|truncatechars:100 }} -
-
- +
+
{{ page.name }}
+
+ {{ page.description|truncatechars:100 }} +
+
+ {% for item in arts_down %} - diff --git a/templates/pages/p_main.html b/templates/pages/p_main.html index bb2deac..4d0d160 100644 --- a/templates/pages/p_main.html +++ b/templates/pages/p_main.html @@ -3,6 +3,8 @@ {% load i18n %} {% block meta %} + + @@ -209,16 +211,19 @@
-
-

- {% if page.FAQ_title %}{{ page.FAQ_title }}{% else %}{% translate "Частые вопросы" %}{% endif %} -

- {% for faq_item in page.get_FAQ_items %} -
- {{ faq_item.question }} -

{{ faq_item.answer }}

-
- {% endfor %} + + {% if page.get_FAQ_items %} +
+

+ {% if page.FAQ_title %}{{ page.FAQ_title }}{% else %}{% translate "Частые вопросы" %}{% endif %} +

+ {% for faq_item in page.get_FAQ_items %} +
+ {{ faq_item.question }} +

{{ faq_item.answer }}

+
+ {% endfor %} + {% endif %} diff --git a/templates/pages/p_user_page.html b/templates/pages/p_user_page.html index 4761e10..8af54ac 100644 --- a/templates/pages/p_user_page.html +++ b/templates/pages/p_user_page.html @@ -1,9 +1,9 @@ {% extends "tb_base.html" %} {% block content %} -
{{ art.name }}
- {% if art.description != none %} -
{{ art.description }}
+
{{ page.name }}
+ {% if page.description != none %} +
{{ page.description }}
{% endif %} -
{{ art.text|safe }}
+
{{ page.text|safe }}
{% endblock %} \ No newline at end of file diff --git a/templates/tb_base.html b/templates/tb_base.html index bb4b30e..c58cb51 100644 --- a/templates/tb_base.html +++ b/templates/tb_base.html @@ -6,9 +6,8 @@ - Title - + {% include "inter/meta_names.html" %} {# #}