diff --git a/AKModel/templatetags/tags_AKModel.py b/AKModel/templatetags/tags_AKModel.py index 4540e85997647ba46b2cae4ac1404d03194e329c..80cbc6fc4089b8d27d84b42b2882e7264c107649 100644 --- a/AKModel/templatetags/tags_AKModel.py +++ b/AKModel/templatetags/tags_AKModel.py @@ -14,3 +14,15 @@ def footer_info(): @register.filter def check_app_installed(name): return apps.is_installed(name) + + +@register.filter +def message_bootstrap_class(tag): + print(tag) + if tag == "error": + return "alert-danger" + elif tag == "success": + return "alert-success" + elif tag == "warning": + return "alert-warning" + return "alert-info" diff --git a/AKSubmission/templates/AKSubmission/ak_detail.html b/AKSubmission/templates/AKSubmission/ak_detail.html index b7b9342d4ce69452cd70ed9750d4d606a786699f..bb99e830744bb3d6516a78ecd6bc6f2dfe8ae9a0 100644 --- a/AKSubmission/templates/AKSubmission/ak_detail.html +++ b/AKSubmission/templates/AKSubmission/ak_detail.html @@ -23,7 +23,7 @@ {% endif %} {% block content %} - {% include "AKSubmission/messages.html" %} + {% include "messages.html" %} <div class="text-right"> {% if ak.interest_counter >= 0 %} diff --git a/AKSubmission/templates/AKSubmission/ak_history.html b/AKSubmission/templates/AKSubmission/ak_history.html index 61094ad2ab2aba82a90aa9cb3c0ca388c809dedc..586fc0b1b19fd7e4c8e0a7702ff7bf652f53cfc0 100644 --- a/AKSubmission/templates/AKSubmission/ak_history.html +++ b/AKSubmission/templates/AKSubmission/ak_history.html @@ -20,7 +20,7 @@ {% endblock %} {% block content %} - {% include "AKSubmission/messages.html" %} + {% include "messages.html" %} <div class="float-right"> <a href='{% url 'submit:ak_detail' event_slug=ak.event.slug pk=ak.pk %}' data-toggle="tooltip" diff --git a/AKSubmission/templates/AKSubmission/submission_overview.html b/AKSubmission/templates/AKSubmission/submission_overview.html index f26cf36ad07019a6fed34f990555e1544dae1c19..6265d4c34b867d99e8b4bac455334f1b02f85ec2 100644 --- a/AKSubmission/templates/AKSubmission/submission_overview.html +++ b/AKSubmission/templates/AKSubmission/submission_overview.html @@ -37,7 +37,7 @@ {% block content %} <h1>{% trans "AKs" %}: {{ event.name }}</h1> - {% include "AKSubmission/messages.html" %} + {% include "messages.html" %} {% blocktrans %}On this page you can see a list of current AKs, change them and add new ones.{% endblocktrans %} diff --git a/AKSubmission/templates/AKSubmission/submit_new.html b/AKSubmission/templates/AKSubmission/submit_new.html index 2a07c2b280348ecd9b65d035f9339a85ac1ccdbe..489806f4cf8716e2d2f71b27010ba4d1a7a18243 100644 --- a/AKSubmission/templates/AKSubmission/submit_new.html +++ b/AKSubmission/templates/AKSubmission/submit_new.html @@ -22,7 +22,7 @@ {% endblock %} {% block content %} - {% include "AKSubmission/messages.html" %} + {% include "messages.html" %} {% block headline %} <h2>{% trans 'New AK' %}</h2> diff --git a/AKSubmission/templatetags/tags_AKSubmission.py b/AKSubmission/templatetags/tags_AKSubmission.py index e8a60e2cd4754e7a4671f4f9a0aea3e5cce70ad7..7be35e1e028b885099634c470bad54a6ea08c045 100644 --- a/AKSubmission/templatetags/tags_AKSubmission.py +++ b/AKSubmission/templatetags/tags_AKSubmission.py @@ -29,15 +29,3 @@ def category_list(categories, event_slug): @register.inclusion_tag("AKSubmission/category_linked_badge.html") def category_linked_badge(category, event_slug): return {"category": category, "event_slug": event_slug} - - -@register.filter -def message_bootstrap_class(tag): - print(tag) - if tag == "error": - return "alert-danger" - elif tag == "success": - return "alert-success" - elif tag == "warning": - return "alert-warning" - return "alert-info" diff --git a/AKSubmission/templates/AKSubmission/messages.html b/templates/messages.html similarity index 90% rename from AKSubmission/templates/AKSubmission/messages.html rename to templates/messages.html index dc8dd31f18b78e92597e39ac66447e778efec8d9..7aacbaa66e2fee13e5c315e87de56e980f4c2401 100644 --- a/AKSubmission/templates/AKSubmission/messages.html +++ b/templates/messages.html @@ -1,4 +1,4 @@ -{% load tags_AKSubmission %} +{% load tags_AKModel %} {% if messages %} {% for message in messages %}