Browse Source

add site version

Mr Duhaz 7 months ago
parent
commit
2fb9972c8f
3 changed files with 8 additions and 2 deletions
  1. 1 1
      templates/base.html
  2. 1 1
      templates/base_no_card.html
  3. 6 0
      views.py

+ 1 - 1
templates/base.html

@@ -165,7 +165,7 @@
 </main>
 <footer class="footer mt-auto py-1 text-white" style="background-color: {{page.c_bgcolor}};">
 	<div class="container">
-		{{page.c_sitename}} - Jan. 2024
+		{{page.c_sitename}} - {{page.c_siteversion}}
 		{% if page.p_menu_pied %}
 		{% for item in page.p_menu_pied %}
 			<a class="link-light" href="{{item.p_adresse}}">{{item.p_titre}}</a>{% if not forloop.last %}, {% endif %}

+ 1 - 1
templates/base_no_card.html

@@ -168,7 +168,7 @@
 </main>
 <footer class="footer mt-auto py-1 text-white" style="background-color: {{page.c_bgcolor}};">
 	<div class="container">
-		{{page.c_sitename}} - Jan. 2024
+		{{page.c_sitename}} - {{page.c_siteversion}}
 		{% if page.p_menu_pied %}
 		{% for item in page.p_menu_pied %}
 			<a class="link-light" href="{{item.p_adresse}}">{{item.p_titre}}</a>{% if not forloop.last %}, {% endif %}

+ 6 - 0
views.py

@@ -49,6 +49,11 @@ def get_data_value(name):
 			data.d_type = "txt"
 			data.d_variable = "far fa-clone"
 			data.save()
+		elif name == "site-version":
+			data.d_titre = name
+			data.d_type = "txt"
+			data.d_variable = "Jan. 2024"
+			data.save()
 		elif name == "background-color":
 			data.d_titre = name
 			data.d_type = "txt"
@@ -106,6 +111,7 @@ def gen_page_base():
 	page.p_see_title_and_des_in_templates = True
 
 	page.c_sitename = get_data_value('site-name')
+	page.c_siteversion = get_data_value('site-version')
 	page.c_sitelogo = get_data_value('site-logo')
 	page.c_bgcolor = get_data_value('background-color')
 	page.c_bgimage = get_data_value('background')