diff options
-rw-r--r-- | packages/templatetags/package_extras.py | 12 | ||||
-rw-r--r-- | templates/packages/details.html | 2 |
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 %} |