mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Refactoring for "stock" pages
This commit is contained in:
parent
707a03c416
commit
e178a2c370
@ -524,10 +524,6 @@
|
|||||||
font-size: 125%;
|
font-size: 125%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-group {
|
|
||||||
padding-bottom: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.action-buttons .btn {
|
.action-buttons .btn {
|
||||||
font-size: 175%;
|
font-size: 175%;
|
||||||
align-content: center;
|
align-content: center;
|
||||||
|
@ -120,17 +120,19 @@
|
|||||||
<h4>{% trans "Parts" %}</h4>
|
<h4>{% trans "Parts" %}</h4>
|
||||||
</div>
|
</div>
|
||||||
<div id='part-button-toolbar'>
|
<div id='part-button-toolbar'>
|
||||||
<div class='btn-group'>
|
<div class='btn-group' role='group'>
|
||||||
<button class='btn btn-default' id='part-export' title='{% trans "Export Part Data" %}'>
|
<button type='button' class='btn btn-outline-secondary' id='part-export' title='{% trans "Export Part Data" %}'>
|
||||||
<span class='fas fa-file-download'></span> {% trans "Export" %}
|
<span class='fas fa-file-download'></span> {% trans "Export" %}
|
||||||
</button>
|
</button>
|
||||||
{% if roles.part.add %}
|
{% if roles.part.add %}
|
||||||
<button class='btn btn-success' id='part-create' title='{% trans "Create new part" %}'>
|
<button type='button' class='btn btn-success' id='part-create' title='{% trans "Create new part" %}'>
|
||||||
<span class='fas fa-plus-circle'></span> {% trans "New Part" %}
|
<span class='fas fa-plus-circle'></span> {% trans "New Part" %}
|
||||||
</button>
|
</button>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<div class='btn-group'>
|
<div class='btn-group' role='group'>
|
||||||
<button id='part-options' class='btn btn-primary dropdown-toggle' type='button' data-toggle="dropdown">{% trans "Options" %} <span class='caret'></span></button>
|
<button id='part-options' class='btn btn-primary dropdown-toggle' type='button' data-bs-toggle="dropdown">
|
||||||
|
{% trans "Options" %}
|
||||||
|
</button>
|
||||||
<ul class='dropdown-menu'>
|
<ul class='dropdown-menu'>
|
||||||
{% if roles.part.change %}
|
{% if roles.part.change %}
|
||||||
<li><a href='#' id='multi-part-category' title='{% trans "Set category" %}'>{% trans "Set Category" %}</a></li>
|
<li><a href='#' id='multi-part-category' title='{% trans "Set category" %}'>{% trans "Set Category" %}</a></li>
|
||||||
@ -141,7 +143,7 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<!-- Buttons to toggle between grid and table view -->
|
<!-- Buttons to toggle between grid and table view -->
|
||||||
<button id='view-list' class='btn btn-default' type='button' title='{% trans "View list display" %}'>
|
<button id='view-list' class='btn btn-outline-secondary' type='button' title='{% trans "View list display" %}'>
|
||||||
<span class='fas fa-th-list'></span>
|
<span class='fas fa-th-list'></span>
|
||||||
</button>
|
</button>
|
||||||
<button id='view-grid' class='btn btn-default' type='button' title='{% trans "View grid display" %}'>
|
<button id='view-grid' class='btn btn-default' type='button' title='{% trans "View grid display" %}'>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{% extends "two_column.html" %}
|
{% extends "page_base.html" %}
|
||||||
{% load static %}
|
{% load static %}
|
||||||
{% load inventree_extras %}
|
{% load inventree_extras %}
|
||||||
{% load status_codes %}
|
{% load status_codes %}
|
||||||
@ -16,154 +16,153 @@
|
|||||||
{% include 'stock/loc_link.html' with location=item.location %}
|
{% include 'stock/loc_link.html' with location=item.location %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block thumbnail %}
|
{% block heading %}
|
||||||
<img class='part-thumb' {% if item.part.image %}src="{{ item.part.image.url }}"{% else %}src="{% static 'img/blank_image.png' %}"{% endif %}/>
|
<h4>
|
||||||
|
{% trans "Stock Item Details" %}
|
||||||
|
</h4>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block page_data %}
|
{% block details_left %}
|
||||||
|
<div class='media-left'>
|
||||||
|
<img class='part-thumb' {% if item.part.image %}src="{{ item.part.image.url }}"{% else %}src="{% static 'img/blank_image.png' %}"{% endif %}/>
|
||||||
|
</div>
|
||||||
|
<div class='media-body'>
|
||||||
|
|
||||||
{% setting_object 'STOCK_OWNERSHIP_CONTROL' as owner_control %}
|
{% setting_object 'STOCK_OWNERSHIP_CONTROL' as owner_control %}
|
||||||
{% if owner_control.value == "True" %}
|
{% if owner_control.value == "True" %}
|
||||||
{% authorized_owners item.owner as owners %}
|
{% authorized_owners item.owner as owners %}
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
<h3>
|
|
||||||
{% trans "Stock Item" %}
|
|
||||||
{% if item.is_expired %}
|
|
||||||
<span class='label label-large label-large-red'>{% trans "Expired" %}</span>
|
|
||||||
{% else %}
|
|
||||||
{% if roles.stock.change %}
|
|
||||||
<a href='#' id='stock-edit-status'>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% stock_status_label item.status large=True %}
|
|
||||||
{% if roles.stock.change %}
|
<h3>
|
||||||
|
{% trans "Stock Item" %}
|
||||||
|
{% if item.is_expired %}
|
||||||
|
<span class='label label-large label-large-red'>{% trans "Expired" %}</span>
|
||||||
|
{% else %}
|
||||||
|
{% if roles.stock.change %}
|
||||||
|
<a href='#' id='stock-edit-status'>
|
||||||
|
{% endif %}
|
||||||
|
{% stock_status_label item.status large=True %}
|
||||||
|
{% if roles.stock.change %}
|
||||||
|
</a>
|
||||||
|
{% endif %}
|
||||||
|
{% if item.is_stale %}
|
||||||
|
<span class='label label-large label-large-yellow'>{% trans "Stale" %}</span>
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
</h3>
|
||||||
|
<hr>
|
||||||
|
<h4>
|
||||||
|
{% if roles.part.view %}
|
||||||
|
<a href='{% url "part-detail" item.part.pk %}'>
|
||||||
|
{% endif %}
|
||||||
|
{{ item.part.full_name}}
|
||||||
|
{% if roles.part.view %}
|
||||||
</a>
|
</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if item.is_stale %}
|
{% if item.serialized %}
|
||||||
<span class='label label-large label-large-yellow'>{% trans "Stale" %}</span>
|
# {{ item.serial }}
|
||||||
|
{% else %}
|
||||||
|
× {% decimal item.quantity %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% if user.is_staff and roles.stock.change %}
|
||||||
|
<a href="{% url 'admin:stock_stockitem_change' item.pk %}"><span title="{% trans 'Admin view' %}" class='fas fa-user-shield'></span></a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</h3>
|
|
||||||
<hr>
|
|
||||||
<h4>
|
|
||||||
{% if roles.part.view %}
|
|
||||||
<a href='{% url "part-detail" item.part.pk %}'>
|
|
||||||
{% endif %}
|
|
||||||
{{ item.part.full_name}}
|
|
||||||
{% if roles.part.view %}
|
|
||||||
</a>
|
|
||||||
{% endif %}
|
|
||||||
{% if item.serialized %}
|
|
||||||
# {{ item.serial }}
|
|
||||||
{% else %}
|
|
||||||
× {% decimal item.quantity %}
|
|
||||||
{% endif %}
|
|
||||||
{% if user.is_staff and roles.stock.change %}
|
|
||||||
<a href="{% url 'admin:stock_stockitem_change' item.pk %}"><span title="{% trans 'Admin view' %}" class='fas fa-user-shield'></span></a>
|
|
||||||
{% endif %}
|
|
||||||
</h4>
|
</h4>
|
||||||
|
|
||||||
<div class='btn-group' role='group'>
|
<div class='btn-group' role='group'>
|
||||||
|
|
||||||
</div>
|
{% if barcodes %}
|
||||||
|
<!-- Barcode actions menu -->
|
||||||
<div class='btn-group action-buttons' role='group'>
|
|
||||||
|
|
||||||
{% if barcodes %}
|
|
||||||
<!-- Barcode actions menu -->
|
|
||||||
<div class='btn-group'>
|
|
||||||
<button id='barcode-options' title='{% trans "Barcode actions" %}' class='btn btn-default dropdown-toggle' type='button' data-toggle='dropdown'>
|
|
||||||
<span class='fas fa-qrcode'></span> <span class='caret'></span>
|
|
||||||
</button>
|
|
||||||
<ul class='dropdown-menu' role='menu'>
|
|
||||||
<li><a href='#' id='show-qr-code'><span class='fas fa-qrcode'></span> {% trans "Show QR Code" %}</a></li>
|
|
||||||
{% if roles.stock.change %}
|
|
||||||
{% if item.uid %}
|
|
||||||
<li><a href='#' id='barcode-unlink'><span class='fas fa-unlink'></span> {% trans "Unlink Barcode" %}</a></li>
|
|
||||||
{% else %}
|
|
||||||
<li><a href='#' id='barcode-link'><span class='fas fa-link'></span> {% trans "Link Barcode" %}</a></li>
|
|
||||||
{% endif %}
|
|
||||||
<li><a href='#' id='barcode-scan-into-location'><span class='fas fa-sitemap'></span> {% trans "Scan to Location" %}</a></li>
|
|
||||||
{% endif %}
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
<!-- Document / label menu -->
|
|
||||||
<div class='btn-group'>
|
|
||||||
<button id='document-options' title='{% trans "Printing actions" %}' class='btn btn-default dropdown-toggle' type='button' data-toggle='dropdown'><span class='fas fa-print'></span> <span class='caret'></span></button>
|
|
||||||
<ul class='dropdown-menu' role='menu'>
|
|
||||||
<li><a href='#' id='print-label'><span class='fas fa-tag'></span> {% trans "Print Label" %}</a></li>
|
|
||||||
{% if test_report_enabled %}
|
|
||||||
<li><a href='#' id='stock-test-report'><span class='fas fa-file-pdf'></span> {% trans "Test Report" %}</a></li>
|
|
||||||
{% endif %}
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
<!-- Stock adjustment menu -->
|
|
||||||
<!-- Check permissions and owner -->
|
|
||||||
{% if owner_control.value == "False" or owner_control.value == "True" and user in owners or user.is_superuser %}
|
|
||||||
{% if roles.stock.change and not item.is_building %}
|
|
||||||
<div class='btn-group'>
|
<div class='btn-group'>
|
||||||
<button id='stock-actions' title='{% trans "Stock adjustment actions" %}' class='btn btn-default dropdown-toggle' type='button' data-toggle='dropdown'><span class='fas fa-boxes'></span> <span class='caret'></span></button>
|
<button id='barcode-options' title='{% trans "Barcode actions" %}' class='btn btn-default dropdown-toggle' type='button' data-bs-toggle='dropdown'>
|
||||||
|
<span class='fas fa-qrcode'></span> <span class='caret'></span>
|
||||||
|
</button>
|
||||||
<ul class='dropdown-menu' role='menu'>
|
<ul class='dropdown-menu' role='menu'>
|
||||||
{% if not item.serialized %}
|
<li><a href='#' id='show-qr-code'><span class='fas fa-qrcode'></span> {% trans "Show QR Code" %}</a></li>
|
||||||
{% if item.in_stock %}
|
{% if roles.stock.change %}
|
||||||
<li><a href='#' id='stock-count' title='{% trans "Count stock" %}'><span class='fas fa-clipboard-list'></span> {% trans "Count stock" %}</a></li>
|
{% if item.uid %}
|
||||||
{% endif %}
|
<li><a href='#' id='barcode-unlink'><span class='fas fa-unlink'></span> {% trans "Unlink Barcode" %}</a></li>
|
||||||
{% if not item.customer %}
|
|
||||||
<li><a href='#' id='stock-add' title='{% trans "Add stock" %}'><span class='fas fa-plus-circle icon-green'></span> {% trans "Add stock" %}</a></li>
|
|
||||||
{% endif %}
|
|
||||||
{% if item.in_stock %}
|
|
||||||
<li><a href='#' id='stock-remove' title='{% trans "Remove stock" %}'><span class='fas fa-minus-circle icon-red'></span> {% trans "Remove stock" %}</a></li>
|
|
||||||
{% endif %}
|
|
||||||
{% if item.in_stock and item.part.trackable %}
|
|
||||||
<li><a href='#' id='stock-serialize' title='{% trans "Serialize stock" %}'><span class='fas fa-hashtag'></span> {% trans "Serialize stock" %}</a> </li>
|
|
||||||
{% endif %}
|
|
||||||
{% endif %}
|
|
||||||
{% if item.in_stock and item.can_adjust_location %}
|
|
||||||
<li><a href='#' id='stock-move' title='{% trans "Transfer stock" %}'><span class='fas fa-exchange-alt icon-blue'></span> {% trans "Transfer stock" %}</a></li>
|
|
||||||
{% endif %}
|
|
||||||
{% if item.in_stock and item.can_adjust_location and item.part.salable and not item.customer %}
|
|
||||||
<li><a href='#' id='stock-assign-to-customer' title='{% trans "Assign to customer" %}'><span class='fas fa-user-tie'></span> {% trans "Assign to customer" %}</a></li>
|
|
||||||
{% endif %}
|
|
||||||
{% if item.customer %}
|
|
||||||
<li><a href='#' id='stock-return-from-customer' title='{% trans "Return to stock" %}'><span class='fas fa-undo'></span> {% trans "Return to stock" %}</a></li>
|
|
||||||
{% endif %}
|
|
||||||
{% if item.belongs_to %}
|
|
||||||
<li><a href='#' id='stock-uninstall' title='{% trans "Uninstall stock item" %}'><span class='fas fa-unlink'></span> {% trans "Uninstall" %}</a></li>
|
|
||||||
{% else %}
|
{% else %}
|
||||||
{% if item.part.get_used_in %}
|
<li><a href='#' id='barcode-link'><span class='fas fa-link'></span> {% trans "Link Barcode" %}</a></li>
|
||||||
<li><a href='#' id='stock-install-in' title='{% trans "Install stock item" %}'><span class='fas fa-link'></span> {% trans "Install" %}</a></li>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
<li><a href='#' id='barcode-scan-into-location'><span class='fas fa-sitemap'></span> {% trans "Scan to Location" %}</a></li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<!-- Edit stock item -->
|
<!-- Document / label menu -->
|
||||||
{% if roles.stock.change and not item.is_building %}
|
|
||||||
<div class='btn-group'>
|
<div class='btn-group'>
|
||||||
<button id='stock-edit-actions' title='{% trans "Stock actions" %}' class='btn btn-default dropdown-toggle' type='button' data-toggle='dropdown'><span class='fas fa-tools'></span> <span class='caret'></span></button>
|
<button id='document-options' title='{% trans "Printing actions" %}' class='btn btn-default dropdown-toggle' type='button' data-bs-toggle='dropdown'><span class='fas fa-print'></span> <span class='caret'></span></button>
|
||||||
<ul class='dropdown-menu' role='menu'>
|
<ul class='dropdown-menu' role='menu'>
|
||||||
{% if item.part.can_convert %}
|
<li><a href='#' id='print-label'><span class='fas fa-tag'></span> {% trans "Print Label" %}</a></li>
|
||||||
<li><a href='#' id='stock-convert' title='{% trans "Convert to variant" %}'><span class='fas fa-screwdriver'></span> {% trans "Convert to variant" %}</a></li>
|
{% if test_report_enabled %}
|
||||||
{% endif %}
|
<li><a href='#' id='stock-test-report'><span class='fas fa-file-pdf'></span> {% trans "Test Report" %}</a></li>
|
||||||
{% if roles.stock.add %}
|
|
||||||
<li><a href='#' id='stock-duplicate' title='{% trans "Duplicate stock item" %}'><span class='fas fa-copy'></span> {% trans "Duplicate stock item" %}</a></li>
|
|
||||||
{% endif %}
|
|
||||||
<li><a href='#' id='stock-edit' title='{% trans "Edit stock item" %}'><span class='fas fa-edit icon-blue'></span> {% trans "Edit stock item" %}</a></li>
|
|
||||||
{% if user.is_staff or roles.stock.delete %}
|
|
||||||
{% if item.can_delete %}
|
|
||||||
<li><a href='#' id='stock-delete' title='{% trans "Delete stock item" %}'><span class='fas fa-trash-alt icon-red'></span> {% trans "Delete stock item" %}</a></li>
|
|
||||||
{% endif %}
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- Stock adjustment menu -->
|
||||||
|
<!-- Check permissions and owner -->
|
||||||
|
{% if owner_control.value == "False" or owner_control.value == "True" and user in owners or user.is_superuser %}
|
||||||
|
{% if roles.stock.change and not item.is_building %}
|
||||||
|
<div class='btn-group'>
|
||||||
|
<button id='stock-actions' title='{% trans "Stock adjustment actions" %}' class='btn btn-default dropdown-toggle' type='button' data-bs-toggle='dropdown'><span class='fas fa-boxes'></span> <span class='caret'></span></button>
|
||||||
|
<ul class='dropdown-menu' role='menu'>
|
||||||
|
{% if not item.serialized %}
|
||||||
|
{% if item.in_stock %}
|
||||||
|
<li><a href='#' id='stock-count' title='{% trans "Count stock" %}'><span class='fas fa-clipboard-list'></span> {% trans "Count stock" %}</a></li>
|
||||||
|
{% endif %}
|
||||||
|
{% if not item.customer %}
|
||||||
|
<li><a href='#' id='stock-add' title='{% trans "Add stock" %}'><span class='fas fa-plus-circle icon-green'></span> {% trans "Add stock" %}</a></li>
|
||||||
|
{% endif %}
|
||||||
|
{% if item.in_stock %}
|
||||||
|
<li><a href='#' id='stock-remove' title='{% trans "Remove stock" %}'><span class='fas fa-minus-circle icon-red'></span> {% trans "Remove stock" %}</a></li>
|
||||||
|
{% endif %}
|
||||||
|
{% if item.in_stock and item.part.trackable %}
|
||||||
|
<li><a href='#' id='stock-serialize' title='{% trans "Serialize stock" %}'><span class='fas fa-hashtag'></span> {% trans "Serialize stock" %}</a> </li>
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
{% if item.in_stock and item.can_adjust_location %}
|
||||||
|
<li><a href='#' id='stock-move' title='{% trans "Transfer stock" %}'><span class='fas fa-exchange-alt icon-blue'></span> {% trans "Transfer stock" %}</a></li>
|
||||||
|
{% endif %}
|
||||||
|
{% if item.in_stock and item.can_adjust_location and item.part.salable and not item.customer %}
|
||||||
|
<li><a href='#' id='stock-assign-to-customer' title='{% trans "Assign to customer" %}'><span class='fas fa-user-tie'></span> {% trans "Assign to customer" %}</a></li>
|
||||||
|
{% endif %}
|
||||||
|
{% if item.customer %}
|
||||||
|
<li><a href='#' id='stock-return-from-customer' title='{% trans "Return to stock" %}'><span class='fas fa-undo'></span> {% trans "Return to stock" %}</a></li>
|
||||||
|
{% endif %}
|
||||||
|
{% if item.belongs_to %}
|
||||||
|
<li><a href='#' id='stock-uninstall' title='{% trans "Uninstall stock item" %}'><span class='fas fa-unlink'></span> {% trans "Uninstall" %}</a></li>
|
||||||
|
{% else %}
|
||||||
|
{% if item.part.get_used_in %}
|
||||||
|
<li><a href='#' id='stock-install-in' title='{% trans "Install stock item" %}'><span class='fas fa-link'></span> {% trans "Install" %}</a></li>
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
<!-- Edit stock item -->
|
||||||
|
{% if roles.stock.change and not item.is_building %}
|
||||||
|
<div class='btn-group'>
|
||||||
|
<button id='stock-edit-actions' title='{% trans "Stock actions" %}' class='btn btn-default dropdown-toggle' type='button' data-bs-toggle='dropdown'><span class='fas fa-tools'></span> <span class='caret'></span></button>
|
||||||
|
<ul class='dropdown-menu' role='menu'>
|
||||||
|
{% if item.part.can_convert %}
|
||||||
|
<li><a href='#' id='stock-convert' title='{% trans "Convert to variant" %}'><span class='fas fa-screwdriver'></span> {% trans "Convert to variant" %}</a></li>
|
||||||
|
{% endif %}
|
||||||
|
{% if roles.stock.add %}
|
||||||
|
<li><a href='#' id='stock-duplicate' title='{% trans "Duplicate stock item" %}'><span class='fas fa-copy'></span> {% trans "Duplicate stock item" %}</a></li>
|
||||||
|
{% endif %}
|
||||||
|
<li><a href='#' id='stock-edit' title='{% trans "Edit stock item" %}'><span class='fas fa-edit icon-blue'></span> {% trans "Edit stock item" %}</a></li>
|
||||||
|
{% if user.is_staff or roles.stock.delete %}
|
||||||
|
{% if item.can_delete %}
|
||||||
|
<li><a href='#' id='stock-delete' title='{% trans "Delete stock item" %}'><span class='fas fa-trash-alt icon-red'></span> {% trans "Delete stock item" %}</a></li>
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% endblock %}
|
|
||||||
|
|
||||||
{% block below_thumbnail %}
|
|
||||||
<div class='info-messages'>
|
<div class='info-messages'>
|
||||||
|
|
||||||
{% setting_object 'STOCK_OWNERSHIP_CONTROL' as owner_control %}
|
{% setting_object 'STOCK_OWNERSHIP_CONTROL' as owner_control %}
|
||||||
@ -230,8 +229,7 @@
|
|||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block page_details %}
|
{% block details_right %}
|
||||||
<h4>{% trans "Stock Item Details" %}</h4>
|
|
||||||
<table class="table table-striped">
|
<table class="table table-striped">
|
||||||
<col width='25'>
|
<col width='25'>
|
||||||
<tr>
|
<tr>
|
||||||
@ -432,9 +430,9 @@
|
|||||||
</tr>
|
</tr>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
|
||||||
{% block js_ready %}
|
{% block js_ready %}
|
||||||
{{ block.super }}
|
{{ block.super }}
|
||||||
|
|
||||||
|
@ -11,133 +11,137 @@
|
|||||||
|
|
||||||
<div class='panel panel-default panel-inventree'>
|
<div class='panel panel-default panel-inventree'>
|
||||||
|
|
||||||
{% setting_object 'STOCK_OWNERSHIP_CONTROL' as owner_control %}
|
<div class='panel-heading'>
|
||||||
{% if owner_control.value == "True" %}
|
<h4>
|
||||||
{% authorized_owners location.owner as owners %}
|
{% if location %}
|
||||||
|
{{ location.name }}
|
||||||
|
{% if location %}
|
||||||
|
{% if user.is_staff and roles.stock_location.change %}
|
||||||
|
<a href="{% url 'admin:stock_stocklocation_change' location.pk %}"><span title="{% trans 'Admin view' %}" class='fas fa-user-shield'></span></a>
|
||||||
|
{% endif %}
|
||||||
|
</h3>
|
||||||
|
{% else %}
|
||||||
|
<h3>{% trans "Stock" %}</h3>
|
||||||
|
<p>{% trans "All stock items" %}</p>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% if location and not user in owners and not user.is_superuser %}
|
{% else %}
|
||||||
<div class='alert alert-block alert-info'>
|
{% trans "Stock" %}
|
||||||
{% trans "You are not in the list of owners of this location. This stock location cannot be edited." %}<br>
|
{% endif %}
|
||||||
|
</h4>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
<div class='row'>
|
<div class='panel-content'>
|
||||||
<div class='col-sm-6'>
|
|
||||||
{% if location %}
|
{% setting_object 'STOCK_OWNERSHIP_CONTROL' as owner_control %}
|
||||||
<h3>
|
{% if owner_control.value == "True" %}
|
||||||
{{ location.name }}
|
{% authorized_owners location.owner as owners %}
|
||||||
{% if user.is_staff and roles.stock_location.change %}
|
|
||||||
<a href="{% url 'admin:stock_stocklocation_change' location.pk %}"><span title="{% trans 'Admin view' %}" class='fas fa-user-shield'></span></a>
|
{% if location and not user in owners and not user.is_superuser %}
|
||||||
{% endif %}
|
<div class='alert alert-block alert-info'>
|
||||||
</h3>
|
{% trans "You are not in the list of owners of this location. This stock location cannot be edited." %}<br>
|
||||||
<p>{{ location.description }}</p>
|
|
||||||
{% else %}
|
|
||||||
<h3>{% trans "Stock" %}</h3>
|
|
||||||
<p>{% trans "All stock items" %}</p>
|
|
||||||
{% endif %}
|
|
||||||
<div class='btn-group action-buttons' role='group'>
|
|
||||||
{% if owner_control.value == "False" or owner_control.value == "True" and user in owners or user.is_superuser or not location %}
|
|
||||||
{% if roles.stock_location.add %}
|
|
||||||
<button class='btn btn-default' id='location-create' title='{% trans "Create new stock location" %}'>
|
|
||||||
<span class='fas fa-plus-circle icon-green'/>
|
|
||||||
</button>
|
|
||||||
{% endif %}
|
|
||||||
{% endif %}
|
|
||||||
{% if barcodes %}
|
|
||||||
<!-- Barcode actions menu -->
|
|
||||||
{% if location %}
|
|
||||||
<div class='btn-group'>
|
|
||||||
<button id='barcode-options' title='{% trans "Barcode actions" %}' class='btn btn-default dropdown-toggle' type='button' data-toggle='dropdown'><span class='fas fa-qrcode'></span> <span class='caret'></span></button>
|
|
||||||
<ul class='dropdown-menu' role='menu'>
|
|
||||||
<li><a href='#' id='show-qr-code'><span class='fas fa-qrcode'></span> {% trans "Show QR Code" %}</a></li>
|
|
||||||
<li><a href='#' id='print-label'><span class='fas fa-tag'></span> {% trans "Print Label" %}</a></li>
|
|
||||||
<li><a href='#' id='barcode-check-in'><span class='fas fa-arrow-right'></span> {% trans "Check-in Items" %}</a></li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
</div>
|
||||||
<!-- Check permissions and owner -->
|
{% endif %}
|
||||||
{% if owner_control.value == "False" or owner_control.value == "True" and user in owners or user.is_superuser %}
|
{% endif %}
|
||||||
{% if roles.stock.change %}
|
|
||||||
<div class='btn-group'>
|
<div class='row'>
|
||||||
<button id='stock-actions' title='{% trans "Stock actions" %}' class='btn btn-default dropdown-toggle' type='button' data-toggle='dropdown'>
|
<div class='col-sm-6'>
|
||||||
<span class='fas fa-boxes'></span> <span class='caret'></span>
|
<div class='btn-group' role='group'>
|
||||||
</button>
|
{% if owner_control.value == "False" or owner_control.value == "True" and user in owners or user.is_superuser or not location %}
|
||||||
<ul class='dropdown-menu' role='menu'>
|
{% if roles.stock_location.add %}
|
||||||
<li>
|
<button class='btn btn-success' id='location-create' title='{% trans "Create new stock location" %}'>
|
||||||
<a href='#' id='location-count'>
|
<span class='fas fa-plus-circle'/>
|
||||||
<span class='fas fa-clipboard-list'></span>
|
</button>
|
||||||
{% trans "Count stock" %}
|
{% endif %}
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<a href='#' id='location-move'>
|
|
||||||
<span class='fas fa-exchange-alt'></span>
|
|
||||||
{% trans "Transfer stock" %}
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if roles.stock_location.change %}
|
{% if barcodes %}
|
||||||
<div class='btn-group'>
|
<!-- Barcode actions menu -->
|
||||||
<button id='location-actions' title='{% trans "Location actions" %}' class='btn btn-default dropdown-toggle' type='button' data-toggle="dropdown"><span class='fas fa-sitemap'></span> <span class='caret'></span></button>
|
{% if location %}
|
||||||
<ul class='dropdown-menu' role='menu'>
|
<div class='btn-group' role='group'>
|
||||||
<li><a href='#' id='location-edit'><span class='fas fa-edit icon-green'></span> {% trans "Edit location" %}</a></li>
|
<button id='barcode-options' title='{% trans "Barcode actions" %}' class='btn btn-outline-secondary dropdown-toggle' type='button' data-bs-toggle='dropdown'><span class='fas fa-qrcode'></span> <span class='caret'></span></button>
|
||||||
{% if roles.stock.delete %}
|
<ul class='dropdown-menu'>
|
||||||
<li><a href='#' id='location-delete'><span class='fas fa-trash-alt icon-red'></span> {% trans "Delete location" %}</a></li>
|
<li><a class='dropdown-item' href='#' id='show-qr-code'><span class='fas fa-qrcode'></span> {% trans "Show QR Code" %}</a></li>
|
||||||
{% endif %}
|
<li><a class='dropdown-item' href='#' id='print-label'><span class='fas fa-tag'></span> {% trans "Print Label" %}</a></li>
|
||||||
|
<li><a class='dropdown-item' href='#' id='barcode-check-in'><span class='fas fa-arrow-right'></span> {% trans "Check-in Items" %}</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- Check permissions and owner -->
|
||||||
|
{% if owner_control.value == "False" or owner_control.value == "True" and user in owners or user.is_superuser %}
|
||||||
|
{% if roles.stock.change %}
|
||||||
|
<div class='btn-group' role='group'>
|
||||||
|
<button id='stock-actions' title='{% trans "Stock actions" %}' class='btn btn-outline-secondary dropdown-toggle' type='button' data-bs-toggle='dropdown'>
|
||||||
|
<span class='fas fa-boxes'></span> <span class='caret'></span>
|
||||||
|
</button>
|
||||||
|
<ul class='dropdown-menu' role='menu'>
|
||||||
|
<li>
|
||||||
|
<a class='dropdown-item' href='#' id='location-count'>
|
||||||
|
<span class='fas fa-clipboard-list'></span>
|
||||||
|
{% trans "Count stock" %}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a class='dropdown-item' href='#' id='location-move'>
|
||||||
|
<span class='fas fa-exchange-alt'></span>
|
||||||
|
{% trans "Transfer stock" %}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
{% if roles.stock_location.change %}
|
||||||
|
<div class='btn-group' role='group'>
|
||||||
|
<button id='location-actions' title='{% trans "Location actions" %}' class='btn btn-outline-secondary dropdown-toggle' type='button' data-bs-toggle="dropdown"><span class='fas fa-sitemap'></span> <span class='caret'></span></button>
|
||||||
|
<ul class='dropdown-menu' role='menu'>
|
||||||
|
<li><a class='dropdown-item' href='#' id='location-edit'><span class='fas fa-edit icon-green'></span> {% trans "Edit location" %}</a></li>
|
||||||
|
{% if roles.stock.delete %}
|
||||||
|
<li><a class='dropdown-item' href='#' id='location-delete'><span class='fas fa-trash-alt icon-red'></span> {% trans "Delete location" %}</a></li>
|
||||||
|
{% endif %}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
</div>
|
||||||
{% endif %}
|
</div>
|
||||||
|
<div class='col-sm-6'>
|
||||||
|
{% if location %}
|
||||||
|
<table class='table table-striped table-condensed'>
|
||||||
|
<col width='25'>
|
||||||
|
<tr>
|
||||||
|
<td><span class='fas fa-info-circle'></span></td>
|
||||||
|
<td>{% trans "Description" %}</td>
|
||||||
|
<td>{{ location.description }}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><span class='fas fa-map-marker-alt'></span></td>
|
||||||
|
<td>{% trans "Sublocations" %}</td>
|
||||||
|
<td>{{ location.children.count }}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><span class='fas fa-boxes'></span></td>
|
||||||
|
<td>{% trans "Stock Items" %}</td>
|
||||||
|
<td>{{ location.item_count }}</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
{% else %}
|
||||||
|
<h3>{% trans "Stock Details" %}</h3>
|
||||||
|
<table class='table table-striped table-condensed'>
|
||||||
|
<col width='25'>
|
||||||
|
<tr>
|
||||||
|
<td><span class='fas fa-map-marker-alt'></span></td>
|
||||||
|
<td>{% trans "Stock Locations" %}</td>
|
||||||
|
<td>{{ loc_count }}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><span class='fas fa-boxes'></span></td>
|
||||||
|
<td>{% trans "Stock Items" %}</td>
|
||||||
|
<td>{{ stock_count }}</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class='col-sm-6'>
|
|
||||||
{% if location %}
|
|
||||||
<h3>{% trans "Location Details" %}</h3>
|
|
||||||
<table class='table table-striped table-condensed'>
|
|
||||||
<col width='25'>
|
|
||||||
<tr>
|
|
||||||
<td><span class='fas fa-sitemap'></span></td>
|
|
||||||
<td>{% trans "Location Path" %}</td>
|
|
||||||
<td>{{ location.pathstring }}</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><span class='fas fa-info-circle'></span></td>
|
|
||||||
<td>{% trans "Location Description" %}</td>
|
|
||||||
<td>{{ location.description }}</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><span class='fas fa-map-marker-alt'></span></td>
|
|
||||||
<td>{% trans "Sublocations" %}</td>
|
|
||||||
<td>{{ location.children.count }}</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><span class='fas fa-boxes'></span></td>
|
|
||||||
<td>{% trans "Stock Items" %}</td>
|
|
||||||
<td>{{ location.item_count }}</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
{% else %}
|
|
||||||
<h3>{% trans "Stock Details" %}</h3>
|
|
||||||
<table class='table table-striped table-condensed'>
|
|
||||||
<col width='25'>
|
|
||||||
<tr>
|
|
||||||
<td><span class='fas fa-map-marker-alt'></span></td>
|
|
||||||
<td>{% trans "Stock Locations" %}</td>
|
|
||||||
<td>{{ loc_count }}</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><span class='fas fa-boxes'></span></td>
|
|
||||||
<td>{% trans "Stock Items" %}</td>
|
|
||||||
<td>{{ stock_count }}</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
</h3>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -147,7 +151,9 @@
|
|||||||
<div class='panel-heading'>
|
<div class='panel-heading'>
|
||||||
<h4>{% trans "Stock Items" %}</h4>
|
<h4>{% trans "Stock Items" %}</h4>
|
||||||
</div>
|
</div>
|
||||||
{% include "stock_table.html" %}
|
<div class='panel-content'>
|
||||||
|
{% include "stock_table.html" %}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class='panel panel-default panel-inventree panel-hidden' id='panel-sublocations'>
|
<div class='panel panel-default panel-inventree panel-hidden' id='panel-sublocations'>
|
||||||
@ -156,14 +162,14 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class='panel-content'>
|
<div class='panel-content'>
|
||||||
<div id='sublocation-button-toolbar'>
|
<div id='sublocation-button-toolbar'>
|
||||||
<div class='button-toolbar container-fluid' style='float: right;'>
|
<div class='btn-group' role='group'>
|
||||||
<!-- Printing actions menu -->
|
<!-- Printing actions menu -->
|
||||||
<div class='btn-group'>
|
<div class='btn-group' role='group'>
|
||||||
<button id='location-print-options' class='btn btn-primary dropdown-toggle' type='button' data-toggle="dropdown" title='{% trans "Printing Actions" %}'>
|
<button id='location-print-options' class='btn btn-outline-secondary dropdown-toggle' type='button' data-bs-toggle="dropdown" title='{% trans "Printing Actions" %}'>
|
||||||
<span class='fas fa-print'></span> <span class='caret'></span>
|
<span class='fas fa-print'></span> <span class='caret'></span>
|
||||||
</button>
|
</button>
|
||||||
<ul class='dropdown-menu'>
|
<ul class='dropdown-menu'>
|
||||||
<li><a href='#' id='multi-location-print-label' title='{% trans "Print labels" %}'><span class='fas fa-tags'></span> {% trans "Print labels" %}</a></li>
|
<li><a class='dropdown-item' href='#' id='multi-location-print-label' title='{% trans "Print labels" %}'><span class='fas fa-tags'></span> {% trans "Print labels" %}</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class='filter-list' id='filter-list-location'>
|
<div class='filter-list' id='filter-list-location'>
|
||||||
|
@ -71,15 +71,16 @@
|
|||||||
|
|
||||||
<div class='inventree-body'>
|
<div class='inventree-body'>
|
||||||
|
|
||||||
|
{% block breadcrumb_list %}
|
||||||
<div class='container-fluid'>
|
<div class='container-fluid'>
|
||||||
<nav aria-label='breadcrumb'>
|
<nav aria-label='breadcrumb'>
|
||||||
<ol class='breadcrumb'>
|
<ol class='breadcrumb'>
|
||||||
{% block breadcrumbs %}
|
{% block breadcrumbs %}
|
||||||
<li class='breadcrumb-item active'>Breadcrumbs Go Here!</li>
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
</ol>
|
</ol>
|
||||||
</nav>
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
<div class='containter-fluid inventree-pre-content'>
|
<div class='containter-fluid inventree-pre-content'>
|
||||||
{% block pre_content %}
|
{% block pre_content %}
|
||||||
|
36
InvenTree/templates/page_base.html
Normal file
36
InvenTree/templates/page_base.html
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
{% extends "base.html" %}
|
||||||
|
|
||||||
|
{% load static %}
|
||||||
|
{% load i18n %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
|
||||||
|
<div class='panel panel-default panel-inventree'>
|
||||||
|
<div class='panel-heading'>
|
||||||
|
{% block heading %}
|
||||||
|
block heading
|
||||||
|
{% endblock %}
|
||||||
|
</div>
|
||||||
|
<div class='panel-content'>
|
||||||
|
{% block details %}
|
||||||
|
<div class='row'>
|
||||||
|
<div class='col-sm-6' id='detail-panel-left'>
|
||||||
|
{% block details_left %}
|
||||||
|
block details_left
|
||||||
|
{% endblock %}
|
||||||
|
</div>
|
||||||
|
<div class='col-sm-6' id='detail-panel-right'>
|
||||||
|
{% block details_right %}
|
||||||
|
block details_right
|
||||||
|
{% endblock %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endblock %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{% block page_content %}
|
||||||
|
block page_content
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% endblock %}
|
Loading…
Reference in New Issue
Block a user