From 3c115c85cf8cea1d7083c2643043d556a4992131 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 27 Mar 2013 14:54:10 -0400 Subject: Add a context processor so BRANDING_* works in templaces --- main/context_processors.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'main') diff --git a/main/context_processors.py b/main/context_processors.py index a60d4e63..850bb499 100644 --- a/main/context_processors.py +++ b/main/context_processors.py @@ -1,4 +1,13 @@ def secure(request): return {'secure': request.is_secure()} +def branding(request): + from django.conf import settings + return { + 'BRANDING_APPNAME': settings.BRANDING_APPNAME, + 'BRANDING_DISTRONAME': settings.BRANDING_DISTRONAME, + 'BRANDING_SHORTNAME': settings.BRANDING_SHORTNAME, + 'BRANDING_EMAIL': settings.BRANDING_EMAIL, + } + # vim: set ts=4 sw=4 et: -- cgit v1.2.3-2-g168b From ae9ee14ff153698dd90c6560437e42ff124a6d0b Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Fri, 19 Apr 2013 21:46:51 -0400 Subject: Abstract ArchWiki URLs and references. Notable things: * Standardize on "ArchWiki", instead of also having "Arch Wiki", via BRANDING_WIKINAME * Link to the article "Install_Guide" instead of "Official_Arch_Linux_Install_Guide", it's a redirect anyway. * On the download page, it assumes the that the version is just appended to the URL for the wiki link. * For the wiki RSS link, It now uses "/${title}?feed=rss" instead of "?title=${title}&feed=rss". --- main/context_processors.py | 1 + main/templatetags/wiki.py | 9 +++++++++ 2 files changed, 10 insertions(+) create mode 100644 main/templatetags/wiki.py (limited to 'main') diff --git a/main/context_processors.py b/main/context_processors.py index 850bb499..5ac31744 100644 --- a/main/context_processors.py +++ b/main/context_processors.py @@ -7,6 +7,7 @@ def branding(request): '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, } 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(' ', '_') -- cgit v1.2.3-2-g168b From 55b52a92806e4e76b1db17178f323362e3ddfe09 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 20 Apr 2013 00:24:29 -0400 Subject: add MAILMAN_BASE_URL to abstract mailing list links --- main/context_processors.py | 1 + 1 file changed, 1 insertion(+) (limited to 'main') diff --git a/main/context_processors.py b/main/context_processors.py index 5ac31744..d6456a9d 100644 --- a/main/context_processors.py +++ b/main/context_processors.py @@ -9,6 +9,7 @@ def branding(request): 'BRANDING_SHORTNAME': settings.BRANDING_SHORTNAME, 'BRANDING_WIKINAME': settings.BRANDING_WIKINAME, 'BRANDING_EMAIL': settings.BRANDING_EMAIL, + 'MAILMAN_BASE_URL': settings.MAILMAN_BASE_URL, } # vim: set ts=4 sw=4 et: -- cgit v1.2.3-2-g168b From 753784954794259c6a674a7b33e8b1e0105f55d1 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 21 Apr 2013 01:01:35 -0400 Subject: add BUGTRACKER_URL --- main/context_processors.py | 1 + 1 file changed, 1 insertion(+) (limited to 'main') diff --git a/main/context_processors.py b/main/context_processors.py index d6456a9d..2543a3de 100644 --- a/main/context_processors.py +++ b/main/context_processors.py @@ -10,6 +10,7 @@ def branding(request): 'BRANDING_WIKINAME': settings.BRANDING_WIKINAME, 'BRANDING_EMAIL': settings.BRANDING_EMAIL, 'MAILMAN_BASE_URL': settings.MAILMAN_BASE_URL, + 'BUGTRACKER_URL': settings.BUGTRACKER_URL, } # vim: set ts=4 sw=4 et: -- cgit v1.2.3-2-g168b