Add arrow under active menu item
This commit is contained in:
parent
a621c3e206
commit
904cfc4750
@ -32,3 +32,8 @@ def tagcloud(request):
|
|||||||
tagcloud.sort(key=itemgetter('name'))
|
tagcloud.sort(key=itemgetter('name'))
|
||||||
|
|
||||||
return {'tagcloud': tagcloud}
|
return {'tagcloud': tagcloud}
|
||||||
|
|
||||||
|
def viewname(request):
|
||||||
|
return {
|
||||||
|
'view_name': request.view_name,
|
||||||
|
}
|
||||||
|
0
gergelypolonkaiweb/middleware/__init__.py
Normal file
0
gergelypolonkaiweb/middleware/__init__.py
Normal file
5
gergelypolonkaiweb/middleware/viewname.py
Normal file
5
gergelypolonkaiweb/middleware/viewname.py
Normal file
@ -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__))
|
||||||
|
|
@ -104,6 +104,7 @@ MIDDLEWARE_CLASSES = (
|
|||||||
'django.contrib.messages.middleware.MessageMiddleware',
|
'django.contrib.messages.middleware.MessageMiddleware',
|
||||||
# Uncomment the next line for simple clickjacking protection:
|
# Uncomment the next line for simple clickjacking protection:
|
||||||
# 'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
# 'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
||||||
|
'gergelypolonkaiweb.middleware.viewname.ViewNameMiddleware',
|
||||||
)
|
)
|
||||||
|
|
||||||
ROOT_URLCONF = 'gergelypolonkaiweb.urls'
|
ROOT_URLCONF = 'gergelypolonkaiweb.urls'
|
||||||
@ -173,6 +174,7 @@ TEMPLATE_CONTEXT_PROCESSORS = (
|
|||||||
"django.contrib.messages.context_processors.messages",
|
"django.contrib.messages.context_processors.messages",
|
||||||
'gergelypolonkaiweb.helper.tagcloud',
|
'gergelypolonkaiweb.helper.tagcloud',
|
||||||
'gergelypolonkaiweb.helper.randomheader',
|
'gergelypolonkaiweb.helper.randomheader',
|
||||||
|
'gergelypolonkaiweb.helper.viewname',
|
||||||
)
|
)
|
||||||
|
|
||||||
HEADER_DIR = SITE_ROOT + os.path.sep + "static" + os.path.sep + "images" + os.path.sep + "header"
|
HEADER_DIR = SITE_ROOT + os.path.sep + "static" + os.path.sep + "images" + os.path.sep + "header"
|
||||||
|
BIN
gergelypolonkaiweb/static/images/arrow-up.png
Normal file
BIN
gergelypolonkaiweb/static/images/arrow-up.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 228 B |
@ -43,9 +43,9 @@
|
|||||||
<div id="menu">
|
<div id="menu">
|
||||||
<div id="tagcloud-button"><img alt="" src="{% static "images/tagcloud.png" %}" /></div>
|
<div id="tagcloud-button"><img alt="" src="{% static "images/tagcloud.png" %}" /></div>
|
||||||
<ul>
|
<ul>
|
||||||
<li {% if currentMenu == 'resume' %} class="active"{% endif %}><a href="{% url 'basics:resume' %}">Resume</a></li>
|
<li {% if view_name|slice:"-7:" == ".resume" %} class="active"{% endif %}><a href="{% url 'basics:resume' %}">Resume</a></li>
|
||||||
<li {% if currentMenu == 'blog' %} class="active"{% endif %}><a href="{% url 'blog:index' %}">Blog</a></li>
|
<li {% if view_name|slice:":5" == "blog." %} class="active"{% endif %}><a href="{% url 'blog:index' %}">Blog</a></li>
|
||||||
<li {% if currentMenu == 'about' %} class="active"{% endif %}><a href="{% url 'basics:about' %}">About me</a></li>
|
<li {% if view_name|slice:"-6:" == ".about" %} class="active"{% endif %}><a href="{% url 'basics:about' %}">About me</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
<br class="clear" />
|
<br class="clear" />
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user