summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/templatetags/package_extras.py19
-rw-r--r--templates/packages/details.html6
2 files changed, 10 insertions, 15 deletions
diff --git a/packages/templatetags/package_extras.py b/packages/templatetags/package_extras.py
index 42001aa5..01bf7510 100644
--- a/packages/templatetags/package_extras.py
+++ b/packages/templatetags/package_extras.py
@@ -61,20 +61,13 @@ def userpkgs(user):
)
return ''
-def svn_link(package, svnpath):
- '''Helper function for the two real SVN link methods.'''
- parts = (package.repo.svn_root, package.pkgbase, svnpath)
- linkbase = "http://projects.archlinux.org/svntogit/%s.git/tree/%s/%s/"
- return linkbase % tuple(urlquote(part) for part in parts)
-
@register.simple_tag
-def svn_arch(package):
- repo = package.repo.name.lower()
- return svn_link(package, "repos/%s-%s" % (repo, package.arch.name))
-
-@register.simple_tag
-def svn_trunk(package):
- return svn_link(package, "trunk")
+def scm_link(package, operation):
+ parts = (package.repo.svn_root, operation, package.pkgbase)
+ linkbase = (
+ "http://projects.archlinux.org/svntogit/%s.git/%s/trunk?"
+ "h=packages/%s")
+ return linkbase % tuple(urlquote(part) for part in parts)
@register.simple_tag
def get_wiki_link(package):
diff --git a/templates/packages/details.html b/templates/packages/details.html
index afbf9103..fa8283ed 100644
--- a/templates/packages/details.html
+++ b/templates/packages/details.html
@@ -16,8 +16,10 @@
<div id="actionlist">
<h4>Package Actions</h4>
<ul class="small">
- <li><a href="{% svn_arch pkg %}" title="View SVN entries in the {{pkg.repo|lower}}-{{pkg.arch}} branch">SVN Entries ({{pkg.repo|lower}}-{{pkg.arch}})</a></li>
- <li><a href="{% svn_trunk pkg %}" title="View SVN entries on trunk">SVN Entries (trunk)</a></li>
+ <li>
+ <a href="{% scm_link pkg 'tree' %}" title="View source files for {{ pkg.pkgname }}">Source Files</a> /
+ <a href="{% scm_link pkg 'log' %}" title="View changes for {{ pkg.pkgname }}">View Changes</a>
+ </li>
<li><a href="{% get_wiki_link pkg %}" title="Search wiki for {{ pkg.pkgname }}">Search Wiki</a></li>
<li><a href="{% bugs_list pkg %}" title="View existing bug tickets for {{ pkg.pkgname }}">Bug Reports</a></li>
<li><a href="{% bug_report pkg %}" title="Report bug for {{ pkg.pkgname }}">Report a Bug</a></li>