summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2010-01-31 15:43:37 -0600
committerDan McGee <dan@archlinux.org>2010-01-31 15:43:37 -0600
commitd721c724addb811ed4734fc391303950a484167e (patch)
tree56b31c9e7d8819da23e729a15da61896ec92eb6d
parentcc93d3eda6a929ce02a608a113b2eb5f74547323 (diff)
Make bugs link more useful
Link directly to the right project in Flyspray instead of whatever the user looked at last. Fixes FS#13166. Signed-off-by: Dan McGee <dan@archlinux.org>
-rw-r--r--main/models.py9
-rw-r--r--templates/packages/details.html2
2 files changed, 10 insertions, 1 deletions
diff --git a/main/models.py b/main/models.py
index 336f0ecf..8d5da3bc 100644
--- a/main/models.py
+++ b/main/models.py
@@ -260,6 +260,15 @@ class Package(models.Model):
root = 'packages'
return linkbase % (root, dirname, repo, self.arch.name)
+ def get_bugs_link(self):
+ repo = self.repo.name.lower()
+ if repo.startswith('community'):
+ project = 5
+ else:
+ project = 1
+ return "http://bugs.archlinux.org/?project=%d&string=%s" % \
+ (project, self.pkgname)
+
class Signoff(models.Model):
pkg = models.ForeignKey(Package)
diff --git a/templates/packages/details.html b/templates/packages/details.html
index 39cba672..90bef992 100644
--- a/templates/packages/details.html
+++ b/templates/packages/details.html
@@ -7,7 +7,7 @@
<div style="float:right" class="listing">
<ul class="small">
<li><a href="{{ pkg.get_svn_link }}">View SVN Entries</a></li>
- <li><a href="http://bugs.archlinux.org/?string={{ pkg.pkgname }}">Bug Reports</a></li>
+ <li><a href="{{ pkg.get_bugs_link }}">Bug Reports</a></li>
<!-- <li><a href="/packages/files/{{ pkg.id }}/">View File List</a></li> -->
<li>
{% if pkg.needupdate %}