changeset 1160:b84ce2d7e93d

New template for displaying django messages. New common template for rendering django messages in the new V3 Foundation style.
author Brian Neal <bgneal@gmail.com>
date Tue, 24 Jan 2017 19:22:29 -0600
parents 621ccf7c20eb
children a60aabced346 d551b6004213
files sg101/templates/bandmap/add.html sg101/templates/bio/view_profile.html sg101/templates/core/message_list.html sg101/templates/messages/messages_base.html sg101/templates/user_photos/gallery.html
diffstat 5 files changed, 11 insertions(+), 28 deletions(-) [+]
line wrap: on
line diff
--- a/sg101/templates/bandmap/add.html	Mon Jan 23 20:18:34 2017 -0600
+++ b/sg101/templates/bandmap/add.html	Tue Jan 24 19:22:29 2017 -0600
@@ -10,15 +10,7 @@
 
 <h2>Add Band to Map</h2>
 
-{% if messages %}
-<div class="success callout">
-   <ul class="user-messages">
-   {% for message in messages %}
-      <li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</li>
-   {% endfor %}
-   </ul>
-</div>
-{% endif %}
+{% include 'core/message_list.html' %}
 
 <p>
 To add a band to our map, please fill out the form, below. The information will
--- a/sg101/templates/bio/view_profile.html	Mon Jan 23 20:18:34 2017 -0600
+++ b/sg101/templates/bio/view_profile.html	Tue Jan 24 19:22:29 2017 -0600
@@ -8,13 +8,7 @@
 {% block title %}User Profile for {{ subject.username }}{% endblock %}
 {% block content %}
 <h2>User Profile for {{ subject.username }}</h2>
-{% if messages %}
-<ul class="user-messages">
- {% for message in messages %}
-    <li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</li>
- {% endfor %}
-</ul>
-{% endif %}
+{% include 'core/message_list.html' %}
 <p>
    {% avatar subject 0 %}
 </p>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sg101/templates/core/message_list.html	Tue Jan 24 19:22:29 2017 -0600
@@ -0,0 +1,7 @@
+{% if messages %}
+   {% for message in messages %}
+      <div class="{{ message.tags }} callout">
+         {{ message }}
+      </div>
+   {% endfor %}
+{% endif %}
--- a/sg101/templates/messages/messages_base.html	Mon Jan 23 20:18:34 2017 -0600
+++ b/sg101/templates/messages/messages_base.html	Tue Jan 24 19:22:29 2017 -0600
@@ -4,11 +4,7 @@
 {% block content %}
 <h2>Your Private Messages</h2>
 
-{% for message in messages %}
-   <div class="{{ message.tags }} callout">
-      {{ message }}
-   </div>
-{% endfor %}
+{% include 'core/message_list.html' %}
 
 <ul class="vertical medium-horizontal menu">
    <li{% if tab == 'inbox' %} class="active"{% endif %}>
--- a/sg101/templates/user_photos/gallery.html	Mon Jan 23 20:18:34 2017 -0600
+++ b/sg101/templates/user_photos/gallery.html	Tue Jan 24 19:22:29 2017 -0600
@@ -32,13 +32,7 @@
 <h2>Photo Gallery for {{ gallery_owner.username }}</h2>
 
 {% if user == gallery_owner %}
-{% if messages %}
-   <ul>
-    {% for message in messages %}
-       <li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</li>
-    {% endfor %}
-   </ul>
-{% endif %}
+{% include 'core/message_list.html' %}
 <p>
 You have uploaded {{ paginator.count }} photo{{ paginator.count|pluralize }}.
 Would you like to <a href="{% url 'user_photos-upload' %}">upload a photo</a>?