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

{% block content %}
5 6 7

{% include 'messages.html' %}

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

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

20 21
{% if me.on_campus %}

22
{% if not me.room and me.on_campus %}
23
  <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>
24 25
{% else %}

26
  {% if roomies|length == 1 %}
Daniel W Bond's avatar
Daniel W Bond committed
27
    <h3>Your Roommate in {{ me.room }}</h3>
28
    <hr/>
29
  {% else %}
Daniel W Bond's avatar
Daniel W Bond committed
30
  <h3>Your Roommates in <a href="{{ me.room.get_absolute_url }}">{{ me.room }}</a></h3>
31
  <hr/>
32 33 34
  {% endif %}
    <div class="row">
      {% for student in roomies %}
35
        <div class="col-sm-3 col-xs-6 text-center">
Daniel W Bond's avatar
Daniel W Bond committed
36
          <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>
37
          <h4><a href="{{ student.get_absolute_url }}"><strong>{{ student.get_full_name_or_uname }}</strong></a></h4>
38 39 40
          {% if student.is_staff %}
          <h4 class="text-info">{{ student.lead }}</h4>
          {% endif %}
41
          <h5><em>{% include 'double_major.html' %}</em></h5>
42
        </div>
43 44 45 46 47
      {% if forloop.counter|divisibleby:4 %}
      </div>
      <br />
      <div class="row">
      {% endif %}
Daniel W Bond's avatar
Daniel W Bond committed
48
      {% empty %}
49 50 51
        <div class="col-md-12">
          <h4>There are no other students registered in your room right now.</h4>
        </div>
52 53 54
      {% endfor %}
    </div>

Daniel W Bond's avatar
Daniel W Bond committed
55 56 57
{% load humanize %}

<h3>Your Floormates from <a href="{{ me.room.floor.get_absolute_url }}">{{ me.room.floor.building }} {{ me.room.floor.number|ordinal }}</a></h3>
58
    <hr/>
59 60
    <div class="row">
      {% for student in floories %}
61
      <div class="col-md-3 col-xs-6 text-center">
Daniel W Bond's avatar
Daniel W Bond committed
62
        <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">
63
        <h4><a href="{{ student.get_absolute_url }}"><strong>{{ student.get_full_name_or_uname }}</strong></a></h4>
64 65 66
          {% if student.is_staff %}
          <h4 class="text-info">{{ student.lead }}</h4>
          {% endif %}
67
        <h5><em>{% include 'double_major.html' %}</em></h5>
Daniel W Bond's avatar
Daniel W Bond committed
68
        <h5><a href="{{ student.room.get_absolute_url }}">{{ student.room }}</h5></a>
69
      </div>
70 71 72 73 74
      {% if forloop.counter|divisibleby:4 %}
        </div>
        <br />
        <div class="row">
      {% endif %}
Daniel W Bond's avatar
Daniel W Bond committed
75
      {% empty %}
76 77 78
        <div class="col-md-12">
          <h4>There are no other students registered on your floor right now.</h4>
        </div>
79 80 81
      {% endfor %}
    </div>

Daniel W Bond's avatar
Daniel W Bond committed
82
{% endif %}
83
{% endif %}
84
{% endcache %}
85

86
{% load accounts_extras %}
87
{% cache 120 landing_majors request.user.username %}
88
{% if not me.major.all %}
89
  <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>
90
{% else %}
91 92 93
  {% for major, students in majormates.items %}
    <h3>Other Students in <a href="{{ major.get_absolute_url }}">{{ major.name }}</a></h3>
    <hr />
94
    <div class="row">
95
      {% for student in students %}
96
      <div class="col-sm-3 col-xs-6 text-center">
Daniel W Bond's avatar
Daniel W Bond committed
97
        <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">
98
        <h4><a href="{{ student.get_absolute_url }}"><strong>{{ student.get_full_name_or_uname }}</strong></a></h4>
99
        <h5>{{ student.graduating_year|bc }}</h5>
100
      </div>
101 102 103 104 105
      {% if forloop.counter|divisibleby:4 %}
        </div>
        <br />
        <div class="row">
      {% endif %}
Daniel W Bond's avatar
Daniel W Bond committed
106
      {% empty %}
107 108 109
        <div class="col-md-12">
          <h4>There are no other students registered in your major right now.</h4>
        </div>
110 111
      {% endfor %}
    </div>
112
  {% endfor %}
113
{% endif %}
114

115
{% endcache %}
116
{% endblock %}