added help and about view

This commit is contained in:
Fabian Faessler 2013-09-29 16:58:02 +02:00
parent b568682501
commit d8f42c1fb1
5 changed files with 44 additions and 1 deletions

View File

@ -0,0 +1,9 @@
{% extends "base.html" %}
{% load bootstrap %}
{% block content %}
<div class="row">
<h1>About page</h1>
You take the blue pill, the story ends, you wake up in your bed and believe whatever you want to believe. You take the red pill, you stay in Wonderland, and I show you how deep the rabbit hole goes.
</div>
{% endblock %}

View File

@ -0,0 +1,12 @@
{% extends "base.html" %}
{% load bootstrap %}
{% block content %}
<div class="row">
<h1>Help / FAQ</h1>
I am the Architect. I created the Matrix. I've been waiting for you. You have many questions, and although the process has altered your consciousness, you remain irrevocably human. Ergo, some of my answers you will understand, and some of them you will not. Concordantly, while your first question may be the most pertinent, you may or may not realize it is also the most irrelevant.
</div>
{% endblock %}

View File

@ -1,11 +1,13 @@
from django.conf.urls import patterns, url
from main.views import HomeView, OverviewView, HostView, DeleteHostView
from main.views import HomeView, OverviewView, HostView, DeleteHostView, AboutView, HelpView
from api.views import MyIpView, DetectIpView, NicUpdateView, AuthorizedNicUpdateView
urlpatterns = patterns(
'',
url(r'^$', HomeView.as_view(), name="home"),
url(r'^about/$', AboutView.as_view(), name="about"),
url(r'^help/$', HelpView.as_view(), name="help"),
url(r'^overview/$', OverviewView.as_view(), name='overview'),
url(r'^host/(?P<pk>\d+)/$', HostView.as_view(), name='host_view'),
url(r'^host/(?P<pk>\d+)/delete/$', DeleteHostView.as_view(), name='delete_host'),

View File

@ -31,6 +31,24 @@ class HomeView(TemplateView):
return context
class HelpView(TemplateView):
template_name = "main/help.html"
def get_context_data(self, *args, **kwargs):
context = super(HelpView, self).get_context_data(*args, **kwargs)
context['nav_help'] = True
return context
class AboutView(TemplateView):
template_name = "main/about.html"
def get_context_data(self, *args, **kwargs):
context = super(AboutView, self).get_context_data(*args, **kwargs)
context['nav_about'] = True
return context
class OverviewView(CreateView):
model = Host
template_name = "main/overview.html"

View File

@ -30,6 +30,8 @@
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li{% if nav_home %} class="active"{% endif %}><a href="{% url 'home' %}">Home</a></li>
<li{% if nav_about %} class="active"{% endif %}><a href="{% url 'about' %}">About</a></li>
<li{% if nav_help %} class="active"{% endif %}><a href="{% url 'help' %}">Help</a></li>
<li{% if nav_overview %} class="active"{% endif %}><a href="{% url 'overview' %}">Overview</a></li>
</ul>
<ul class="nav navbar-nav pull-right">