Skip to content

Commit

Permalink
Reuse messages snippet
Browse files Browse the repository at this point in the history
  • Loading branch information
adilmohak committed Oct 5, 2024
1 parent cea04b6 commit e736b44
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 65 deletions.
14 changes: 1 addition & 13 deletions templates/course/user_course_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,7 @@
<div class="title-1">{% trans 'My Courses' %}</div>
{% endif %}

{% if messages %}
{% for message in messages %}
{% if message.tags == 'error' %}
<div class="alert alert-danger">
<i class="fas fa-exclamation-circle"></i>{{ message }}
</div>
{% else %}
<div class="alert alert-success">
<i class="fas fa-check-circle"></i>{{ message }}
</div>
{% endif %}
{% endfor %}
{% endif %}
{% include 'snippets/messages.html' %}

{% if request.user.is_student %}
<div class="table-responsive p-3 mt-3">
Expand Down
14 changes: 1 addition & 13 deletions templates/registration/password_reset_confirm.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,7 @@
{% load crispy_forms_tags %}
{% block content %}

{% if messages %}
{% for message in messages %}
{% if message.tags == 'error' %}
<div class="alert alert-danger">
<i class="fas fa-exclamation-circle"></i>{{ message }}
</div>
{% else %}
<div class="alert alert-success">
<i class="fas fa-check-circle"></i>{{ message }}
</div>
{% endif %}
{% endfor %}
{% endif %}
{% include 'snippets/messages.html' %}

<div id="login">
<h3 class="login-title">{% trans 'Confirm New Password' %}</h3>
Expand Down
14 changes: 1 addition & 13 deletions templates/result/assessment_results.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,7 @@
</ol>
</nav>

{% if messages %}
{% for message in messages %}
{% if message.tags == 'error' %}
<div class="alert alert-danger">
<i class="fas fa-exclamation-circle"></i>{{ message }}
</div>
{% else %}
<div class="alert alert-success">
<i class="fas fa-check-circle"></i>{{ message }}
</div>
{% endif %}
{% endfor %}
{% endif %}
{% include 'snippets/messages.html' %}

<div class="title-1"><i class="fa fa-spell-check"></i>{% trans 'Assesment Results' %}</div>
<p>{{ student.level }} {% trans 'Result' %}</p>
Expand Down
14 changes: 1 addition & 13 deletions templates/result/grade_results.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,7 @@
</ol>
</nav>

{% if messages %}
{% for message in messages %}
{% if message.tags == 'error' %}
<div class="alert alert-danger">
<i class="fas fa-exclamation-circle"></i>{{ message }}
</div>
{% else %}
<div class="alert alert-success">
<i class="fas fa-check-circle"></i>{{ message }}
</div>
{% endif %}
{% endfor %}
{% endif %}
{% include 'snippets/messages.html' %}

<div class="title-1"><i class="fas fa-table"></i>{% trans 'Grade Results' %}</div>
<p>{{ student.level }} {% trans 'Result' %}</p>
Expand Down
15 changes: 2 additions & 13 deletions templates/setting/admin_panel.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,8 @@
<div class="title-1"><i class="fas fa-user-tie"></i>{% trans 'Admin Panel' %}</div>
<br>
<br>
{% if messages %}
{% for message in messages %}
{% if message.tags == 'error' %}
<div class="alert alert-danger">
<i class="fas fa-exclamation-circle"></i>{{ message }}
</div>
{% else %}
<div class="alert alert-success">
<i class="fas fa-check-circle"></i>{{ message }}
</div>
{% endif %}
{% endfor %}
{% endif %}

{% include 'snippets/messages.html' %}

<div class="container-fluid">
<div class="row">
Expand Down

0 comments on commit e736b44

Please sign in to comment.