Skip to content

Commit 020f582

Browse files
Switched everything to templates
1 parent 66dee64 commit 020f582

25 files changed

+172
-798
lines changed
+8-16
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,16 @@
1-
{% extends "base.html" %}
1+
{% extends "body.html" %}
22

33
{% block head_title %}{{ page_name }} | {% endblock %}
44

5-
{% block navbar %}
6-
{% for item in links %}
7-
<li><a href="/{{ item }}">{{ item }}</a></li>
8-
{% endfor %}
9-
{% endblock %}
10-
11-
125
{% block content %}
136

14-
<div class='col-sm-6 col-sm-offset-3'>
15-
16-
<form method='POST'> {% csrf_token %}
17-
18-
{{ form.as_p }}
19-
20-
<input type="submit" class='btn btn-default' value="{{ button_value }}">
21-
</form>
7+
<div class="container" role="main">
8+
<div class="panel panel-default">
9+
<form method="POST" class="panel-body validate"> {% csrf_token %}
10+
{{ form.as_p }}
11+
<input type="submit" class='btn btn-primary' value="{{ button_value }}">
12+
</form>
13+
</div>
2214
</div>
2315

2416
{% endblock %}

AuthenticationApp/templates/home.html

-15
This file was deleted.

AuthenticationApp/templates/logout.html

-16
This file was deleted.

AuthenticationApp/templates/welcome.html

-25
This file was deleted.

AuthenticationApp/urls.py

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
from . import views
99

