]> git.deb.at Git - deb/packages.git/blobdiff - templates/html/show.tmpl
Templates: Also display the suite's alias name in selected places
[deb/packages.git] / templates / html / show.tmpl
index 1a7ca12af399148d4952d9f4c9dbef494448812e..554f48fd1e8f5b706c194180b7555ab4cc11a13a 100644 (file)
@@ -1,16 +1,32 @@
 [% PROCESS 'config/archive_layout.tmpl' %]
+[% PROCESS 'config/mirrors.tmpl' %]
+[%- known_vcs = [ [ 'cvs', 'CVS', 'cvs' ],
+               [ 'svn', 'Subversion', 'subversion' ],
+               [ 'bzr', 'bzr', 'bzr' ],
+               [ 'darcs', 'Darcs', 'darcs' ],
+               [ 'arch', 'arch', 'tla' ],
+               [ 'git', 'Git', 'git-core' ],
+               [ 'hg', 'Hg', 'mercurial' ], ];
+   vcs_link = page.get_newest("vcs-browser");
+-%]
+[%- suite_name = suite;
+    SET suite_name = suite_name _ ' (' _ suite_aliases.$suite _ ')' IF suite_aliases.$suite;
+    nav_arr = [ { prefix=>'Distribution:', title=>'Overview over this suite', url=>make_url('/','','source',''), name=>suite_name }, ];
+    nav_arr.push( { title => 'Source packages', url=>make_url('/'), name=>'Source' } ) IF is_source;
+    nav_arr.push( { prefix=>'Section:', title=>'All packages in this section', url=>make_url("$subsection/"), name=>subsection } );
+    nav_arr.push( { prefix=>'Package:', name=>pkg } ); -%]
+[% desclang = 'en';
+   SET desclang = lang IF desc.$lang.long %]
 [%- PROCESS 'html/head.tmpl'
    title_tag = ( is_source ? "Details of source package $pkg in $suite"
                           : "Details of package $pkg in $suite" )
-   description = desc
+   description = desc.$desclang.short
    keywords = "$suite, $archive, $section, $subsection, $version"
    print_search_field = 'packages'
    search_field_values = { 
                          searchon => is_source ? 'sourcenames' : 'names',
                          }
-  navigation = [ { prefix=>'Distribution:', title=>'Overview over this suite', url=>make_url('/'), name=>suite },
-                { prefix=>'Section:', title=>'All packages in this section', url=>make_url("$subsection/"), name=>subsection },
-                { prefix=>'Package:', name=>pkg } ]
+  navigation = nav_arr
 -%]
 <!-- show.tmpl -->
 [% PROCESS 'html/menu.inc' %]
 <h1>Package: [% pkg %] ([% versions.short %])
 [% END %]
 [%- PROCESS marker text=archive IF archive && archive != main_archive %]
-[%- PROCESS marker text=subsection IF subsection == 'non-US' and archive != 'non-US' %]
 [%- PROCESS marker text=section IF section && section != main_section %]
 [%- PROCESS marker text='essential' IF page.get_newest('essential') == 'yes' %]</h1>
 
