Skip to content

Commit 1b4db71

Browse files
committed
add url base functionality, add about page
1 parent 4687b61 commit 1b4db71

File tree

7 files changed

+77
-8
lines changed

7 files changed

+77
-8
lines changed

home/urls.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22
from home import views
33

44
urlpatterns = [
5-
url(r'^$', views.home),
5+
url(r'^$', views.home, name='home'),
6+
url(r'^about$', views.about, name='about'),
67
]

home/views.py

+4
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,7 @@ def home(request):
77
return render(request, 'home/home.html', {
88
'15sof': ''
99
})
10+
11+
12+
def about(request):
13+
return render(request, 'home/about.html')

simdb/settings.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
'SCOPES': ('openid', 'profile', 'email'),
8585
}
8686

87-
ROOT_URLCONF = 'simdb.urls'
87+
ROOT_URLCONF = 'simdb.urlsdummy'
8888

8989
TEMPLATES = [
9090
{

simdb/urlsdummy.py

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
"""This file is used to specify a base url path for our project. It is possible
2+
that we deploy our django app not on the root url of a domain. In those cases,
3+
the BASE_PATH environment variable should be set to that subpath appended
4+
with a trailing /
5+
"""
6+
import os
7+
8+
from django.conf.urls import url, include
9+
10+
urlpatterns = [
11+
url(r'^%s' % os.getenv('BASE_PATH', ''), include('simdb.urls')),
12+
]

templates/base.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ <h1>{% block pagetitle %}Welcome to the Simmons DB{% endblock %}</h1>
2727
<ul class="navbar">
2828
<li>SIMMONS DB
2929
<ul>
30-
<li><a href='https://simmons.mit.edu/sds/home.php'>Home</a></li>
30+
<li><a href="{% url 'home' %}">Home</a></li>
3131
<li><a href='https://simmons.mit.edu/sds/directory/'>Directory</a></li>
3232
<li><a href='https://simmons.mit.edu/sds/directory/officers.php'>Student Officers</a></li>
3333
<li><a href='https://simmons.mit.edu/sds/directory/medlinks.php'>Medlinks</a></li>
@@ -105,7 +105,7 @@ <h1>{% block pagetitle %}Welcome to the Simmons DB{% endblock %}</h1>
105105
</div>
106106
<div class="footer">
107107
<hr />
108-
<a href="https://simmons.mit.edu/sds//users/about.php">Simmons DB</a>
108+
<a href="{% url 'about' %}">Simmons DB</a>
109109
</div>
110110
</body>
111111
</html>

templates/home/about.html

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{% extends 'base.html' %}
2+
3+
{% block title %}Simmons DB{% endblock %}
4+
{% block pagetitle %}About the Simmons DB{% endblock %}
5+
6+
{% block content %}
7+
<table class="about">
8+
<tr>
9+
<td rowspan="2">
10+
<span class="title">
11+
<a href="mailto:[email protected]">Administrators
12+
(IT Committee)</a>:</span>
13+
<ul class="names">
14+
<li>Sample Person (Committee Chair)</li>
15+
<li>Sample Person</li>
16+
<li>Sample Person</li>
17+
</ul>
18+
<p style="font-style:italic">
19+
Want to help make the Simmons DB better?<br />
20+
Then join the <a href="mailto:[email protected]">IT Committee!</a>
21+
</p>
22+
</td>
23+
<td rowspan="2">
24+
<span class="title">
25+
<a href="mailto:[email protected]">Moderators</a>:</span>
26+
<ul class="names">
27+
<li>Sample Person</li>
28+
<li>Sample Person</li>
29+
</ul>
30+
</td>
31+
<td>
32+
<span class="title">GovTracker House Committee Editors:</span>
33+
<ul class="names">
34+
<li>Sample Person</li>
35+
<li>Sample Person</li>
36+
</ul>
37+
</td>
38+
</tr>
39+
<tr>
40+
<td>
41+
<span class="title">GovTracker Financial Editors:</span>
42+
<ul class="names">
43+
<li>Sample Person</li>
44+
<li>Sample Person</li>
45+
</ul>
46+
</td>
47+
</tr>
48+
<tr>
49+
<td colspan="3" style="padding-top: 4ex">
50+
<span class="title">Technical specs:</span><br /></td>
51+
</tr>
52+
</table>
53+
{% endblock %}

templates/home/home.html

+3-4
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,14 @@ <h2>15 Seconds Of Frame</h2>
1111
<table border='1'>
1212
<tr>
1313
<td colspan='2'><p align='center'>
14-
<b><a href="directory/entry.php?username=aliciacm"> Alicia Cabrera-Mino</a></b> <br />
14+
<b><a href="directory/entry.php?username=sample">Sample Person</a></b> <br />
1515
</p></td>
1616
</tr>
1717
<tr>
1818
<td>
1919
<table width='100%'>
20-
<tr><td align="right">Year:</td> <td>2017</td></tr>
21-
<tr><td align="right">Hometown:</td> <td>San Diego </td></tr>
22-
<tr><td align="right">Favorite color:</td> <td>blue</td></tr>
20+
<tr><td align="right">Year:</td> <td>1234</td></tr>
21+
<tr><td align="right">Hometown:</td> <td>Earth</td></tr>
2322
</table>
2423
</td>
2524
</tr>

0 commit comments

Comments
 (0)