From 904cfc47507a93740f6503cbaeecd9b7c5b08c94 Mon Sep 17 00:00:00 2001 From: "Gergely Polonkai (W00d5t0ck)" Date: Tue, 15 Oct 2013 09:29:03 +0200 Subject: [PATCH] Add arrow under active menu item --- gergelypolonkaiweb/helper.py | 5 +++++ gergelypolonkaiweb/middleware/__init__.py | 0 gergelypolonkaiweb/middleware/viewname.py | 5 +++++ gergelypolonkaiweb/settings.py | 2 ++ gergelypolonkaiweb/static/images/arrow-up.png | Bin 0 -> 228 bytes gergelypolonkaiweb/templates/front_base.html | 6 +++--- 6 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 gergelypolonkaiweb/middleware/__init__.py create mode 100644 gergelypolonkaiweb/middleware/viewname.py create mode 100644 gergelypolonkaiweb/static/images/arrow-up.png diff --git a/gergelypolonkaiweb/helper.py b/gergelypolonkaiweb/helper.py index 1b3151b..8fd3193 100644 --- a/gergelypolonkaiweb/helper.py +++ b/gergelypolonkaiweb/helper.py @@ -32,3 +32,8 @@ def tagcloud(request): tagcloud.sort(key=itemgetter('name')) return {'tagcloud': tagcloud} + +def viewname(request): + return { + 'view_name': request.view_name, + } diff --git a/gergelypolonkaiweb/middleware/__init__.py b/gergelypolonkaiweb/middleware/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/gergelypolonkaiweb/middleware/viewname.py b/gergelypolonkaiweb/middleware/viewname.py new file mode 100644 index 0000000..529cc32 --- /dev/null +++ b/gergelypolonkaiweb/middleware/viewname.py @@ -0,0 +1,5 @@ +class ViewNameMiddleware(object): + def process_view(self, request, view_func, view_args, view_kwargs): + request.test = "TEST" + request.view_name = ".".join((view_func.__module__, view_func.__name__)) + diff --git a/gergelypolonkaiweb/settings.py b/gergelypolonkaiweb/settings.py index 8959a02..2f1a6c1 100644 --- a/gergelypolonkaiweb/settings.py +++ b/gergelypolonkaiweb/settings.py @@ -104,6 +104,7 @@ MIDDLEWARE_CLASSES = ( 'django.contrib.messages.middleware.MessageMiddleware', # Uncomment the next line for simple clickjacking protection: # 'django.middleware.clickjacking.XFrameOptionsMiddleware', + 'gergelypolonkaiweb.middleware.viewname.ViewNameMiddleware', ) ROOT_URLCONF = 'gergelypolonkaiweb.urls' @@ -173,6 +174,7 @@ TEMPLATE_CONTEXT_PROCESSORS = ( "django.contrib.messages.context_processors.messages", 'gergelypolonkaiweb.helper.tagcloud', 'gergelypolonkaiweb.helper.randomheader', + 'gergelypolonkaiweb.helper.viewname', ) HEADER_DIR = SITE_ROOT + os.path.sep + "static" + os.path.sep + "images" + os.path.sep + "header" diff --git a/gergelypolonkaiweb/static/images/arrow-up.png b/gergelypolonkaiweb/static/images/arrow-up.png new file mode 100644 index 0000000000000000000000000000000000000000..7341693ff7c91ff44c074df9b14489222749598f GIT binary patch literal 228 zcmeAS@N?(olHy`uVBq!ia0vp^B0$W}!3HEbPUl(xDYhhUcNd2LAh=-f^2tCE&H|6f zVxW%eAk65bF}nh!r^M6OmHiGEn;;v%>?fz2K%qiU7sn8d^GnZcP@xClsWE`?n=8={fp{8 SUS|ljoWax8&t;ucLK6UGXi)$F literal 0 HcmV?d00001 diff --git a/gergelypolonkaiweb/templates/front_base.html b/gergelypolonkaiweb/templates/front_base.html index a57030d..fb1e15b 100644 --- a/gergelypolonkaiweb/templates/front_base.html +++ b/gergelypolonkaiweb/templates/front_base.html @@ -43,9 +43,9 @@