mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Create 'tabs' for SupplierPart view
This commit is contained in:
parent
34c3320cd5
commit
63b70614b6
@ -1,4 +1,4 @@
|
||||
{% extends "base.html" %}
|
||||
{% extends "company/supplier_part_base.html" %}
|
||||
{% load static %}
|
||||
{% load i18n %}
|
||||
|
||||
@ -6,33 +6,9 @@
|
||||
InvenTree | {{ company.name }} - {% trans "Parts" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% block details %}
|
||||
|
||||
<div class='row'>
|
||||
<div class='col-sm-6'>
|
||||
<h3>{% trans "Supplier Part" %}</h3>
|
||||
<div class='btn-row'>
|
||||
<div class='btn-group'>
|
||||
<button type='button' class='btn btn-default btn-glyph' id='edit-part' title='Edit supplier part'>
|
||||
<span class='glyphicon glyphicon-edit'/>
|
||||
</button>
|
||||
<button type='button' class='btn btn-default btn-glyph' id='delete-part' title='Delete supplier part'>
|
||||
<span class='glyphicon glyphicon-trash'/>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class='col-sm-6'>
|
||||
<div class='media-left'>
|
||||
<img class='part-thumb'
|
||||
{% if part.part.image %}
|
||||
src='{{ part.part.image.url }}'
|
||||
{% else %}
|
||||
src="{% static 'img/blank_image.png' %}"
|
||||
{% endif %}/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% include "company/supplier_part_tabs.html" with tab='details' %}
|
||||
|
||||
<hr>
|
||||
|
||||
@ -120,23 +96,7 @@ InvenTree | {{ company.name }} - {% trans "Parts" %}
|
||||
|
||||
{% block js_ready %}
|
||||
{{ block.super }}
|
||||
$('#edit-part').click(function () {
|
||||
launchModalForm(
|
||||
"{% url 'supplier-part-edit' part.id %}",
|
||||
{
|
||||
reload: true
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
$('#delete-part').click(function() {
|
||||
launchModalForm(
|
||||
"{% url 'supplier-part-delete' %}?part={{ part.id }}",
|
||||
{
|
||||
redirect: "{% url 'company-detail-parts' part.supplier.id %}"
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
$('#new-price-break').click(function() {
|
||||
launchModalForm("{% url 'price-break-create' %}",
|
||||
|
68
InvenTree/company/templates/company/supplier_part_base.html
Normal file
68
InvenTree/company/templates/company/supplier_part_base.html
Normal file
@ -0,0 +1,68 @@
|
||||
{% extends "base.html" %}
|
||||
{% load static %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block page_title %}
|
||||
InvenTree | {% trans "Supplier Part" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div class='row'>
|
||||
<div class='col-sm-6'>
|
||||
<h3>{% trans "Supplier Part" %}</h3>
|
||||
<div class='btn-row'>
|
||||
<div class='btn-group'>
|
||||
<button type='button' class='btn btn-default btn-glyph' id='edit-part' title='Edit supplier part'>
|
||||
<span class='glyphicon glyphicon-edit'/>
|
||||
</button>
|
||||
<button type='button' class='btn btn-default btn-glyph' id='delete-part' title='Delete supplier part'>
|
||||
<span class='glyphicon glyphicon-trash'/>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class='col-sm-6'>
|
||||
<div class='media-left'>
|
||||
<img class='part-thumb'
|
||||
{% if part.part.image %}
|
||||
src='{{ part.part.image.url }}'
|
||||
{% else %}
|
||||
src="{% static 'img/blank_image.png' %}"
|
||||
{% endif %}/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<div class='container-fluid'>
|
||||
{% block details %}
|
||||
<!-- Particular SupplierPart page goes here ... -->
|
||||
{% endblock %}
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block js_ready %}
|
||||
{{ block.super }}
|
||||
|
||||
$('#edit-part').click(function () {
|
||||
launchModalForm(
|
||||
"{% url 'supplier-part-edit' part.id %}",
|
||||
{
|
||||
reload: true
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
$('#delete-part').click(function() {
|
||||
launchModalForm(
|
||||
"{% url 'supplier-part-delete' %}?part={{ part.id }}",
|
||||
{
|
||||
redirect: "{% url 'company-detail-parts' part.supplier.id %}"
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
{% endblock %}
|
19
InvenTree/company/templates/company/supplier_part_tabs.html
Normal file
19
InvenTree/company/templates/company/supplier_part_tabs.html
Normal file
@ -0,0 +1,19 @@
|
||||
{% load i18n %}
|
||||
|
||||
<ul class='nav nav-tabs'>
|
||||
<li{% if tab == 'details' %} class='active'{% endif %}>
|
||||
<a href="{% url 'supplier-part-detail' part.id %}">{% trans "Details" %}</a>
|
||||
</li>
|
||||
<li{% if tab == 'pricing' %} class='active'{% endif %}>
|
||||
<a href="{% url 'supplier-part-detail' part.id %}">{% trans "Pricing" %}</a>
|
||||
</li>
|
||||
<li{% if tab == 'stock' %} class='active'{% endif %}>
|
||||
<a href="{% url 'supplier-part-detail' part.id %}">{% trans "Stock" %}</a>
|
||||
</li>
|
||||
<li {% if tab == 'orders' %} class='active'{% endif %}>
|
||||
<a href="{% url 'supplier-part-detail' part.id %}">{% trans "Orders" %}</a>
|
||||
</li>
|
||||
<li {% if tab == 'notes' %} class='active'{% endif %}>
|
||||
<a href="{% url 'supplier-part-detail' part.id %}">{% trans "Notes" %}</a>
|
||||
</li>
|
||||
</ul>
|
Loading…
Reference in New Issue
Block a user