landing.html 3.8 KB
Newer Older
1 2 3
{% extends 'layouts/base.html' %} {% block title %} SRCT Roomlist • Homepage {% endblock %} {% block content %}
{% load cache %}
{% load gravatar %}
4
<h2>Welcome Back {{ me.get_first_name_or_uname }}!</h2>
5 6
<legend></legend>

7 8 9 10
{% if not me.room %}
  <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 %}

11 12
{% cache 300 roommates request.user.username %}
  {% if roomies|length == 1 %}
Daniel W Bond's avatar
Daniel W Bond committed
13
    <h3>Your Roommate in {{ me.room }}</h3>
14 15
    <legend></legend>
  {% else %}
Daniel W Bond's avatar
Daniel W Bond committed
16
  <h3>Your Roommates in <a href="{{ me.room.get_absolute_url }}">{{ me.room }}</a></h3>
17 18 19 20
  <legend></legend>
  {% endif %}
    <div class="text-center">
    <div class="row">
21
     {% for student in roomies %}
22
          <div class="col-md-3">
23 24
            <a href="{{ student.get_absolute_url }}"><img class="img-circle img-responsive center center-block" src="{% gravatar_url student.user.email 100 %}" alt="{{ student.get_first_name_or_uname}} Gravatar picture"></img></a>
            <h4><a href="{{ student.get_absolute_url }}"><strong>{{ student.get_full_name_or_uname }}</strong></a></h4>
Daniel W Bond's avatar
Daniel W Bond committed
25
            <h5><a href="{{ student.major.get_absolute_url }}"><em>{{ student.major }}</em></a></h5>
26 27 28
          </div>
      {% empty %}
        <h4>There are no other students registered in your room right now.</h4>
29 30 31 32 33
      {% if forloop.counter|divisibleby:4 %}
      </div>
      <br />
      <div class="row">
      {% endif %}
34 35 36 37 38
      {% endfor %}
    </div>
    </div>
{% endcache %}

Daniel W Bond's avatar
Daniel W Bond committed
39 40
{% load humanize %}

41
{% cache 300 floormates request.user.username %}
Daniel W Bond's avatar
Daniel W Bond committed
42
<h3>Your Floormates from <a href="{{ me.room.floor.get_absolute_url }}">{{ me.room.floor.building }} {{ me.room.floor.number|ordinal }}</a></h3>
43 44 45 46 47 48
    <legend></legend>
    <div class="text-center">
    <div class="row">
      {% for student in floories %}
      <div class="col-md-3">
        <a href="{{ student.get_absolute_url }}"><img class="img-circle img-responsive center center-block" src="{% gravatar_url student.user.email 100 %}" alt="{{ student.user.first_name }} Gravatar picture"></a>
49
        <h4><a href="{{ student.get_absolute_url }}"><strong>{{ student.user.get_full_name_or_uname }}</strong></a></h4>
Daniel W Bond's avatar
Daniel W Bond committed
50 51
        <h5><a href="{{ student.major.get_absolute_url }}"><em>{{ student.major }}</em></a></h5>
        <h5><a href="{{ student.room.get_absolute_url }}">{{ student.room }}</h5></a>
52 53 54
      </div>
      {% empty %}
        <h4>There are no other students registered on your floor right now.</h4>
55 56 57 58 59
      {% if forloop.counter|divisibleby:4 %}
        </div>
        <br />
        <div class="row">
      {% endif %}
60 61 62 63 64
      {% endfor %}
    </div>
    </div>
{% endcache %}

65 66 67 68 69 70
{% endif %}

{% if not me.major %}
  <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 %}

71
{% cache 600 majormates request.user.username %}
Daniel W Bond's avatar
Daniel W Bond committed
72
    <h3>Other Students in <a href="{{ me.major.get_absolute_url }}">{{ me.major.name }}</a></h3>
73 74 75
    <legend></legend>
    <div class="text-center">
    <div class="row">
76
      <!--{//% for student in majormates %}
77 78
      <div class="col-md-3">
        <a href="{{ student.get_absolute_url }}"><img class="img-circle img-responsive center center-block" src="{% gravatar_url student.user.email 100 %}" alt="{{ student.user.first_name }} Gravatar picture"></a>
79
        <h4><a href="{{ student.get_full_name_or_uname }}"><strong>{{ student.user.get_full_name_or_uname }}</strong></a></h4>
80
      </div>
81
      {//% empty %}
82
        <h4>There are no other students registered in your major right now.</h4>
83
      {//% if forloop.counter|divisibleby:4 %}
84 85 86
        </div>
        <br />
        <div class="row">
87 88 89
      {//% endif %}
      {//% endfor %}
      -->
90 91 92 93
    </div>
    </div>
{% endcache %}

94
{% endif %}
95 96

{% endblock %}