Mr Duhaz 10 kuukautta sitten
vanhempi
sitoutus
acdaabe155
3 muutettua tiedostoa jossa 42 lisäystä ja 14 poistoa
  1. 12 11
      templates/base.html
  2. 16 3
      templates/base_no_card.html
  3. 14 0
      views.py

+ 12 - 11
templates/base.html

@@ -121,22 +121,23 @@
 				{% endfor %}
 				</div>
 			{% endif %}
-			<div class="card" style="background-color: rgba(250,250,250,0.88);" >
+			{% if page.c_card_mp == 'True'%}<div class="card" style="background-color: rgba(250,250,250,0.88);" >
 				{% if page.p_see_title_and_des_in_templates == True %}
 				<div class="card-header">
 						<h2>{% block title %}{% if page.p_icone != "" %}<i class="{{page.p_icone}}"></i> {% endif %}{{page.p_titre|safe}}{% endblock %}</h2>
 				</div>
 				{% endif %}
-				{% if page.p_include %}
-					{% include page.p_include %}
-				{% else %}
-					{% block main %}{% endblock %}
-				{% endif %}
-			</div>
+			{% endif %}
+			{% if page.p_include %}
+				{% include page.p_include %}
+			{% else %}
+				{% block main %}{% endblock %}
+			{% endif %}
+			{% if page.c_card_mp != 'None'%}</div>{% endif %}
 		</div>
 		<div class="col-lg-3 p-lg-1 p-md-0 mb-sm-1">
-			<div class="card" style="background-color: rgba(250,250,250,0.88);" >
-				{% include 'feeds_link.html' %}
+			{% if page.c_card_rp == 'True'%}<div class="card" style="background-color: rgba(250,250,250,0.88);" >{% endif %}
+				{% if page.c_includ_rp != 'None'%}{% include page.c_includ_rp %}{% endif %}
 				{% block right_panel %}
 				{% endblock %}
 				{% if not request.user.is_authenticated and page.p_right and not "account/" in request.path %}
@@ -154,9 +155,9 @@
 						<script>
 							(adsbygoogle = window.adsbygoogle || []).push({});
 						</script>
-					</div>
 				{% endif %}
-			</div>
+			{% if page.c_card_rp != 'None'%}</div>{% endif %}
+		</div>
 	</div>
 </div>
 </main>

+ 16 - 3
templates/base_no_card.html

@@ -123,11 +123,24 @@
 				{% endfor %}
 				</div>
 			{% endif %}
-			{% block main %}{% endblock %}
+			{% if page.c_card_mp == 'True'%}<div class="card" style="background-color: rgba(250,250,250,0.88);" >
+				{% if page.p_see_title_and_des_in_templates == True %}
+				<div class="card-header">
+						<h2>{% block title %}{% if page.p_icone != "" %}<i class="{{page.p_icone}}"></i> {% endif %}{{page.p_titre|safe}}{% endblock %}</h2>
+				</div>
+				{% endif %}
+			{% endif %}
+			{% if page.p_include %}
+				{% include page.p_include %}
+			{% else %}
+				{% block main %}{% endblock %}
+			{% endif %}
+			{% if page.c_card_mp != 'None'%}</div>{% endif %}
 		</div>
 		
 		<div class="col-lg-3 p-lg-1 p-md-0 mb-sm-1">
-			{% include 'feeds_link.html' %}
+			{% if page.c_card_rp == 'True'%}<div class="card" style="background-color: rgba(250,250,250,0.88);" >{% endif %}
+			{% if page.c_includ_rp != 'None'%}{% include page.c_includ_rp %}{% endif %}
 			{% block right_panel %}
 			{% endblock %}
 			{% if not request.user.is_authenticated and page.p_right and not "account/" in request.path %}
@@ -146,7 +159,7 @@
 						(adsbygoogle = window.adsbygoogle || []).push({});
 					</script>
 			{% endif %}
-			</div>
+			{% if page.c_card_rp != 'None'%}</div>{% endif %}
 		</div>
 	</div>
 </div>

+ 14 - 0
views.py

@@ -74,6 +74,16 @@ def get_data_value(name):
 			data.d_type = "txt"
 			data.d_variable = "None"
 			data.save()
+		elif name == "card-main-panel":
+			data.d_titre = name
+			data.d_type = "txt"
+			data.d_variable = "True"
+			data.save()
+		elif name == "card-right-panel":
+			data.d_titre = name
+			data.d_type = "txt"
+			data.d_variable = "True"
+			data.save()
 		else :
 			data.d_variable = "Blop"
 	return data.d_variable
@@ -102,6 +112,8 @@ def gen_page_base():
 	page.c_bgimagelogo = get_data_value('background-logo')
 	page.c_menulogin = get_data_value('login-menu')
 	page.c_includ_rp = get_data_value('includ-right-panel')
+	page.c_card_mp = get_data_value('card-main-panel')
+	page.c_card_rp = get_data_value('card-right-panel')
 
 	return page
 
@@ -126,6 +138,8 @@ def gen_page_sys(p_titre_slugify):
 	page.c_bgimagelogo = get_data_value('background-logo')
 	page.c_menulogin = get_data_value('login-menu')
 	page.c_includ_rp = get_data_value('includ-right-panel')
+	page.c_card_mp = get_data_value('card-main-panel')
+	page.c_card_rp = get_data_value('card-right-panel')
 	
 	return page