update_student.html 9.94 KB
Newer Older
1
{% extends 'layouts/base.html' %}
2
3
4
{% block title %}
SRCT Roomlist • My Settings
{% endblock %}
5

6
7
8
9
{% block css %}
<link href="/static/css/chosen.min.css" rel="stylesheet" media="screen">
{% endblock css %}

Daniel W Bond's avatar
Daniel W Bond committed
10
{% block message_queue %}
11
12
13
{% endblock %}

{% block content %}
14
15
{% load cache %}
{% cache 4 student_update request.user.username %}
16

17
18
{% include 'room_change_warning.html' %}

19
{% comment %} moves the messages to below the room change warning {% endcomment %}
20
21
{% include 'messages.html' %}

22
23
{% load accounts_extras %}

24
25
26
<div class="page-header" id="banner">
  <div class="row">
    <div class="col-md-12 text-center">
27
      <h1><strong>My Settings</strong></h1>
28
29
30
31
    </div>
  </div>
</div>

32
33
<div class="row">
  <div class="col-md-8">
34
35
36

    <div class="panel panel-default">
      <div class="panel-heading">
37
        <h1 class="panel-title text-center"><strong>Profile Settings</strong></h1>
38
39
      </div>
      <div class="panel-body">
40
41
42
43
44
45
        <p class="small">
          <i class="fa fa-fw fa-info-circle"></i>
          Unfortunately we do not support uploading images for your profile picture.
          Connect your Facebook account, or add your
          <a href="http://masonlive.gmu.edu/">@masonlive.gmu.edu</a>
          email address to <a href="https://en.gravatar.com/">Gravatar</a>.
46
        </p>
47
        <hr />
48
        {% if form.non_field_errors %}
49
        <ul class="text-center">
50
          {% for error in form.non_field_errors %}
51
52
53
            <li class="text-danger">
              <i class="fa fa-exclamation-triangle fa-fw"></i> {{ error }}
            </li>
54
55
56
57
          {% endfor %}
        </ul>
        <hr />
        {% endif %}
58
        {% spaceless %}
59
60
        <form class="form-horizontal" autocomplete="off" action="" method="post">
        {% csrf_token %}
61
          <fieldset>
62
63
          {% if form.first_name.errors %}
            {% for error in form.first_name.errors %}
64
65
66
              <p class="text-danger">
                <i class="fa fa-exclamation-triangle fa-fw"></i> {{ error }}
              </p>
67
68
69
70
            {% endfor %}
          {% endif %}
          {% if form.last_name.errors %}
            {% for error in form.last_name.errors %}
71
72
73
              <p class="text-danger">
                <i class="fa fa-exclamation-triangle fa-fw"></i> {{ error }}
              </p>
74
75
            {% endfor %}
          {% endif %}
76
          <div class="form-group">
77
            <div class="col-sm-6">
78
79
80
              <label for="{{ form.first_name.id_for_label }}">First Name</label>
                {% if not form.first_name.errors %}
                  {{ form.first_name }}
81
82
                {% else %}
                  <div class="has-error">
83
                    {{ form.first_name }}
84
85
86
87
                    <p>{{ form.first_name.errors }}</p>
                  </div>
                {% endif %}
              </div>
88
            <div class="col-sm-6">
89
90
91
              <label for="{{ form.last_name.id_for_label }}">Last Name</label>
                {% if not form.last_name.errors %}
                  {{ form.last_name }}
92
93
                {% else %}
                  <div class="has-error">
94
                    {{ form.last_name }}
95
96
97
                    <p>{{ form.last_name.errors }}</p>
                  </div>
                {% endif %}
98
            </div>
99
          </div>
100
101
          {% if form.gender.errors %}
            {% for error in form.gender.errors %}
102
103
104
              <p class="text-danger">
                <i class="fa fa-exclamation-triangle fa-fw"></i> {{ error }}
              </p>
105
106
            {% endfor %}
          {% endif %}
107
          <div class="form-group">
108
            <label for="{{ form.gender.id_for_label }}" class="col-xs-12">
109
110
              Gender Identity
              <p class="help-block">(choose all that apply)</p>
111
            </label>
112
              {% for checkbox in form.gender %}
113
                <div class="checkbox col-md-3 col-sm-3 col-sm-offset-1 col-xs-5 col-xs-offset-1">
114
115
116
117
118
119
120
                  <label for="{{ checkbox.id_for_label }}">
                    {{ checkbox.choice_label|gender_icon }}
                    {{ checkbox.tag }}
                  </label>
                </div>
              {% endfor %}
          </div>
121
122
          {% if form.show_gender.errors %}
            {% for error in form.show_gender.errors %}
123
124
125
              <p class="text-danger">
                <i class="fa fa-exclamation-triangle fa-fw"></i> {{ error }}
              </p>
126
127
            {% endfor %}
          {% endif %}
128
          <div class="form-group">
129
            <div class="col-md-4">
130
            <label for="{{ form.show_gender.id_for_label }}">
131
              Show Gender on Profile?
132
            </label><br />
133
              {% for option in form.show_gender %}
134
135
                <label class="radio-inline">{{ option.choice_label }}{{ option.tag }}</label>
              {% endfor %}
136
            </div>
137
          </div>
138
          <hr />
139
140
          {% if form.major.errors %}
            {% for error in form.major.errors %}
141
142
143
              <p class="text-danger">
                <i class="fa fa-exclamation-triangle fa-fw"></i> {{ error }}
              </p>
