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

@@ -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 %]