From 0ff620b9eb11f2a281639dfba8bd3502690a07ca Mon Sep 17 00:00:00 2001
From: Paul Wise <pabs@debian.org>
Date: Sun, 24 Aug 2008 10:55:13 +0800
Subject: [PATCH] Show tooltips for non-main sections and non-main archives

---
 templates/config/mirrors.tmpl |   10 ++++++++++
 templates/html/search.tmpl    |    8 ++++----
 templates/html/show.tmpl      |    6 +++---
 templates/html/util.inc       |    2 +-
 4 files changed, 18 insertions(+), 8 deletions(-)

diff --git a/templates/config/mirrors.tmpl b/templates/config/mirrors.tmpl
index 9547482..edaaf8b 100644
--- a/templates/config/mirrors.tmpl
+++ b/templates/config/mirrors.tmpl
@@ -70,6 +70,7 @@ mirrors = {
 	},
 
 	volatile => {
+		title => g('volatile packages that need major changes during the life of a stable release'),
 		mirror_list => 'http://www.debian.org/devel/debian-volatile/volatile-mirrors',
 		europa => [
 			"volatile.debian.net/debian-volatile",
@@ -91,6 +92,7 @@ mirrors = {
 	},
 
 	backports => {
+		title => g('newer packages that have been adapted to stable releases of Debian'),
 		mirror_list => 'http://www.backports.org/debian/README.mirrors.html',
 		europa => [
 			"www.backports.org/debian",
@@ -118,6 +120,7 @@ mirrors = {
 	},
 
 	amd64 => {
+		title => g('ports of packages to architectures not yet available in Debian'),
 		mirror_list => 'http://amd64.debian.net/README.mirrors.html',
 		unofficial_port => {
 			amd64 => {
@@ -148,6 +151,7 @@ mirrors = {
 	},
 
 	debports => {
+		title => g('ports of packages to architectures not yet available in Debian'),
 		mirror_list => 'http://wiki.debian.org/DebianPorts/Mirrors',
 		unofficial_port => {
 			'kfreebsd-amd64' => {
@@ -183,5 +187,11 @@ continents = {
 		africa        => g('Africa'),
 	}
 
+section_titles = {
+		'main' => g('packages that meet the Debian Free Software Guidelines'),
+		'contrib' => g('packages that meet the Debian Free Software Guidelines but need software not in Debian main'),
+		'non-free' => g('packages that do not meet the Debian Free Software Guidelines'),
+	}
+
 %]
 
diff --git a/templates/html/search.tmpl b/templates/html/search.tmpl
index 3cd004c..ede09ea 100644
--- a/templates/html/search.tmpl
+++ b/templates/html/search.tmpl
@@ -118,13 +118,13 @@
   <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 %]:
 	[% PROCESS desc_i18n trans_desc=s.trans_desc desc=s.desc %]
-	[%- PROCESS marker text=s.section IF s.section && s.section != main_section %]
+	[%- PROCESS marker text=section title=section_titles.$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 %] [<strong class="pmarker" title="[% mirrors.$archive.title %]">[% archive %]</strong>][% END %]: [% architectures.join(' ') %]
     [% END %]
     [% IF s.providers %]
 	<br>[% IF s.versions.size > 0; g('also provided by:'); ELSE; g('provided by:'); END %]
@@ -142,7 +142,7 @@
      [% 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 %]
-      [%- PROCESS marker text=section IF section %] [%- PROCESS marker text=real_archive IF real_archive %]
+      [%- PROCESS marker text=section title=section_titles.$section IF section %] [%- PROCESS marker text=real_archive title=mirrors.$real_archive.title 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('show %u binary packages', binaries.size) %]","[% g('hide %u binary packages', binaries.size) %]")</script>
diff --git a/templates/html/show.tmpl b/templates/html/show.tmpl
index ef049a5..06f1335 100644
--- a/templates/html/show.tmpl
+++ b/templates/html/show.tmpl
@@ -56,9 +56,9 @@
 [% ELSE %]
 <h1>[% g('Package: %s (%s)', pkg, versions.short) %]
 [% END %]
-[%- PROCESS marker text=archive IF archive && archive != main_archive %]
-[%- PROCESS marker text=section IF section && section != main_section %]
-[%- PROCESS marker text=g('essential') IF page.get_newest('essential') == 'yes' %]</h1>
+[%- PROCESS marker text=archive title=mirrors.$archive.title IF archive && archive != main_archive %]
+[%- PROCESS marker text=section title=section_titles.$section IF section && section != main_section %]
+[%- PROCESS marker text=g('essential') title=g('package manager will refuse to remove this package by default') IF page.get_newest('essential') == 'yes' %]</h1>
 
 [% UNLESS is_virtual %]
 <div id="pmoreinfo">
diff --git a/templates/html/util.inc b/templates/html/util.inc
index 731b8ae..cabc6a7 100644
--- a/templates/html/util.inc
+++ b/templates/html/util.inc
@@ -7,7 +7,7 @@
   [%- END -%]
   &nbsp;]
 [%- END -%]
-[% BLOCK marker %] [<strong class="pmarker">[% text %]</strong>] [%- END %]
+[% BLOCK marker %] [<strong class="pmarker" [% 'title="' _ title _ '"' IF title %]>[% text %]</strong>] [%- END %]
 [%- BLOCK desc_i18n;
    IF trans_desc.$ddtp_lang;
       trans_desc.$ddtp_lang | html;
-- 
1.5.6.3

