diff options
author | Dan McGee <dan@archlinux.org> | 2010-01-31 17:28:50 -0600 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2010-01-31 17:28:50 -0600 |
commit | a32eb2dce6e19445492528f0b93bf3850389c41a (patch) | |
tree | 30fb1dc5b64bbcc0f2fb11fd92396bc5977ed24c | |
parent | be3591d95748c4477c3f7b8334e4a690ad111d8a (diff) |
Provide SVN links to trunk/ for each package
This is, at least for me, more useful than the link to a specific
build of a package. We provide both so no one should lose here.
Signed-off-by: Dan McGee <dan@archlinux.org>
-rw-r--r-- | main/models.py | 13 | ||||
-rw-r--r-- | templates/packages/details.html | 3 |
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> |