From 74d7be314bf1a32288e89a7f020910bbe37e0b60 Mon Sep 17 00:00:00 2001 From: Frank Lichtenheld Date: Fri, 2 May 2008 14:29:08 +0200 Subject: [PATCH] Fix handling of the base search URL Actually use the template config variable in the templates. (Re-)Introduce the search_url variable in config.sh so that make_search_url can actually use it. --- config.sh.sed.in | 2 ++ lib/Packages/Config.pm | 5 +++-- templates/config.tmpl | 2 +- templates/html/head.tmpl | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/config.sh.sed.in b/config.sh.sed.in index c208878..9fddcb8 100644 --- a/config.sh.sed.in +++ b/config.sh.sed.in @@ -35,7 +35,9 @@ ddtp_ftpsite=http://ddtp.debian.net/debian wget_cmd="wget --no-verbose --tries=2 --timeout=60" check_release_cmd="perl -I${libdir} ${bindir}/check-release --verbose --ignoremissing --keyring ${configdir}/trusted.gpg" +# URLs that need to be known in the code (as opposed to the templates) root="" +search_url="/search" # Architectures # diff --git a/lib/Packages/Config.pm b/lib/Packages/Config.pm index 1b9dbf5..2ec87ed 100644 --- a/lib/Packages/Config.pm +++ b/lib/Packages/Config.pm @@ -8,11 +8,11 @@ use Packages::CGI qw( :DEFAULT error ); our @ISA = qw( Exporter ); -our ( $TOPDIR, $DBDIR, $TEMPLATEDIR, $CACHEDIR, $ROOT, +our ( $TOPDIR, $DBDIR, $TEMPLATEDIR, $CACHEDIR, $ROOT, $SEARCH_URL, @LANGUAGES, @DDTP_LANGUAGES, @SUITES, @SECTIONS, @ARCHIVES, @ARCHITECTURES, @PRIORITIES, %FTP_SITES ); -our @EXPORT_OK = qw( $TOPDIR $DBDIR $TEMPLATEDIR $CACHEDIR $ROOT +our @EXPORT_OK = qw( $TOPDIR $DBDIR $TEMPLATEDIR $CACHEDIR $ROOT $SEARCH_URL @LANGUAGES @DDTP_LANGUAGES @SUITES @SECTIONS @ARCHIVES @ARCHITECTURES @PRIORITIES %FTP_SITES ); @@ -35,6 +35,7 @@ sub init { $TEMPLATEDIR = $1 if /^\s*templatedir="?([^\"]*)"?\s*$/o; $CACHEDIR = $1 if /^\s*cachedir="?([^\"]*)"?\s*$/o; $ROOT = $1 if /^\s*root="?([^\"]*)"?\s*$/o; + $SEARCH_URL = $1 if /^\s*search_url="?([^\"]*)"?\s*$/o; $FTP_SITES{us} = $1 if /^\s*ftpsite="?([^\"]*)"?\s*$/o; $FTP_SITES{$1} = $2 if /^\s*(\w+)_ftpsite="?([^\"]*)"?\s*$/o; @LANGUAGES = split(/\s+/, $1) if /^\s*polangs="?([^\"]*)"?\s*$/o; diff --git a/templates/config.tmpl b/templates/config.tmpl index e4ccf72..3e91e26 100644 --- a/templates/config.tmpl +++ b/templates/config.tmpl @@ -7,7 +7,7 @@ project_homepage = 'http://www.debian.org/' packages_homepage = 'http://packages.debian.net/' searchformurl = packages_homepage - search_url = '/' + search_url = '/search' tags_url = 'http://debtags.alioth.debian.org/' bugs_url = 'http://bugs.debian.org/' pts_url = 'http://packages.qa.debian.org/' diff --git a/templates/html/head.tmpl b/templates/html/head.tmpl index 9526e22..1cc5d1f 100644 --- a/templates/html/head.tmpl +++ b/templates/html/head.tmpl @@ -36,7 +36,7 @@ [%- IF print_search_field %] [% checked = 'checked="checked"' selected = 'selected="selected"' %] -
+
[% IF search_field_values.mode %][% END %] [% IF search_field_values.sort_by %][% END %] -- 2.39.2