improved nav
This commit is contained in:
parent
2c6b84f59b
commit
0d628f35e0
2
.gitignore
vendored
2
.gitignore
vendored
@ -4,4 +4,4 @@
|
||||
local_settings.py
|
||||
.idea/
|
||||
.cache/
|
||||
|
||||
*.sqlite
|
||||
|
@ -1,6 +1,6 @@
|
||||
from django.conf.urls import patterns, include, url
|
||||
from django.views.generic import TemplateView
|
||||
from main.views import HomeView
|
||||
|
||||
urlpatterns = patterns('',
|
||||
url(r'^$', TemplateView.as_view(template_name="base.html")),
|
||||
url(r'^$', HomeView.as_view(), name="home"),
|
||||
)
|
||||
|
@ -1 +1,11 @@
|
||||
# Create your views here.
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from django.views.generic import TemplateView
|
||||
|
||||
class HomeView(TemplateView):
|
||||
template_name = "base.html"
|
||||
|
||||
def get_context_data(self, *args, **kwargs):
|
||||
context = super(HomeView, self).get_context_data(*args, **kwargs)
|
||||
context['nav_home'] = True
|
||||
return context
|
||||
|
@ -22,13 +22,13 @@
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="#">nsupdate.info</a>
|
||||
<a class="navbar-brand" href="{% url 'home' %}">nsupdate.info</a>
|
||||
</div>
|
||||
<div class="collapse navbar-collapse">
|
||||
<ul class="nav navbar-nav">
|
||||
<li class="active"><a href="#">Home</a></li>
|
||||
<li><a href="#about">About</a></li>
|
||||
<li><a href="#contact">Contact</a></li>
|
||||
<li{% if nav_home %} class="active"{% endif %}><a href="{% url 'home' %}">Home</a></li>
|
||||
<li{% if nav_about %} class="active"{% endif %}><a href="#about">About</a></li>
|
||||
<li{% if nav_contact %} class="active"{% endif %}><a href="#contact">Contact</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user