more appropriate usage of vars and template tokens in before and before_template

This commit is contained in:
Oliver Gorwits
2013-02-09 15:27:25 +00:00
parent 6671032952
commit 367bd6f858
11 changed files with 162 additions and 151 deletions

View File

@@ -14,10 +14,10 @@
<td>[% row.alias %]</a>
<td>[% row.dns.remove(settings.domain_suffix) %]</a>
<td class="center_cell"><a class="nd_linkcell"
href="[% vars.device_ports %]&q=[% row.ip %]&f=[% row.port %]">[% row.port %]</a></td>
href="[% device_ports %]&q=[% row.ip %]&f=[% row.port %]">[% row.port %]</a></td>
<td>[% row.device_port.name %]</td>
<td><a class="nd_linkcell"
href="[% vars.search_device %]&ip=[% row.subnet %]">[% row.subnet %]</a></td>
href="[% search_device %]&ip=[% row.subnet %]">[% row.subnet %]</a></td>
</tr>
[% END %]
</tbody>

View File

@@ -18,7 +18,7 @@
[% ELSE %]
<td>
<a rel="tooltip" data-placement="top" data-offset="5" data-title="Find Similar Devices"
href="[% vars.search_device %]&location=[% d.location | uri %]">[% d.location %]</a>
href="[% search_device %]&location=[% d.location | uri %]">[% d.location %]</a>
</td>
[% END %]
</tr>
@@ -41,10 +41,10 @@
<td>Vendor / Model</td>
<td>
<a rel="tooltip" data-placement="top" data-offset="5" data-title="Find Similar Devices"
href="[% vars.search_device %]&vendor=[% d.vendor | uri %]">[% d.vendor %]</a>
href="[% search_device %]&vendor=[% d.vendor | uri %]">[% d.vendor %]</a>
/
<a rel="tooltip" data-placement="top" data-offset="5" data-title="Find Similar Devices"
href="[% vars.search_device %]&model=[% d.model | uri %]">[% d.model %]</a>
href="[% search_device %]&model=[% d.model | uri %]">[% d.model %]</a>
</td>
</tr>
<tr>
@@ -52,7 +52,7 @@
<td>[% d.os %] /
<a rel="tooltip" data-placement="top" data-offset="5"
data-title="Find Similar Devices"
href="[% vars.search_device %]&os_ver=[% d.os_ver | uri %]">[% d.os_ver %]</a>
href="[% search_device %]&os_ver=[% d.os_ver | uri %]">[% d.os_ver %]</a>
</td>
</tr>
<tr>

View File

@@ -44,7 +44,7 @@
<td nowrap>
[% END %]
<a class="nd_linkcell nd_this_port_only" href="[% uri_for('/device',
vars.self_options) %]&q=[% params.q | uri %]&f=[% row.port | uri %]">
self_options) %]&q=[% params.q | uri %]&f=[% row.port | uri %]">
[% row.port | html_entity %]
</a></td>
[% END %]
@@ -182,12 +182,12 @@
[% IF params.c_neighbors AND row.remote_ip %]
[% IF row.neighbor %]
<a href="[% uri_for('/device',
vars.self_options) %]&q=[% row.neighbor.ip | uri %]&f=[% row.remote_port | uri %]">
self_options) %]&q=[% row.neighbor.ip | uri %]&f=[% row.remote_port | uri %]">
[% row.neighbor.dns.remove(settings.domain_suffix) || row.neighbor.ip %]
([% row.remote_port | html_entity %])</a>
[% ELSE %]
<span class="label label-important">N</span>
<a href="[% vars.search_node %]&q=[% row.remote_ip | uri %]">
<a href="[% search_node %]&q=[% row.remote_ip | uri %]">
[% row.remote_ip %] (port: [% row.remote_port %]
id: [% (row.remote_type _ ' / ') IF row.remote_type %][% row.remote_id %])</a>
[% END %]
@@ -196,16 +196,16 @@
[% FOREACH node IN row.$nodes %]
[% '<br/>' IF row.remote_ip OR NOT loop.first %]
[% '<span class="label label-warning">A</span> &nbsp;' IF NOT node.active %]
<a href="[% vars.search_node %]&q=[% node.mac | uri %]">[% node.mac %]</a>
<a href="[% search_node %]&q=[% node.mac | uri %]">[% node.mac %]</a>
[% ' (' _ node.time_last_age _ ')' IF params.n_age %]
[% IF params.n_ip %]
[% FOREACH ip IN node.ips %]
<br/>&nbsp; [% '<span class="label label-warning">A</span> &nbsp;' IF NOT ip.active %]
[% SET dns = ip.dns %]
[% IF dns %]
<a href="[% vars.search_node %]&q=[% ip.ip | uri %]">[% dns %] ([% ip.ip %])</a>
<a href="[% search_node %]&q=[% ip.ip | uri %]">[% dns %] ([% ip.ip %])</a>
[% ELSE %]
<a href="[% vars.search_node %]&q=[% ip.ip | uri %]">[% ip.ip %]</a>
<a href="[% search_node %]&q=[% ip.ip | uri %]">[% ip.ip %]</a>
[% END %]
[% END %]
[% END %]