From e736b4419be4ba37f212f85e8144e3b1d12ee2c8 Mon Sep 17 00:00:00 2001 From: Adil Mohak Date: Sat, 5 Oct 2024 22:47:20 +0300 Subject: [PATCH] Reuse messages snippet --- templates/course/user_course_list.html | 14 +------------- .../registration/password_reset_confirm.html | 14 +------------- templates/result/assessment_results.html | 14 +------------- templates/result/grade_results.html | 14 +------------- templates/setting/admin_panel.html | 15 ++------------- 5 files changed, 6 insertions(+), 65 deletions(-) diff --git a/templates/course/user_course_list.html b/templates/course/user_course_list.html index f6cd7f6..38a4e9b 100644 --- a/templates/course/user_course_list.html +++ b/templates/course/user_course_list.html @@ -23,19 +23,7 @@
{% trans 'My Courses' %}
{% endif %} -{% if messages %} - {% for message in messages %} - {% if message.tags == 'error' %} -
- {{ message }} -
- {% else %} -
- {{ message }} -
- {% endif %} - {% endfor %} -{% endif %} +{% include 'snippets/messages.html' %} {% if request.user.is_student %}
diff --git a/templates/registration/password_reset_confirm.html b/templates/registration/password_reset_confirm.html index 23c034b..1cbe3ae 100644 --- a/templates/registration/password_reset_confirm.html +++ b/templates/registration/password_reset_confirm.html @@ -4,19 +4,7 @@ {% load crispy_forms_tags %} {% block content %} -{% if messages %} - {% for message in messages %} - {% if message.tags == 'error' %} -
- {{ message }} -
- {% else %} -
- {{ message }} -
- {% endif %} - {% endfor %} -{% endif %} +{% include 'snippets/messages.html' %}
diff --git a/templates/result/assessment_results.html b/templates/result/assessment_results.html index f71e7ab..787880d 100644 --- a/templates/result/assessment_results.html +++ b/templates/result/assessment_results.html @@ -11,19 +11,7 @@ -{% if messages %} - {% for message in messages %} - {% if message.tags == 'error' %} -
- {{ message }} -
- {% else %} -
- {{ message }} -
- {% endif %} - {% endfor %} -{% endif %} +{% include 'snippets/messages.html' %}
{% trans 'Assesment Results' %}

{{ student.level }} {% trans 'Result' %}

diff --git a/templates/result/grade_results.html b/templates/result/grade_results.html index dbdbd4e..08050ea 100644 --- a/templates/result/grade_results.html +++ b/templates/result/grade_results.html @@ -11,19 +11,7 @@ -{% if messages %} - {% for message in messages %} - {% if message.tags == 'error' %} -
- {{ message }} -
- {% else %} -
- {{ message }} -
- {% endif %} - {% endfor %} -{% endif %} +{% include 'snippets/messages.html' %}
{% trans 'Grade Results' %}

{{ student.level }} {% trans 'Result' %}

diff --git a/templates/setting/admin_panel.html b/templates/setting/admin_panel.html index e9bcaef..4f214eb 100644 --- a/templates/setting/admin_panel.html +++ b/templates/setting/admin_panel.html @@ -16,19 +16,8 @@
{% trans 'Admin Panel' %}


-{% if messages %} - {% for message in messages %} - {% if message.tags == 'error' %} -
- {{ message }} -
- {% else %} -
- {{ message }} -
- {% endif %} - {% endfor %} -{% endif %} + +{% include 'snippets/messages.html' %}