Files @ 9491eb545fef
Branch filter:

Location: kallithea/kallithea/templates/base/flash_msg.html

Mads Kiilerich
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.
<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_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>
        % endfor
    % endif
    <script>
    if (typeof jQuery != 'undefined') {
        $(".alert").alert();
    }
    </script>
</div>