From: Frank Lichtenheld Date: Mon, 19 Nov 2007 17:34:01 +0000 (+0100) Subject: html/index.tmpl: Loops in TT and me, the neverending story X-Git-Url: https://git.deb.at/?a=commitdiff_plain;h=49958dcd8e2ec4821e650f11a05781fdc76e8389;p=deb%2Fpackages.git html/index.tmpl: Loops in TT and me, the neverending story Using implictely declared variables when looping over an array of hashes remains a good way to shoot oneself in the foot. Fixes non-English index pages if not all of the packages have translated short descs (which is always the case). (cherry picked from commit b9f0c69092ef533663cd99fbd98459dfc7790313) --- diff --git a/templates/html/index.tmpl b/templates/html/index.tmpl index 63d5f49..cc20983 100644 --- a/templates/html/index.tmpl +++ b/templates/html/index.tmpl @@ -25,30 +25,30 @@ navigation = nav_arr %] -[% FOREACH packages %] +[% FOREACH p IN packages %] [% '
' IF loop.first %] [% BLOCK marker %] [[% text %]] [%- END %] [% BLOCK markers %] - [% PROCESS marker text=section IF section != main_section %] - [% PROCESS marker text=archive IF archive != main_archive %] + [% PROCESS marker text=p.section IF p.section != main_section %] + [% PROCESS marker text=p.archive IF p.archive != main_archive %] [% END %] - [%- IF trans_desc.$lang; - sdesc = trans_desc.$lang; + [%- IF p.trans_desc.$lang; + sdesc = p.trans_desc.$lang; ELSE; - sdesc = desc; + sdesc = p.desc; END -%] - [% IF providers.size %] -
[% name %]
+ [% IF p.providers.size %] +
[% p.name %]
[% g('virtual package provided by') %] - [% FOREACH provider IN providers %][% provider %] + [% FOREACH provider IN p.providers %][% provider %] [%- ', ' UNLESS loop.last %][% END %]
- [% IF versions.length %] -
[% name %] ([% versions %])[% PROCESS markers %]
+ [% IF p.versions.length %] +
[% p.name %] ([% p.versions %])[% PROCESS markers %]
[% sdesc | html %]
[% END %] [% ELSE %] -
[% name %] ([% versions %])[% PROCESS markers %]
+
[% p.name %] ([% p.versions %])[% PROCESS markers %]
[% sdesc | html %]
[% END %]