+[% UNLESS is_virtual %]
+<div id="pmoreinfo">
+<h2>Links for [% pkg %]</h2>
+<h3>Debian Resources:</h3>
+<ul>
+<li><a href="[% (is_source ? src_bugs_url : bugs_url) _ pkg | uri %]">Bug Reports</a></li>
+
+[% IF src.pkg -%]
+<li><a href="[% pts_url _ src.pkg | uri %]">Developer Information (PTS)</a></li>
+[% ELSIF is_source %]
+<li><a href="[% pts_url _ pkg | uri %]">Developer Information (PTS)</a></li>
+[%- END %]
+
+[% IF files && (!archive or archive == main_archive or archive == 'security') %]
+<li><a href="[% changelogs_url _ files.changelog.path %]">Debian Changelog</a></li>
+<li><a href="[% changelogs_url _ files.copyright.path %]">Copyright File</a></li>
+[% END %]
+
+[% IF vcs_link %]
+<li><a href="[% vcs_link %]" class="pvcslink">Debian Source Repository</a>
+[%- FOREACH vcs IN known_vcs;
+       vcs_id = vcs.0; vcs_name = vcs.1; vcs_pkg = vcs.2;
+       vcs_info = page.get_newest("vcs-$vcs_id");
+       SET vcs_info = page.get_newest("x-vcs-$vcs_id") UNLESS vcs_info;
+   IF vcs_info %]
+ (<a href="[% vcs_info %]" class="pvcslink">[% vcs_name %]</a>)
+[% END %]
+</li>
+[% END; END %]
+
+</ul>
+
+[% IF src %]
+  <p>Download Source Package <a href="[% src.url %]">[% src.pkg %]</a>:
+  [% FOREACH src.downloads %]
+    [% '<ul>' IF loop.first %]
+    <li><a href="[% server _ path %]">[[% name %]]</a></li>
+    [% '</ul>' IF loop.last %]
+  [% END %]
+  [% IF src.downloads.size == 0 %]
+  Not found
+  [% END %]
+[% END %]
+
+[% IF maintainers.size == 1 -%]
+  <h3>Maintainer:</h3>
+[%- ELSE -%]
+  <h3>Maintainers:</h3>
+[%- END %]
+[%- FOREACH maintainers -%]
+  [%- '<ul>' IF loop.first -%]
+       <li><a href="mailto:[% mail %]">[% name | html %]</a>
+       (<a href="[% ddpo_url _ mail %]" title="An overview over the maintainer's packages and uploads">QA Page</a>)
+       </li>
+  [%- '</ul>' IF loop.last -%]
+[%- END -%]
+
+[% url = page.get_newest('url');
+   SET url = page.get_newest('homepage') IF page.get_newest('homepage');
+   IF url %]
+<h3>External Resources:</h3>
+<ul>
+<li><a href="[% url | uri %]">Homepage</a> [[% extract_host(url) %]]</li>
+</ul>
+[% END %]
+
+[% FOREACH sim IN similar %]
+       [% IF loop.first %]
+       <h3>Similar packages:</h3>
+       <ul>
+       [% END %]
+       <li><a href="/[% sim %]">[% sim %]</a></li>
+       [% '</ul>' IF loop.last %]
+[% END %]
+
+</div> <!-- end pmoreinfo -->
+[% END %]
+
 [% IF suite == "experimental" || subsection == "debian-installer" %]
 <div class="pconstantnag">
 [% IF suite == "experimental" %]
+[% changelog_link = 'changelog';
+   changelog_link = "<a href='$changelogs_url$files.changelog.path'>changelog</a>" %] 
 <h2>Experimental package</h2>
 <p>Warning: This package is from the <strong>experimental</strong> distribution.
 That means it is likely unstable or buggy, and it may even cause data loss.
-Please be sure to consult the changelog and other possible documentation before
+Please be sure to consult the [% changelog_link %] and other possible documentation before
 using it.</p>
 [% END %]
 [% IF subsection == "debian-installer" %]
@@ -62,21 +157,39 @@ Do not install it on a normal Debian system.</p>
 </div>
 [% END %]
 
-[% UNLESS is_virtual %]
+<div id="ptablist">
+</div>
+
+[% IF desc %]
+<div id="pdesctab">
 <div id="pdesc">
-[% IF desc.short %]
-       <h2>[% desc.short %]</h2>
-       <p>[% desc.long %]
+[% UNLESS is_virtual %]
+       [% IF desc.$desclang.short %]
+       <h2>[% desc.$desclang.short %]</h2>
+       <p>[% desc.$desclang.long %]
+       [% END %]
+[% ELSE %]
+       <p>This is a <em>virtual package</em>. See the <a href="[% policy_url %]">Debian policy</a> for a <a href="[% policy_url %]ch-binary.html#s-virtual_pkg">definition of virtual packages</a>.</p>
 [% END %]
 </div> <!-- end pdesc -->
