Commit 83935a43 authored by Jason D Yeomans's avatar Jason D Yeomans
Browse files

Created SignIn page

parent b36e08a4
from django.db import models
from django.contrib.auth.models import User
# Create your models here.
class Class(models.Model):
year_int = models.IntegerField()
......@@ -5,6 +5,7 @@ admin.autodiscover()
urlpatterns = patterns('',
url(r'^$', views.index, name='index'),
url(r'^login/$', views.login, name='login'),
url(r'^buildings/$', views.buildings, name='buildings'),
url(r'^building/(?P<buildingName>[a-zA-Z]+)$', views.building, name='building'),
......@@ -28,3 +28,9 @@ def building(request, buildingName):
'room_list' : room_list,
return HttpResponse(template.render(context))
def login(request):
template = loader.get_template('login.html')
context = RequestContext(request, {
return HttpResponse(template.render(context))
body {
padding-top: 40px;
padding-bottom: 40px;
background-color: #eee;
.form-signin {
max-width: 330px;
padding: 15px;
margin: 0 auto;
.form-signin .form-signin-heading,
.form-signin .checkbox {
margin-bottom: 10px;
.form-signin .checkbox {
font-weight: normal;
.form-signin .form-control {
position: relative;
height: auto;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
padding: 10px;
font-size: 16px;
.form-signin .form-control:focus {
z-index: 2;
.form-signin input[type="email"] {
margin-bottom: -1px;
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
.form-signin input[type="password"] {
margin-bottom: 10px;
border-top-left-radius: 0;
border-top-right-radius: 0;
......@@ -11,13 +11,25 @@
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li class="active"><a href="/">Home</a></li>
<li><a href="/#about">About</a></li>
<li><a href="/buildings">Buildings</a></li>
<li class="active"><a href="/">Home</a>
<li><a href="/#about">About</a>
<li><a href="/buildings">Buildings</a>
<ul class="nav navbar-nav navbar-right">
<li><a href="#">Login</a></li>
{% if use.is_authenticated %}
<li><a href="#">{{ user.username }}</a>
<li><a href="#">Logout</a>
{% else %}
<li><a href="/login">Login</a>
{% endif %}
</div><!--/.nav-collapse -->
<!--/.nav-collapse -->
{% extends 'layouts/base.html' %} {% block title %} GMU RoomList &bull; Homepage {% endblock %} {% block content %}
<link href="/static/css/signin.css" rel="stylesheet" media="screen">
<div class="page-header" id="banner">
<div class="row">
<div class="col-lg-12 text-center">
<p class="lead">{{ }}</p>
<form class="form-signin" role="form">
<h2 class="form-signin-heading">Please sign in</h2>
<label for="inputEmail" class="sr-only">Username</label>
<input type="username" id="inputEmail" class="form-control" placeholder="Email address" required autofocus>
<label for="inputPassword" class="sr-only">Password</label>
<input type="password" id="inputPassword" class="form-control" placeholder="Password" required>
<div class="checkbox">
<input type="checkbox" value="remember-me"> Remember me
<button class="btn btn-lg btn-primary btn-block" type="submit">Sign in</button>
{% endblock %}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment