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

87 lines
2.9 KiB
HTML
Raw Normal View History

{% extends 'account/base.html' %}
2020-04-24 09:23:58 -04:00
{% load helpers %}
{% load form_helpers %}
{% load i18n %}
2020-04-24 09:23:58 -04:00
{% block title %}{% trans "User Preferences" %}{% endblock %}
2020-04-24 09:23:58 -04:00
2021-08-24 15:24:03 -04:00
{% block content %}
2021-12-08 16:36:06 -05:00
<form method="post" action="" id="preferences-update">
2021-04-25 20:11:46 -07:00
{% csrf_token %}
{# Built-in preferences #}
{% for group, fields in form.fieldsets %}
<div class="field-group my-5">
<div class="row mb-2">
<h5 class="offset-sm-3">{{ group }}</h5>
</div>
{% for name in fields %}
2021-12-22 09:35:29 -05:00
{% render_field form|getfield:name %}
{% endfor %}
2021-12-08 16:36:06 -05:00
</div>
{% endfor %}
{# Plugin preferences #}
2021-12-22 09:35:29 -05:00
{% with plugin_fields=form.plugin_fields %}
{% if plugin_fields %}
<div class="field-group my-5">
<div class="row mb-2">
<h5 class="offset-sm-3">{% trans "Plugins" %}</h5>
2021-12-22 09:35:29 -05:00
</div>
{% for name in plugin_fields %}
{% render_field form|getfield:name %}
{% endfor %}
</div>
{% endif %}
{% endwith %}
{# Table configurations #}
<div class="field-group my-5">
<div class="row mb-2">
<h5 class="offset-sm-3">{% trans "Table Configurations" %}</h5>
</div>
<div class="row">
{% if request.user.config.data.tables %}
<label class="col-sm-3 col-form-label text-lg-end">
{% trans "Clear table preferences" %}
</label>
<div class="col-sm-9">
<table class="table table-hover object-list">
<thead>
<tr>
<th>
<input type="checkbox" class="toggle form-check-input" title="{% trans "Toggle All" %}">
</th>
<th>{% trans "Table" %}</th>
<th>{% trans "Ordering" %}</th>
<th>{% trans "Columns" %}</th>
</tr>
</thead>
<tbody>
{% for table, prefs in request.user.config.data.tables.items %}
<tr>
<td>
<input type="checkbox" name="pk" value="tables.{{ table }}" class="form-check-input" />
</td>
<td>{{ table }}</td>
<td>{{ prefs.ordering|join:", "|placeholder }}</td>
<td>{{ prefs.columns|join:", "|placeholder }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% else %}
<div class="offset-sm-3">
<p class="text-muted">{% trans "None found" %}</p>
</div>
{% endif %}
</div>
</div>
<div class="text-end my-3">
<a class="btn btn-outline-secondary" href="{% url 'account:preferences' %}">{% trans "Cancel" %}</a>
<button type="submit" name="_update" class="btn btn-primary">{% trans "Save" %}</button>
2021-04-25 20:11:46 -07:00
</div>
2021-12-08 16:36:06 -05:00
</form>
2020-04-24 09:23:58 -04:00
{% endblock %}