diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2013-07-15 23:54:42 -0600 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2013-07-15 23:54:42 -0600 |
commit | 943618d2ce87d30c561b1659002f0d33eb718aa9 (patch) | |
tree | 5313aa0b71fc0c294683b5d74ab06940fed05811 | |
parent | e142f448ec08624007eb8d8e69515871b0fa34b5 (diff) |
reduce differences in the package details page
-rw-r--r-- | packages/templatetags/package_extras.py | 31 | ||||
-rw-r--r-- | templates/packages/details.html | 6 |
2 files changed, 14 insertions, 23 deletions
diff --git a/packages/templatetags/package_extras.py b/packages/templatetags/package_extras.py index ca977c03..c36c34ee 100644 --- a/packages/templatetags/package_extras.py +++ b/packages/templatetags/package_extras.py @@ -95,18 +95,6 @@ def maintainer_link(user): @register.simple_tag -def get_download_link(package): - parts = { - "repo": package.repo.name.lower(), - "arch": package.arch.name, - "pkgfile": package.filename - } - if parts["arch"] == "any": - parts["arch"] = "i686" - linkbase = "https://repo.parabolagnulinux.org/%(repo)s/os/%(arch)s/%(pkgfile)s" - return linkbase % parts - -@register.simple_tag def packager_link(user): if user: # TODO don't hardcode @@ -118,6 +106,15 @@ def packager_link(user): ) return '' + +@register.simple_tag +def scm_link(package, operation): + parts = ("abslibre", operation, package.repo, package.pkgbase) + linkbase = ( + "https://projects.parabolagnulinux.org/%s.git/%s/%s/%s") + return linkbase % tuple(urlquote(part.encode('utf-8')) for part in parts) + + @register.simple_tag def get_wiki_link(package): url = "https://wiki.parabolagnulinux.org/index.php" @@ -127,16 +124,6 @@ def get_wiki_link(package): } return link_encode(url, data) - -@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") - @register.simple_tag def bugs_list(package): url = "https://labs.parabola.nu/search/index/issue-tracker" diff --git a/templates/packages/details.html b/templates/packages/details.html index 35134f97..2fb14bb8 100644 --- a/templates/packages/details.html +++ b/templates/packages/details.html @@ -17,6 +17,10 @@ <h4>Package Actions</h4> <ul class="small"> <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="{% bugs_list pkg %}" title="View existing bug tickets for {{ pkg.pkgname }}">Bug Reports</a> / <a href="{% bug_report pkg %}" title="Report new bug for {{ pkg.pkgname }}">Add New Bug</a> / <a href="{% flag_unfree pkg %}" title="Report {{ pkg.pkgname }} as unfree">Report as unfree</a> @@ -41,7 +45,7 @@ onclick="return !window.open('/packages/flaghelp/','FlagHelp', 'height=350,width=450,location=no,scrollbars=yes,menubars=no,toolbars=no,resizable=no');">(?)</a></li> {% endif %} - <li><a href="{% get_download_link pkg %}" rel="nofollow" title="Download {{ pkg.pkgname }} from mirror">Download From Mirror</a></li> + <li><a href="download/" rel="nofollow" title="Download {{ pkg.pkgname }} from mirror">Download From Mirror</a></li> </ul> {% if perms.main.change_package %} |