Commit 185b0e2f authored by Daniel W Bond's avatar Daniel W Bond
Browse files

Merge branch 'issue52'

parents 8b5d27c1 204744fe
......@@ -31,7 +31,7 @@ def pfinfo(uname):
base_url = settings.PF_URL
url = base_url + "basic/all/" + str(uname)
try:
metadata = requests.get(url)
metadata = requests.get(url, timeout=5)
print("Retrieving information from the peoplefinder api.")
metadata.raise_for_status()
except requests.exceptions.RequestException as e:
......
{% extends 'layouts/base.html' %} {% block title %} SRCT Roomlist | {{ student.user.first_name }} {{ student.user.last_name }} {% endblock %} {% load socialaccount %} {% block content %}
<!-- gravatar_url student.user.email 175 %} -->
{% extends 'layouts/base.html' %}
{% block title %} SRCT Roomlist | {{ student.user.first_name }} {{ student.user.last_name }} {% endblock title %}
{% block content %}
{% load socialaccount %}
{% load gravatar %}
{% load cache %}
{% cache 4 student_page request.user.username %}
{% get_social_accounts student.user as accounts %}
<div class="page-header" id="banner">
<div class="row">
......@@ -141,4 +145,5 @@
<legend></legend>
{% include 'disclaimer.html' %}
{% endblock %}
{% endcache %}
{% endblock content %}
{% extends 'layouts/base.html' %}
{% block title %} SRCT Roomlist | Majors | {{ major.name }} {% endblock title %}
{% block content %}
{% load cache %}
{% cache 120 major_students request.user.username major %}
<div class="page-header" id="banner">
<div class="row">
......@@ -113,4 +113,5 @@
<legend></legend>
{% include 'disclaimer.html' %}
{% endcache %}
{% endblock content %}
......@@ -22,13 +22,11 @@ urlpatterns = patterns('',
name='list_majors'),
url(r'^majors/(?P<slug>[\w-]+)/(?P<major>[\w-]+)/$',
cache_page(60 * 2)(DetailMajor.as_view()),
name='detail_major'),
DetailMajor.as_view(), name='detail_major'),
# student profile pages
url(r'^student/(?P<slug>[\w-]+)/$',
cache_page(4)(DetailStudent.as_view()),
name='detail_student'),
DetailStudent.as_view(), name='detail_student'),
#url(r'^student/$',
#cache_page(60 * 2)(DetailCurrentStudent.as_view()),
......
{% extends 'layouts/base.html' %}
{% load humanize %}
{% block title %} SRCT Roomlist &bull; {{ floor.building.name }} {{ floor.number|ordinal }}{% endblock %}
{% block title %} SRCT Roomlist &bull; {{ floor.building.name }} {{ floor.number|ordinal }}{% endblock title %}
{% block content %}
{% load cache %}
{% cache 120 floor_students request.user.username floor %}
<div class="page-header" id="banner">
<div class="row">
......@@ -61,4 +63,5 @@
<legend></legend>
{% include 'disclaimer.html' %}
{% endblock %}
{% endcache %}
{% endblock content %}
{% extends 'layouts/base.html' %}
{% block title %} SRCT Roomlist &bull; {{ room.floor.building.name }} {{ room.number }}{% endblock %}
{% block content %}
{% load cache %}
{% cache 120 room_students request.user.username room %}
{% load humanize %}
<div class="page-header" id="banner">
......@@ -62,4 +63,5 @@
<legend></legend>
{% include 'disclaimer.html' %}
{% endblock %}
{% endcache %}
{% endblock content %}
......@@ -9,19 +9,16 @@ from .views import ListBuildings, DetailBuilding, DetailFloor, DetailRoom
urlpatterns = patterns('',
url(r'^$',
ListBuildings.as_view(), name='list_buildings'),
url(r'^$', cache_page(60 * 15)(ListBuildings.as_view()), name='list_buildings'),
url(r'^(?P<slug>[\w-]+)/(?P<building>[\w-]+)/$',
cache_page(60 * 15)(DetailBuilding.as_view()),
name='detail_building'),
url(r'^(?P<slug>[\w-]+)/(?P<building>[\w-]+)/(?P<floor>[\w-]+)/$',
cache_page(60 * 2)(DetailFloor.as_view()),
name='detail_floor'),
DetailFloor.as_view(), name='detail_floor'),
url(r'^(?P<slug>[\w-]+)/(?P<building>[\w-]+)/(?P<floor>[\w-]+)/(?P<room>[\w-]+)/$',
cache_page(60 * 2)(DetailRoom.as_view()),
name='detail_room'),
DetailRoom.as_view(), name='detail_room'),
)
......@@ -18,8 +18,7 @@ handle500 = TemplateView.as_view(template_name="500.html")
urlpatterns = patterns('',
# project-level urls
url(r'^$',
cache_page(4)(HomePageView.as_view()), name='homepage'),
url(r'^$', HomePageView.as_view(), name='homepage'),
url(r'^about/$',
cache_page(60 * 15)(TemplateView.as_view(template_name='about.html')),
name='about'),
......
{% extends 'layouts/base.html' %} {% block title %} SRCT Roomlist &bull; Homepage {% endblock %} {% block content %}
{% extends 'layouts/base.html' %}
{% block title %} SRCT Roomlist &bull; Homepage {% endblock title %}
{% block content %}
{% load cache %}
{% cache 900 homepage %}
<div class="container container-padding">
<div class="row">
......@@ -45,4 +51,5 @@
</div>
{% endif %}
{% endblock %}
{% endcache %}
{% endblock content %}
{% extends 'layouts/base.html' %} {% block title %} SRCT Roomlist &bull; Homepage {% endblock %} {% block content %}
{% extends 'layouts/base.html' %}
{% block title %} SRCT Roomlist &bull; Homepage {% endblock title %}
{% block content %}
{% include 'messages.html' %}
{% load cache %}
{% cache 120 landing request.user.username %}
{% load gravatar %}
<h2>Welcome Back {{ me.get_first_name_or_uname }}!</h2>
<legend></legend>
......@@ -11,7 +16,6 @@
<h3><em><a href="{% url 'updateStudent' request.user.username %}">Select your room</a>, and we'll show you the other students on your floor.</em></h3>
{% else %}
{% cache 300 roommates request.user.username %}
{% if roomies|length == 1 %}
<h3>Your Roommate in {{ me.room }}</h3>
<legend></legend>
......@@ -37,11 +41,9 @@
</div>
{% endfor %}
</div>
{% endcache %}
{% load humanize %}
{% cache 300 floormates request.user.username %}
<h3>Your Floormates from <a href="{{ me.room.floor.get_absolute_url }}">{{ me.room.floor.building }} {{ me.room.floor.number|ordinal }}</a></h3>
<legend></legend>
<div class="row">
......@@ -63,7 +65,6 @@
</div>
{% endfor %}
</div>
{% endcache %}
{% endif %}
......@@ -71,7 +72,6 @@
<h3><em><a href="{% url 'updateStudent' request.user.username %}">Set your major</a>, and we'll show you some of the other students in your program.</em></h3>
{% else %}
{% cache 600 majormates request.user.username %}
<h3>Other Students in <a href="{{ me.major.get_absolute_url }}">{{ me.major.name }}</a></h3>
<legend></legend>
<div class="row">
......@@ -91,8 +91,8 @@
</div>
{% endfor %}
</div>
{% endcache %}
{% endif %}
{% endcache %}
{% 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