improve trainee management
This commit is contained in:
@@ -23,20 +23,21 @@
|
||||
<th>Grade</th><th>Email</th><th>Supervisor</th><th>Edit</th>
|
||||
<th class="trainee-bulk-edit">Bulk Edit<br/>
|
||||
<span _="on click log 'test' then log 'hello' then repeat for i in <input/>
|
||||
set i.checked to not i.checked
|
||||
-- set i.checked to not i.checked
|
||||
toggle [@checked] on i
|
||||
">Toggle All</span>
|
||||
</th>
|
||||
</tr>
|
||||
|
||||
{% for trainee in trainees %}
|
||||
<tr class="trainee">
|
||||
<tr class="trainee" _="on click log 'test' then log the next <input/> then toggle [@checked] on <input/> in me">
|
||||
<td>{{trainee.user.first_name}} {{trainee.user.last_name}}</td>
|
||||
<td
|
||||
{% if not trainee.grade %}
|
||||
class="no-grade"
|
||||
{% endif %}
|
||||
>{{trainee.grade}}{% if not trainee.grade %}
|
||||
<a href="{% url 'account_profile_update' trainee.user.username %}" class="add-grade">add</a>
|
||||
<a href="{% url 'account_profile_update' trainee.user.username %}?redirect={{request.path}}" class="add-grade">add</a>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>{{trainee.user.email}}</td>
|
||||
@@ -45,7 +46,7 @@
|
||||
class="no-supervisor"
|
||||
{% endif %}
|
||||
>{{trainee.supervisor}}{% if not trainee.supervisor %}
|
||||
<a href="{% url 'account_profile_update' trainee.user.username %}" class="add-supervisor">add</a>
|
||||
<a href="{% url 'account_profile_update' trainee.user.username %}?redirect={{request.path}}" class="add-supervisor">add</a>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td><a href="{% url 'account_update' trainee.user.username %}">User</a>/<a href="{% url 'account_profile_update' trainee.user.username %}">Profile</a>
|
||||
@@ -54,7 +55,7 @@
|
||||
></i></span>
|
||||
</td>
|
||||
<td class="trainee-bulk-edit">
|
||||
<input type="checkbox" name="trainee" value="{{trainee.user.pk}}">
|
||||
<input type="checkbox" name="selection" value="{{trainee.user.pk}}">
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
@@ -67,11 +68,41 @@
|
||||
|
||||
<button class="btn btn-sm"
|
||||
_="on click toggle .show on .remove-trainee"
|
||||
>Remove trainees</button>
|
||||
>Remove trainee status</button>
|
||||
<button class="btn btn-sm"
|
||||
_="on click toggle .show on .trainee-bulk-edit"
|
||||
>Bulk edit trainees</button>
|
||||
|
||||
<div id="bulk-edit" class="trainee-bulk-edit">
|
||||
<h3>Bulk edit options</h3>
|
||||
These actions will act on all the selected trainees. Refresh the page to cancel / clear.
|
||||
<div id="htmx-info"></div>
|
||||
<div id="htmx-options"></div>
|
||||
<button id="bulk-delete-supervisors-button"
|
||||
title="Deletes the supervisors of all selected users"
|
||||
hx-post="{% url 'generic:users_bulk_delete_supervisors' %}"
|
||||
hx-include="[name='selection']"
|
||||
hx-confirm="This will delete supervisors from all selected users, are you sure you wish to continue?"
|
||||
hx-target="#htmx-info"
|
||||
_='on click put "" into #htmx-options'
|
||||
>Delete supervisors</button>
|
||||
<button id="bulk-edit-grade-button"
|
||||
hx-post="{% url 'generic:users_bulk_edit' %}"
|
||||
hx-include="[name='selection']"
|
||||
hx-target="#htmx-options"
|
||||
title="Changes the selected users grade."
|
||||
|
||||
>Edit grade</button>
|
||||
<button id="bulk-deactivate-user-button"
|
||||
hx-post="{% url 'generic:users_bulk_edit' %}"
|
||||
hx-include="[name='selection']"
|
||||
hx-target="#htmx-options"
|
||||
hx-confirm="This will deactivate all selected users, are you sure you wish to continue?"
|
||||
title="Deactivates the selected users"
|
||||
|
||||
>Deactivate</button>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.add-supervisor, .add-grade {
|
||||
font-size: small;
|
||||
@@ -85,8 +116,12 @@
|
||||
display: none;
|
||||
}
|
||||
|
||||
#bulk-edit {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.show {
|
||||
display: inline;
|
||||
display: inline !important;
|
||||
}
|
||||
|
||||
td {
|
||||
|
||||
Reference in New Issue
Block a user