Commit 658c6813 authored by Frédéric Buclin's avatar Frédéric Buclin

Bug 796072: Make admin/table.html.tmpl a bit faster

r=dkl a=LpSolit
parent 58f4a0a7
......@@ -125,41 +125,26 @@
[% IF class %] class="[% class FILTER html %]" [% END %]>
[% IF contentlink %]
[% link_uri = contentlink %]
[% WHILE link_uri.search('%%(.+?)%%')%]
[% FOREACH m = link_uri.match('%%(.+?)%%') %]
[% IF row.$m.defined %]
[% replacement_value = FILTER uri; row.$m; END %]
[% ELSE %]
[% replacement_value = "" %]
[% END %]
[% link_uri = link_uri.replace("%%$m%%", replacement_value) %]
[% END %]
[% FOREACH m = contentlink.match('%%(.+?)%%', 1) %]
[% replacement_value = FILTER uri; row.$m; END %]
[% contentlink = contentlink.replace("%%$m%%", replacement_value) %]
[% END %]
<a href="[% link_uri %]">
<a href="[% contentlink %]">
[% END %]
[% IF content_use_field %]
[% colname = row.${c.name} %]
[% field_descs.${colname} FILTER html %]
[% colname = row.${c.name} %]
[% field_descs.${colname} FILTER html %]
[% ELSIF content %]
[% content FILTER html_light %]
[% content FILTER html_light %]
[% ELSIF yesno_field %]
[% row.${c.name} ? "Yes" : "No" %]
[% ELSIF allow_html_content %]
[% row.${c.name} FILTER html_light %]
[% ELSE %]
[% IF yesno_field %]
[% IF row.${c.name} %]
Yes
[% ELSE %]
No
[% END %]
[% ELSE %]
[% IF allow_html_content %]
[% row.${c.name} FILTER html_light %]
[% ELSE %]
[% row.${c.name} FILTER html %]
[% END %]
[% END %]
[% row.${c.name} FILTER html %]
[% END %]
[% IF contentlink %]
</a>
[% END %]
......
......@@ -348,7 +348,7 @@
],
'admin/table.html.tmpl' => [
'link_uri'
'contentlink'
],
'admin/custom_fields/cf-js.js.tmpl' => [
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment