source: asadb/template/membership/confirm.html

stablestage
Last change on this file was 5560f6d, checked in by Alex Dehnert <adehnert@…>, 12 years ago

JSify the giant list of groups (ASA-#185)

This requires that Chosen (http://harvesthq.github.io/chosen/) be installed at
media/js/libs/chosen/.

  • Property mode set to 100644
File size: 2.6 KB
Line 
1{% extends "base.html" %}
2
3{% block extrahead %}
4<link rel="stylesheet" href="{{MEDIA_URL}}js/libs/chosen/chosen.css">
5{% endblock %}
6
7{% block title %}Membership update{% endblock %}
8{% block content %}
9
10<h2>Membership update</h2>
11
12{% if message %}
13<div class='messagebox {{message_type}}box'>
14<p>{{message}}</p>
15</div>
16{% endif %}
17
18<p>
19The ASA is attempting to verify that all currently recognized groups are active
20and have at least five student members.
21</p>
22
23<p>We ask you to help with that process by indicating what groups you consider yourself a member of.</p>
24
25<h3>Groups you currently say you're a member of:</h3>
26{% if member_groups %}
27<table class='pretty-table'>
28<thead>
29<tr>
30    <th>Group</th>
31    <th></th>
32</tr>
33</thead>
34<tbody>
35{% for group in member_groups %}
36<tr>
37    <th>{{group}}</th>
38    <td><form action="" method="post">
39        <input type="hidden" name="group" value="{{group.pk}}">
40        {% csrf_token %}
41        <input type="hidden" name="action" value="remove">
42        <input type="submit" name="add-remove" value="Remove">
43    </form></td>
44</tr>
45{% endfor %}
46</tbody>
47</table>
48{% else %}
49<p>You are not currently indicating membership in any groups.</p>
50{% endif %}
51
52<h3>Option 1: Add or remove groups that list a role for you</h3>
53
54<table class='pretty-table'>
55<thead>
56<tr>
57    <th>Group</th>
58    <th>Roles</th>
59    <th>Add/Remove</th>
60</tr>
61</thead>
62<tbody>
63{% for group, roles in role_groups.values %}
64<tr>
65    <th>{{group}}</th>
66    <td>{{roles|join:", "}}</td>
67    <td><form action="" method="post">
68        <input type="hidden" name="group" value="{{group.pk}}">
69        {% csrf_token %}
70        {% if group in member_groups %}
71        <input type="hidden" name="action" value="remove">
72        <input type="submit" name="add-remove" value="Remove">
73        {% else %}
74        <input type="hidden" name="action" value="add">
75        <input type="submit" name="add-remove" value="Add">
76        {% endif %}
77    </form></td>
78</tr>
79{% endfor %}
80</tbody>
81</table>
82
83<h3>Option 2: Select all your groups at once</h3>
84
85<p>Below, you can add or remove any recognized group from the list of groups you are a member of.</p>
86
87<form enctype="multipart/form-data" method="post" action="">
88{% csrf_token %}
89<table class='pretty-table'>
90{{ form.as_table }}
91<tr><th colspan='2'><input type='submit' name='list' value='Update list of groups' /></th></tr>
92</table>
93</form>
94
95
96<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js" type="text/javascript"></script>
97<script src="{{MEDIA_URL}}js/libs/chosen/chosen.jquery.js" type="text/javascript"></script>
98<script type="text/javascript">
99    $("#id_groups").chosen();
100</script>
101
102{% endblock %}
Note: See TracBrowser for help on using the repository browser.