1010
urlpatterns = [
11-
url(r'^$', views.home, name='Home'),
1211
url(r'^login$', views.auth_login, name='Login'),
1312
url(r'^logout$', views.auth_logout, name='Logout'),
1413
url(r'^register$', views.auth_register, name='Register'),

AuthenticationApp/views.py

+3-11
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,7 @@
1212
from .forms import LoginForm, RegisterForm, UpdateForm
1313
from .models import MyUser
1414

15-
# Create your views here.
16-
17-
def home(request):
18-
if request.user.is_authenticated():
19-
context = {"user_name": request.user.first_name,}
20-
return render(request, 'home.html', context)
21-
return render(request, 'welcome.html', {})
22-
23-
15+
# Auth Views
2416

2517
def auth_login(request):
2618
form = LoginForm(request.POST or None)
@@ -44,8 +36,8 @@ def auth_login(request):
4436
return render(request, 'auth_form.html', context)
4537

4638
def auth_logout(request):
47-
logout(request);
48-
return HttpResponseRedirect("/")
39+
logout(request)
40+
return render(request, 'index.html')
4941

5042
def auth_register(request):
5143
if request.user.is_authenticated():

CSCapstoneApp/templates/form.html

+3-75
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,7 @@
1-
{% load static %}
2-
<!DOCTYPE HTML>
3-
<html><head>
4-
<meta charset="utf-8">
5-
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7-
<meta http-equiv="Content-type" content="text/html;charset=UTF-8">
1+
{% extends "body.html" %}
82

9-
<title>CS Capstone Marketplace</title>
10-
<link REL="icon" HREF="{% static "images/fav.png" %}">
3+
{% block content %}
114

12-
<meta name="author" content="CSCapstone Marketplace">
13-
<meta name="description" content="CSCapstone Marketplace">
14-
<meta name="keywords" content="purdue, university, computer, science, capstone, marketplace, IBM">
15-
16-
<!-- BValidator -->
17-
<link href="{% static "css/bvalidator.css" %}" rel="stylesheet" type="text/css">
18-
19-
<!-- jQuery UI -->
20-
<link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
21-
22-
<!-- Bootstrap CSS -->
23-
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
24-
25-
<!-- Bootstrap IE8 Support -->
26-
<!--[if lt IE 9]>
27-
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
28-
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
29-
<![endif]-->
30-
31-
<!-- Fonts -->
32-
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
33-
34-
<!-- Site CSS -->
35-
<link rel="stylesheet" type="text/css" href="{% static "css/site.css" %}">
36-
</head><body>
37-
<!-- Navbar -->
38-
<nav class="navbar navbar-inverse navbar-fixed-top">
39-
<div class="container">
40-
<div class="navbar-header">
41-
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
42-
<span class="sr-only">Toggle navigation</span>
43-
<span class="icon-bar"></span>
44-
<span class="icon-bar"></span>
45-
<span class="icon-bar"></span>
46-
</button>
47-
<a class="navbar-brand" href="/">CS Capstone Marketplace</a>
48-
</div>
49-
<div id="navbar" class="navbar-collapse collapse">
50-
<ul class="nav navbar-nav">
51-
<li><a href="/">Home</a></li>
52-
<li><a href="/table">Table</a></li>
53-
<li class="active"><a href="#">Form</a></li>
54-
</ul>
55-
</div>
56-
</div>
57-
</nav>
58-
595
<!-- Content -->
606
<div class="container" role="main">
617
<div class="panel panel-default">
@@ -74,22 +20,4 @@
7420
</div>
7521
</div>
7622

77-
<!-- ----- Javascript ----- -->
78-
79-
<!-- jQuery / jQuery UI -->
80-
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
81-
<script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
82-
<script type="text/javascript" src="{% static "js/jquery.cookie.js" %}"></script>
83-
84-
<!-- BValidator -->
85-
<script type="text/javascript" src="{% static "js/jquery.bvalidator-yc.js" %}"></script>
86-
87-
<!-- Bootstrap JS -->
88-
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
89-
90-
<!-- Tablesorter -->
91-
<script type="text/javascript" src="{% static "js/jquery.tablesorter.min.js" %}"></script>
92-
93-
<!-- Site JS -->
94-
<script type="text/javascript" src="{% static "js/site.js" %}"></script>
95-
</body></html>
23+
{% endblock %}

CSCapstoneApp/templates/index.html

+9-77
Original file line numberDiff line numberDiff line change
@@ -1,85 +1,17 @@
1-
{% load static %}
2-
<!DOCTYPE HTML>
3-
<html><head>
4-
<meta charset="utf-8">
5-
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7-
<meta http-equiv="Content-type" content="text/html;charset=UTF-8">
1+
{% extends "body.html" %}
82

9-
<title>CS Capstone Marketplace</title>
10-
<link REL="icon" HREF="{% static "images/fav.png" %}">
3+
{% block content %}
114

12-
<meta name="author" content="CSCapstone Marketplace">
13-
<meta name="description" content="CSCapstone Marketplace">
14-
<meta name="keywords" content="purdue, university, computer, science, capstone, marketplace, IBM">
15-
16-
<!-- BValidator -->
17-
<link href="{% static "css/bvalidator.css" %}" rel="stylesheet" type="text/css">
18-
19-
<!-- jQuery UI -->
20-
<link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
21-
22-
<!-- Bootstrap CSS -->
23-
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
24-
25-
<!-- Bootstrap IE8 Support -->
26-
<!--[if lt IE 9]>
27-
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
28-
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
29-
<![endif]-->
30-
31-
<!-- Fonts -->
32-
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
33-
34-
<!-- Site CSS -->
35-
<link rel="stylesheet" type="text/css" href="{% static "css/site.css" %}">
36-
</head><body>
37-
<!-- Navbar -->
38-
<nav class="navbar navbar-inverse navbar-fixed-top">
39-
<div class="container">
40-
<div class="navbar-header">
41-
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
42-
<span class="sr-only">Toggle navigation</span>
43-
<span class="icon-bar"></span>
44-
<span class="icon-bar"></span>
45-
<span class="icon-bar"></span>
46-
</button>
47-
<a class="navbar-brand" href="#">CS Capstone Marketplace</a>
48-
</div>
49-
<div id="navbar" class="navbar-collapse collapse">
50-
<ul class="nav navbar-nav">
51-
<li class="active"><a href="#">Home</a></li>
52-
<li><a href="/table">Table</a></li>
53-
<li><a href="/form">Form</a></li>
54-
</ul>
55-
</div>
56-
</div>
57-
</nav>
58-
595
<!-- Content -->
606
<div class="container theme-showcase" role="main">
617
<div class="jumbotron">
62-
<h1>CS Capstone Marketplace</h1>
63-
<p>Hello World!</p>
8+
<h1>Hi There!</h1>
9+
<p>Welcome to the CS390-Python CS Capstone Project!</p>
10+
<br>
11+
<a href="/login">Log in</a>
12+
<br>
13+
<a href="/register">Register</a>
6414
</div>
6515
</div>
6616

67-
<!-- ----- Javascript ----- -->
68-
69-
<!-- jQuery / jQuery UI -->
70-
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
71-
<script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
72-
<script type="text/javascript" src="{% static "js/jquery.cookie.js" %}"></script>
73-
74-
<!-- BValidator -->
75-
<script type="text/javascript" src="{% static "js/jquery.bvalidator-yc.js" %}"></script>
76-
77-
<!-- Bootstrap JS -->
78-
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
79-
80-
<!-- Tablesorter -->
81-
<script type="text/javascript" src="{% static "js/jquery.tablesorter.min.js" %}"></script>
82-
83-
<!-- Site JS -->
84-
<script type="text/javascript" src="{% static "js/site.js" %}"></script>
85-
</body></html>
17+
{% endblock %}

0 commit comments

Comments
 (0)