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

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 %} {% extends 'layouts/base.html' %}
{% block title %} SRCT Roomlist | {{ student.user.first_name }} {{ student.user.last_name }} {% endblock title %}
<!-- gravatar_url student.user.email 175 %} --> {% block content %}
{% load socialaccount %}
{% load gravatar %} {% load gravatar %}
{% load cache %}
{% cache 4 student_page request.user.username %}
{% get_social_accounts student.user as accounts %} {% get_social_accounts student.user as accounts %}
<div class="page-header" id="banner"> <div class="page-header" id="banner">
<div class="row"> <div class="row">
...@@ -141,4 +145,5 @@ ...@@ -141,4 +145,5 @@
<legend></legend> <legend></legend>
{% include 'disclaimer.html' %} {% include 'disclaimer.html' %}
{% endblock %} {% endcache %}
{% endblock content %}
{% extends 'layouts/base.html' %} {% extends 'layouts/base.html' %}
{% block title %} SRCT Roomlist | Majors | {{ major.name }} {% endblock title %} {% block title %} SRCT Roomlist | Majors | {{ major.name }} {% endblock title %}
{% load cache %}
{% block content %} {% block content %}
{% load cache %}
{% cache 120 major_students request.user.username major %}
<div class="page-header" id="banner"> <div class="page-header" id="banner">
<div class="row"> <div class="row">
...@@ -25,7 +25,6 @@ ...@@ -25,7 +25,6 @@
{% for building in aq_students_by_building %} {% for building in aq_students_by_building %}
<legend><a name="{{ building.grouper }}" href="{{ building.grouper.get_absolute_url }}">{{ building.grouper }}</a></legend> <legend><a name="{{ building.grouper }}" href="{{ building.grouper.get_absolute_url }}">{{ building.grouper }}</a></legend>
<div class="row"> <div class="row">
{% cache 900 building.list request.user.username %}
{% for student in building.list %} {% for student in building.list %}
<div class="col-sm-3 text-center"> <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"> <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 @@ ...@@ -52,7 +51,6 @@
{% for building in ra_students_by_building %} {% for building in ra_students_by_building %}
<legend><a name="{{ building.grouper }}" href="{{ building.grouper.get_absolute_url }}">{{ building.grouper }}</a></legend> <legend><a name="{{ building.grouper }}" href="{{ building.grouper.get_absolute_url }}">{{ building.grouper }}</a></legend>
<div class="row"> <div class="row">
{% cache 900 building.list request.user.username %}
{% for student in building.list %} {% for student in building.list %}
<div class="col-sm-3 text-center"> <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"> <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 @@ ...@@ -79,7 +77,6 @@
{% for building in sh_students_by_building %} {% for building in sh_students_by_building %}
<legend><a name="{{ building.grouper }}" href="{{ building.grouper.get_absolute_url }}">{{ building.grouper }}</a></legend> <legend><a name="{{ building.grouper }}" href="{{ building.grouper.get_absolute_url }}">{{ building.grouper }}</a></legend>
<div class="row"> <div class="row">
{% cache 900 building.list request.user.username %}
{% for student in building.list %} {% for student in building.list %}
<div class="col-sm-3 text-center"> <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"> <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 @@ ...@@ -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> <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="row">
<div class="col-md-12"> <div class="col-md-12">
{% cache 900 location_hidden request.user.username %}
{% for student in location_hidden %} {% for student in location_hidden %}
<div class="col-sm-3 text-center"> <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"> <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('', ...@@ -22,13 +22,11 @@ urlpatterns = patterns('',
name='list_majors'), name='list_majors'),
url(r'^majors/(?P<slug>[\w-]+)/(?P<major>[\w-]+)/$', url(r'^majors/(?P<slug>[\w-]+)/(?P<major>[\w-]+)/$',
cache_page(60 * 2)(DetailMajor.as_view()), DetailMajor.as_view(), name='detail_major'),
name='detail_major'),
# student profile pages # student profile pages
url(r'^student/(?P<slug>[\w-]+)/$', url(r'^student/(?P<slug>[\w-]+)/$',
cache_page(4)(DetailStudent.as_view()), DetailStudent.as_view(), name='detail_student'),
name='detail_student'),
#url(r'^student/$', #url(r'^student/$',
#cache_page(60 * 2)(DetailCurrentStudent.as_view()), #cache_page(60 * 2)(DetailCurrentStudent.as_view()),
......
{% extends 'layouts/base.html' %} {% extends 'layouts/base.html' %}
{% load humanize %} {% load humanize %}
{% load cache %} {% block title %} SRCT Roomlist &bull; {{ floor.building.name }} {{ floor.number|ordinal }}{% endblock title %}
{% block title %} SRCT Roomlist &bull; {{ floor.building.name }} {{ floor.number|ordinal }}{% endblock %}
{% block content %} {% block content %}
{% load cache %}
{% cache 120 floor_students request.user.username floor %}
<div class="page-header" id="banner"> <div class="page-header" id="banner">
<div class="row"> <div class="row">
...@@ -24,7 +25,6 @@ ...@@ -24,7 +25,6 @@
{% load gravatar %} {% load gravatar %}
<div class="row"> <div class="row">
{% cache 900 students request.user.username %}
{% for student in students %} {% for student in students %}
<div class="col-sm-3 text-center"> <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"> <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 @@ ...@@ -64,4 +64,4 @@
{% include 'disclaimer.html' %} {% include 'disclaimer.html' %}
{% endcache %} {% endcache %}
{% endblock %} {% endblock content %}
{% extends 'layouts/base.html' %} {% extends 'layouts/base.html' %}
{% block title %} SRCT Roomlist &bull; {{ room.floor.building.name }} {{ room.number }}{% endblock %} {% block title %} SRCT Roomlist &bull; {{ room.floor.building.name }} {{ room.number }}{% endblock %}
{% block content %} {% block content %}
{% load humanize %}
{% load cache %} {% load cache %}
{% cache 120 room_students request.user.username room %}
{% load humanize %}
<div class="page-header" id="banner"> <div class="page-header" id="banner">
<div class="row"> <div class="row">
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
{% load gravatar %} {% load gravatar %}
<div class="row"> <div class="row">
{% cache 900 students request.user.username %}
{% for student in students %} {% for student in students %}
<div class="col-sm-3 text-center"> <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"> <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 @@ ...@@ -63,5 +62,6 @@
<br /> <br />
<legend></legend> <legend></legend>
{% include 'disclaimer.html' %} {% include 'disclaimer.html' %}
{% endcache %} {% endcache %}
{% endblock %} {% endblock content %}
...@@ -9,19 +9,16 @@ from .views import ListBuildings, DetailBuilding, DetailFloor, DetailRoom ...@@ -9,19 +9,16 @@ from .views import ListBuildings, DetailBuilding, DetailFloor, DetailRoom
urlpatterns = patterns('', urlpatterns = patterns('',
url(r'^$', url(r'^$', cache_page(60 * 15)(ListBuildings.as_view()), name='list_buildings'),
ListBuildings.as_view(), name='list_buildings'),
url(r'^(?P<slug>[\w-]+)/(?P<building>[\w-]+)/$', url(r'^(?P<slug>[\w-]+)/(?P<building>[\w-]+)/$',
cache_page(60 * 15)(DetailBuilding.as_view()), cache_page(60 * 15)(DetailBuilding.as_view()),
name='detail_building'), name='detail_building'),
url(r'^(?P<slug>[\w-]+)/(?P<building>[\w-]+)/(?P<floor>[\w-]+)/$', url(r'^(?P<slug>[\w-]+)/(?P<building>[\w-]+)/(?P<floor>[\w-]+)/$',
cache_page(60 * 2)(DetailFloor.as_view()), DetailFloor.as_view(), name='detail_floor'),
name='detail_floor'),
url(r'^(?P<slug>[\w-]+)/(?P<building>[\w-]+)/(?P<floor>[\w-]+)/(?P<room>[\w-]+)/$', url(r'^(?P<slug>[\w-]+)/(?P<building>[\w-]+)/(?P<floor>[\w-]+)/(?P<room>[\w-]+)/$',
cache_page(60 * 2)(DetailRoom.as_view()), DetailRoom.as_view(), name='detail_room'),
name='detail_room'),
) )
...@@ -18,8 +18,7 @@ handle500 = TemplateView.as_view(template_name="500.html") ...@@ -18,8 +18,7 @@ handle500 = TemplateView.as_view(template_name="500.html")
urlpatterns = patterns('', urlpatterns = patterns('',
# project-level urls # project-level urls
url(r'^$', url(r'^$', HomePageView.as_view(), name='homepage'),
cache_page(4)(HomePageView.as_view()), name='homepage'),
url(r'^about/$', url(r'^about/$',
cache_page(60 * 15)(TemplateView.as_view(template_name='about.html')), cache_page(60 * 15)(TemplateView.as_view(template_name='about.html')),
name='about'), 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="container container-padding">
<div class="row"> <div class="row">
...@@ -45,4 +51,5 @@ ...@@ -45,4 +51,5 @@
</div> </div>
{% endif %} {% 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' %} {% include 'messages.html' %}
{% load cache %} {% load cache %}
{% cache 120 landing request.user.username %}
{% load gravatar %} {% load gravatar %}
<h2>Welcome Back {{ me.get_first_name_or_uname }}!</h2> <h2>Welcome Back {{ me.get_first_name_or_uname }}!</h2>
<legend></legend> <legend></legend>
...@@ -11,7 +16,6 @@ ...@@ -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> <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 %} {% else %}
{% cache 300 roommates request.user.username %}
{% if roomies|length == 1 %} {% if roomies|length == 1 %}
<h3>Your Roommate in {{ me.room }}</h3> <h3>Your Roommate in {{ me.room }}</h3>
<legend></legend> <legend></legend>
...@@ -37,11 +41,9 @@ ...@@ -37,11 +41,9 @@
</div> </div>
{% endfor %} {% endfor %}
</div> </div>
{% endcache %}
{% load humanize %} {% 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> <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> <legend></legend>
<div class="row"> <div class="row">
...@@ -63,7 +65,6 @@ ...@@ -63,7 +65,6 @@
</div> </div>
{% endfor %} {% endfor %}
</div> </div>
{% endcache %}
{% endif %} {% endif %}
...@@ -71,7 +72,6 @@ ...@@ -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> <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 %} {% else %}
{% cache 600 majormates request.user.username %}
<h3>Other Students in <a href="{{ me.major.get_absolute_url }}">{{ me.major.name }}</a></h3> <h3>Other Students in <a href="{{ me.major.get_absolute_url }}">{{ me.major.name }}</a></h3>
<legend></legend> <legend></legend>
<div class="row"> <div class="row">
...@@ -91,8 +91,8 @@ ...@@ -91,8 +91,8 @@
</div> </div>
{% endfor %} {% endfor %}
</div> </div>
{% endcache %}
{% endif %} {% endif %}
{% endcache %}
{% endblock %} {% 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