2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-19 21:45:39 +00:00

Merge pull request #1999 from matmair/turn-of-functions

Disable functions in navbars
This commit is contained in:
Oliver
2021-08-23 20:29:28 +10:00
committed by GitHub
9 changed files with 95 additions and 12 deletions

View File

@ -4,6 +4,12 @@
{% settings_value "PART_INTERNAL_PRICE" as show_internal_price %}
{% settings_value 'PART_SHOW_RELATED' as show_related %}
{% settings_value 'BUILD_FUNCTION_ENABLE' as enable_build %}
{% settings_value 'STOCK_FUNCTION_ENABLE' as enable_stock %}
{% settings_value 'PO_FUNCTION_ENABLE' as enable_po %}
{% settings_value 'SO_FUNCTION_ENABLE' as enable_so %}
{% settings_value 'BUY_FUNCTION_ENABLE' as enable_buy %}
{% settings_value 'SELL_FUNCTION_ENABLE' as enable_sell %}
<ul class='list-group'>
<li class='list-group-item'>
@ -25,12 +31,14 @@
</a>
</li>
{% endif %}
{% if enable_stock %}
<li class='list-group-item' title='{% trans "Stock Items" %}'>
<a href='#' id='select-part-stock' class='nav-toggle'>
<span class='menu-tab-icon fas fa-boxes sidebar-icon'></span>
{% trans "Stock" %}
</a>
</li>
{% endif %}
{% if part.assembly %}
<li class='list-group-item' title='{% trans "Bill of Materials" %}'>
<a href='#' id='select-bom' class='nav-toggle'>
@ -38,7 +46,7 @@
{% trans "Bill of Materials" %}
</a>
</li>
{% if roles.build.view %}
{% if roles.build.view and enable_build %}
<li class='list-group-item ' title='{% trans "Build Orders" %}'>
<a href='#' id='select-build-orders' class='nav-toggle'>
<span class='menu-tab-icon fas fa-tools sidebar-icon'></span>
@ -55,19 +63,22 @@
</a>
</li>
{% endif %}
{% if enable_buy or enable_sell %}
<li class='list-group-item' title='{% trans "Pricing Information" %}'>
<a href='#' id='select-pricing' class='nav-toggle'>
<span class='menu-tab-icon fas fa-dollar-sign sidebar-icon'></span>
{% trans "Prices" %}
</a>
</li>
{% if part.purchaseable and roles.purchase_order.view %}
{% endif %}
{% if part.purchaseable and roles.purchase_order.view and enable_buy %}
<li class='list-group-item' title='{% trans "Suppliers" %}'>
<a href='#' id='select-suppliers' class='nav-toggle'>
<span class='menu-tab-icon fas fa-building sidebar-icon'></span>
{% trans "Suppliers" %}
</a>
</li>
{% if enable_po %}
<li class='list-group-item' title='{% trans "Purchase Orders" %}'>
<a href='#' id='select-purchase-orders' class='nav-toggle'>
<span class='menu-tab-icon fas fa-shopping-cart sidebar-icon'></span>
@ -75,7 +86,8 @@
</a>
</li>
{% endif %}
{% if roles.sales_order.view %}
{% endif %}
{% if roles.sales_order.view and enable_sell and enable_so %}
<li class='list-group-item' title='{% trans "Sales Orders" %}'>
<a href='#' id='select-sales-orders' class='nav-toggle'>
<span class='menu-tab-icon fas fa-truck sidebar-icon'></span>

View File

@ -10,6 +10,11 @@
{% block content %}
{% settings_value 'BUY_FUNCTION_ENABLE' as enable_buy %}
{% settings_value 'SELL_FUNCTION_ENABLE' as enable_sell %}
{% settings_value 'PO_FUNCTION_ENABLE' as enable_po %}
{% settings_value 'STOCK_FUNCTION_ENABLE' as enable_stock %}
<div class="panel panel-default panel-inventree">
<!-- Default panel contents -->
<div class="panel-heading"><h3>{{ part.full_name }}</h3></div>
@ -80,10 +85,12 @@
</div>
{% endif %}
{% if part.active %}
{% if enable_buy or enable_sell %}
<button type='button' class='btn btn-default' id='price-button' title='{% trans "Show pricing information" %}'>
<span id='part-price-icon' class='fas fa-dollar-sign'/>
</button>
{% if roles.stock.change %}
{% endif %}
{% if roles.stock.change and enable_stock %}
<div class='btn-group'>
<button id='stock-actions' title='{% trans "Stock actions" %}' class='btn btn-default dropdown-toggle' type='button' data-toggle='dropdown'>
<span class='fas fa-boxes'></span> <span class='caret'></span>
@ -104,8 +111,8 @@
</ul>
</div>
{% endif %}
{% if part.purchaseable %}
{% if roles.purchase_order.add %}
{% if part.purchaseable and roles.purchase_order.add %}
{% if enable_buy and enable_po %}
<button type='button' class='btn btn-default' id='part-order' title='{% trans "Order part" %}'>
<span id='part-order-icon' class='fas fa-shopping-cart'/>
</button>