]> git.deb.at Git - deb/packages.git/blobdiff - templates/html/search.tmpl
Some fixes for Polish translation.
[deb/packages.git] / templates / html / search.tmpl
index 65729672202c2d2516ec6799f1fe63fcf34ece0c..683d8bc0435673a6dda87ca2ae0cfaf701f18eb7 100644 (file)
@@ -1,4 +1,5 @@
 [%- PROCESS 'config/archive_layout.tmpl' -%]
+[%- PROCESS 'config/mirrors.tmpl' -%]
 [%- keyword_str = search_keywords.join(' ');
    keyword_esc = uri_escape(keyword_str);
    keyword_enc = html_encode(keyword_str);
     }
    navigation = [ { name => g('Package Search Results') } ]
 -%]
+[%- PROCESS 'html/util.inc' -%]
 
 <div id="psearchsug">
 [% UNLESS results %]
-       <p>[% g('You can try a different search on the <a href="%s#search_packages">Packages search page</a>.',
-               searchformurl) %]</p>
-       
        [% IF opts.searchon != "names" && opts.exact %]
        <p>[% g('You have searched only for words exactly matching your keywords. You can try to search <a href="%s">allowing subword matching</a>.',
                make_search_url('',"keywords=$keyword_esc",'exact',0) ) %]</p>
        [% END %]
 [% END %]
+
+<p>[% g('Search in specific suite:') %]
+[% FOREACH s IN all_suites %]
+       [% IF s != suite_str %]
+       [<a href="[% make_search_url('',"keywords=$keyword_esc",'suite',s) %]">[% s %]</a>]
+       [% ELSE %]
+       [[% s %]]
+       [% END %]
+[% END %]
+[% IF search_suites.size == 1 %]
+<p>[% g('Search in <a href="%s">all suites</a>',
+       make_search_url('',"keywords=$keyword_esc",'suite','all')) %]
+[% END %]
+
+<p>[% g('Limit search to a specific architecture:') %]
+[% FOREACH a IN all_architectures %]
+   [% IF a != arch_str %]
+   [<a href="[% make_search_url('',"keywords=$keyword_esc",'arch',a) %]">[% a %]</a>]
+   [% ELSE %]
+   [[% a %]]
+   [% END %]
+[% END %]
+[% IF search_architectures.size == 1 %]
+<p>[% g('Search in <a href="%s">all architectures</a>',
+       make_search_url('',"keywords=$keyword_esc",'arch','any')) %]
+[% END %]
+
+</div>
+
 [% IF opts.searchon == "names" && non_results %]
-<p>[% g('<a href="%s">%u</a> results have not been displayed due to the search parameters.',
-       "$search_url$keyword_esc", non_results) %]</p>
+<p>[% g('<a href="%s">Some</a> results have not been displayed due to the search parameters.',
+       "$search_url?keywords=$keyword_esc") %]</p>
 [% END %]
 </div>
 
 
 <div id="psearchres">
 
