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.db import models
from django.contrib.auth.models import User
# Create your models here. # Create your models here.
class Class(models.Model): class Class(models.Model):
year_int = models.IntegerField() year_int = models.IntegerField()
...@@ -5,6 +5,7 @@ admin.autodiscover() ...@@ -5,6 +5,7 @@ admin.autodiscover()
urlpatterns = patterns('', urlpatterns = patterns('',
url(r'^$', views.index, name='index'), url(r'^$', views.index, name='index'),
url(r'^login/$', views.login, name='login'),
url(r'^buildings/$', views.buildings, name='buildings'), url(r'^buildings/$', views.buildings, name='buildings'),
url(r'^building/(?P<buildingName>[a-zA-Z]+)$', views.building, name='building'), url(r'^building/(?P<buildingName>[a-zA-Z]+)$', views.building, name='building'),
) )
...@@ -28,3 +28,9 @@ def building(request, buildingName): ...@@ -28,3 +28,9 @@ def building(request, buildingName):
'room_list' : room_list, 'room_list' : room_list,
}) })
return HttpResponse(template.render(context)) 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"> <nav class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container"> <div class="container">
<div class="navbar-header"> <div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar"> <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="sr-only">Toggle navigation</span>
<span class="icon-bar"></span> <span class="icon-bar"></span>
<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="/"><strong>GMU</strong>ROOMLIST</a> <a class="navbar-brand" href="/"><strong>GMU</strong>ROOMLIST</a>
</div> </div>
<div id="navbar" class="navbar-collapse collapse"> <div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav"> <ul class="nav navbar-nav">
<li class="active"><a href="/">Home</a></li> <li class="active"><a href="/">Home</a>
<li><a href="/#about">About</a></li> </li>
<li><a href="/buildings">Buildings</a></li> <li><a href="/#about">About</a>
</ul> </li>
<ul class="nav navbar-nav navbar-right"> <li><a href="/buildings">Buildings</a>
<li><a href="#">Login</a></li> </li>
</ul> </ul>
</div><!--/.nav-collapse --> <ul class="nav navbar-nav navbar-right">
</div> {% if use.is_authenticated %}
</nav> <li><a href="#">{{ user.username }}</a>
<li><a href="#">Logout</a>
{% else %}
<li><a href="/login">Login</a>
{% endif %}
<!--/.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