detail_major.html 4.47 KB
Newer Older
Daniel W Bond's avatar
Daniel W Bond committed
1
{% extends 'layouts/base.html' %}
2
{% block title %} SRCT Roomlist | Majors | {{ major.name }} {% endblock title %}
Daniel W Bond's avatar
Daniel W Bond committed
3
{% block content %}
4
{% load cache %}
5
{% cache 15 major_students request.user.username major %}
Daniel W Bond's avatar
Daniel W Bond committed
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29

<div class="page-header" id="banner">
  <div class="row">
    <div class="col-md-12 text-center">
      <h1><strong>SRCT</strong>ROOMLIST</h1>
      <p class="lead"><strong>{{ major.name }}</strong></p>
    </div>
  </div>
</div>

{% load gravatar %}

{% comment %} Sigh... three sections of largely duplicated code. {% endcomment %}

<legend><strong><a href="{% url 'list_buildings' %}#Aquia">Aquia</a></strong></legend>

<div class="row">
  <div class="col-md-12">
    {% regroup aq_location_visible by get_building as 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>
    <div class="row">
      {% for student in building.list %}
        <div class="col-sm-3 text-center">
30
          <img class="img-circle img-responsive center center-block" src="{{ student.profile_image_url }}" alt="{{ student.get_first_name_or_uname }} profile picture">
31
          <h4><a href="{{ student.get_absolute_url }}"><strong>{{ student.get_full_name_or_uname }}</strong></a></h4>
32 33 34
          {% if student.get_flag_count > 4 %}
            <p><em>* a number of other floormates say this info is incorrect</em></p>
          {% endif %}
Daniel W Bond's avatar
Daniel W Bond committed
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
        </div>
     {% endfor %}
   </div>
   {% empty %}
   No visible students in the database. :'-(
   {% endfor %}
  </div>
</div>

<br />

<legend><strong><a href="{% url 'list_buildings' %}#Rappahannock">Rappahannock</a></strong></legend>

<div class="row">
  <div class="col-md-12">
    {% regroup ra_location_visible by get_building as 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>
    <div class="row">
      {% for student in building.list %}
        <div class="col-sm-3 text-center">
56 57
          <img class="img-circle img-responsive center center-block" src="{{ student.profile_image_url }}" alt="{{ student.get_first_name_or_uname }} profile picture">
          <h4><a href="{{ student.get_absolute_url }}"><strong>{{ student.get_full_name_or_uname }}</strong></a></h4>
58 59 60
          {% if student.get_flag_count > 4 %}
            <p><em>* a number of other floormates say this info is incorrect</em></p>
          {% endif %}
Daniel W Bond's avatar
Daniel W Bond committed
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
        </div>
     {% endfor %}
   </div>
   {% empty %}
   No visible students in the database. :'-(
   {% endfor %}
  </div>
</div>

<br />

<legend><strong><a href="{% url 'list_buildings' %}#Shenandoah">Shenandoah</a></strong></legend>

<div class="row">
  <div class="col-md-12">
    {% regroup sh_location_visible by get_building as 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>
    <div class="row">
      {% for student in building.list %}
        <div class="col-sm-3 text-center">
82 83
          <img class="img-circle img-responsive center center-block" src="{{ student.profile_image_url }}" alt="{{ student.get_first_name_or_uname }} profile picture">
          <h4><a href="{{ student.get_absolute_url }}"><strong>{{ student.get_full_name_or_uname }}</strong></a></h4>
84 85 86
          {% if student.get_flag_count > 4 %}
            <p><em>* a number of other floormates say this info is incorrect</em></p>
          {% endif %}
Daniel W Bond's avatar
Daniel W Bond committed
87 88 89 90 91 92 93 94 95 96 97
        </div>
     {% endfor %}
   </div>
   {% empty %}
   No visible students in the database. :'-(
   {% endfor %}
  </div>
</div>

<br />

98
{% if location_hidden %}
99
  <legend class="text-center">Location not visible because of student <a href="{% url 'update_student' request.user.username %}">privacy settings</a></legend>
100 101 102 103
  <div class="row">
    <div class="col-md-12">
      {% for student in location_hidden %}
        <div class="col-sm-3 text-center">
104 105
          <img class="img-circle img-responsive center center-block" src="{{ student.profile_image_url }}" alt="{{ student.get_first_name_or_uname }} profile picture">
          <h4><a href="{{ student.get_absolute_url }}"><strong>{{ student.get_full_name_or_uname }}</strong></a></h4>
106 107 108
        </div>
      {% endfor %}
    </div>
Daniel W Bond's avatar
Daniel W Bond committed
109
  </div>
110
{% endif %}
Daniel W Bond's avatar
Daniel W Bond committed
111

112 113 114 115
<br />
<legend></legend>
{% include 'disclaimer.html' %}

116
{% endcache %}
Daniel W Bond's avatar
Daniel W Bond committed
117
{% endblock content %}