[LNT] r249104 - Support for Flask's flash system

Chris Matthews via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 1 17:02:27 PDT 2015


Author: cmatthews
Date: Thu Oct  1 19:02:27 2015
New Revision: 249104

URL: http://llvm.org/viewvc/llvm-project?rev=249104&view=rev
Log:
Support for Flask's flash system

Modified:
    lnt/trunk/lnt/server/ui/templates/layout.html
    lnt/trunk/lnt/server/ui/util.py

Modified: lnt/trunk/lnt/server/ui/templates/layout.html
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/templates/layout.html?rev=249104&r1=249103&r2=249104&view=diff
==============================================================================
--- lnt/trunk/lnt/server/ui/templates/layout.html (original)
+++ lnt/trunk/lnt/server/ui/templates/layout.html Thu Oct  1 19:02:27 2015
@@ -162,9 +162,20 @@
       <pre>{{g.db_log.getvalue()}}</pre>
     </div>
     {% endif %}
+    
 
     {# Page Content #}
     <div id="content" class="container-fluid">
+        {% with messages = get_flashed_messages(with_categories=true) %}
+            {% if messages %}
+                {% for category, message in messages %}
+                    <div class="{{ category }}" role="alert">
+                        {{ message }}
+                    </div>
+                    {% endfor %}
+            {% endif %}
+        {% endwith %} 
+    
     {% if nosidebar is defined %}
       <div class="row">
         <div id="page-content" class="span12">

Modified: lnt/trunk/lnt/server/ui/util.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/util.py?rev=249104&r1=249103&r2=249104&view=diff
==============================================================================
--- lnt/trunk/lnt/server/ui/util.py (original)
+++ lnt/trunk/lnt/server/ui/util.py Thu Oct  1 19:02:27 2015
@@ -232,3 +232,8 @@ def sorted(l, *args, **kwargs):
     l = list(l)
     l.sort(*args, **kwargs)
     return l
+
+FLASH_DANGER = "alert alert-danger"
+FLASH_INFO = "alert alert-info"
+FLASH_SUCCESS = "alert alert-success"
+FLASH_WARNING = "alert alert-warning"




More information about the llvm-commits mailing list