Don't look up the description on the debtags vocabulary in the script
but in the template. Split facet and tag in the script so that we can
merge together multiple tags with the same facet.
debug( "Data search and merging took ".timestr($std) ) if DEBUG;
my $did = $page->get_newest( 'description' );
debug( "Data search and merging took ".timestr($std) ) if DEBUG;
my $did = $page->get_newest( 'description' );
- my @tags = map { [ $_, $debtags{$_} ] } split(/, /, $page->get_newest( 'tag' ));
+ my @tags = map { [ split( /::/, $_) ] } split(/, /, $page->get_newest( 'tag' ));
$contents{tags} = \@tags;
$contents{tags} = \@tags;
+ $contents{debtags_voc} = \%debtags;
$section = $page->get_newest( 'section' );
$contents{section} = $section;
$section = $page->get_newest( 'section' );
$contents{section} = $section;
<div id="ptags"><p>
<a href="[% tags_url %]edit.html?pkg=[% pkg | uri %]">Tags</a>:
[%- END %]
<div id="ptags"><p>
<a href="[% tags_url %]edit.html?pkg=[% pkg | uri %]">Tags</a>:
[%- END %]
- [% IF tag.1 %]
- <a href="/about/debtags#[% string2id(tag.0) %]">[% tag.1 %]</a>[% ', ' UNLESS loop.last %]
+ [% facet = tag.0;
+ facet_name = debtags_voc.$facet;
+ tag_id = "$tag.0::$tag.1";
+ tag_name = debtags_voc.$tag_id;
+ %]
+ [% facet_name _ ': ' UNLESS old_facet && facet == old_facet %]
+ [% IF tag_name %]
+ <a href="/about/debtags#[% string2id(tag_id) %]">[% tag_name %]</a>[% ', ' UNLESS loop.last %]
- [% tag.0 %][% ', ' UNLESS loop.last %]
+ [% tag_id %][% ', ' UNLESS loop.last %]
+ [% old_facet = facet %]
[% IF loop.last -%]
</p>
</div> <!-- end ptags -->
[% IF loop.last -%]
</p>
</div> <!-- end ptags -->