update_student.html 9.05 KB
Newer Older
1
2
{% extends 'layouts/base.html' %}

3
{% block title %} SRCT Roomlist • My Settings {% endblock %}
4

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

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

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

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

18
19
{% include 'messages.html' %}

20
21
{% load accounts_extras %}

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

30
<div class="row">
31

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

    <div class="panel panel-default">
      <div class="panel-heading">
36
        <h1 class="panel-title text-center"><strong>Profile Settings</strong></h1>
37
38
      </div>
      <div class="panel-body">
39
40
41
42
43
44
        <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>.
45
        </p>
46
47
48
49
        <hr />
        {% if my_form.non_field_errors %}
        <ul class="text-center">
          {% for error in form.non_field_errors %}
50
            <li class="text-danger"><i class="fa fa-exclamation-triangle fa-fw"></i> {{ error }}</li>
51
52
53
54
          {% endfor %}
        </ul>
        <hr />
        {% endif %}
55
        {% spaceless %}
56
        <form class="form-horizontal" autocomplete="off" action="" method="post">{% csrf_token %}
57
          <fieldset>
58
59
60
61
62
63
64
65
66
67
          {% if form.first_name.errors %}
            {% for error in form.first_name.errors %}
              <p class="text-danger"><i class="fa fa-exclamation-triangle fa-fw"></i> {{ error }}</p>
            {% endfor %}
          {% endif %}
          {% if form.last_name.errors %}
            {% for error in form.last_name.errors %}
              <p class="text-danger"><i class="fa fa-exclamation-triangle fa-fw"></i> {{ error }}</p>
            {% endfor %}
          {% endif %}
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
          <div class="form-group">
            <label for="{{ my_form.first_name.id_for_label }}" class="col-md-2">First Name</label>
              <div class="col-md-4">
                {% if not my_form.first_name.errors %}
                  {{ my_form.first_name }}
                {% else %}
                  <div class="has-error">
                    {{ my_form.first_name }}
                    <p>{{ form.first_name.errors }}</p>
                  </div>
                {% endif %}
              </div>
            <label for="{{ my_form.last_name.id_for_label }}" class="col-md-2">Last Name</label>
              <div class="col-md-4">
                {% if not my_form.last_name.errors %}
                  {{ my_form.last_name }}
                {% else %}
                  <div class="has-error">
                    {{ my_form.last_name }}
                    <p>{{ form.last_name.errors }}</p>
                  </div>
                {% endif %}
              </div>
          </div>
92
93
94
95
96
          {% if form.gender.errors %}
            {% for error in form.gender.errors %}
              <p class="text-danger"><i class="fa fa-exclamation-triangle fa-fw"></i> {{ error }}</p>
            {% endfor %}
          {% endif %}
97
          <div class="form-group">
98
99
100
            <label for="{{ my_form.gender.id_for_label }}" class="col-lg-3 col-md-12 col-sm-12 col-xs-12">
              Gender Identity
              <p class="help-block">(choose all that apply)</p>
101
102
            </label>
              {% for checkbox in my_form.gender %}
103
                <div class="checkbox col-lg-2 col-md-3 col-sm-3 col-sm-offset-1 col-xs-5 col-xs-offset-1">
104
105
106
107
108
109
110
                  <label for="{{ checkbox.id_for_label }}">
                    {{ checkbox.choice_label|gender_icon }}
                    {{ checkbox.tag }}
                  </label>
                </div>
              {% endfor %}
          </div>
111
112
113
114
115
          {% if form.show_gender.errors %}
            {% for error in form.show_gender.errors %}
              <p class="text-danger"><i class="fa fa-exclamation-triangle fa-fw"></i> {{ error }}</p>
            {% endfor %}
          {% endif %}
116
          <div class="form-group">
117
            <label for="{{ my_form.show_gender.id_for_label }}" class="col-md-3 col-sm-4 col-xs-5">
118
119
120
121
122
123
              Show Gender on Profile?
            </label>
              {% for option in my_form.show_gender %}
                <label class="radio-inline">{{ option.choice_label }}{{ option.tag }}</label>
              {% endfor %}
          </div>
124
125
126
127
128
          {% if form.major.errors %}
            {% for error in form.major.errors %}
              <p class="text-danger"><i class="fa fa-exclamation-triangle fa-fw"></i> {{ error }}</p>
            {% endfor %}
          {% endif %}
129
          <hr />
