Created index

Minor changes to base template navbar
This commit is contained in:
Tom Price
2014-12-02 16:23:31 +00:00
parent 0ecfe9369c
commit d7f6a7f0aa
6 changed files with 58 additions and 9 deletions

2
.idea/PyRIGS.iml generated
View File

@@ -11,7 +11,7 @@
</component>
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="jdk" jdkName="Python 3.4.2 virtualenv at ~/.virtualenvs/pyrigs" jdkType="Python SDK" />
<orderEntry type="jdk" jdkName="Python 3.3.3 virtualenv at D:\Users\Ghost\.virtualenvs\pyrigs" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="sass-stdlib" level="application" />
</component>

2
.idea/dataSources.xml generated
View File

@@ -4,7 +4,7 @@
<data-source source="LOCAL" name="Django default" uuid="09730cb6-cd27-4034-9959-d242e7905a51">
<driver-ref>sqlite.xerial</driver-ref>
<jdbc-driver>org.sqlite.JDBC</jdbc-driver>
<jdbc-url>jdbc:sqlite:$PROJECT_DIR$/db.sqlite3</jdbc-url>
<jdbc-url>jdbc:sqlite:D:\Users\Ghost\PycharmProjects\pyrigs\db.sqlite3</jdbc-url>
<table-pattern>.*</table-pattern>
<libraries />
</data-source>

View File

@@ -0,0 +1,43 @@
{% extends 'base.html' %}
{% block title %}RIGS{% endblock %}
{% block content %}
<div class="col-sm-12">
<h2>Rig Information Gathering System</h2>
</div>
<div class="col-sm-6">
<div class="well">
{% if request.user %}
<h3>Welcome back {{ request.user.get_full_name }}.<br />
<small>Your rigboard initials are {{ request.user.initials }}</small></h3>
{% endif %}
<h3>There are currently {{ rig_count }} rigs coming up.</h3>
<a class="btn btn-default" href="{% url 'rigboard' %}">View Rigboard</a>
</div>
</div>
<div class="col-sm-6">
<div class="well">
<div>
<h4><a href="{% url 'person_list' %}">People</a></h4>
<form class="form-inline" role="form" action="{% url 'person_list' %}" method="GET">
<input type="search" name="q" class="form-control" placeholder="Search People" />
<button type="submit" class="form-control"><span class="glyphicon glyphicon-search"></span></button>
</form>
</div>
<div>
<h4><a href="{% url 'organisation_list' %}">Organisations</a></h4>
<form class="form-inline" role="form" action="{% url 'organisation_list' %}" method="GET">
<input type="search" name="q" class="form-control" placeholder="Search Organisations" />
<button type="submit" class="form-control"><span class="glyphicon glyphicon-search"></span></button>
</form>
</div>
<div>
<h4><a href="{% url 'venue_list' %}">Venues</a></h4>
<form class="form-inline" role="form" action="{% url 'venue_list' %}" method="GET">
<input type="search" name="q" class="form-control" placeholder="Search Venues" />
<button type="submit" class="form-control"><span class="glyphicon glyphicon-search"></span></button>
</form>
</div>
</div>
</div>
{% endblock %}

View File

@@ -8,6 +8,7 @@ urlpatterns = patterns('',
# Examples:
# url(r'^$', 'PyRIGS.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url('^$', views.Index.as_view(), name='index'),
url(r'^closemodal/$', views.CloseModal.as_view(), name='closemodal'),
url('^user/login/$', 'RIGS.views.login', name='login'),

View File

@@ -5,13 +5,22 @@ from django.views import generic
from django.db.models import Q
from django.shortcuts import get_object_or_404
from django.core import serializers
import simplejson
from django.contrib import messages
from RIGS import models
import simplejson
"""
Displays the current rig count along with a few other bits and pieces
"""
class Index(generic.TemplateView):
template_name = 'RIGS/index.html'
def get_context_data(self, **kwargs):
context = super(Index, self).get_context_data(**kwargs)
context['rig_count'] = models.Event.objects.rig_count()
return context
# Create your views here.
def login(request, **kwargs):
if request.user.is_authenticated():
next = request.REQUEST.get('next', '/')
@@ -33,9 +42,7 @@ class CloseModal(generic.TemplateView):
template_name = 'closemodal.html'
def get_context_data(self, **kwargs):
from django.contrib import messages
return {'messages', messages.get_messages(self.request)}
return {'messages': messages.get_messages(self.request)}
class PersonList(generic.ListView):

View File

@@ -41,8 +41,6 @@
<ul class="dropdown-menu">
<li><a href="{% url 'rigboard' %}">Rigboard</a></li>
<li><a href="#">Calendar</a></li>
<li><a href="#">Bookings</a></li>
<li><a href="#">Other Events</a></li>
</ul>
</li>
{% if perms.RIGS.view_invoice %}