From: Frank Lichtenheld Date: Wed, 23 Apr 2008 02:45:49 +0000 (+0200) Subject: Make language override URLs more robust X-Git-Url: https://git.deb.at/w?a=commitdiff_plain;h=1c880dbbb5b885dd620120354e735c06280030df;p=deb%2Fpackages.git Make language override URLs more robust Previously they were just specified as "?lang=foo" which broke horribly when the language was already specified in the path_info. Use make(_search)_url and fix all templates to provide the necessary information. --- diff --git a/bin/create_index_pages b/bin/create_index_pages index 8072fa4..3e9fc52 100755 --- a/bin/create_index_pages +++ b/bin/create_index_pages @@ -188,12 +188,18 @@ foreach my $source (("", "source/")) { foreach my $s (@SUITES) { my %common_vars = ( suite => $s, is_source => $source ); - close_file("$source$s", \%common_vars, 'allpackages'); - close_txt_file("$source$s", \%common_vars, 'allpackages'); + my $page_base = "$source$s/"; + close_file("$source$s", { %common_vars, + page_name => "${page_base}allpackages" }, + 'allpackages'); + close_txt_file("$source$s", { %common_vars, + page_name => "{$page_base}allpackages" }, + 'allpackages'); foreach my $sec (keys %{$sections->{$s}}) { close_file("$source$s/$sec", { %common_vars, + page_name => "$page_base$sec/", category => { id => N_('Section'), name => $sec }}); } @@ -201,6 +207,7 @@ foreach my $source (("", "source/")) { next if $ssec eq '-'; close_file("$source$s/$ssec", { %common_vars, + page_name => "$page_base$ssec/", category => { id => N_('Subsection'), name => $ssec }}); } @@ -208,6 +215,7 @@ foreach my $source (("", "source/")) { next if $prio eq '-'; close_file("$source$s/$prio", { %common_vars, + page_name => "$page_base$prio/", category => { id => N_('Priority'), name => $prio }}); } diff --git a/bin/parse-debtags-voc b/bin/parse-debtags-voc index 4fd49f9..7515de1 100755 --- a/bin/parse-debtags-voc +++ b/bin/parse-debtags-voc @@ -125,7 +125,8 @@ foreach (@tags) { } my %content = ( vocabulary => \%voc, facets => \@facets, tags => \@tags, - tags_by_facet => \%tags_by_facet ); + tags_by_facet => \%tags_by_facet, + used_langs => [ 'en' ]); print TAGLST $template->page( 'tag_index', \%content ); close TAGLST or warn "Couldn't close tag list: $!"; diff --git a/templates/html/download.tmpl b/templates/html/download.tmpl index c524423..97ef81e 100644 --- a/templates/html/download.tmpl +++ b/templates/html/download.tmpl @@ -110,4 +110,4 @@ deb http://[% mirrors.$archive.europa.0 %] [% suite %] main [% section [% g('SHA256 checksum') %] [% sha256 || g('Not Available') %] -[%- PROCESS 'html/foot.tmpl' -%] +[%- PROCESS 'html/foot.tmpl' page_name="$pkg/download" -%] diff --git a/templates/html/filelist.tmpl b/templates/html/filelist.tmpl index e450d5f..73fc883 100644 --- a/templates/html/filelist.tmpl +++ b/templates/html/filelist.tmpl @@ -15,4 +15,4 @@ [% '' IF loop.last -%] [% END %] -[%- PROCESS 'html/foot.tmpl' -%] +[%- PROCESS 'html/foot.tmpl' page_name="$pkg/filelist" -%] diff --git a/templates/html/foot.tmpl b/templates/html/foot.tmpl index a6705db..b911d78 100644 --- a/templates/html/foot.tmpl +++ b/templates/html/foot.tmpl @@ -14,7 +14,7 @@ Total page evaluation took [% benchmark %]
[% l.selfname %] [%- IF l.transliteration %] ([% l.transliteration %])[% END %] [% END %] diff --git a/templates/html/newpkg.tmpl b/templates/html/newpkg.tmpl index aaff074..e8c5d3e 100644 --- a/templates/html/newpkg.tmpl +++ b/templates/html/newpkg.tmpl @@ -42,4 +42,4 @@ [% END %]

-[%- PROCESS 'html/foot.tmpl' -%] +[%- PROCESS 'html/foot.tmpl' page_name=section ? "$section/newpkg" : "newpkg" -%] diff --git a/templates/html/show.tmpl b/templates/html/show.tmpl index eec364b..3ebc1a1 100644 --- a/templates/html/show.tmpl +++ b/templates/html/show.tmpl @@ -366,4 +366,4 @@ [%# %] -[%- PROCESS 'html/foot.tmpl' -%] +[%- PROCESS 'html/foot.tmpl' page_name=pkg -%] diff --git a/templates/html/suite_index.tmpl b/templates/html/suite_index.tmpl index aaa971c..9be0784 100644 --- a/templates/html/suite_index.tmpl +++ b/templates/html/suite_index.tmpl @@ -45,4 +45,4 @@ ([% g('compact compressed textlist') %])

-[%- PROCESS 'html/foot.tmpl' -%] +[%- PROCESS 'html/foot.tmpl' page_name= source ? "source/$suite/" : "$suite/" -%] diff --git a/templates/html/tag_index.tmpl b/templates/html/tag_index.tmpl index 5f84c5e..5b29df4 100644 --- a/templates/html/tag_index.tmpl +++ b/templates/html/tag_index.tmpl @@ -22,4 +22,4 @@ [% END %] -[%- PROCESS 'html/foot.tmpl' -%] +[%- PROCESS 'html/foot.tmpl' page_name="about/debtags" -%]