144
145
            {% endfor %}
          {% endif %}
146
          <div class="form-group">
147
            <div class="col-lg-9">
148
            <label for="{{ form.major.id_for_label }}">
149
150
              Major(s)
            </label><br />
151
              {{ form.major }}
152
153
            </div>
          </div>
154
155
          {% if form.graduating_year.errors %}
            {% for error in form.graduating_year.errors %}
156
157
158
              <p class="text-danger">
                <i class="fa fa-exclamation-triangle fa-fw"></i> {{ error }}
              </p>
159
160
            {% endfor %}
          {% endif %}
161
162
          <div class="form-group">
            <div class="col-lg-3 col-md-3 col-sm-4 col-xs-6">
163
              <label for="{{ form.graduating_year.id_for_label }}">
164
165
                Graduating Year
              </label>
166
                {{ form.graduating_year }}
167
            </div>
168
169
170
          </div>
          {% if not request.user.student.recent_changes > 2 %}
          <hr />
171
172
          {% if form.on_campus.errors %}
            {% for error in form.on_campus.errors %}
173
174
175
              <p class="text-danger">
                <i class="fa fa-exclamation-triangle fa-fw"></i> {{ error }}
              </p>
176
177
            {% endfor %}
          {% endif %}
178
179
180
181
          {% if request.user.student.is_staff %}
          <p class="help-block">Contact us if you are no longer a Resident Advisor or Director at
          <a href="mailto:roomlist@lists.srct.gmu.edu">roomlist@lists.srct.gmu.edu</a>.</p>
          {% endif %}
182
          <div class="form-group">
183
            <div class="col-md-4">
184
            <label for="{{ form.on_campus.id_for_label }}">
185
              Do You Live on Campus?
186
            </label><br/>
187
              {% for option in form.on_campus %}
188
189
                <label class="radio-inline">{{ option.choice_label }}{{ option.tag }}</label>
              {% endfor %}
190
            </div>
191
192
          </div>
          <div id="lives-on-campus">
193
            <hr />
194
195
            <p class="help-block">
            The Global Center, the Townhouses, and Beacon Hall are not currently supported.<br />
196
            We'll let everyone know when we add them.</p>
197
198
            {% if form.room.errors %}
              {% for error in form.room.errors %}
199
200
201
                <p class="text-danger">
                  <i class="fa fa-exclamation-triangle fa-fw"></i> {{ error }}
                </p>
202
203
              {% endfor %}
            {% endif %}
204
            <div class="form-group">
205
              {{ form.room }}
206
            </div>
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
            {% endif %}  {% comment %} recent_changes {% endcomment %}
            <hr />
            <p class="help-block">
              Your privacy settings affect the visibility of both your room and your social media accounts.
            </p>
            {% if form.privacy.errors %}
              {% for error in form.privacy.errors %}
                <p class="text-danger">
                  <i class="fa fa-exclamation-triangle fa-fw"></i> {{ error }}
                </p>
              {% endfor %}
            {% endif %}
            <div class="form-group">
              <div class="col-md-3 col-sm-6">
              <label for="{{ form.privacy.id_for_label }}">
Ross I Kinsey's avatar
Ross I Kinsey committed
222
                Who can see me
223
224
225
              </label><br/>
                {{ form.privacy }}
              </div>
226
            </div>
227
          </div> <!-- lives-on-campus -->
Daniel W Bond's avatar
Daniel W Bond committed
228
          <hr />
229
230
231
232
233
          <p class="help-block">
            You will not be able to see these students, and they will not be able to see you.
          </p>
          {% if form.blocked_kids.errors %}
            {% for error in form.blocked_kids.errors %}
234
235
236
              <p class="text-danger">
                <i class="fa fa-exclamation-triangle fa-fw"></i> {{ error }}
              </p>
237
238
            {% endfor %}
          {% endif %}
Daniel W Bond's avatar
Daniel W Bond committed
239
          <div class="form-group">
240
            <div class="col-xs-12">
241
            <label for="{{ form.blocked_kids.id_for_label }}">
Daniel W Bond's avatar
Daniel W Bond committed
242
243
              Blocked Students
            </label>
244
              {{ form.blocked_kids }}
Daniel W Bond's avatar
Daniel W Bond committed
245
246
            </div>
          </div>
247
          <hr />
248
          <input type="submit" value="Save" class="btn btn-primary"/>
249
        </fieldset>
250
        </form>
251
        {% endspaceless %}
252
253
      </div>
    </div>
254
    {% if not request.user.student.is_staff %}
255
256
257
    <p><small>
      <a href="{% url 'delete_student' request.user.username %}">Delete Account</a>
    </small></p>
258
    {% endif %}
259
  </div>
260
261
262

{% include 'social/social_media_settings.html' %}

263
264
</div>

265
{% endcache %}
Daniel W Bond's avatar
Daniel W Bond committed
266
267
268
{% endblock content %}

{% block javascript %}
269
270
271
<script type="text/javascript" src="/static/js/chained.min.js"></script>
<script type="text/javascript" src="/static/js/chosen.min.js"></script>
<script>
272
$(".chosen-select").chosen({max_selected_options: 2,
273
274
                            width: "100%",
                            placeholder_text_multiple: '(select up to two)'});
275
276
$(".blocked-select").chosen({width: "100%",
                             placeholder_text_multiple: "(search by name)"});
277
</script>
278
{% include 'room_selection_script.html' %}
Daniel W Bond's avatar
Daniel W Bond committed
279
{% endblock javascript %}