diff options
Diffstat (limited to 'packages')
-rw-r--r-- | packages/templatetags/package_extras.py | 50 |
1 files changed, 30 insertions, 20 deletions
diff --git a/packages/templatetags/package_extras.py b/packages/templatetags/package_extras.py index 67c7fbbc..fc2201e5 100644 --- a/packages/templatetags/package_extras.py +++ b/packages/templatetags/package_extras.py @@ -37,7 +37,7 @@ class BuildQueryStringNode(template.Node): qs['sort'] = ['-' + self.sortfield] else: qs['sort'] = [self.sortfield] - return urlencode(qs, True).replace('&', '&') + return urlencode(qs, True) @register.tag(name='buildsortqs') def do_buildsortqs(parser, token): @@ -72,39 +72,49 @@ def userpkgs(user): ) return '' -@register.simple_tag -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") + +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 get_wiki_link(package): - url = "https://wiki.archlinux.org/index.php/Special:Search" - data = { - 'search': package.pkgname, - } - return link_encode(url, data) +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://bugs.archlinux.org/" + url = "https://bugs.parabolagnulinux.org/bugs/issue?" data = { - 'project': package.repo.bugs_project, - 'string': package.pkgname, + '@action': 'search', + 'title': package.pkgname, } return link_encode(url, data) @register.simple_tag def bug_report(package): - url = "https://bugs.archlinux.org/newtask" + url = "https://bugs.parabolagnulinux.org/bugs/issue?" data = { - 'project': package.repo.bugs_project, - 'product_category': package.repo.bugs_category, - 'item_summary': '[%s]' % package.pkgname, + '@template': 'item', + 'keyword': 'packages', + 'title': '[%s]' % package.pkgname, } return link_encode(url, data) +@register.simple_tag +def flag_unfree(package): + data = { + '@template': 'item', + 'keyword': 'packages,unfree', + 'nosy': 'dev_list', + 'priority': 'critical', + 'title': '[%s] Please put your reasons here (register first if you haven\'t)' % package.pkgname, + } + return "https://bugs.parabolagnulinux.org/bugs/issue?%s" % urlencode(data) # vim: set ts=4 sw=4 et: |