-[% END %]
 
 [% FOREACH tag IN tags %]
   [% IF loop.first -%]
     <div id="ptags"><p>
     <a href="[% tags_url %]edit.html?pkg=[% pkg | uri %]">Tags</a>:
   [%- END %]
-  [% tag %][% ', ' 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 %]
+  [% ELSE %]
+  [% tag_id %][% ', ' UNLESS loop.last %]
+  [% END %]
+  [% old_facet = facet %]
   [% IF loop.last -%]
     </p>
     </div> <!-- end ptags -->
@@ -89,9 +202,11 @@ Do not install it on a normal Debian system.</p>
     <dd>[% desc %]</dd>
   [% '</dl></div>' IF loop.last %]
 [% END %]
+</div> <!-- pdesctab -->
+[% END %]
 
 [% FOREACH binaries %]
-  [% IF loop.first %]<div class="pdesc">The following binary packages are built from this source package:<dl>[% END %]
+  [% IF loop.first %]<div id="pbinaries">The following binary packages are built from this source package:<dl>[% END %]
     <dt>[% IF available %]<a href="[% make_url(name,'','source','') %]">[% name %]</a>[% ELSE %][% name %][% END %]</dt>
     <dd>[% desc %]</dd>    
   [% '</dl></div>' IF loop.last %]
@@ -145,7 +260,7 @@ Do not install it on a normal Debian system.</p>
   [%- END %]
 [% END %]
 
-[% FOREACH downloads %]
+[% FOREACH d IN downloads %]
   [% IF loop.first -%]
     <div id="pdownload">
     <h2>Download [% pkg %]</h2>
@@ -156,13 +271,23 @@ Do not install it on a normal Debian system.</p>
   [%- END %]
 
 <tr>
-[% download_url = pkg _ '/' _ arch _ '/download'
-   filelist_url = pkg _ '/' _ arch _ '/filelist' %]
-<th><a href="[% make_url(download_url) | uri %]">[% arch %]</a></th>
-[% '<td>' _ version _ '</td>' IF versions.multiple %]
-<td class="size">[% pkgsize %]&nbsp;kB</td><td class="size">[% instsize %]&nbsp;kB</td>
+[% download_url = pkg _ '/' _ d.arch _ '/download'
+   filelist_url = pkg _ '/' _ d.arch _ '/filelist' %]
+<th><a href="[% make_url(download_url) | uri %]">[% d.arch %]</a>
+[%- SET a = d.archive; IF mirrors.$a.unofficial_port  %] <strong>(unofficial port)</strong>[% END %]</th>
+[% vnorm = d.version.replace( '\+b\d+$', '' ); vlatest = version.replace( '\+b\d+$', '' );
+   vup = vnorm.replace( '-[^-]+$', '' ); vuplatest = vlatest.replace( '-[^-]+$', '' );
+   IF vnorm == vlatest;
+       version_class = 'vcurrent';
+   ELSIF vup == vuplatest;
+       version_class = 'volder';
+   ELSE;
+       version_class = 'vold';
+   END %]
+[% "<td class='$version_class'>$d.version</td>" IF versions.multiple %]
+<td class="size">[% d.pkgsize %]&nbsp;kB</td><td class="size">[% d.instsize %]&nbsp;kB</td>
 <td>
-[% IF contents_avail %]
+[% IF d.contents_avail %]
   [<a href="[% make_url(filelist_url) | uri %]">list of files</a>]
 [% ELSE %]
   no current information
@@ -195,71 +320,24 @@ Do not install it on a normal Debian system.</p>
   [% IF loop.last -%]
     </table>
 
