From 658c6813fa1bd10d4fd2add711a660720d6fa44b Mon Sep 17 00:00:00 2001 From: Frédéric Buclin Date: Thu, 4 Oct 2012 13:23:52 +0200 Subject: Bug 796072: Make admin/table.html.tmpl a bit faster r=dkl a=LpSolit --- template/en/default/admin/table.html.tmpl | 43 ++++++++++--------------------- 1 file changed, 14 insertions(+), 29 deletions(-) (limited to 'template/en/default/admin') diff --git a/template/en/default/admin/table.html.tmpl b/template/en/default/admin/table.html.tmpl index 0f572d590..80f6417a3 100644 --- a/template/en/default/admin/table.html.tmpl +++ b/template/en/default/admin/table.html.tmpl @@ -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 %] - + [% 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 %] [% END %] -- cgit v1.2.3-24-g4f1b