mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Refactor part display
This commit is contained in:
parent
e235e5adec
commit
9d2b4af83f
@ -229,16 +229,26 @@
|
||||
|
||||
/* Extra label styles */
|
||||
|
||||
.label {
|
||||
display: inline;
|
||||
font-size: 75%;
|
||||
line-height: 1;
|
||||
padding-left: 4px;
|
||||
padding-right: 4px;
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
vertical-align: baseline;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
.label-large {
|
||||
margin: 3px;
|
||||
font-size: 100%;
|
||||
font-size: 90%;
|
||||
border: 3px solid;
|
||||
border-radius: 15px;
|
||||
background: none;
|
||||
padding-right: 10px;
|
||||
padding-left: 10px;
|
||||
padding-top: 5px;
|
||||
padding-bottom: 5px;
|
||||
padding: 3px;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.label-large-red {
|
||||
@ -254,18 +264,7 @@
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
.label {
|
||||
display: inline;
|
||||
font-size: 75%;
|
||||
line-height: 1;
|
||||
padding-left: 4px;
|
||||
padding-right: 4px;
|
||||
color: white;
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
vertical-align: baseline;
|
||||
border-radius: .25em;
|
||||
}
|
||||
|
||||
|
||||
.label-red {
|
||||
background: var(--label-red);
|
||||
|
@ -11,6 +11,88 @@
|
||||
|
||||
{% block page_content %}
|
||||
|
||||
<div class='panel panel-inventree panel-hidden' id='panel-part-details'>
|
||||
<div class='panel-heading'>
|
||||
<h4>{% trans "Part Details" %}</h4>
|
||||
</div>
|
||||
<div class='panel-content'>
|
||||
|
||||
<!-- Details Table -->
|
||||
<table class="table table-striped">
|
||||
<col width='25'>
|
||||
{% if part.IPN %}
|
||||
<tr>
|
||||
<td><span class='fas fa-tag'></span></td>
|
||||
<td>{% trans "IPN" %}</td>
|
||||
<td>{{ part.IPN }}{% include "clip.html"%}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
<tr>
|
||||
<td><span class='fas fa-shapes'></span></td>
|
||||
<td>{% trans "Name" %}</td>
|
||||
<td>{{ part.name }}{% include "clip.html"%}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span class='fas fa-info-circle'></span></td>
|
||||
<td>{% trans "Description" %}</td>
|
||||
<td>{{ part.description }}{% include "clip.html"%}</td>
|
||||
</tr>
|
||||
{% if part.revision %}
|
||||
<tr>
|
||||
<td><span class='fas fa-code-branch'></span></td>
|
||||
<td>{% trans "Revision" %}</td>
|
||||
<td>{{ part.revision }}{% include "clip.html"%}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if part.keywords %}
|
||||
<tr>
|
||||
<td><span class='fas fa-key'></span></td>
|
||||
<td>{% trans "Keywords" %}</td>
|
||||
<td>{{ part.keywords }}{% include "clip.html"%}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if part.link %}
|
||||
<tr>
|
||||
<td><span class='fas fa-link'></span></td>
|
||||
<td>{% trans "External Link" %}</td>
|
||||
<td><a href="{{ part.link }}">{{ part.link }}</a>{% include "clip.html"%}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
<tr>
|
||||
<td><span class='fas fa-calendar-alt'></span></td>
|
||||
<td>{% trans "Creation Date" %}</td>
|
||||
<td>
|
||||
{{ part.creation_date }}
|
||||
{% if part.creation_user %}
|
||||
<span class='badge'>{{ part.creation_user }}</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% if part.trackable and part.getLatestSerialNumber %}
|
||||
<tr>
|
||||
<td><span class='fas fa-hashtag'></span></td>
|
||||
<td>{% trans "Latest Serial Number" %}</td>
|
||||
<td>{{ part.getLatestSerialNumber }}{% include "clip.html"%}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if part.default_location %}
|
||||
<tr>
|
||||
<td><span class='fas fa-search-location'></span></td>
|
||||
<td>{% trans "Default Location" %}</td>
|
||||
<td>{{ part.default_location }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if part.default_supplier %}
|
||||
<tr>
|
||||
<td><span class='fas fa-building'></span></td>
|
||||
<td>{% trans "Default Supplier" %}</td>
|
||||
<td>{{ part.default_supplier }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class='panel panel-inventree panel-hidden' id='panel-part-stock'>
|
||||
<div class='panel-heading'>
|
||||
<h4>{% trans "Part Stock" %}</h4>
|
||||
|
@ -11,6 +11,12 @@
|
||||
<span class='menu-tab-icon fas fa-expand-arrows-alt'></span>
|
||||
</a>
|
||||
</li>
|
||||
<li class='list-group-item' title='{% trans "Details" %}'>
|
||||
<a href='#' id='select-part-details' class='nav-toggle'>
|
||||
<span class='menu-tab-icon fas fa-info-circle sidebar-icon'></span>
|
||||
{% trans "Details" %}
|
||||
</a>
|
||||
</li>
|
||||
<li class='list-group-item' title='{% trans "Parameters" %}'>
|
||||
<a href='#' id='select-part-parameters' class='nav-toggle'>
|
||||
<span class='menu-tab-icon fas fa-th-list sidebar-icon'></span>
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% extends "base.html" %}
|
||||
{% extends "page_base.html" %}
|
||||
{% load static %}
|
||||
{% load i18n %}
|
||||
{% load inventree_extras %}
|
||||
|
@ -8,44 +8,46 @@
|
||||
{% include "part/navbar.html" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div class="panel panel-inventree">
|
||||
<div class='panel-content'></div>
|
||||
<!-- Default panel contents -->
|
||||
<div class="panel-heading"><h3>{{ part.full_name }}</h3></div>
|
||||
<div class="panel-content">
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
{% block thumbnail %}
|
||||
{% include "part/part_thumb.html" %}
|
||||
<div class="media-body">
|
||||
<p>
|
||||
<h3>
|
||||
{% endblock %}
|
||||
|
||||
{% block details %}
|
||||
|
||||
<h4>
|
||||
{{ part.full_name }}
|
||||
<!-- Admin View -->
|
||||
{% if user.is_staff and roles.part.change %}
|
||||
<a href="{% url 'admin:part_part_change' part.pk %}"><span title="{% trans 'Admin view' %}" class='fas fa-user-shield'></span></a> 
|
||||
{% endif %}
|
||||
</h4>
|
||||
<!-- Properties -->
|
||||
<div id='part-properties' class='btn-group' role='group'>
|
||||
<h4>
|
||||
<div id='part-properties' class='btn-group'>
|
||||
{% if part.is_template %}
|
||||
 
|
||||
<span class='fas fa-clone' title='{% trans "Part is a template part (variants can be made from this part)" %}'></span>
|
||||
{% endif %}
|
||||
{% if part.assembly %}
|
||||
 
|
||||
<span class='fas fa-tools' title='{% trans "Part can be assembled from other parts" %}'></span>
|
||||
{% endif %}
|
||||
{% if part.component %}
|
||||
 
|
||||
<span class='fas fa-th' title='{% trans "Part can be used in assemblies" %}'></span>
|
||||
{% endif %}
|
||||
{% if part.trackable %}
|
||||
 
|
||||
<span class='fas fa-directions' title='{% trans "Part stock is tracked by serial number" %}'></span>
|
||||
{% endif %}
|
||||
{% if part.purchaseable %}
|
||||
 
|
||||
<span class='fas fa-shopping-cart' title='{% trans "Part can be purchased from external suppliers" %}'></span>
|
||||
{% endif %}
|
||||
{% if part.salable %}
|
||||
 
|
||||
<span class='fas fa-dollar-sign' title='{% trans "Part can be sold to customers" %}'></span>
|
||||
{% endif %}
|
||||
</div>
|
||||
<!-- Part active -->
|
||||
{% if not part.active %}
|
||||
 
|
||||
@ -62,9 +64,10 @@
|
||||
{% trans 'Virtual' %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</h3>
|
||||
</p>
|
||||
</div>
|
||||
</h4>
|
||||
|
||||
<!-- Part Actions -->
|
||||
<div class='btn-group' role='group'>
|
||||
<button type='button' class='btn btn-outline-secondary' id='toggle-starred' title='{% trans "Star this part" %}'>
|
||||
<span id='part-star-icon' class='fas fa-star {% if starred %}icon-yellow{% endif %}'/>
|
||||
@ -128,16 +131,10 @@
|
||||
</ul>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
|
||||
<p>
|
||||
<!-- Details show/hide button -->
|
||||
<button id="toggle-part-details" class="btn btn-primary" data-bs-toggle="collapse" data-target="#collapsible-part-details" value="show">
|
||||
<span class="fas fa-chevron-down"></span> {% trans "Show Part Details" %}
|
||||
</button>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Part info messages -->
|
||||
<div class='info-messages'>
|
||||
{% if part.variant_of %}
|
||||
<div class='alert alert-info alert-block' style='padding: 10px;'>
|
||||
@ -146,8 +143,11 @@
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block details_right %}
|
||||
<table class='table table-condensed table-striped'>
|
||||
<col width='25'>
|
||||
<tr>
|
||||
@ -212,94 +212,6 @@
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="collapse" id="collapsible-part-details">
|
||||
<div class="card card-body">
|
||||
<!-- Details Table -->
|
||||
<table class="table table-striped">
|
||||
<col width='25'>
|
||||
{% if part.IPN %}
|
||||
<tr>
|
||||
<td><span class='fas fa-tag'></span></td>
|
||||
<td>{% trans "IPN" %}</td>
|
||||
<td>{{ part.IPN }}{% include "clip.html"%}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
<tr>
|
||||
<td><span class='fas fa-shapes'></span></td>
|
||||
<td>{% trans "Name" %}</td>
|
||||
<td>{{ part.name }}{% include "clip.html"%}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span class='fas fa-info-circle'></span></td>
|
||||
<td>{% trans "Description" %}</td>
|
||||
<td>{{ part.description }}{% include "clip.html"%}</td>
|
||||
</tr>
|
||||
{% if part.revision %}
|
||||
<tr>
|
||||
<td><span class='fas fa-code-branch'></span></td>
|
||||
<td>{% trans "Revision" %}</td>
|
||||
<td>{{ part.revision }}{% include "clip.html"%}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if part.keywords %}
|
||||
<tr>
|
||||
<td><span class='fas fa-key'></span></td>
|
||||
<td>{% trans "Keywords" %}</td>
|
||||
<td>{{ part.keywords }}{% include "clip.html"%}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if part.link %}
|
||||
<tr>
|
||||
<td><span class='fas fa-link'></span></td>
|
||||
<td>{% trans "External Link" %}</td>
|
||||
<td><a href="{{ part.link }}">{{ part.link }}</a>{% include "clip.html"%}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
<tr>
|
||||
<td><span class='fas fa-calendar-alt'></span></td>
|
||||
<td>{% trans "Creation Date" %}</td>
|
||||
<td>
|
||||
{{ part.creation_date }}
|
||||
{% if part.creation_user %}
|
||||
<span class='badge'>{{ part.creation_user }}</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% if part.trackable and part.getLatestSerialNumber %}
|
||||
<tr>
|
||||
<td><span class='fas fa-hashtag'></span></td>
|
||||
<td>{% trans "Latest Serial Number" %}</td>
|
||||
<td>{{ part.getLatestSerialNumber }}{% include "clip.html"%}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if part.default_location %}
|
||||
<tr>
|
||||
<td><span class='fas fa-search-location'></span></td>
|
||||
<td>{% trans "Default Location" %}</td>
|
||||
<td>{{ part.default_location }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if part.default_supplier %}
|
||||
<tr>
|
||||
<td><span class='fas fa-building'></span></td>
|
||||
<td>{% trans "Default Supplier" %}</td>
|
||||
<td>{{ part.default_supplier }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
{% block page_content %}
|
||||
{% endblock %}
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block js_ready %}
|
||||
|
@ -4,8 +4,6 @@
|
||||
|
||||
{% settings_value "INVENTREE_DOWNLOAD_FROM_URL" as allow_download %}
|
||||
|
||||
<div class="media">
|
||||
<div class="media-left part-thumb-container">
|
||||
<div class='dropzone' id='part-thumb'>
|
||||
<img class="part-thumb" id='part-image'
|
||||
{% if part.image %}
|
||||
@ -25,4 +23,3 @@
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
Loading…
Reference in New Issue
Block a user