-    </div> <!-- end pdownload -->
-  [%- END %]
-[% END %]
-
-
-[% UNLESS is_virtual %]
-<div id="pmoreinfo">
-<h2>More Information on [% pkg %]</h2><p>
-Check for <a href="[% (is_source ? src_bugs_url : bugs_url) _ pkg | uri %]">Bug Reports</a> about [% pkg %].<br>
-[% IF src %]
-  Source Package: <a href="[% src.url %]">[% src.pkg %]</a>, Download:
-  [% FOREACH src.downloads %]
-  <a href="[% server _ path %]">[[% name %]]</a>
-  [% END %]
-  [% IF src.downloads.size == 0 %]
-  Not found
-  [% END %]
-[% END %]
-
-[% IF files %]
-<br>View the <a href="[% changelogs_url _ files.changelog.path %]">Debian changelog</a><br>
-View the <a href="[% changelogs_url _ files.copyright.path %]">copyright file</a></p>
-[% END %]
-<p>
-[% IF maintainers.size == 1 -%]
-  [%- FOREACH maintainers -%]
-    <a href="mailto:[% mail %]">[% name | html %]</a> is responsible for this Debian package.
-  [%- END -%]
-[%- ELSE -%]
-  [%- FOREACH maintainers -%]
-    [%- IF loop.first -%]
-<a href="mailto:[% mail %]">[% name | html %]</a>
-    [%- ELSIF loop.last -%]
- and <a href="mailto:[% mail %]">[% name | html %]</a> are responsible for this Debian package.
-    [%- ELSE -%]
-, <a href="mailto:[% mail %]">[% name | html %]</a>
-    [%- END -%]
-  [%- END -%]
-[%- END %]
-[% IF src -%]
-See the <a href="[% pts_url _ src.pkg | uri %]">developer information for [% pkg %]</a>.
-[% ELSIF is_source %]
-See the <a href="[% pts_url _ pkg | uri %]">developer information for [% pkg %]</a>.
-[%- END %]
-[% # use url only for source packages
-   # otherwise we have too often two home page links
-   url = page.get_newest('url');
-   IF is_source && url %]
-<p>Homepage: <a href="[% url | uri %]">[% url | html %]</a></p>
-[% END %]
-[% #FIXME: should this only be used for the PTS?
-   known_vcs = [ [ 'cvs', 'CVS' ],
-               [ 'svn', 'Subversion' ],
-               [ 'bzr', 'bzr' ],
-               [ 'darcs', 'Darcs'],
-               [ 'arch', 'arch' ] ];
-   FOREACH vcs IN known_vcs;
-       vcs_id = vcs.0; vcs_name = vcs.1;
+[% FOREACH vcs IN known_vcs;
+       vcs_id = vcs.0; vcs_name = vcs.1; vcs_pkg = vcs.2;
        vcs_info = page.get_newest("vcs-$vcs_id");
        SET vcs_info = page.get_newest("x-vcs-$vcs_id") UNLESS vcs_info;
        IF vcs_info; %]
-<p>Repository for Debian package: <a href="[% vcs_info %]" class="pvcslink">[% vcs_info %]</a> (<acronym title="Version Control System">VCS</acronym>: [% vcs_name %])</p>
+<dl>
+<dt>Debian Package Source Repository (<acronym title="Version Control System">VCS</acronym>: <a href="[% make_url(vcs_pkg,'','source','') %]">[% vcs_name %]</a>)</dt>
+<dd><a href="[% vcs_info %]" class="pvcslink">[% vcs_info %]</a></dd>
+[% IF vcs_link %]
+<dt>Debian Package Source Repository (Browsable)</dt><dd><a href="[% vcs_link %]" class="pvcslink">[% vcs_link %]</a></dd>
+[% END %]
+</dl>
 [% END; END %]
 
-</p>
-<p>Search for <a href="[% (is_source ? src_search_url : search_url) _ pkg | uri %]">other versions of [% pkg %]</a></p>
-</div> <!-- end pmoreinfo -->
+    </div> <!-- end pdownload -->
+  [%- END %]
 [% END %]
+
+[%# <script type="text/javascript">init_tab_list("ptablist")</script> %]
+
+[%- PROCESS 'html/foot.tmpl' -%]