[llvm-commits] [zorg] r130218 - in /zorg/trunk/lnt/lnt/server/ui/templates: simple_machine.html utils.html

Daniel Dunbar daniel at zuster.org
Tue Apr 26 10:48:16 PDT 2011


Author: ddunbar
Date: Tue Apr 26 12:48:16 2011
New Revision: 130218

URL: http://llvm.org/viewvc/llvm-project?rev=130218&view=rev
Log:
LNT/Flask: Move macros out to a separate template.

Added:
    zorg/trunk/lnt/lnt/server/ui/templates/utils.html
Modified:
    zorg/trunk/lnt/lnt/server/ui/templates/simple_machine.html

Modified: zorg/trunk/lnt/lnt/server/ui/templates/simple_machine.html
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/lnt/lnt/server/ui/templates/simple_machine.html?rev=130218&r1=130217&r2=130218&view=diff
==============================================================================
--- zorg/trunk/lnt/lnt/server/ui/templates/simple_machine.html (original)
+++ zorg/trunk/lnt/lnt/server/ui/templates/simple_machine.html Tue Apr 26 12:48:16 2011
@@ -1,14 +1,4 @@
-{% macro render_popup_begin(id, title, hidden, depth) -%}
-<p>
-<a href="javascript://" onclick="toggleLayer('{{id}}')"; id="{{id}}_">({{
-  "-" if hidden else "+" }}) {{title}}</a>
-<div id="{{id}}"
-     style="display: {{'none' if hidden else '' }};"
-     class="hideable_{{depth}}">
-{%- endmacro %}
-{% macro render_popup_end() -%}
-</div>
-{%- endmacro %}
+{% import "utils.html" as utils %}
 
 {% set db = request.get_db() %}
 {% set machine = db.getMachine(id) %}
@@ -48,7 +38,7 @@
       </table>
 
 
-{{ render_popup_begin('machine_info', 'Machine Info', true, 1) }}
+{{ utils.render_popup_begin('machine_info', 'Machine Info', true, 1) }}
       <table border=1>
 {% for key,item in machine.info|dictsort %}
       <tr>
@@ -57,7 +47,7 @@
       </tr>
 {% endfor %}
       </table>
-{{ render_popup_end() }}
+{{ utils.render_popup_end() }}
 
 <p>
 <table class="sortable" border=1>

Added: zorg/trunk/lnt/lnt/server/ui/templates/utils.html
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/lnt/lnt/server/ui/templates/utils.html?rev=130218&view=auto
==============================================================================
--- zorg/trunk/lnt/lnt/server/ui/templates/utils.html (added)
+++ zorg/trunk/lnt/lnt/server/ui/templates/utils.html Tue Apr 26 12:48:16 2011
@@ -0,0 +1,12 @@
+{% macro render_popup_begin(id, title, hidden, depth=1) -%}
+<p>
+<a href="javascript://" onclick="toggleLayer('{{id}}')"; id="{{id}}_">({{
+  "-" if hidden else "+" }}) {{title}}</a>
+<div id="{{id}}"
+     style="display: {{'none' if hidden else '' }};"
+     class="hideable_{{depth}}">
+{%- endmacro %}
+
+{% macro render_popup_end() -%}
+</div>
+{%- endmacro %}





More information about the llvm-commits mailing list