130
131
          <div class="form-group">
            <label for="{{ my_form.major.id_for_label }}" class="col-md-2">
132
              Major(s)
133
134
135
136
137
            </label>
            <div class="col-md-4">
              {{ my_form.major }}
            </div>
          </div>
138
139
140
141
142
          {% if form.graduating_year.errors %}
            {% for error in form.graduating_year.errors %}
              <p class="text-danger"><i class="fa fa-exclamation-triangle fa-fw"></i> {{ error }}</p>
            {% endfor %}
          {% endif %}
143
          <div class="form-group">
144
            <label for="{{ my_form.graduating_year.id_for_label }}" class="col-md-2 col-sm-12 col-xs-12">
145
146
              Graduating Year
            </label>
147
              <div class="col-md-2 col-sm-3 col-xs-3">
148
149
150
151
152
                {{ my_form.graduating_year }}
              </div>
          </div>
          {% if not request.user.student.recent_changes > 2 %}
          <hr />
153
154
155
156
157
          {% if form.on_campus.errors %}
            {% for error in form.on_campus.errors %}
              <p class="text-danger"><i class="fa fa-exclamation-triangle fa-fw"></i> {{ error }}</p>
            {% endfor %}
          {% endif %}
158
          <div class="form-group">
159
            <label for="{{ my_form.on_campus.id_for_label }}" class="col-md-3 col-sm-4 col-xs-5">
160
161
162
163
164
165
166
              Do You Live on Campus?
            </label>
              {% for option in my_form.on_campus %}
                <label class="radio-inline">{{ option.choice_label }}{{ option.tag }}</label>
              {% endfor %}
          </div>
          <div id="lives-on-campus">
167
168
169
            <hr />
            <p class="help-block">The Global Center, the Townhouses, and Beacon Hall are not currently supported.<br />
            We'll let everyone know when we add them.</p>
170
171
172
173
174
            {% if form.room.errors %}
              {% for error in form.room.errors %}
                <p class="text-danger"><i class="fa fa-exclamation-triangle fa-fw"></i> {{ error }}</p>
              {% endfor %}
            {% endif %}
175
176
177
178
179
            <div class="form-group">
              <div class="col-md-12">
                {{ my_form.room }}
              </div>
            </div>
180
181
182
183
184
            {% 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 %}
185
186
187
188
189
190
191
            <div class="form-group">
              <label for="{{ my_form.privacy.id_for_label }}" class="col-md-2">
                Privacy
              </label>
                {{ my_form.privacy }}
            </div>
          </div>
Daniel W Bond's avatar
Daniel W Bond committed
192
          <hr />
193
194
195
            <p class="help-block">
              You will not be able to see these students, and they will not be able to see you.
            </p>
196
197
198
199
200
            {% if form.blocked_kids.errors %}
              {% for error in form.blocked_kids.errors %}
                <p class="text-danger"><i class="fa fa-exclamation-triangle fa-fw"></i> {{ error }}</p>
              {% endfor %}
            {% endif %}
Daniel W Bond's avatar
Daniel W Bond committed
201
202
203
204
205
206
207
208
          <div class="form-group">
            <label for="{{ my_form.blocked_kids.id_for_label }}" class="col-md-2">
              Blocked Students
            </label>
            <div class="col-md-10">
              {{ my_form.blocked_kids }}
            </div>
          </div>
209
210
          {% endif %}
          <hr />
211
          <input type="submit" value="Save" class="btn btn-primary"/>
212
        </fieldset>
213
        </form>
214
        {% endspaceless %}
215
216
      </div>
    </div>
217
    <p>
218
219
      <small><a href="{% url 'delete_student' request.user.username %}">Delete Account</a></small>
    </p>
220
  </div>
221
222
223

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

224
225
</div>

226
{% endcache %}
Daniel W Bond's avatar
Daniel W Bond committed
227
228
229
{% endblock content %}

{% block javascript %}
230
231
232
<script type="text/javascript" src="/static/js/chained.min.js"></script>
<script type="text/javascript" src="/static/js/chosen.min.js"></script>
<script>
233
234
$(".chosen-select").chosen({max_selected_options: 2,
                           placeholder_text_multiple: '(select up to two)'});
235
236
$(".blocked-select").chosen({width: "100%",
                             placeholder_text_multiple: "(search by name)"});
237
</script>
238
{% include 'room_selection_script.html' %}
Daniel W Bond's avatar
Daniel W Bond committed
239
{% endblock javascript %}