Skip to content
Snippets Groups Projects
Commit ea7c8553 authored by Benjamin Hättasch's avatar Benjamin Hättasch Committed by Nadja Geisler
Browse files

Move messages to general templates

parent 1f4b5334
No related branches found
No related tags found
No related merge requests found
...@@ -14,3 +14,15 @@ def footer_info(): ...@@ -14,3 +14,15 @@ def footer_info():
@register.filter @register.filter
def check_app_installed(name): def check_app_installed(name):
return apps.is_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"
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
{% endif %} {% endif %}
{% block content %} {% block content %}
{% include "AKSubmission/messages.html" %} {% include "messages.html" %}
<div class="text-right"> <div class="text-right">
{% if ak.interest_counter >= 0 %} {% if ak.interest_counter >= 0 %}
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
{% endblock %} {% endblock %}
{% block content %} {% block content %}
{% include "AKSubmission/messages.html" %} {% include "messages.html" %}
<div class="float-right"> <div class="float-right">
<a href='{% url 'submit:ak_detail' event_slug=ak.event.slug pk=ak.pk %}' data-toggle="tooltip" <a href='{% url 'submit:ak_detail' event_slug=ak.event.slug pk=ak.pk %}' data-toggle="tooltip"
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
{% block content %} {% block content %}
<h1>{% trans "AKs" %}: {{ event.name }}</h1> <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 %} {% blocktrans %}On this page you can see a list of current AKs, change them and add new ones.{% endblocktrans %}
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
{% endblock %} {% endblock %}
{% block content %} {% block content %}
{% include "AKSubmission/messages.html" %} {% include "messages.html" %}
{% block headline %} {% block headline %}
<h2>{% trans 'New AK' %}</h2> <h2>{% trans 'New AK' %}</h2>
......
...@@ -29,15 +29,3 @@ def category_list(categories, event_slug): ...@@ -29,15 +29,3 @@ def category_list(categories, event_slug):
@register.inclusion_tag("AKSubmission/category_linked_badge.html") @register.inclusion_tag("AKSubmission/category_linked_badge.html")
def category_linked_badge(category, event_slug): def category_linked_badge(category, event_slug):
return {"category": category, "event_slug": 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"
{% load tags_AKSubmission %} {% load tags_AKModel %}
{% if messages %} {% if messages %}
{% for message in messages %} {% for message in messages %}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment