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;
}
<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/"><strong>GMU</strong>ROOMLIST</a>
</div>
<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>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><a href="#">Login</a></li>
</ul>
</div><!--/.nav-collapse -->
</div>
</nav>
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/"><strong>GMU</strong>ROOMLIST</a>
</div>
<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>
</ul>
<ul class="nav navbar-nav navbar-right">
{% if use.is_authenticated %}
<li><a href="#">{{ user.username }}</a>
</li>
<li><a href="#">Logout</a>
</li>
{% else %}
<li><a href="/login">Login</a>
</li>
{% endif %}
</ul>
</div>
<!--/.nav-collapse -->
</div>
</nav>
{% 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">
<h1><strong>GMU</strong>ROOMLIST</h1>
<p class="lead">{{ building.name }}</p>
</div>
</div>
</div>
<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">
<label>
<input type="checkbox" value="remember-me"> Remember me
</label>
</div>
<button class="btn btn-lg btn-primary btn-block" type="submit">Sign in</button>
</form>
{% 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