detail_major.html 1.65 KB
Newer Older
Daniel W Bond's avatar
Daniel W Bond committed
1
{% extends 'layouts/base.html' %}
2 3 4
{% block title %}
SRCT Roomlist • Majors • {{ major.name }}
{% endblock title %}
Daniel W Bond's avatar
Daniel W Bond committed
5
{% block content %}
6
{% load cache %}
7
{% cache 15 major_students request.user.username major %}
Daniel W Bond's avatar
Daniel W Bond committed
8 9 10 11

<div class="page-header" id="banner">
  <div class="row">
    <div class="col-md-12 text-center">
12
      <h1><strong>{{ major.name }}</strong></h1>
Daniel W Bond's avatar
Daniel W Bond committed
13 14 15 16 17
    </div>
  </div>
</div>

{% load gravatar %}
18
{% load accounts_extras %}
Daniel W Bond's avatar
Daniel W Bond committed
19

20
{% regroup major_students by graduating_year as students %}
Daniel W Bond's avatar
Daniel W Bond committed
21

22
{% for graduating_year in students %}
23 24 25
<legend>
  <a name="{{ graduating_year.grouper }}" href="#{{ graduating_year.grouper }}">{{ graduating_year.grouper|bc }}</a>
</legend>
26 27 28 29
  <div class="row">
    <div class="col-md-12">
      <div class="row">
        {% for student in graduating_year.list %}
30
          <div class="col-sm-3 col-xs-6 text-center">
Daniel W Bond's avatar
Daniel W Bond committed
31
            <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">
32 33 34 35 36 37
            <h4><a href="{{ student.get_absolute_url }}"><strong>{{ student.get_full_name_or_uname }}</strong></a></h4>
            {% if student.get_flag_count > 4 %}
              <p><em>* a number of other floormates say this info is incorrect</em></p>
            {% endif %}
          </div>
        {% if forloop.counter|divisibleby:4 %}
38
      </div>
39 40
      <br />
      <div class="row">
41
        {% endif %}
42
        {% endfor %}
43
      </div>
44
    </div>
Daniel W Bond's avatar
Daniel W Bond committed
45
  </div>
46 47 48 49
{% empty %}
<div class="col-md-12 text-center">
  <p>No visible students.</p>
</div>
50
{% endfor %}
Daniel W Bond's avatar
Daniel W Bond committed
51

52
<br />
53
<hr />
54 55
{% include 'disclaimer.html' %}

56
{% endcache %}
Daniel W Bond's avatar
Daniel W Bond committed
57
{% endblock content %}