Commit 204744fe authored by Daniel W Bond's avatar Daniel W Bond

changed basically everything: modifed existing template cache, added new...

changed basically everything: modifed existing template cache, added new template caching, removed url cacheing
parent fa8cec30
{% 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 %}
{% load cache %}
{% block content %}
{% load cache %}
{% cache 120 major_students request.user.username major %}
<div class="page-header" id="banner">
<div class="row">
......@@ -25,7 +25,6 @@
{% for building in aq_students_by_building %}
<legend><a name="{{ building.grouper }}" href="{{ building.grouper.get_absolute_url }}">{{ building.grouper }}</a></legend>
<div class="row">
{% cache 900 building.list request.user.username %}
{% for student in building.list %}
<div class="col-sm-3 text-center">
<img class="img-circle img-responsive center center-block" src="{{ student.profile_image_url }}" alt="{{ student.get_first_name_or_uname }} profile picture">
......@@ -52,7 +51,6 @@
{% for building in ra_students_by_building %}
<legend><a name="{{ building.grouper }}" href="{{ building.grouper.get_absolute_url }}">{{ building.grouper }}</a></legend>
<div class="row">
{% cache 900 building.list request.user.username %}
{% for student in building.list %}
<div class="col-sm-3 text-center">
<img class="img-circle img-responsive center center-block" src="{{ student.profile_image_url }}" alt="{{ student.get_first_name_or_uname }} profile picture">
......@@ -79,7 +77,6 @@
{% for building in sh_students_by_building %}
<legend><a name="{{ building.grouper }}" href="{{ building.grouper.get_absolute_url }}">{{ building.grouper }}</a></legend>
<div class="row">
{% cache 900 building.list request.user.username %}
{% for student in building.list %}
<div class="col-sm-3 text-center">
<img class="img-circle img-responsive center center-block" src="{{ student.profile_image_url }}" alt="{{ student.get_first_name_or_uname }} profile picture">
......@@ -102,7 +99,6 @@
<legend class="text-center">Location not visible because of student <a href="{% url 'updateStudent' request.user.username %}">privacy settings</a></legend>
<div class="row">
<div class="col-md-12">
{% cache 900 location_hidden request.user.username %}
{% for student in location_hidden %}
<div class="col-sm-3 text-center">
<img class="img-circle img-responsive center center-block" src="{{ student.profile_image_url }}" alt="{{ student.get_first_name_or_uname }} profile picture">
......
......@@ -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 %}
{% load cache %}
{% 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">
......@@ -24,7 +25,6 @@
{% load gravatar %}
<div class="row">
{% cache 900 students request.user.username %}
{% for student in students %}
<div class="col-sm-3 text-center">
<img class="img-circle img-responsive center center-block" src="{{ student.profile_image_url }}" alt="{{ student.get_first_name_or_uname }} profile picture">
......@@ -64,4 +64,4 @@
{% include 'disclaimer.html' %}
{% endcache %}
{% endblock %}
{% endblock content %}
{% extends 'layouts/base.html' %}
{% block title %} SRCT Roomlist &bull; {{ room.floor.building.name }} {{ room.number }}{% endblock %}
{% block content %}
{% load humanize %}
{% load cache %}
{% cache 120 room_students request.user.username room %}
{% load humanize %}
<div class="page-header" id="banner">
<div class="row">
......@@ -26,7 +26,6 @@
{% load gravatar %}
<div class="row">
{% cache 900 students request.user.username %}
{% for student in students %}
<div class="col-sm-3 text-center">
<img class="img-circle img-responsive center center-block" src="{{ student.profile_image_url }}" alt="{{ student.get_first_name_or_uname }} profile picture">
......@@ -63,5 +62,6 @@
<br />
<legend></legend>
{% include 'disclaimer.html' %}
{% endcache %}
{% endblock %}
{% 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