aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2007-10-11 11:36:07 +0000
committerRobin H. Johnson <robbat2@gentoo.org>2007-10-11 11:36:07 +0000
commitdbe08a0ce324fb03ba6de2d02a947b2ac1834a54 (patch)
treeeea49cba73d3606d18ebec57e0c20abbceb53fe7
parentAdd links for similar, bugs, forums. Display version only, not PN in column. (diff)
downloadpackages-3-dbe08a0ce324fb03ba6de2d02a947b2ac1834a54.tar.gz
packages-3-dbe08a0ce324fb03ba6de2d02a947b2ac1834a54.tar.bz2
packages-3-dbe08a0ce324fb03ba6de2d02a947b2ac1834a54.zip
Add links in the licenses.
-rw-r--r--web/model.py7
-rw-r--r--web/templates/index.html3
2 files changed, 9 insertions, 1 deletions
diff --git a/web/model.py b/web/model.py
index a71b8e8..6634e25 100644
--- a/web/model.py
+++ b/web/model.py
@@ -180,6 +180,13 @@ class PackageDB(object):
pkg['atom'] = atom
pkg['meta'] = pkg_metadata
pkg['keywords'] = self.get_package_keywords(cpvstr)
+ pkg['license'] = []
+ for l in pkg_metadata['license'].split():
+ if l[0].isalnum():
+ l = '<a href="http://sources.gentoo.org/viewcvs.py/*checkout*/gentoo-x86/licenses/%s">%s</a>' % (l,l)
+ pkg['license'].append(l)
+ pkg['license'] = ' '.join(pkg['license'])
+
pkg['changelog'] = 'http://sources.gentoo.org/viewcvs.py/*checkout*/gentoo-x86/%s/ChangeLog' % (atom.key)
pkg['bugzilla'] = 'http://bugs.gentoo.org/buglist.cgi?query_format=&short_desc_type=allwords&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&short_desc=%s' % (atom.package)
pkg['forums'] = 'http://forums.gentoo.org//search.php?search_terms=all&show_results=topics&mode=results&search_keywords=%s' % (atom.package)
diff --git a/web/templates/index.html b/web/templates/index.html
index b133b18..ff65395 100644
--- a/web/templates/index.html
+++ b/web/templates/index.html
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
+<?python from genshi import HTML ?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
@@ -60,7 +61,7 @@ ${pkg.meta.commitmsg}
</tr>
<tr>
<td class="category">${pkg.meta.atom.category}</td>
- <td class="license">${pkg.meta.license}</td>
+ <td class="license">${HTML(pkg.license)}</td>
</tr>
</table>
</div>