From 259d96ce9a90dfdf472a8c37736412b0163c906c Mon Sep 17 00:00:00 2001 From: hardythe1 Date: Fri, 19 Sep 2014 02:03:59 +0530 Subject: added custom template tag for dyanmic bolding in nav bar --- scipy/settings.py | 5 +++++ static/website/templates/base.html | 15 ++++++++------- static/website/templates/home.html | 20 +++++++++----------- website/templatetags/__init__.py | 0 website/templatetags/tags.py | 10 ++++++++++ website/views.py | 19 ++++++++++--------- 6 files changed, 42 insertions(+), 27 deletions(-) create mode 100644 website/templatetags/__init__.py create mode 100644 website/templatetags/tags.py diff --git a/scipy/settings.py b/scipy/settings.py index b31d3b6..1bb64dc 100644 --- a/scipy/settings.py +++ b/scipy/settings.py @@ -120,6 +120,11 @@ TEMPLATE_DIRS = ( os.path.join(BASE_DIR, 'static'), ) +TEMPLATE_CONTEXT_PROCESSORS = ( + 'django.core.context_processors.request', + 'django.contrib.auth.context_processors.auth', +) + INSTALLED_APPS = ( 'django.contrib.auth', 'django.contrib.contenttypes', diff --git a/static/website/templates/base.html b/static/website/templates/base.html index c43b8ae..db5a3e1 100755 --- a/static/website/templates/base.html +++ b/static/website/templates/base.html @@ -1,4 +1,5 @@ {% load static %} +{% load tags %} @@ -27,13 +28,13 @@