1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Add page for user to view/clear preferences

This commit is contained in:
Jeremy Stretch
2020-04-24 10:29:06 -04:00
parent 7c8c85e435
commit 587339bea0
4 changed files with 56 additions and 11 deletions

View File

@@ -12,6 +12,9 @@
<li{% ifequal active_tab "profile" %} class="active"{% endifequal %}>
<a href="{% url 'user:profile' %}">Profile</a>
</li>
<li{% ifequal active_tab "preferences" %} class="active"{% endifequal %}>
<a href="{% url 'user:preferences' %}">Preferences</a>
</li>
{% if not request.user.ldap_username %}
<li{% ifequal active_tab "change_password" %} class="active"{% endifequal %}>
<a href="{% url 'user:change_password' %}">Change Password</a>

View File

@@ -4,15 +4,32 @@
{% block title %}User Preferences{% endblock %}
{% block usercontent %}
<table class="table table-striped">
<thead>
<tr>
<th>Preference</th>
<th>Value</th>
</tr>
</thead>
<tbody>
{% for %}
</tbody>
</table>
{% if preferences %}
<form method="post" action="">
{% csrf_token %}
<table class="table table-striped">
<thead>
<tr>
<th><input type="checkbox" class="toggle" title="Toggle all"></th>
<th>Preference</th>
<th>Value</th>
</tr>
</thead>
<tbody>
{% for key, value in preferences.items %}
<tr>
<td class="min-width"><input type="checkbox" name="pk" value="{{ key }}"></td>
<td>{{ key }}</td>
<td>{{ value }}</td>
</tr>
{% endfor %}
</tbody>
</table>
<button type="submit" class="btn btn-danger">
<span class="glyphicon glyphicon-trash" aria-hidden="true"></span> Clear Selected
</button>
</form>
{% else %}
<h3 class="text-muted text-center">No preferences found</h3>
{% endif %}
{% endblock %}