| 1 | {% extends "base.html" %} |
|---|
| 2 | |
|---|
| 3 | {% block title %}{{group.name}}: Update people{% endblock %} |
|---|
| 4 | {% block content %} |
|---|
| 5 | |
|---|
| 6 | <h1>{{group.name}}: Update people</h1> |
|---|
| 7 | |
|---|
| 8 | {% include "groups/group_tools.part.html" %} |
|---|
| 9 | |
|---|
| 10 | <p>Please adjust the people associated with your group below.</p> |
|---|
| 11 | |
|---|
| 12 | <h2>Available roles</h2> |
|---|
| 13 | |
|---|
| 14 | <table class='pretty-table'> |
|---|
| 15 | <tr> |
|---|
| 16 | <th>Role</th> |
|---|
| 17 | <th>Description</th> |
|---|
| 18 | <th>Maximum allowed</th> |
|---|
| 19 | <th>Requires student?</th> |
|---|
| 20 | </tr> |
|---|
| 21 | {% for role in roles %} |
|---|
| 22 | <tr> |
|---|
| 23 | <th>{{role.display_name}}</th> |
|---|
| 24 | <td>{{role.description}}</td> |
|---|
| 25 | <td>{{role.max_count_str}}</td> |
|---|
| 26 | <td>{% if role.require_student %}Yes{%else%}No{%endif%}</td> |
|---|
| 27 | </tr> |
|---|
| 28 | {% endfor %} |
|---|
| 29 | </table> |
|---|
| 30 | |
|---|
| 31 | {% if msgs %} |
|---|
| 32 | <h2>Messages</h2> |
|---|
| 33 | <ul> |
|---|
| 34 | {% for msg in msgs %} |
|---|
| 35 | <li>{{msg}}</li> |
|---|
| 36 | {%endfor %} |
|---|
| 37 | </ul> |
|---|
| 38 | {%endif%} |
|---|
| 39 | |
|---|
| 40 | {% if changes %} |
|---|
| 41 | <h2>Changes made</h2> |
|---|
| 42 | <table class='pretty-table'> |
|---|
| 43 | <tr> |
|---|
| 44 | <th>Action</th> |
|---|
| 45 | <th>Person</th> |
|---|
| 46 | <th>Role</th> |
|---|
| 47 | </tr> |
|---|
| 48 | {% for verb, color, person, role in changes %} |
|---|
| 49 | <tr><td style='background-color: {{color}}; color: black'>{{verb}}</td><td>{{person}}</td><td>{{role.display_name}}</td></tr> |
|---|
| 50 | {% endfor %} |
|---|
| 51 | </table> |
|---|
| 52 | {% endif %} |
|---|
| 53 | |
|---|
| 54 | <h2>Option 1: View and update people one at a time</h2> |
|---|
| 55 | |
|---|
| 56 | <p>Please note:</p> |
|---|
| 57 | <ul> |
|---|
| 58 | <li>We don't track "group membership" – people will show up in the list below only if they have one of the roles listed</li> |
|---|
| 59 | <li>Type only the <em>Athena username</em> to add people – do not type full names or names plus username</li> |
|---|
| 60 | <li>To add <em>more than four</em> new people, add four at a time and <em>submit multiple times</em></li> |
|---|
| 61 | </ul> |
|---|
| 62 | |
|---|
| 63 | <form enctype="multipart/form-data" method="post" action=""> |
|---|
| 64 | <input type='hidden' name='opt-mode' value='table' /> |
|---|
| 65 | {% csrf_token %} |
|---|
| 66 | <table class='pretty-table group-update-people-change'> |
|---|
| 67 | <thead> |
|---|
| 68 | <tr> |
|---|
| 69 | <th></th> |
|---|
| 70 | {% for role in roles %} |
|---|
| 71 | <th>{{role.display_name}}</th> |
|---|
| 72 | {% endfor %} |
|---|
| 73 | </tr> |
|---|
| 74 | </thead> |
|---|
| 75 | <tbody> |
|---|
| 76 | {%for specify_name, person, formatted_name, role_list in officers %} |
|---|
| 77 | <tr> |
|---|
| 78 | <th> |
|---|
| 79 | {% if specify_name %} |
|---|
| 80 | <input type='text' name='{{person}}' value=''> |
|---|
| 81 | {% else %} |
|---|
| 82 | {{formatted_name}} |
|---|
| 83 | {% endif %} |
|---|
| 84 | </th> |
|---|
| 85 | {%for role,val in role_list%} |
|---|
| 86 | <td><input type='checkbox' name='holders.{{role.slug}}' value='{{person}}' {%if val%}checked='checked'{%endif%}></td> |
|---|
| 87 | {%endfor%} |
|---|
| 88 | </tr> |
|---|
| 89 | {%endfor%} |
|---|
| 90 | </tbody> |
|---|
| 91 | </table> |
|---|
| 92 | |
|---|
| 93 | <input type='submit' value='Update' /> |
|---|
| 94 | </form> |
|---|
| 95 | |
|---|
| 96 | {%if edited %} |
|---|
| 97 | <p>Untouched were {{kept}} filled people/role combinations and {{kept_not}} unfilled combinations.</p> |
|---|
| 98 | {% endif %} |
|---|
| 99 | |
|---|
| 100 | <h2>Option 2: Bulk update</h2> |
|---|
| 101 | |
|---|
| 102 | <form enctype="multipart/form-data" method="post" action=""> |
|---|
| 103 | <input type='hidden' name='opt-mode' value='bulk' /> |
|---|
| 104 | {% csrf_token %} |
|---|
| 105 | <table class='pretty-table'> |
|---|
| 106 | {{ bulk_form.as_table }} |
|---|
| 107 | <tr><th colspan='2'><input type='submit' value='Update' /></th></tr> |
|---|
| 108 | </table> |
|---|
| 109 | </form> |
|---|
| 110 | |
|---|
| 111 | {% endblock %} |
|---|