mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-29 20:16:44 +00:00
StockItem display now uses menubar
This commit is contained in:
parent
888fd4116c
commit
89bdfd1c62
@ -4,16 +4,21 @@
|
|||||||
{% load inventree_extras %}
|
{% load inventree_extras %}
|
||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
|
|
||||||
{% block details %}
|
{% block menubar %}
|
||||||
|
{% include "stock/navbar.html" with tab="tracking" %}
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
{% include "stock/tabs.html" with tab="tracking" %}
|
{% block heading %}
|
||||||
|
{% trans "Stock Tracking Information" %}
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block details %}
|
||||||
|
|
||||||
{% 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 %}
|
{% endif %}
|
||||||
|
|
||||||
<h4>{% trans "Stock Tracking Information" %}</h4>
|
|
||||||
<hr>
|
<hr>
|
||||||
|
|
||||||
<!-- Check permissions and owner -->
|
<!-- Check permissions and owner -->
|
||||||
|
@ -3,13 +3,15 @@
|
|||||||
{% load static %}
|
{% load static %}
|
||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
|
|
||||||
|
{% block menubar %}
|
||||||
|
{% include "stock/navbar.html" with tab='attachments' %}
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block heading %}
|
||||||
|
{% trans "Stock Item Attachments" %}
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
{% block details %}
|
{% block details %}
|
||||||
|
|
||||||
{% include "stock/tabs.html" with tab='attachments' %}
|
|
||||||
|
|
||||||
<h4>{% trans "Stock Item Attachments" %}</h4>
|
|
||||||
<hr>
|
|
||||||
|
|
||||||
{% include "attachment_table.html" with attachments=item.attachments.all %}
|
{% include "attachment_table.html" with attachments=item.attachments.all %}
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -381,9 +381,12 @@ InvenTree | {% trans "Stock Item" %} - {{ item }}
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block js_ready %}
|
{% block js_ready %}
|
||||||
|
|
||||||
{{ block.super }}
|
{{ block.super }}
|
||||||
|
|
||||||
|
enableRightNavbar({
|
||||||
|
minWidth: '50px'
|
||||||
|
});
|
||||||
|
|
||||||
loadTree("{% url 'api-stock-tree' %}",
|
loadTree("{% url 'api-stock-tree' %}",
|
||||||
"#stock-tree",
|
"#stock-tree",
|
||||||
{
|
{
|
||||||
|
@ -3,14 +3,16 @@
|
|||||||
{% load static %}
|
{% load static %}
|
||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
|
|
||||||
|
|
||||||
|
{% block menubar %}
|
||||||
|
{% include "stock/navbar.html" with tab='children' %}
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block heading %}
|
||||||
|
{% trans "Child Stock Items" %}
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
{% block details %}
|
{% block details %}
|
||||||
|
|
||||||
{% include "stock/tabs.html" with tab='children' %}
|
|
||||||
|
|
||||||
<hr>
|
|
||||||
|
|
||||||
<h4>{% trans "Child Stock Items" %}</h4>
|
|
||||||
|
|
||||||
{% if item.child_count > 0 %}
|
{% if item.child_count > 0 %}
|
||||||
{% include "stock_table.html" %}
|
{% include "stock_table.html" %}
|
||||||
{% else %}
|
{% else %}
|
||||||
|
@ -3,13 +3,15 @@
|
|||||||
{% load static %}
|
{% load static %}
|
||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
|
|
||||||
|
{% block menubar %}
|
||||||
|
{% include "stock/navbar.html" with tab='installed' %}
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block heading %}
|
||||||
|
{% trans "Installed Stock Items" %}
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
{% block details %}
|
{% block details %}
|
||||||
|
|
||||||
{% include "stock/tabs.html" with tab='installed' %}
|
|
||||||
|
|
||||||
<h4>{% trans "Installed Stock Items" %}</h4>
|
|
||||||
<hr>
|
|
||||||
|
|
||||||
<table class='table table-striped table-condensed' id='installed-table'></table>
|
<table class='table table-striped table-condensed' id='installed-table'></table>
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -5,15 +5,16 @@
|
|||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
{% load markdownify %}
|
{% load markdownify %}
|
||||||
|
|
||||||
|
{% block menubar %}
|
||||||
|
{% include "stock/navbar.html" with tab="notes" %}
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block heading %}
|
||||||
|
{% trans "Stock Item Notes" %}
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
{% block details %}
|
{% block details %}
|
||||||
|
|
||||||
{% include "stock/tabs.html" with tab="notes" %}
|
|
||||||
|
|
||||||
{% if editing %}
|
{% if editing %}
|
||||||
|
|
||||||
<h4>{% trans "Stock Item Notes" %}</h4>
|
|
||||||
<hr>
|
|
||||||
|
|
||||||
<form method='POST'>
|
<form method='POST'>
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
|
|
||||||
@ -25,22 +26,10 @@
|
|||||||
{{ form.media }}
|
{{ form.media }}
|
||||||
|
|
||||||
{% else %}
|
{% else %}
|
||||||
<div class='row'>
|
<button title='{% trans "Edit notes" %}' class='btn btn-default action-button' id='edit-notes'><span class='fas fa-edit'></span></button>
|
||||||
<div class='col-sm-6'>
|
{% if item.notes %}
|
||||||
<h4>{% trans "Stock Item Notes" %}</h4>
|
{{ item.notes | markdownify }}
|
||||||
</div>
|
{% endif %}
|
||||||
<div class='col-sm-6'>
|
|
||||||
<button title='{% trans "Edit notes" %}' class='btn btn-default action-button float-right' id='edit-notes'><span class='fas fa-edit'></span></button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<hr>
|
|
||||||
<div class='panel panel-default'>
|
|
||||||
<div class='panel-content'>
|
|
||||||
{% if item.notes %}
|
|
||||||
{{ item.notes | markdownify }}
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
@ -3,13 +3,15 @@
|
|||||||
{% load static %}
|
{% load static %}
|
||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
|
|
||||||
|
{% block menubar %}
|
||||||
|
{% include "stock/navbar.html" with tab='tests' %}
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block heading %}
|
||||||
|
{% trans "Test Data" %}
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
{% block details %}
|
{% block details %}
|
||||||
|
|
||||||
{% include "stock/tabs.html" with tab='tests' %}
|
|
||||||
|
|
||||||
<h4>{% trans "Test Data" %}</h4>
|
|
||||||
<hr>
|
|
||||||
|
|
||||||
<div id='button-toolbar'>
|
<div id='button-toolbar'>
|
||||||
<div class='button-toolbar container-fluid' style="float: right;">
|
<div class='button-toolbar container-fluid' style="float: right;">
|
||||||
<div class='btn-group' role='group'>
|
<div class='btn-group' role='group'>
|
||||||
|
61
InvenTree/stock/templates/stock/navbar.html
Normal file
61
InvenTree/stock/templates/stock/navbar.html
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
{% load i18n %}
|
||||||
|
|
||||||
|
<ul class='list-group'>
|
||||||
|
|
||||||
|
<li class='list-group-item'>
|
||||||
|
<a href='#' id='company-menu-toggle'>
|
||||||
|
<span class='menu-tab-icon fas fa-expand-arrows-alt'></span>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class='list-group-item {% if tab == "tracking" %}active{% endif %}' title='{% trans "Stock Item Tracking" %}'>
|
||||||
|
<a href='{% url "stock-item-detail" item.id %}'>
|
||||||
|
<span class='fas fa-history'></span>
|
||||||
|
{% trans "History" %}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
{% if item.part.trackable %}
|
||||||
|
<li class='list-group-item {% if tab == "tests" %}active{% endif %}' title='{% trans "Test Data" %}'>
|
||||||
|
<a href='{% url "stock-item-test-results" item.id %}'>
|
||||||
|
<span class='fas fa-vial'></span>
|
||||||
|
{% trans "Test Data" %}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
{% if item.part.assembly %}
|
||||||
|
<li class='list-group-item {% if tab == "installed" %}active{% endif %}' title='{% trans "Installed Stock Items" %}'>
|
||||||
|
<a href='{% url "stock-item-installed" item.id %}'>
|
||||||
|
<span class='fas fa-sign-in-alt'></span>
|
||||||
|
{% trans "Installed Items" %}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if item.child_count > 0 %}
|
||||||
|
<li class='list-group-item {% if tab == "children" %}active{% endif %}' title='{% trans "Child Items" %}'>
|
||||||
|
<a href='{% url "stock-item-children" item.id %}'>
|
||||||
|
<span class='fas fa-sitemap'></span>
|
||||||
|
{% trans "Children" %}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
|
||||||
|
<li class='list-group-item {% if tab == "attachments" %}active{% endif %}' title='{% trans "Attachments" %}'>
|
||||||
|
<a href='{% url "stock-item-attachments" item.id %}'>
|
||||||
|
<span class='fas fa-paperclip'></span>
|
||||||
|
{% trans "Attachments" %}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class='list-group-item {% if tab == "notes" %}active{% endif %}' title='{% trans "Stock Item Notes" %}'>
|
||||||
|
<a href='{% url "stock-item-notes" item.id %}'>
|
||||||
|
<span class='fas fa-clipboard'></span>
|
||||||
|
{% trans "Notes" %}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
</ul>
|
@ -1,49 +0,0 @@
|
|||||||
{% load i18n %}
|
|
||||||
|
|
||||||
<ul class='nav nav-tabs'>
|
|
||||||
<li{% ifequal tab 'tracking' %} class='active'{% endifequal %}>
|
|
||||||
<a href="{% url 'stock-item-detail' item.id %}">
|
|
||||||
{% trans "Tracking" %}
|
|
||||||
{% if item.tracking_info.count > 0 %}<span class='badge'>{{ item.tracking_info.count }}</span>{% endif %}
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
{% if item.part.trackable %}
|
|
||||||
<li{% if tab == 'tests' %} class='active'{% endif %}>
|
|
||||||
<a href="{% url 'stock-item-test-results' item.id %}">
|
|
||||||
{% trans "Test Data" %}
|
|
||||||
{% if item.test_results.count > 0 %}<span class='badge'>{{ item.test_results.count }}</span>{% endif %}
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
{% endif %}
|
|
||||||
{% if 0 %}
|
|
||||||
<!-- These tabs are to be implemented in the future -->
|
|
||||||
<li{% ifequal tab 'builds' %} class='active'{% endifequal %}>
|
|
||||||
<a href='#'>{% trans "Builds" %}</a>
|
|
||||||
</li>
|
|
||||||
{% endif %}
|
|
||||||
<li{% ifequal tab 'notes' %} class='active'{% endifequal %}>
|
|
||||||
<a href="{% url 'stock-item-notes' item.id %}">
|
|
||||||
{% trans "Notes" %}
|
|
||||||
{% if item.notes %} <span class='fas fa-info-circle'></span>{% endif %}
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li{% if tab == 'attachments' %} class='active'{% endif %}>
|
|
||||||
<a href="{% url 'stock-item-attachments' item.id %}">
|
|
||||||
{% trans "Attachments" %}
|
|
||||||
{% if item.attachments.count > 0 %}<span class='badge'>{{ item.attachments.count }}</span>{% endif %}
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
{% if item.child_count > 0 %}
|
|
||||||
<li{% ifequal tab 'children' %} class='active'{% endifequal %}>
|
|
||||||
<a href="{% url 'stock-item-children' item.id %}">{% trans "Children" %}{% if item.child_count > 0 %}<span class='badge'>{{ item.child_count }}</span>{% endif %}</a>
|
|
||||||
</li>
|
|
||||||
{% endif %}
|
|
||||||
{% if item.part.assembly or item.installedItemCount > 0 %}
|
|
||||||
<li {% if tab == 'installed' %} class='active'{% endif %}>
|
|
||||||
<a href="{% url 'stock-item-installed' item.id %}">
|
|
||||||
{% trans "Installed Items" %}
|
|
||||||
{% if item.installedItemCount > 0 %}<span class='badge'>{{ item.installedItemCount }}</span>{% endif %}
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
{% endif %}
|
|
||||||
</ul>
|
|
Loading…
x
Reference in New Issue
Block a user