mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-21 03:27:21 -06:00
Document available user preferences
This commit is contained in:
parent
30c3d6ee40
commit
d8494e44e7
9
docs/development/user-preferences.md
Normal file
9
docs/development/user-preferences.md
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
# User Preferences
|
||||||
|
|
||||||
|
The `users.UserConfig` model holds individual preferences for each user in the form of JSON data. This page serves as a manifest of all recognized user preferences in NetBox.
|
||||||
|
|
||||||
|
## Available Preferences
|
||||||
|
|
||||||
|
| Name | Description |
|
||||||
|
| ---- | ----------- |
|
||||||
|
| pagination.per_page | The number of items to display per page of a paginated table |
|
@ -72,6 +72,7 @@ nav:
|
|||||||
- Utility Views: 'development/utility-views.md'
|
- Utility Views: 'development/utility-views.md'
|
||||||
- Extending Models: 'development/extending-models.md'
|
- Extending Models: 'development/extending-models.md'
|
||||||
- Application Registry: 'development/application-registry.md'
|
- Application Registry: 'development/application-registry.md'
|
||||||
|
- User Preferences: 'development/user-preferences.md'
|
||||||
- Release Checklist: 'development/release-checklist.md'
|
- Release Checklist: 'development/release-checklist.md'
|
||||||
- Squashing Migrations: 'development/squashing-migrations.md'
|
- Squashing Migrations: 'development/squashing-migrations.md'
|
||||||
- Release Notes:
|
- Release Notes:
|
||||||
|
18
netbox/templates/users/preferences.html
Normal file
18
netbox/templates/users/preferences.html
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
{% extends 'users/_user.html' %}
|
||||||
|
{% load helpers %}
|
||||||
|
|
||||||
|
{% 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>
|
||||||
|
{% endblock %}
|
@ -50,9 +50,9 @@ def get_paginate_count(request):
|
|||||||
if 'per_page' in request.GET:
|
if 'per_page' in request.GET:
|
||||||
try:
|
try:
|
||||||
per_page = int(request.GET.get('per_page'))
|
per_page = int(request.GET.get('per_page'))
|
||||||
request.user.config.set('paginate_count', per_page, commit=True)
|
request.user.config.set('pagination.per_page', per_page, commit=True)
|
||||||
return per_page
|
return per_page
|
||||||
except ValueError:
|
except ValueError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
return request.user.config.get('paginate_count', settings.PAGINATE_COUNT)
|
return request.user.config.get('pagination.per_page', settings.PAGINATE_COUNT)
|
||||||
|
Loading…
Reference in New Issue
Block a user