Clean up user preferences view

This commit is contained in:
jeremystretch 2021-12-08 16:36:06 -05:00
parent cd08836f3e
commit 50d393e0f9

View File

@ -4,56 +4,54 @@
{% block title %}User Preferences{% endblock %} {% block title %}User Preferences{% endblock %}
{% block content %} {% block content %}
<form method="post" action="" id="preferences-update"> <form method="post" action="" id="preferences-update">
{% csrf_token %} {% csrf_token %}
<div class="field-group mb-3"> <div class="field-group mb-3">
<h5 class="text-center">Color Mode</h5> <h5>Color Mode</h5>
<p class="lead text-muted">Set preferred UI color mode</p> <p class="text-muted">Set preferred UI color mode</p>
{% with color_mode=preferences|get_key:'ui.colormode'%} {% with color_mode=preferences|get_key:'ui.colormode'%}
<div class="form-check form-check-inline"> <div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="ui.colormode" id="color-mode-preference-dark" value="dark"{% if color_mode == 'dark'%} checked{% endif %}> <input class="form-check-input" type="radio" name="ui.colormode" id="color-mode-preference-dark" value="dark"{% if color_mode == 'dark'%} checked{% endif %}>
<label class="form-check-label" for="color-mode-preference-dark">Dark</label> <label class="form-check-label" for="color-mode-preference-dark">Dark</label>
</div> </div>
<div class="form-check form-check-inline"> <div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="ui.colormode" id="color-mode-preference-light" value="light"{% if color_mode == 'light'%} checked{% endif %}> <input class="form-check-input" type="radio" name="ui.colormode" id="color-mode-preference-light" value="light"{% if color_mode == 'light'%} checked{% endif %}>
<label class="form-check-label" for="color-mode-preference-light">Light</label> <label class="form-check-label" for="color-mode-preference-light">Light</label>
</div> </div>
{% endwith %} {% endwith %}
</div> </div>
<div class="row"> <div class="row mb-3">
<div class="col"> <div class="col">
<button type="submit" class="btn btn-primary" name="_update"> <button type="submit" class="btn btn-primary" name="_update">Save</button>
Save </div>
</button>
</div>
</div> </div>
{% if preferences %} {% if preferences %}
<div class="field-group mb-3"> <div class="field-group mb-3">
<h5 class="text-center">Other Preferences</h5> <h5>Other Preferences</h5>
<table class="table table-striped"> <table class="table table-striped">
<thead> <thead>
<tr> <tr>
<th><input type="checkbox" class="toggle form-check-input" title="Toggle All"></th> <th><input type="checkbox" class="toggle form-check-input" title="Toggle All"></th>
<th>Preference</th> <th>Preference</th>
<th>Value</th> <th>Value</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{% for key, value in preferences.items %} {% for key, value in preferences.items %}
<tr> <tr>
<td class="min-width"><input class="form-check-input" type="checkbox" name="pk" value="{{ key }}"></td> <td class="min-width"><input class="form-check-input" type="checkbox" name="pk" value="{{ key }}"></td>
<td><samp>{{ key }}</samp></td> <td><samp>{{ key }}</samp></td>
<td><samp>{{ value }}</samp></td> <td><samp>{{ value }}</samp></td>
</tr> </tr>
{% endfor %} {% endfor %}
</tbody> </tbody>
</table> </table>
<button type="submit" class="btn btn-danger" name="_delete"> <button type="submit" class="btn btn-danger" name="_delete">
<span class="mdi mdi-trash-can-outline" aria-hidden="true"></span> Clear Selected <span class="mdi mdi-trash-can-outline" aria-hidden="true"></span> Clear Selected
</button> </button>
</div> </div>
{% else %} {% else %}
<h3 class="text-muted text-center">No Preferences Found</h3> <h3 class="text-muted text-center">No preferences found</h3>
{% endif %} {% endif %}
</form> </form>
{% endblock %} {% endblock %}