list_majors.html 1.93 KB
Newer Older
Daniel W Bond's avatar
Daniel W Bond committed
1
2
{% extends 'layouts/base.html' %}

3
{% block title %} SRCT Roomlist | Majors {% endblock title %}
Daniel W Bond's avatar
Daniel W Bond committed
4

5
6
7
8
9
10
11
12
13
14
{% block og_metadata %}
<meta property="og:title" content="SRCT Roomlist Majors"/>
<meta property="og:description" content="Undergraduate majors on SRCT Roomlist. Log in with your Mason username and password to find your on-campus neighbors."/>
{% endblock %}

{% block tw_metadata %}
<meta name="twitter:title" content="SRCT Roomlist Majors" />
<meta name="twitter:description" content="Undergraduate majors on SRCT Roomlist. Log in with your Mason username and password to find your on-campus neighbors." />
{% endblock tw_metadata %}

Daniel W Bond's avatar
Daniel W Bond committed
15
{% block content %}
16
17
18

{% include 'no_auth.html' %}

19
20
{% load cache %}
{% cache 900 list_majors %}
Daniel W Bond's avatar
Daniel W Bond committed
21
22
23
24
25
26
27
28
29
30

<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>Majors</strong></p>
    </div>
  </div>
</div>

31
32
33
34
35
36
37
38
39
40
41
{% regroup majors by first_letter as majors_by_letter %}

<div class="row">
  <div class="col-md-10 col-md-offset-1 text-center"><h3>
    &middot;
    {% for letter in majors_by_letter %}
      <a href="#{{ letter.grouper }}">{{ letter.grouper }}</a> &middot;
    {% endfor %}
  </h3></div>
</div>

Daniel W Bond's avatar
Daniel W Bond committed
42
43
44
45
46
47
48
<div class="row">
  <div class="col-md-10 col-md-offset-1">
    {% for letter in majors_by_letter %}
    <legend><a name="{{ letter.grouper }}" href="#{{ letter.grouper }}">{{ letter.grouper }}</a></legend>
      <div class="row">
      {% for major in letter.list %}
          <div class="col-md-6 text-center">
49
            <a href="{{ major.get_absolute_url }}" class="btn btn-primary btn-lg btn-block">{{ major.name }}</a>
Daniel W Bond's avatar
Daniel W Bond committed
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
          </div>
        {% if forloop.counter|divisibleby:2 %}
        </div>
        <br />
      <div class="row">
      {% endif %}
      {% endfor %}
    </div>
    <br />
    {% empty %}
    No majors in the database. :'-(
    {% endfor %}
  </div>
</div>

65
{% endcache %}
Daniel W Bond's avatar
Daniel W Bond committed
66
{% endblock content %}