From: Jeroen van Wolffelaar Date: Fri, 24 Mar 2006 02:11:36 +0000 (+0000) Subject: Show debtags if available X-Git-Tag: switch-to-templates~7 X-Git-Url: https://git.deb.at/w?a=commitdiff_plain;h=fa9e1fd3cdaacb0cf72e559fde02ae83812bff0b;p=deb%2Fpackages.git Show debtags if available --- diff --git a/TODO b/TODO index d197162..d555d9d 100644 --- a/TODO +++ b/TODO @@ -50,6 +50,9 @@ General: anymore, so search further is futile. Maybe the backend could even add a marker, ignored by read_entry_all, but understood by read_entry_small, that indicates end of $res2 and start of $res3 +- Debtags: print friendly names instead of raw names? +- Store in db \1-separated, and split on that, instead of the more fragile + '/, /' split Missing pieces from old code: diff --git a/lib/Packages/DoShow.pm b/lib/Packages/DoShow.pm index 3a5e4f3..5b22552 100644 --- a/lib/Packages/DoShow.pm +++ b/lib/Packages/DoShow.pm @@ -122,6 +122,7 @@ sub do_show { debug( "Data search and merging took ".timestr($std) ) if DEBUG; my $did = $page->get_newest( 'description' ); + my @tags = split(/, /, $page->get_newest( 'tag' )); $section = $page->get_newest( 'section' ); $subsection = $page->get_newest( 'subsection' ); my $filenames = $page->get_arch_field( 'filename' ); @@ -183,6 +184,7 @@ sub do_show { ); } $package_page .= pdesc( $short_desc, $long_desc ); + $package_page .= ptags( $pkg, @tags ) if @tags; # # display dependencies diff --git a/lib/Packages/HTML.pm b/lib/Packages/HTML.pm index c7dfd0b..e0814a7 100644 --- a/lib/Packages/HTML.pm +++ b/lib/Packages/HTML.pm @@ -21,7 +21,7 @@ use Packages::I18N::LanguageNames; our @ISA = qw( Exporter ); our @EXPORT = qw( header title trailer file_changed time_stamp read_md5_hash write_md5_hash simple_menu - ds_begin ds_item ds_end title marker pdesc + ds_begin ds_item ds_end title marker pdesc ptags pdeplegend pkg_list pmoreinfo print_deps print_src_deps ); our $CHANGELOG_URL = '/changelogs'; @@ -66,6 +66,20 @@ sub pdesc { return $str; } +sub ptags { + my ( $package, @tags ) = @_; + my $str = ""; + + $str .= "
\n

"; + $str .= "Tags:\n"; + foreach my $tag (@tags) { + $str .= "$tag\n"; + } + $str .= "

\n
\n"; + + return $str; +} + sub pdeplegend { my $str = "\n"; diff --git a/static/packages.css b/static/packages.css index 7deb83d..64bdd10 100644 --- a/static/packages.css +++ b/static/packages.css @@ -26,7 +26,7 @@ /* classes and div names for package pages */ -#pdesc, #pdeps, #pdownload, #pmoreinfo { +#pdesc, #ptags, #pdeps, #pdownload, #pmoreinfo { margin-left: 1em; margin-right: 1em; }