style(templates): Refactor HTML structure for improved readability and consistency
This commit is contained in:
@@ -47,78 +47,78 @@
|
||||
<details>
|
||||
<summary>Edit CID exams</summary>
|
||||
<p>This should be done via the exams pages one via group management.</p>
|
||||
<p>Select exams below to add user(s) to (or edit existing user(s)).</p>
|
||||
<div class="exam-selectors">
|
||||
<span>
|
||||
Physics Exams<br />
|
||||
<select id="physics-exams" multiple="multiple">
|
||||
{% for name, id in physics_exams %}
|
||||
<option value="{{id}}">{{name}}</option>
|
||||
{% endfor %}
|
||||
<p>Select exams below to add user(s) to (or edit existing user(s)).</p>
|
||||
<div class="exam-selectors">
|
||||
<span>
|
||||
Physics Exams<br />
|
||||
<select id="physics-exams" multiple="multiple">
|
||||
{% for name, id in physics_exams %}
|
||||
<option value="{{id}}">{{name}}</option>
|
||||
{% endfor %}
|
||||
|
||||
</select>
|
||||
</span>
|
||||
<span>
|
||||
Rapid Exams<br />
|
||||
<select id="rapid-exams" multiple="multiple">
|
||||
{% for name, id in rapid_exams %}
|
||||
<option value="{{id}}">{{name}}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</span>
|
||||
<span>
|
||||
Rapid Exams<br />
|
||||
<select id="rapid-exams" multiple="multiple">
|
||||
{% for name, id in rapid_exams %}
|
||||
<option value="{{id}}">{{name}}</option>
|
||||
{% endfor %}
|
||||
|
||||
</select>
|
||||
</span>
|
||||
<span>
|
||||
Sba Exams<br />
|
||||
<select id="sbas-exams" multiple="multiple">
|
||||
{% for name, id in sba_exams %}
|
||||
<option value="{{id}}">{{name}}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</span>
|
||||
<span>
|
||||
Sba Exams<br />
|
||||
<select id="sbas-exams" multiple="multiple">
|
||||
{% for name, id in sba_exams %}
|
||||
<option value="{{id}}">{{name}}</option>
|
||||
{% endfor %}
|
||||
|
||||
</select>
|
||||
</span>
|
||||
<span>
|
||||
Long Exams<br />
|
||||
<select id="longs-exams" multiple="multiple">
|
||||
{% for name, id in longs_exams %}
|
||||
<option value="{{id}}">{{name}}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</span>
|
||||
<span>
|
||||
Long Exams<br />
|
||||
<select id="longs-exams" multiple="multiple">
|
||||
{% for name, id in longs_exams %}
|
||||
<option value="{{id}}">{{name}}</option>
|
||||
{% endfor %}
|
||||
|
||||
</select>
|
||||
</span>
|
||||
<span>
|
||||
Anatomy Exams<br />
|
||||
<select id="anatomy-exams" multiple="multiple">
|
||||
{% for name, id in anatomy_exams %}
|
||||
<option value="{{id}}">{{name}}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</span>
|
||||
<span>
|
||||
Anatomy Exams<br />
|
||||
<select id="anatomy-exams" multiple="multiple">
|
||||
{% for name, id in anatomy_exams %}
|
||||
<option value="{{id}}">{{name}}</option>
|
||||
{% endfor %}
|
||||
|
||||
</select>
|
||||
</span>
|
||||
<span>
|
||||
Shorts Exams<br />
|
||||
<select id="shorts-exams" multiple="multiple">
|
||||
{% for name, id in shorts_exams %}
|
||||
<option value="{{id}}">{{name}}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</span>
|
||||
<span>
|
||||
Shorts Exams<br />
|
||||
<select id="shorts-exams" multiple="multiple">
|
||||
{% for name, id in shorts_exams %}
|
||||
<option value="{{id}}">{{name}}</option>
|
||||
{% endfor %}
|
||||
|
||||
</select>
|
||||
</span>
|
||||
<span>
|
||||
CaseCollection Exams<br />
|
||||
<select id="casecollection-exams" multiple="multiple">
|
||||
{% for name, id in casecollection_exams %}
|
||||
<option value="{{id}}">{{name}}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</span>
|
||||
<span>
|
||||
CaseCollection Exams<br />
|
||||
<select id="casecollection-exams" multiple="multiple">
|
||||
{% for name, id in casecollection_exams %}
|
||||
<option value="{{id}}">{{name}}</option>
|
||||
{% endfor %}
|
||||
|
||||
</select>
|
||||
</span>
|
||||
</select>
|
||||
</span>
|
||||
|
||||
|
||||
</div>
|
||||
<button id="add-exams-selected-cids">Add selected exams</button>
|
||||
<button id="change-exams-selected-cids">Change selected exams</button>
|
||||
<button id="clear-exams-selected-cids">Clear selected exams</button>
|
||||
|
||||
</div>
|
||||
<button id="add-exams-selected-cids">Add selected exams</button>
|
||||
<button id="change-exams-selected-cids">Change selected exams</button>
|
||||
<button id="clear-exams-selected-cids">Clear selected exams</button>
|
||||
|
||||
</details>
|
||||
</details>
|
||||
|
||||
@@ -183,20 +183,20 @@
|
||||
})
|
||||
// $.ajax().done(), $.ajax().fail(), $ajax().always() are upto you. Add/change accordingly
|
||||
.done(function (data) {
|
||||
console.log(data);
|
||||
console.log(data);
|
||||
|
||||
if (data.status == "success") {
|
||||
toastr.info('Added/Updated');
|
||||
location.reload();
|
||||
} else {
|
||||
toastr.error(data.details)
|
||||
}
|
||||
if (data.status == "success") {
|
||||
toastr.info('Added/Updated');
|
||||
location.reload();
|
||||
} else {
|
||||
toastr.error(data.details)
|
||||
}
|
||||
// show some message according to the response.
|
||||
// For eg. A message box showing that the status has been changed
|
||||
})
|
||||
})
|
||||
.always(function () {
|
||||
console.log('[Done]');
|
||||
})
|
||||
console.log('[Done]');
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -16,41 +16,41 @@
|
||||
<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'
|
||||
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."
|
||||
|
||||
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-add-group-button"
|
||||
hx-post="{% url 'generic:users_bulk_edit' %}"
|
||||
hx-include="[name='selection']"
|
||||
hx-target="#htmx-options"
|
||||
title="Adds the selected user to a group."
|
||||
|
||||
hx-post="{% url 'generic:users_bulk_edit' %}"
|
||||
hx-include="[name='selection']"
|
||||
hx-target="#htmx-options"
|
||||
title="Adds the selected user to a group."
|
||||
|
||||
>Add group</button>
|
||||
<button id="bulk-remove-group-button"
|
||||
hx-post="{% url 'generic:users_bulk_edit' %}"
|
||||
hx-include="[name='selection']"
|
||||
hx-target="#htmx-options"
|
||||
title="Removes the selected user from a group."
|
||||
|
||||
hx-post="{% url 'generic:users_bulk_edit' %}"
|
||||
hx-include="[name='selection']"
|
||||
hx-target="#htmx-options"
|
||||
title="Removes the selected user from a group."
|
||||
|
||||
>Remove group</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"
|
||||
|
||||
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>
|
||||
</details>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user