-[%# @translators: I'm really sorry :/ %]
-[% suite_wording = suite_enc.match("^(default|all)$") ? g("all suites") : g("suite(s) <em>$suite_enc</em>");
-   section_wording = (section_enc == 'all') ? g("all sections") : g("section(s) <em>$section_enc</em>");
-   arch_wording = (architectures_enc == 'any') ? g("all architectures") : g("architecture(s) <em>$architectures_enc</em>");
+[% suite_wording = suite_enc.match("^(default|all)$") ? g("all suites") : g("suite(s) <em>%s</em>", suite_enc);
+   section_wording = (section_enc == 'all') ? g("all sections") : g("section(s) <em>%s</em>", section_enc);
+   arch_wording = (architectures_enc == 'any') ? g("all architectures") : g("architecture(s) <em>%s</em>", architectures_enc);
     IF opts.searchon == "names";
        source_wording = opts.source ? g("source packages") : g("packages");
        msg = g("You have searched for %s that names contain <em>%s</em> in %s, %s, and %s.",
                source_wording, keyword_enc, suite_wording, section_wording, arch_wording);
     ELSE;
        exact_wording = opts.exact ? "" : g(" (including subword matching)");
+       # @translators: I'm really sorry :/
        msg = g("You have searched for <em>%s</em> in packages names and descriptions in %s, %s, and %s%s.",
                keyword_enc, suite_wording, section_wording, arch_wording, exact_wording);
     END %]
 
 [% IF too_many_hits %]
 [% IF opts.searchon != "names" %]
-<p id="psearchtoomanyhits">[% g("Note that this only shows the best matches, sorted by relevance.
-If the first few packages don't match what you searched for, try using more keywords or alternative
-keywords.") %]</p>
+<p id="psearchtoomanyhits">[% g("Note that this only shows the best matches, sorted by relevance. If the first few packages don't match what you searched for, try using more keywords or alternative keywords.") %]</p>
 [% ELSE %]
-<p id="psearchtoomanyhits">[% g('Your search was too wide so we will only display exact matches.
-At least <em>%u</em> results have been omitted and will not be displayed.
-Please consider using a longer keyword or more keywords.', too_many_hits) %]</p>
+<p id="psearchtoomanyhits">
+[%- IF results %]
+[% g("Your keyword was too generic, for optimizing reasons some results might have been suppressed.<br>Please consider using a longer keyword or more keywords.") %]
+[%- ELSE -%]
+[% g("Your keyword was too generic.<br>Please consider using a longer keyword or more keywords.") %]
+[% END -%]
+</p>
 [% END; END %]
 
-[% UNLESS results %]
+[% UNLESS results || too_many_hits %]
 <p id="psearchnoresult">[% g('Sorry, your search gave no results') %]</p>
 [% END %]
 
@@ -89,14 +119,17 @@ Please consider using a longer keyword or more keywords.', too_many_hits) %]</p>
   <h3>[% g('Package %s', pkg) %]</h3>
   <ul>
   [% FOREACH s IN suites;
-       suite = s.suite %]
+       suite = s.suite ; section = s.section %]
     <li class="[% suite %]"><a class="resultlink" href="[% make_url(pkg,'','suite',suite,'arch','','section','') %]">[% suite %]
-       [%- ' (' _ suite_aliases.$suite _ ')' IF suite_aliases.$suite %]</a>[% ' (' _ s.subsection _ ')' IF s.subsection %]: [% s.desc %]  [%- IF s.section != main_section %] [<strong class="pmarker">[% s.section %]</strong>][% END %]
+       [%- ' (' _ suite_aliases.$suite _ ')' IF suite_aliases.$suite %]</a>[% ' (' _ s.subsection _ ')' IF s.subsection %]:
+       [% PROCESS desc_i18n trans_desc=s.trans_desc desc=s.desc %]
+       [%- PROCESS marker text=section title=section_titles.$section url=section_urls.$section IF section && section != main_section %]
     [% FOREACH s.versions %]
-      <br>[% version %] [%- IF archive != main_archive %] [<strong class="pmarker">[% archive %]</strong>][% END %]: [% architectures.join(' ') %]
+      <br>[% version %] [%- IF archive != main_archive %] [[% IF mirrors.$archive.url %]<a href="[% mirrors.$archive.url %]">[% END %]<strong class="pmarker" title="[% mirrors.$archive.title %]">[% archive %]</strong>[% IF mirrors.$archive.url %]</a>[% END %]][% END %]: [% architectures.join(' ') %]
     [% END %]
     [% IF s.providers %]
-       <br>[% 'also ' IF s.versions.size > 0 %][% g('provided by:') %] [% FOREACH provider IN s.providers %]<a href="[% make_url(provider,'','suite',suite) %]">[% provider %]</a>[% ', ' UNLESS loop.last %][% END %]
+       <br>[% IF s.versions.size > 0; g('also provided by:'); ELSE; g('provided by:'); END %]
+       [% FOREACH provider IN s.providers.sort %]<a href="[% make_url(provider,'','suite',suite) %]">[% provider %]</a>[% ', ' UNLESS loop.last %][% END %]
     [% END %]
     </li>
   [% END %]
@@ -110,11 +143,10 @@ Please consider using a longer keyword or more keywords.', too_many_hits) %]</p>
      [% 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,'section','','arch','') %]">[% origin %]</a> ([% subsection %]): [% version %]
-      [%- IF section %] [<strong class="pmarker">[% section %]</strong>][% END %]
-      [%- IF real_archive %] [<strong class="pmarker">[% real_archive %]</strong>][% END %]
-    <br>[% g('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,'arch','','archive','') %]">[% binary %]</a>[% ', ' UNLESS loop.last %][% END %]</span>
+      [%- PROCESS marker text=section title=section_titles.$section url=section_urls.$section IF section %] [%- PROCESS marker text=real_archive title=mirrors.$real_archive.title url=mirrors.$real_archive.url IF real_archive %]
+    <br>[% g('Binary packages:') %] <span id="js_[% js_id %]" class="p_js_elem"></span> <span id="html_[% js_id %]" class="binaries">[% FOREACH binary IN binaries.sort %]<a href="[% make_url(binary,'','source','','suite',suite,'archive',archive,'arch','','archive','') %]">[% binary %]</a>[% ', ' UNLESS loop.last %][% END %]</span>
        [% IF binaries.size > 10 %]
-       <script type="text/javascript">init_toggle_elem("[% js_id %]","[% g('%u binary packages', binaries.size) %])</script>
+       <script type="text/javascript">init_toggle_elem("[% js_id %]","[% g('show %u binary packages', binaries.size) %]","[% g('hide %u binary packages', binaries.size) %]")</script>
        [% END %]
     </li>
   [% END %]