From b9f0c69092ef533663cd99fbd98459dfc7790313 Mon Sep 17 00:00:00 2001 From: Frank Lichtenheld Date: Mon, 19 Nov 2007 18:34:01 +0100 Subject: [PATCH] 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). --- templates/html/index.tmpl | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) 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 %] -- 2.39.2