improved nav
This commit is contained in:
parent
2c6b84f59b
commit
0d628f35e0
2
.gitignore
vendored
2
.gitignore
vendored
@ -4,4 +4,4 @@
|
|||||||
local_settings.py
|
local_settings.py
|
||||||
.idea/
|
.idea/
|
||||||
.cache/
|
.cache/
|
||||||
|
*.sqlite
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
from django.conf.urls import patterns, include, url
|
from django.conf.urls import patterns, include, url
|
||||||
from django.views.generic import TemplateView
|
from main.views import HomeView
|
||||||
|
|
||||||
urlpatterns = patterns('',
|
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>
|
||||||
<span class="icon-bar"></span>
|
<span class="icon-bar"></span>
|
||||||
</button>
|
</button>
|
||||||
<a class="navbar-brand" href="#">nsupdate.info</a>
|
<a class="navbar-brand" href="{% url 'home' %}">nsupdate.info</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="collapse navbar-collapse">
|
<div class="collapse navbar-collapse">
|
||||||
<ul class="nav navbar-nav">
|
<ul class="nav navbar-nav">
|
||||||
<li class="active"><a href="#">Home</a></li>
|
<li{% if nav_home %} class="active"{% endif %}><a href="{% url 'home' %}">Home</a></li>
|
||||||
<li><a href="#about">About</a></li>
|
<li{% if nav_about %} class="active"{% endif %}><a href="#about">About</a></li>
|
||||||
<li><a href="#contact">Contact</a></li>
|
<li{% if nav_contact %} class="active"{% endif %}><a href="#contact">Contact</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user