mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
make it possible to resitrict the about modal
This commit is contained in:
parent
ff9d8e7b6b
commit
1127bf2497
@ -696,6 +696,13 @@ class InvenTreeSetting(BaseInvenTreeSetting):
|
|||||||
'default': False,
|
'default': False,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
'INVENTREE_RESTRICT_ABOUT': {
|
||||||
|
'name': _('Restrict showing `about`'),
|
||||||
|
'description': _('Show the `about` modal only to superusers'),
|
||||||
|
'validator': bool,
|
||||||
|
'default': False,
|
||||||
|
},
|
||||||
|
|
||||||
'INVENTREE_COMPANY_NAME': {
|
'INVENTREE_COMPANY_NAME': {
|
||||||
'name': _('Company name'),
|
'name': _('Company name'),
|
||||||
'description': _('Internal company name'),
|
'description': _('Internal company name'),
|
||||||
|
@ -166,6 +166,14 @@ def inventree_demo_mode(*args, **kwargs):
|
|||||||
return djangosettings.DEMO_MODE
|
return djangosettings.DEMO_MODE
|
||||||
|
|
||||||
|
|
||||||
|
@register.simple_tag()
|
||||||
|
def inventree_show_about(user, *args, **kwargs):
|
||||||
|
""" Return True if the about modal should be shown """
|
||||||
|
if InvenTreeSetting.get_setting('INVENTREE_RESTRICT_ABOUT') and not user.is_superuser:
|
||||||
|
return False
|
||||||
|
return True
|
||||||
|
|
||||||
|
|
||||||
@register.simple_tag()
|
@register.simple_tag()
|
||||||
def inventree_docker_mode(*args, **kwargs):
|
def inventree_docker_mode(*args, **kwargs):
|
||||||
""" Return True if the server is running as a Docker image """
|
""" Return True if the server is running as a Docker image """
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
{% include "InvenTree/settings/setting.html" with key="INVENTREE_INSTANCE" icon="fa-info-circle" %}
|
{% include "InvenTree/settings/setting.html" with key="INVENTREE_INSTANCE" icon="fa-info-circle" %}
|
||||||
{% include "InvenTree/settings/setting.html" with key="INVENTREE_INSTANCE_TITLE" icon="fa-info-circle" %}
|
{% include "InvenTree/settings/setting.html" with key="INVENTREE_INSTANCE_TITLE" icon="fa-info-circle" %}
|
||||||
|
{% include "InvenTree/settings/setting.html" with key="INVENTREE_RESTRICT_ABOUT" icon="fa-info-circle" %}
|
||||||
{% include "InvenTree/settings/setting.html" with key="INVENTREE_BASE_URL" icon="fa-globe" %}
|
{% include "InvenTree/settings/setting.html" with key="INVENTREE_BASE_URL" icon="fa-globe" %}
|
||||||
{% include "InvenTree/settings/setting.html" with key="INVENTREE_COMPANY_NAME" icon="fa-building" %}
|
{% include "InvenTree/settings/setting.html" with key="INVENTREE_COMPANY_NAME" icon="fa-building" %}
|
||||||
{% include "InvenTree/settings/setting.html" with key="INVENTREE_DOWNLOAD_FROM_URL" icon="fa-cloud-download-alt" %}
|
{% include "InvenTree/settings/setting.html" with key="INVENTREE_DOWNLOAD_FROM_URL" icon="fa-cloud-download-alt" %}
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
{% settings_value "REPORT_ENABLE" as report_enabled %}
|
{% settings_value "REPORT_ENABLE" as report_enabled %}
|
||||||
{% settings_value "SERVER_RESTART_REQUIRED" as server_restart_required %}
|
{% settings_value "SERVER_RESTART_REQUIRED" as server_restart_required %}
|
||||||
{% settings_value "LABEL_ENABLE" with user=user as labels_enabled %}
|
{% settings_value "LABEL_ENABLE" with user=user as labels_enabled %}
|
||||||
|
{% inventree_show_about user as show_about %}
|
||||||
{% inventree_demo_mode as demo_mode %}
|
{% inventree_demo_mode as demo_mode %}
|
||||||
|
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
@ -130,7 +131,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% include 'modals.html' %}
|
{% include 'modals.html' %}
|
||||||
{% include 'about.html' %}
|
{% if show_about %}{% include 'about.html' %}{% endif %}
|
||||||
{% include "notifications.html" %}
|
{% include "notifications.html" %}
|
||||||
{% include "search.html" %}
|
{% include "search.html" %}
|
||||||
</div>
|
</div>
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
{% settings_value 'STICKY_HEADER' user=request.user as sticky %}
|
{% settings_value 'STICKY_HEADER' user=request.user as sticky %}
|
||||||
{% navigation_enabled as plugin_nav %}
|
{% navigation_enabled as plugin_nav %}
|
||||||
{% inventree_demo_mode as demo %}
|
{% inventree_demo_mode as demo %}
|
||||||
|
{% inventree_show_about user as show_about %}
|
||||||
|
|
||||||
<nav class="navbar {% if sticky %}fixed-top{% endif %} navbar-expand-lg navbar-light">
|
<nav class="navbar {% if sticky %}fixed-top{% endif %} navbar-expand-lg navbar-light">
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
@ -144,6 +145,7 @@
|
|||||||
{% trans "System Information" %}
|
{% trans "System Information" %}
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
{% if show_about %}
|
||||||
<li id='launch-about'>
|
<li id='launch-about'>
|
||||||
<a class='dropdown-item' href='#'>
|
<a class='dropdown-item' href='#'>
|
||||||
{% if up_to_date %}
|
{% if up_to_date %}
|
||||||
@ -154,6 +156,7 @@
|
|||||||
{% trans "About InvenTree" %}
|
{% trans "About InvenTree" %}
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
{% endif %}
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
Loading…
Reference in New Issue
Block a user