summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main/models.py13
-rw-r--r--templates/packages/details.html3
2 files changed, 12 insertions, 4 deletions
diff --git a/main/models.py b/main/models.py
index 570221bf..16fe73e4 100644
--- a/main/models.py
+++ b/main/models.py
@@ -247,8 +247,8 @@ class Package(models.Model):
self.deps_cache = deps
return deps
- def get_svn_link(self):
- linkbase = "http://repos.archlinux.org/wsvn/%s/%s/repos/%s-%s/"
+ def get_svn_link(self, svnpath):
+ linkbase = "http://repos.archlinux.org/wsvn/%s/%s/%s/"
if self.pkgbase:
dirname = self.pkgbase
else:
@@ -258,7 +258,14 @@ class Package(models.Model):
root = 'community'
else:
root = 'packages'
- return linkbase % (root, dirname, repo, self.arch.name)
+ return linkbase % (root, dirname, svnpath)
+
+ def get_arch_svn_link(self):
+ repo = self.repo.name.lower()
+ return self.get_svn_link("repos/%s-%s" % (repo, self.arch.name))
+
+ def get_trunk_svn_link(self):
+ return self.get_svn_link("trunk")
def get_bugs_link(self):
repo = self.repo.name.lower()
diff --git a/templates/packages/details.html b/templates/packages/details.html
index ca0bf498..2e8d1c2d 100644
--- a/templates/packages/details.html
+++ b/templates/packages/details.html
@@ -6,7 +6,8 @@
<h2 class="title">{{ pkg.pkgname }} {{ pkg.pkgver }}-{{ pkg.pkgrel }}</h2>
<div style="float:right" class="listing">
<ul class="small">
- <li><a href="{{ pkg.get_svn_link }}">View SVN Entries</a></li>
+ <li><a href="{{ pkg.get_arch_svn_link }}">SVN Entries ({{pkg.repo|lower}}-{{pkg.arch}})</a></li>
+ <li><a href="{{ pkg.get_trunk_svn_link }}">SVN Entries (trunk)</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>