diff options
Diffstat (limited to 'main')
-rw-r--r-- | main/context_processors.py | 15 | ||||
-rw-r--r-- | main/templatetags/bugs.py | 6 | ||||
-rw-r--r-- | main/templatetags/wiki.py | 9 |
3 files changed, 30 insertions, 0 deletions
diff --git a/main/context_processors.py b/main/context_processors.py index a60d4e63..96a45dcf 100644 --- a/main/context_processors.py +++ b/main/context_processors.py @@ -1,4 +1,19 @@ def secure(request): return {'secure': request.is_secure()} +def branding(request): + from django.conf import settings + return { + 'BUGTRACKER_URL': settings.BUGTRACKER_URL, + 'MAILMAN_BASE_URL': settings.MAILMAN_BASE_URL, + 'PROJECTS_URL': settings.PROJECTS_URL, + + 'BRANDING_APPNAME': settings.BRANDING_APPNAME, + 'BRANDING_DISTRONAME': settings.BRANDING_DISTRONAME, + 'BRANDING_SHORTNAME': settings.BRANDING_SHORTNAME, + 'BRANDING_WIKINAME': settings.BRANDING_WIKINAME, + 'BRANDING_EMAIL': settings.BRANDING_EMAIL, + 'BRANDING_OSEARCH_TAGS': settings.BRANDING_OSEARCH_TAGS, + } + # vim: set ts=4 sw=4 et: diff --git a/main/templatetags/bugs.py b/main/templatetags/bugs.py new file mode 100644 index 00000000..b548859a --- /dev/null +++ b/main/templatetags/bugs.py @@ -0,0 +1,6 @@ +from django import template +register = template.Library() + +@register.simple_tag +def bug_link(bugid): + return "<a href=\"https://bugs.archlinux.org/task/{0}\">FS#{0}</a>".format(bugid) diff --git a/main/templatetags/wiki.py b/main/templatetags/wiki.py new file mode 100644 index 00000000..b1b8dd55 --- /dev/null +++ b/main/templatetags/wiki.py @@ -0,0 +1,9 @@ +from django import template +register = template.Library() + +@register.simple_tag +def wiki_url(article=""): + if article == "": + return "https://wiki.archlinux.org/" + else: + return "https://wiki.archlinux.org/index.php/"+article.replace(' ', '_') |