Improve visualisation of global settings

This commit is contained in:
Oliver Walters 2021-01-03 22:57:39 +11:00
parent bdc3a9ef02
commit 9fa37a9156
9 changed files with 54 additions and 16 deletions

View File

@ -111,6 +111,20 @@ class InvenTreeSetting(models.Model):
'validator': bool 'validator': bool
}, },
'PART_TEMPLATE': {
'name': _('Template'),
'description': _('Parts are templates by default'),
'default': False,
'validator': bool,
},
'PART_ASSEMBLY': {
'name': _('Assembly'),
'description': _('Parts can be assembled from other components by default'),
'default': False,
'validator': bool,
},
'PART_COMPONENT': { 'PART_COMPONENT': {
'name': _('Component'), 'name': _('Component'),
'description': _('Parts can be used as sub-components by default'), 'description': _('Parts can be used as sub-components by default'),

View File

@ -13,7 +13,7 @@
{% block settings %} {% block settings %}
<table class='table table-striped table-condensed'> <table class='table table-striped table-condensed'>
<thead></thead> {% include "InvenTree/settings/header.html" %}
<tbody> <tbody>
{% include "InvenTree/settings/setting.html" with key="BUILDORDER_REFERENCE_PREFIX" %} {% include "InvenTree/settings/setting.html" with key="BUILDORDER_REFERENCE_PREFIX" %}
{% include "InvenTree/settings/setting.html" with key="BUILDORDER_REFERENCE_REGEX" %} {% include "InvenTree/settings/setting.html" with key="BUILDORDER_REFERENCE_REGEX" %}

View File

@ -13,11 +13,11 @@
{% block settings %} {% block settings %}
<table class='table table-striped table-condensed'> <table class='table table-striped table-condensed'>
<thead></thead> {% include "InvenTree/settings/header.html" %}
<tbody> <tbody>
{% include "InvenTree/settings/setting.html" with key="INVENTREE_INSTANCE" %} {% include "InvenTree/settings/setting.html" with key="INVENTREE_INSTANCE" icon="fa-info-circle" %}
{% include "InvenTree/settings/setting.html" with key="INVENTREE_COMPANY_NAME" %} {% include "InvenTree/settings/setting.html" with key="INVENTREE_COMPANY_NAME" icon="fa-building" %}
{% include "InvenTree/settings/setting.html" with key="INVENTREE_DEFAULT_CURRENCY" %} {% include "InvenTree/settings/setting.html" with key="INVENTREE_DEFAULT_CURRENCY" icon="fa-dollar-sign" %}
</tbody> </tbody>
</table> </table>

View File

@ -0,0 +1,12 @@
{% load i18n %}
<col width='25'>
<thead>
<tr>
<th></th>
<th>{% trans "Setting" %}</th>
<th>{% trans "Value" %}</th>
<th>{% trans "Description" %}</th>
<th></th>
</tr>
</thead>

View File

@ -14,16 +14,18 @@
<h4>{% trans "Part Options" %}</h4> <h4>{% trans "Part Options" %}</h4>
<table class='table table-striped table-condensed'> <table class='table table-striped table-condensed'>
<thead></thead> {% include "InvenTree/settings/header.html" %}
<tbody> <tbody>
{% include "InvenTree/settings/setting.html" with key="PART_IPN_REGEX" %} {% include "InvenTree/settings/setting.html" with key="PART_IPN_REGEX" %}
{% include "InvenTree/settings/setting.html" with key="PART_ALLOW_DUPLICATE_IPN" %} {% include "InvenTree/settings/setting.html" with key="PART_ALLOW_DUPLICATE_IPN" %}
<tr><td colspan='4'></td></tr> <tr><td colspan='5 '></td></tr>
{% include "InvenTree/settings/setting.html" with key="PART_COMPONENT" %} {% include "InvenTree/settings/setting.html" with key="PART_TEMPLATE" icon="fa-clone" %}
{% include "InvenTree/settings/setting.html" with key="PART_PURCHASEABLE" %} {% include "InvenTree/settings/setting.html" with key="PART_ASSEMBLY" icon="fa-tools" %}
{% include "InvenTree/settings/setting.html" with key="PART_SALABLE" %} {% include "InvenTree/settings/setting.html" with key="PART_COMPONENT" icon="fa-th"%}
{% include "InvenTree/settings/setting.html" with key="PART_TRACKABLE" %} {% include "InvenTree/settings/setting.html" with key="PART_TRACKABLE" icon="fa-directions" %}
<tr><td colspan='4'></td></tr> {% include "InvenTree/settings/setting.html" with key="PART_PURCHASEABLE" icon="fa-shopping-cart" %}
{% include "InvenTree/settings/setting.html" with key="PART_SALABLE" icon="fa-dollar-sign" %}
<tr><td colspan='5'></td></tr>
{% include "InvenTree/settings/setting.html" with key="PART_COPY_BOM" %} {% include "InvenTree/settings/setting.html" with key="PART_COPY_BOM" %}
{% include "InvenTree/settings/setting.html" with key="PART_COPY_PARAMETERS" %} {% include "InvenTree/settings/setting.html" with key="PART_COPY_PARAMETERS" %}
{% include "InvenTree/settings/setting.html" with key="PART_COPY_TESTS" %} {% include "InvenTree/settings/setting.html" with key="PART_COPY_TESTS" %}

View File

@ -11,7 +11,7 @@
{% block settings %} {% block settings %}
<table class='table table-striped table-condensed'> <table class='table table-striped table-condensed'>
<thead></thead> {% include "InvenTree/settings/header.html" %}
<tbody> <tbody>
{% include "InvenTree/settings/setting.html" with key="PURCHASEORDER_REFERENCE_PREFIX" %} {% include "InvenTree/settings/setting.html" with key="PURCHASEORDER_REFERENCE_PREFIX" %}
</tbody> </tbody>

View File

@ -3,6 +3,11 @@
{% setting_object key as setting %} {% setting_object key as setting %}
<tr> <tr>
<td>
{% if icon %}
<span class='fas {{ icon }}'></span>
{% endif %}
</td>
<td><b>{{ setting.name }}</b></td> <td><b>{{ setting.name }}</b></td>
<td> <td>
{% if setting.is_bool %} {% if setting.is_bool %}
@ -11,7 +16,9 @@
</div> </div>
{% else %} {% else %}
{% if setting.value %} {% if setting.value %}
<b>{{ setting.value }}</b>{{ setting.units }}</td> <i><b>
{{ setting.value }}</b>{{ setting.units }}
</i>
{% else %} {% else %}
<i>{% trans "No value set" %}</i> <i>{% trans "No value set" %}</i>
{% endif %} {% endif %}

View File

@ -12,7 +12,7 @@
{% block settings %} {% block settings %}
<table class='table table-striped table-condensed'> <table class='table table-striped table-condensed'>
<thead></thead> {% include "InvenTree/settings/header.html" %}
<tbody> <tbody>
{% include "InvenTree/settings/setting.html" with key="SALESORDER_REFERENCE_PREFIX" %} {% include "InvenTree/settings/setting.html" with key="SALESORDER_REFERENCE_PREFIX" %}
</tbody> </tbody>

View File

@ -10,4 +10,7 @@
{% endblock %} {% endblock %}
{% block settings %} {% block settings %}
<div class='alert alert-block alert-info'>
<i>No Stock settings available</i>
</div>
{% endblock %} {% endblock %}