summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Krampf <johannes.krampf@gmail.com>2011-12-02 19:46:36 +0100
committerJohannes Krampf <johannes.krampf@gmail.com>2011-12-02 19:46:36 +0100
commit8ceb83e52897c1c0bccc6322cffb0e864664afd1 (patch)
tree80e72559eed612936ed1d4b08c4922a136dfc710
parent0dc6c41899def8127b8176f4ea2d863757b19560 (diff)
Fix download link. Solution looks a bit unclean to me.
-rw-r--r--packages/templatetags/package_extras.py12
-rw-r--r--templates/packages/details.html2
2 files changed, 13 insertions, 1 deletions
diff --git a/packages/templatetags/package_extras.py b/packages/templatetags/package_extras.py
index bcbda210..c31990d7 100644
--- a/packages/templatetags/package_extras.py
+++ b/packages/templatetags/package_extras.py
@@ -73,6 +73,18 @@ def userpkgs(user):
return ''
@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 get_wiki_link(package):
url = "https://wiki.parabolagnulinux.org/index.php"
data = {
diff --git a/templates/packages/details.html b/templates/packages/details.html
index ef501c83..4570627f 100644
--- a/templates/packages/details.html
+++ b/templates/packages/details.html
@@ -39,7 +39,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="download/" rel="nofollow" title="Download {{ pkg.pkgname }} from mirror">Download From Mirror</a></li>
+ <li><a href="{% get_download_link pkg %}" rel="nofollow" title="Download {{ pkg.pkgname }} from mirror">Download From Mirror</a></li>
</ul>
{% if perms.main.change_package %}