landing.html 3.86 KB
Newer Older
1
2
3
4
{% extends 'layouts/base.html' %}
{% block title %} SRCT Roomlist • Homepage {% endblock title %}

{% block content %}
5

6
7
8
{% load gravatar %}
{% load humanize %}

9
{% load cache %}
10
{% cache 15 landing request.user.username %}
11

12
<h2>Welcome
13
14
{% if not me.is_noob %}
Back,
15
16
{% endif %}
{{ me.get_first_name_or_uname }}!</h2>
17
<hr/>
18

19
20
{% if me.on_campus %}

21
{% if not me.room and me.on_campus %}
22
23
24
25
<h3><em>
  <a href="{% url 'update_student' request.user.username %}">Select your room</a>,
  and we'll show you the other students on your floor.
</em></h3>
26
27
{% else %}

28
  {% if roomies|length == 1 %}
Daniel W Bond's avatar
Daniel W Bond committed
29
    <h3>Your Roommate in {{ me.room }}</h3>
30
    <hr/>
31
  {% else %}
32
33
    <h3>Your Roommates in <a href="{{ me.room.get_absolute_url }}">{{ me.room }}</a></h3>
    <hr/>
34
  {% endif %}
35
36
37
38

<div class="student-row">
  <div class="row">
    {% for student in roomies %}
39
      <div class="col-sm-3 col-xs-6 text-center wordwrap">
40
41
42
43
44
45
46
        <img class="img-circle img-responsive center center-block profile-image"
             src="{{ student.profile_image_url }}"
             alt="{{ student.get_first_name_or_uname }} profile picture"></img>
        <h4><strong>
          <a href="{{ student.get_absolute_url }}">{{ student.get_full_name_or_uname }}</a>
        </strong></h4>
        <h5><em>{% include 'double_major.html' %}</em></h5>
47
      </div>
48
49
50
51
52
53
54
    {% empty %}
      <div class="col-md-12">
        <h4>There are no other students registered in your room right now.</h4>
      </div>
    {% endfor %}
  </div>
</div>
55

56
57
58
59
60
<h3>Your Floormates from
  <a href="{{ me.room.floor.get_absolute_url }}">
  {{ me.room.floor.building }} {{ me.room.floor.number|ordinal }}</a>
</h3>
<hr/>
Daniel W Bond's avatar
Daniel W Bond committed
61

62
63
64
<div class="student-row">
  <div class="row">
    {% for student in floories %}
65
      <div class="col-md-3 col-xs-6 text-center wordwrap">
66
67
68
69
70
71
        <img class="img-circle img-responsive center center-block profile-image"
             src="{{ student.profile_image_url }}"
             alt="{{ student.get_first_name_or_uname }} profile picture">
        <h4><strong>
          <a href="{{ student.get_absolute_url }}">{{ student.get_full_name_or_uname }}
        </strong></h4>
72
        <h5><em>{% include 'double_major.html' %}</em></h5>
Daniel W Bond's avatar
Daniel W Bond committed
73
        <h5><a href="{{ student.room.get_absolute_url }}">{{ student.room }}</h5></a>
74
      </div>
75
76
77
78
79
80
81
    {% empty %}
      <div class="col-md-12">
        <h4>There are no other students registered on your floor right now.</h4>
      </div>
    {% endfor %}
  </div>
</div>
82

83
84
{% endif %}  {% comment %} else not me.room and me.oncampus {% endcomment %}
{% endif %}  {% comment %} else me.oncampus {% endcomment %}
85
{% endcache %}
86

87
{% load accounts_extras %}
88

89
{% cache 120 landing_majors request.user.username %}
90
{% if not me.major.all %}
91
92
93
94
  <h3><em>
    <a href="{% url 'update_student' request.user.username %}">Set your major</a>,
    and we'll show you some of the other students in your program.
  </em></h3>
95
{% else %}
96
97
98
  {% for major, students in majormates.items %}
    <h3>Other Students in <a href="{{ major.get_absolute_url }}">{{ major.name }}</a></h3>
    <hr />
99
100
101
    <div class="student-row">
      <div class="row">
        {% for student in students %}
102
        <div class="col-sm-3 col-xs-6 text-center wordwrap">
103
104
105
106
107
108
109
          <img class="img-circle img-responsive center center-block profile-image"
               src="{{ student.profile_image_url }}"
               alt="{{ student.get_first_name_or_uname }} profile picture">
          <h4><strong>
            <a href="{{ student.get_absolute_url }}">{{ student.get_full_name_or_uname }}</a>
          </strong></h4>
          <h5>{{ student.graduating_year|bc }}</h5>
110
        </div>
111
112
113
114
115
116
        {% empty %}
          <div class="col-md-12">
            <h4>There are no other students registered in your major right now.</h4>
          </div>
        {% endfor %}
      </div>
117
    </div>
118
  {% endfor %}
119
{% endif %}
120

121
122
123
124
<br />
<hr />
{% include 'disclaimer.html' %}

125
{% endcache %}
126
{% endblock %}