mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-30 12:36:45 +00:00
Refactor stock location view
This commit is contained in:
parent
840187f577
commit
a21959f54d
@ -7,50 +7,27 @@
|
||||
{% include "stock/location_navbar.html" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div class='panel panel-inventree'>
|
||||
|
||||
<div class='panel-heading'>
|
||||
<h4>
|
||||
{% if location %}
|
||||
{{ location.name }}
|
||||
{% if location %}
|
||||
{% block details_left %}
|
||||
{% if location %}
|
||||
<h4>
|
||||
{% trans "Stock Location" %}: {{ location.name }}
|
||||
{% 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 %}
|
||||
|
||||
{% else %}
|
||||
</h4>
|
||||
<p>{{ location.description }}</p>
|
||||
{% else %}
|
||||
<h4>
|
||||
{% trans "Stock" %}
|
||||
{% endif %}
|
||||
</h4>
|
||||
</div>
|
||||
</h4>
|
||||
<p>{% trans "All stock items" %}</p>
|
||||
{% endif %}
|
||||
|
||||
<div class='panel-content'>
|
||||
|
||||
{% setting_object 'STOCK_OWNERSHIP_CONTROL' as owner_control %}
|
||||
{% if owner_control.value == "True" %}
|
||||
{% authorized_owners location.owner as owners %}
|
||||
|
||||
{% if location and not user in owners and not user.is_superuser %}
|
||||
<div class='alert alert-block alert-info'>
|
||||
{% trans "You are not in the list of owners of this location. This stock location cannot be edited." %}<br>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
<div class='row'>
|
||||
<div class='col-sm-6'>
|
||||
<div class='btn-group' role='group'>
|
||||
<div class='btn-group' 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-success' id='location-create' title='{% trans "Create new stock location" %}'>
|
||||
<span class='fas fa-plus-circle'/>
|
||||
<button class='btn btn-success' id='location-create' type='button' title='{% trans "Create new stock location" %}'>
|
||||
<span class='fas fa-plus-circle'></span>
|
||||
</button>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
@ -102,11 +79,24 @@
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% setting_object 'STOCK_OWNERSHIP_CONTROL' as owner_control %}
|
||||
{% if owner_control.value == "True" %}
|
||||
{% authorized_owners location.owner as owners %}
|
||||
|
||||
{% if location and not user in owners and not user.is_superuser %}
|
||||
<div class='alert alert-block alert-info'>
|
||||
{% trans "You are not in the list of owners of this location. This stock location cannot be edited." %}<br>
|
||||
</div>
|
||||
</div>
|
||||
<div class='col-sm-6'>
|
||||
{% if location %}
|
||||
<table class='table table-striped table-condensed'>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block details_right %}
|
||||
{% if location %}
|
||||
<table class='table table-striped table-condensed'>
|
||||
<col width='25'>
|
||||
<tr>
|
||||
<td><span class='fas fa-info-circle'></span></td>
|
||||
@ -123,10 +113,10 @@
|
||||
<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'>
|
||||
</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>
|
||||
@ -138,14 +128,11 @@
|
||||
<td>{% trans "Stock Items" %}</td>
|
||||
<td>{{ stock_count }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</table>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block location_content %}
|
||||
{% block page_content %}
|
||||
|
||||
<div class='panel panel-inventree panel-hidden' id='panel-stock'>
|
||||
<div class='panel-heading'>
|
||||
@ -184,10 +171,6 @@
|
||||
|
||||
{% endblock %}
|
||||
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block js_ready %}
|
||||
{{ block.super }}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% extends "base.html" %}
|
||||
{% extends "page_base.html" %}
|
||||
{% load static %}
|
||||
{% load i18n %}
|
||||
{% load inventree_extras %}
|
||||
|
Loading…
x
Reference in New Issue
Block a user