<div class="flash_msg">
    <% messages = h.pop_flash_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.message|n}
            </div>
        % endfor
    % endif
    <script>
    'use strict';
    if (typeof jQuery != 'undefined') {
        $(".alert").alert();
    }
    </script>
</div>
