changeset 6937:9491eb545fef

styling: map pylonslib flash message categories to bootstrap alert classes Error messages where shown without styling because they use the alert-error class which doesn't exist in Bootstrap. Pylonslib only support a few hardcoded categories. Map them to corresponding Bootstrap classes.
author Mads Kiilerich <mads@kiilerich.com>
date Sun, 22 Oct 2017 00:42:12 +0200
parents b16dac5c97e6
children 6fde53180c50
files kallithea/templates/base/flash_msg.html
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/templates/base/flash_msg.html	Mon Oct 16 03:19:31 2017 +0200
+++ b/kallithea/templates/base/flash_msg.html	Sun Oct 22 00:42:12 2017 +0200
@@ -1,8 +1,9 @@
 <div class="flash_msg">
     <% messages = h.flash.pop_messages() %>
     % if messages:
+        <% alert_categories = {'warning': 'alert-warning', 'notice': 'alert-info', 'error': 'alert-danger', 'success': 'alert-success'} %>
         % for message in messages:
-            <div class="alert alert-dismissable alert-${message.category}">
+            <div class="alert alert-dismissable ${alert_categories[message.category]}" role="alert">
               <button type="button" class="close" data-dismiss="alert" aria-hidden="true"><i class="icon-cancel-circled"></i></button>
               ${message}
             </div>