Add links for facts and nodes in fact table macro

Added links to the node page from the facts_table if show_nodes is True.
Added links to the facts page from the facts_table if show_nodes is
False.
Added logic to switch TH table from facts to nodes if show_nodes is True.
This commit is contained in:
Daniel Lawrence
2013-10-11 14:46:39 +11:00
parent 9b662a661e
commit 3fd8a0aad4

View File

@@ -5,7 +5,11 @@
<table class="filter-table table table-striped {% if condensed %}table-condensed{% endif%}" style="table-layout:fixed"> <table class="filter-table table table-striped {% if condensed %}table-condensed{% endif%}" style="table-layout:fixed">
<thead> <thead>
<tr> <tr>
{% if show_node %}
<th>Node</th>
{% else %}
<th>Fact</th> <th>Fact</th>
{% endif %}
<th>Value</th> <th>Value</th>
</tr> </tr>
</thead> </thead>
@@ -13,9 +17,9 @@
{% for fact in facts %} {% for fact in facts %}
<tr> <tr>
{% if show_node %} {% if show_node %}
<td>{{fact.node}}</td> <td><a href="{{url_for('node', node_name=fact.node)}}">{{fact.node}}</a></td>
{% else %} {% else %}
<td>{{fact.name}}</td> <td><a href="{{url_for('fact', fact=fact.name)}}">{{fact.name}}</a></td>
{% endif %} {% endif %}
<td style="word-wrap:break-word">{{fact.value}}</td> <td style="word-wrap:break-word">{{fact.value}}</td>
</tr> </tr>