From 64d0cc2fa80985adecc5cfdbbfee44627c4ffa1a Mon Sep 17 00:00:00 2001 From: Skia Date: Sat, 25 Sep 2021 02:52:13 +0200 Subject: [PATCH] counter: don't display info boxes and navigation menu This will lighten the pages and make the functionality directly accessible without ever scrolling the header garbage that is never needed on those pages. --- com/tests.py | 15 +++++++----- core/templates/core/base.jinja | 24 ++++++++++--------- .../counter/cash_register_summary.jinja | 6 +++++ counter/templates/counter/counter_click.jinja | 9 ++++--- counter/templates/counter/counter_main.jinja | 6 +++++ counter/templates/counter/last_ops.jinja | 6 +++++ 6 files changed, 46 insertions(+), 20 deletions(-) diff --git a/com/tests.py b/com/tests.py index 398b22fe..d42a056e 100644 --- a/com/tests.py +++ b/com/tests.py @@ -79,9 +79,11 @@ class ComTest(TestCase): ) r = self.client.get(reverse("core:index")) self.assertTrue(r.status_code == 200) - self.assertTrue( - """
\\n

ALERTE!

\\n

Caaaataaaapuuuulte!!!!

""" - in str(r.content) + self.assertContains( + r, + """
+

ALERTE!

+

Caaaataaaapuuuulte!!!!

""", ) def test_info_msg(self): @@ -95,9 +97,10 @@ class ComTest(TestCase): ) r = self.client.get(reverse("core:index")) self.assertTrue(r.status_code == 200) - self.assertTrue( - """
\\n

INFO: Caaaataaaapuuuulte!!!!

""" - in str(r.content) + self.assertContains( + r, + """
+

INFO: Caaaataaaapuuuulte!!!!

""", ) def test_birthday_non_subscribed_user(self): diff --git a/core/templates/core/base.jinja b/core/templates/core/base.jinja index 952e0f43..e03230ef 100644 --- a/core/templates/core/base.jinja +++ b/core/templates/core/base.jinja @@ -126,17 +126,19 @@
- {% set sith = get_sith() %} - {% if sith.alert_msg %} -
- {{ sith.alert_msg|markdown }} -
- {% endif %} - {% if sith.info_msg %} -
- {{ sith.info_msg|markdown }} -
- {% endif %} + {% block info_boxes %} + {% set sith = get_sith() %} + {% if sith.alert_msg %} +
+ {{ sith.alert_msg|markdown }} +
+ {% endif %} + {% if sith.info_msg %} +
+ {{ sith.info_msg|markdown }} +
+ {% endif %} + {% endblock %}
{% else %}{# if not popup #} diff --git a/counter/templates/counter/cash_register_summary.jinja b/counter/templates/counter/cash_register_summary.jinja index 6c102b7b..16cdc1a5 100644 --- a/counter/templates/counter/cash_register_summary.jinja +++ b/counter/templates/counter/cash_register_summary.jinja @@ -4,6 +4,12 @@ {% trans obj=object %}Edit {{ obj }}{% endtrans %} {% endblock %} +{% block info_boxes %} +{% endblock %} + +{% block nav %} +{% endblock %} + {% block content %}

{% trans %}Make a cash register summary{% endtrans %}

diff --git a/counter/templates/counter/counter_click.jinja b/counter/templates/counter/counter_click.jinja index c97b1708..d67e1920 100644 --- a/counter/templates/counter/counter_click.jinja +++ b/counter/templates/counter/counter_click.jinja @@ -22,6 +22,12 @@ {{ counter }} {% endblock %} +{% block info_boxes %} +{% endblock %} + +{% block nav %} +{% endblock %} + {% block content %}

{{ counter }}

@@ -151,9 +157,6 @@ {% endblock %} {% block script %} - {{ super() }}