use Deb::Versions;
use Packages::I18N::Locale;
use Packages::Search qw( :all );
-use Packages::CGI qw( :DEFAULT msg );
+use Packages::CGI qw( :DEFAULT msg error );
use Packages::DB;
use Packages::Config qw( $DBDIR @SUITES @ARCHIVES $ROOT );
if ($arch ne 'virtual') {
$pkgs{$pkg}{$suite}{$version}{$arch} = 1;
$subsect{$pkg}{$suite}{$version} = $subsection;
- $sect{$pkg}{$suite}{$version} = $section
- unless $section eq 'main';
+ $sect{$pkg}{$suite}{$version} = $section;
$archives{$pkg}{$suite}{$version} ||= $archive;
$desc{$pkg}{$suite}{$version} = $desc;
--- /dev/null
+
+function init_toggle_elem(id_str,user_str) {
+ toggle_toggle_elem(id_str,user_str,'hide');
+}
+
+function toggle_toggle_elem(id_str,user_str,mode) {
+ var other_mode = ( mode == "hide" ) ? "show" : "hide";
+ var link = document.createElement("a");
+ link.setAttribute("href","javascript:toggle_toggle_elem(\""+id_str+"\",\""+user_str+"\",\""+other_mode+"\")");
+ var txt = document.createTextNode("["+other_mode+" "+user_str+"]");
+ link.appendChild(txt);
+ if (document.getElementById("js_"+id_str).childNodes.length > 0) {
+ document.getElementById("js_"+id_str).replaceChild(link,document.getElementById("js_"+id_str).firstChild);
+ } else {
+ document.getElementById("js_"+id_str).appendChild(link);
+ }
+ toggleDisplay(document.getElementById("html_"+id_str));
+}
+
+function toggleDisplay(obj) {
+ if (obj.style.display == "none")
+ obj.style.display = "";
+ else
+ obj.style.display = "none";
+}
<link href="/debian.css" rel="stylesheet" type="text/css" media="all">
<link href="/packages.css" rel="stylesheet" type="text/css" media="all">
+<script src="/packages.js" type="text/javascript"></script>
</head>
<body>
<div id="header">
<h3>Package [% pkg %]</h3>
<ul>
[% FOREACH s IN suites %]
- <li><a class="resultlink" href="[% make_url(pkg,'','suite',s.suite) %]">[% s.suite %]</a>[% ' (' _ s.subsect _ ')' IF s.subsect %]: [% s.desc %] [%- IF s.section %] [<strong class="pmarker">[% s.section %]</strong>][% END %]
+ <li><a class="resultlink" href="[% make_url(pkg,'','suite',s.suite) %]">[% s.suite %]</a>[% ' (' _ s.subsect _ ')' IF s.subsect %]: [% s.desc %] [%- IF s.section != main_section %] [<strong class="pmarker">[% s.section %]</strong>][% END %]
[% FOREACH s.versions %]
<br>[% version %] [%- IF archive != main_archive %] [<strong class="pmarker">[% archive %]</strong>][% END %]: [% architectures.join(' ') %]
[% END %]
<h3>Source Package [% pkg %]</h3>
<ul>
[% FOREACH origins %]
- [% origin = (archive == 'us') ? suite : "$suite/$archive" %]
- <li><a class="resultlink" href="[% make_url(pkg,'','source',source,'suite',origin) %]">[% origin %]</a> ([% subsection %]): [% version %]
+ [% origin = (archive == main_archive) ? suite : "$suite/$archive";
+ js_id = string2id("$pkg$suite$archive") %]
+ <li><a class="resultlink" href="[% make_url(pkg,'','source','source','suite',origin) %]">[% origin %]</a> ([% subsection %]): [% version %]
[%- IF section %] [<strong class="pmarker">[% section %]</strong>][% END %]
[%- IF real_archive %] [<strong class="pmarker">[% real_archive %]</strong>][% END %]
- <br>Binary packages: <span class="binaries">[% FOREACH binary IN binaries %]<a href="[% make_url(binary,'','source',source,'suite',suite,'archive',archive) %]">[% binary %]</a>[% ', ' UNLESS loop.last %][% END %]</span>
+ <br>Binary packages: <span id="js_[% js_id %]" class="p_js_elem"></span> <span id="html_[% js_id %]" class="binaries">[% FOREACH binary IN binaries %]<a href="[% make_url(binary,'','source','','suite',suite,'archive',archive) %]">[% binary %]</a>[% ', ' UNLESS loop.last %][% END %]</span>
+ [% IF binaries.size > 10 %]
+ <script type="text/javascript">init_toggle_elem("[% js_id %]","[% binaries.size %] binary packages")</script>
+ [% END %]
</li>
[% END %]
</ul>
keywords = "$suite, $archive, $section, $subsection, $version"
print_search_field = 'packages'
search_field_values = {
- keywords => '',
searchon => is_source ? 'sourcenames' : 'names',
- arch => 'any',
- suite => 'all',
- section => 'all',
- exact => 0
}
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 },
[% ' [' _ arch_str _ ']' IF arch_str %]</dt>
[%- IF !is_old_pkgs -%]
<dd>[% desc -%]
- [%- IF providers.size > 0 -%]
+ [%- IF providers.pkgs.size > 0 -%]
[% '<br>also a ' IF providers.also %]virtual package provided by
- [%- IF providers.pkgs.size < 11 -%]
- [% FOREACH provider IN providers.pkgs %]<a href="[% make_url(provider,'','suite',suite,'source','') %]">[% provider %]</a>[% ', ' UNLESS loop.last %][% END %]
- [%- ELSE -%]
- <a href="[% make_url(name,'','suite',suite,'source','') %]">[% providers.pkgs.size %] packages</a>
- [% END %]
+ [% js_id = name %]
+ <span id="js_[% js_id %]" class="p_js_elem"></span> <span id="html_[% js_id %]">[% FOREACH provider IN providers.pkgs %]<a href="[% make_url(provider,'','suite',suite,'source','') %]">[% provider %]</a>[% ', ' UNLESS loop.last %][% END %]</span>
+ [% IF providers.pkgs.size > 10 %]
+ <script type="text/javascript">init_toggle_elem("[% js_id %]","[% providers.pkgs.size %] providing packages")</script>
+ [% END %]
[% END %]
</dd>
[% END %]