diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2013-03-27 10:10:08 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@parabola.nu> | 2018-01-15 14:11:25 -0500 |
commit | f1357297697ca9f14c4a3b5b90a7665604c867d6 (patch) | |
tree | b54f364a50075f8004b0eb63e88374e9814593cb | |
parent | db7e08307134ad42c756234ae900b9cdc849badc (diff) |
branding: Do the backend/glue work to make names and URLs configurable
-rw-r--r-- | main/context_processors.py | 15 | ||||
-rw-r--r-- | main/templatetags/bugs.py | 6 | ||||
-rw-r--r-- | main/templatetags/wiki.py | 9 | ||||
-rw-r--r-- | settings.py | 21 |
4 files changed, 51 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(' ', '_') diff --git a/settings.py b/settings.py index 31070d02..7571f0fc 100644 --- a/settings.py +++ b/settings.py @@ -51,6 +51,7 @@ TEMPLATE_CONTEXT_PROCESSORS = ( 'django.core.context_processors.debug', 'django.contrib.messages.context_processors.messages', 'main.context_processors.secure', + 'main.context_processors.branding', ) TEMPLATE_DIRS = ( @@ -166,6 +167,18 @@ ISO_LIST_URL = 'https://releng.archlinux.org/isos/' # community bit on the end, repo.svn_root is appended) SVN_BASE_URL = 'svn://svn.archlinux.org/' +# URL for linking to mailing lists +MAILMAN_BASE_URL = 'https://mailman.archlinux.org/' + +# URL for linking to the bugtracker +BUGTRACKER_URL = 'https://bugs.archlinux.org/' + +# URL for linking to the release engineering/iso project on the bugtracker +BUGTRACKER_RELENG_URL = 'https://bugs.archlinux.org/index.php?project=6' + +# URL for linking to projects in git +PROJECTS_URL = 'https://projects.archlinux.org' + # Trackers used for ISO download magnet links TORRENT_TRACKERS = ( 'udp://tracker.archlinux.org:6969', @@ -174,6 +187,14 @@ TORRENT_TRACKERS = ( DOMAIN_RE = r'^(.+\.)?archlinux.org$' +BRANDING_APPNAME = 'archweb' +BRANDING_DISTRONAME = 'Arch Linux' +BRANDING_SHORTNAME = 'Arch' +BRANDING_SLUG = 'archlinux' +BRANDING_WIKINAME = 'ArchWiki' +BRANDING_EMAIL = 'Arch Website Notification <nobody@archlinux.org>' +BRANDING_OSEARCH_TAGS = 'linux archlinux package software' + # Shorten some names just a bit COUNTRIES_OVERRIDE = { 'GB': 'United Kingdom', |