mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Adds user option to enable "sticky header"
This commit is contained in:
parent
827ff0f58b
commit
abf2093ab9
@ -1017,7 +1017,14 @@ class InvenTreeUserSetting(BaseInvenTreeSetting):
|
||||
'description': _('Use the escape key to close modal forms'),
|
||||
'default': False,
|
||||
'validator': bool,
|
||||
}
|
||||
},
|
||||
|
||||
'STICKY_HEADER': {
|
||||
'name': _('Fixed Navbar'),
|
||||
'description': _('InvenTree navbar position is fixed to the top of the screen'),
|
||||
'default': False,
|
||||
'validator': bool,
|
||||
},
|
||||
}
|
||||
|
||||
class Meta:
|
||||
|
@ -42,6 +42,12 @@
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class='list-group-item' title='{% trans "Display" %}'>
|
||||
<a href='#' class='nav-toggle' id='select-user-display'>
|
||||
<span class='fas fa-desktop'></span> {% trans "Display" %}
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class='list-group-item' title='{% trans "Forms" %}'>
|
||||
<a href='#' class='nav-toggle' id='select-user-forms'>
|
||||
<span class='fas fa-table'></span>{% trans "Forms" %}
|
||||
|
@ -16,8 +16,8 @@
|
||||
<td><strong>{% trans setting.name %}</strong></td>
|
||||
<td>
|
||||
{% if setting.is_bool %}
|
||||
<div>
|
||||
<input fieldname='{{ setting.key.upper }}' id='setting-value-{{ setting.key.upper }}' type='checkbox' disabled='' {% if setting.as_bool %}checked=''{% endif %}>
|
||||
<div class='form-check form-switch'>
|
||||
<input class='form-check-input' fieldname='{{ setting.key.upper }}' id='setting-value-{{ setting.key.upper }}' type='checkbox' disabled='' {% if setting.as_bool %}checked=''{% endif %}>
|
||||
</div>
|
||||
{% else %}
|
||||
<div id='setting-{{ setting.pk }}'>
|
||||
|
@ -20,6 +20,7 @@
|
||||
{% include "InvenTree/settings/user_search.html" %}
|
||||
{% include "InvenTree/settings/user_labels.html" %}
|
||||
{% include "InvenTree/settings/user_reports.html" %}
|
||||
{% include "InvenTree/settings/user_display.html" %}
|
||||
{% include "InvenTree/settings/user_forms.html" %}
|
||||
|
||||
{% if user.is_staff %}
|
||||
|
22
InvenTree/templates/InvenTree/settings/user_display.html
Normal file
22
InvenTree/templates/InvenTree/settings/user_display.html
Normal file
@ -0,0 +1,22 @@
|
||||
{% extends "panel.html" %}
|
||||
|
||||
{% load i18n %}
|
||||
{% load inventree_extras %}
|
||||
|
||||
{% block label %}user-display{% endblock %}
|
||||
|
||||
{% block heading %}
|
||||
{% trans "Display Settings" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div class='row'>
|
||||
<table class='table table-striped table-condensed'>
|
||||
<tbody>
|
||||
{% include "InvenTree/settings/setting.html" with key="STICKY_HEADER" icon="fa-bars" user_setting=True %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
@ -3,8 +3,9 @@
|
||||
{% load i18n %}
|
||||
|
||||
{% settings_value 'BARCODE_ENABLE' as barcodes %}
|
||||
{% settings_value 'STICKY_HEADER' user=request.user as sticky %}
|
||||
|
||||
<nav class="navbar navbar-expand-lg navbar-light bg-light">
|
||||
<nav class="navbar {% if sticky %}fixed-top{% endif %} navbar-expand-lg navbar-light bg-light">
|
||||
<div class="container-fluid">
|
||||
<div class="navbar-header clearfix content-heading">
|
||||
<a class="navbar-brand" id='logo' href="{% url 'index' %}" style="padding-top: 7px; padding-bottom: 5px;"><img src="{% static 'img/inventree.png' %}" width="32" height="32" style="display:block; margin: auto;"/></a>
|
||||
|
Loading…
Reference in New Issue
Block a user