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

3
{% block title %} SRCT Roomlist | Student | {{ request.user.student.get_full_name_or_uname }} | Update {% 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>SRCT</strong>ROOMLIST</a></strong> Student Update</h1>
26
27
28
29
30
    </div>
  </div>
</div>

<div class="row">
31
  <div class="col-md-12 text-center">
32
    <h2><strong>Welcome, {{ request.user.student.get_first_name_or_uname }}!</strong></h2>
33
34
35
36
37
  </div>
</div>

<br />

38
{% load socialaccount %}
39

40
41
{% get_social_accounts request.user as accounts %}

42
43
44
45
46
47
48
49
50
51
52
<div class="row">
  <div class="col-md-4">
    <div class="panel panel-default">
      <div class="panel-heading">
        <h1 class="panel-title text-center"><strong>Social Media Settings</strong></h1>
      </div>
      <div class="panel-body">
        <p class="text-center">Verify your social media accounts to link them to other students.</p>
        <div class="row text-center">
          <div class="col-md-6">
          {% if accounts.facebook %}
53
54
55
56
57
          <p><i class="fa fa-check-square-o"></i> Verified!</p>
            <h4><i class="fa fa-facebook fa-2x"></i></h4>
            <h4>Facebook</h4>
          {% else %}
          <a href="{% provider_login_url 'facebook' process='connect' %}">
58
59
60
            <h4><i class="fa fa-facebook fa-2x"></i></h4>
            <h4>Facebook</h4>
          </a>
61
          {% endif %}
62
63
64
65
          </div>
          <div class="col-md-6">
          {% if accounts.google %}
            <p><i class="fa fa-check-square-o"></i> Verified!</p>
66
67
68
69
            <h4><i class="fa fa-google fa-2x"></i></h4>
            <h4>Google</h4>
          {% else %}
          <a href="{% provider_login_url 'google' process='connect' %}">
70
71
72
            <h4><i class="fa fa-google fa-2x"></i></h4>
            <h4>Google</h4>
          </a>
73
          {% endif %}
74
75
76
77
78
79
80
          </div>
        </div>
        <br />
        <div class="row text-center">
          <div class="col-md-6">
          {% if accounts.twitter %}
            <p><i class="fa fa-check-square-o"></i> Verified!</p>
81
82
83
84
            <h4><i class="fa fa-twitter fa-2x"></i></h4>
            <h4>Twitter</h4>
          {% else %}
          <a href="{% provider_login_url 'twitter' process='connect' %}">
85
86
87
            <h4><i class="fa fa-twitter fa-2x"></i></h4>
            <h4>Twitter</h4>
          </a>
88
          {% endif %}
89
90
91
92
          </div>
          <div class="col-md-6">
          {% if accounts.instagram %}
            <p><i class="fa fa-check-square-o"></i> Verified!</p>
93
94
95
96
            <h4><i class="fa fa-instagram fa-2x"></i></h4>
            <h4>Instagram</h4>
          {% else %}
          <a href="{% provider_login_url 'instagram' process='connect' %}">
97
98
99
            <h4><i class="fa fa-instagram fa-2x"></i></h4>
            <h4>Instagram</h4>
          </a>
100
          {% endif %}
101
102
          </div>
        </div>
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
        <br />
        <div class="row text-center">
          <div class="col-md-6">
          {% if accounts.tumblr %}
            <p><i class="fa fa-check-square-o"></i> Verified!</p>
            <h4><i class="fa fa-tumblr fa-2x"></i></h4>
            <h4>Tumblr</h4>
          {% else %}
          <a href="{% provider_login_url 'tumblr' process='connect' %}">
            <h4><i class="fa fa-tumblr fa-2x"></i></h4>
            <h4>Tumblr</h4>
          </a>
          {% endif %}
          </div>
          <div class="col-md-6">
          {% if accounts.github %}
            <p><i class="fa fa-check-square-o"></i> Verified!</p>
            <h4><i class="fa fa-github fa-2x"></i></h4>
            <h4>Github</h4>
          {% else %}
          <a href="{% provider_login_url 'github' process='connect' %}">
            <h4><i class="fa fa-github fa-2x"></i></h4>
            <h4>Github</h4>
          </a>
          {% endif %}
          </div>
        </div>
        <br />
        {% if accounts %}
          <div class="row text-center">
            <a href="{% url 'remove_social' request.user.username %}">
              <button class="btn btn-xs btn-danger">Disconnect Accounts</button>
            </a>
          </div>
        {% endif %}
138
139
140
141
142
      </div>
    </div>
  </div>

  <div class="col-md-8">
143
144
145

    <div class="panel panel-default">
      <div class="panel-heading">
146
        <h1 class="panel-title text-center"><strong>Student Settings</strong></h1>
147
148
149
      </div>

      <div class="panel-body">
150
        <p>
151
152
          If you have a <a href="https://en.gravatar.com/">Gravatar profile</a> associated
          with your <a href="https://masonlive.gmu.edu/">Masonlive email</a> address, your
153
154
155
156
          profile picture on Roomlist will use Gravatar.
        </p>
        <p>
          If you connect your Facebook account, we will use your Facebook profile picture.
157
        </p>
158
159
160
161
162
163
164
165
166
        <hr />
        {% if my_form.non_field_errors %}
        <ul class="text-center">
          {% for error in form.non_field_errors %}
            <li>{{ error }}</li>
          {% endfor %}
        </ul>
        <hr />
        {% endif %}
167
        {% spaceless %}
168
        <form class="form-horizontal" autocomplete="off" action="" method="post">{% csrf_token %}
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
          <fieldset>
          <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>
          <div class="form-group">
            <label for="{{ my_form.gender.id_for_label }}" class="col-md-3">
              Gender Identity<br />(choose all that apply)
            </label>
              {% for checkbox in my_form.gender %}
                <div class="checkbox col-md-3">
                  <label for="{{ checkbox.id_for_label }}">
                    {{ checkbox.choice_label|gender_icon }}
                    {{ checkbox.tag }}
                  </label>
                </div>
              {% endfor %}
          </div>
          <div class="form-group">
            <label for="{{ my_form.show_gender.id_for_label }}" class="col-md-3">
              Show Gender on Profile?
            </label>
              {% for option in my_form.show_gender %}
                <label class="radio-inline">{{ option.choice_label }}{{ option.tag }}</label>
              {% endfor %}
          </div>
          <div class="form-group">
            <label for="{{ my_form.major.id_for_label }}" class="col-md-2">
217
              Major(s)
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
            </label>
            <div class="col-md-4">
              {{ my_form.major }}
            </div>
          </div>
          <div class="form-group">
            <label for="{{ my_form.graduating_year.id_for_label }}" class="col-md-2">
              Graduating Year
            </label>
              <div class="col-md-2">
                {{ my_form.graduating_year }}
              </div>
          </div>
          {% if not request.user.student.recent_changes > 2 %}
          <hr />
          <div class="form-group">
            <label for="{{ my_form.on_campus.id_for_label }}" class="col-md-3">
              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">
242
243
244
            <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>
245
246
247
248
249
250
251
252
253
254
255
256
257
258
            <div class="form-group">
              <div class="col-md-12">
                {{ my_form.room }}
              </div>
            </div>
            <div class="form-group">
              <label for="{{ my_form.privacy.id_for_label }}" class="col-md-2">
                Privacy
              </label>
                {{ my_form.privacy }}
            </div>
          </div>
          {% endif %}
          <hr />
259
          <input type="submit" value="Save" class="btn btn-primary"/>
260
        </fieldset>
261
        </form>
262
        {% endspaceless %}
263
264
265
266
267
268
      </div>
    </div>

  </div>
</div>

269
{% endcache %}
Daniel W Bond's avatar
Daniel W Bond committed
270
271
272
{% endblock content %}

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