mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Add 'tabbed' page set for Build app
This commit is contained in:
parent
183871f3cc
commit
bf987f23f3
79
InvenTree/build/templates/build/build_base.html
Normal file
79
InvenTree/build/templates/build/build_base.html
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
{% extends "base.html" %}
|
||||||
|
|
||||||
|
{% load static %}
|
||||||
|
|
||||||
|
{% block page_title %}
|
||||||
|
InvenTree | Build - {{ build }}
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
|
||||||
|
<div class='row'>
|
||||||
|
<div class='col-sm-6'>
|
||||||
|
<h3>Build Details</h3>
|
||||||
|
<p><b>{{ build.title }}</b>{% include "build_status.html" with build=build %}</p>
|
||||||
|
<p>Building {{ build.quantity }} × {{ build.part.full_name }}</p>
|
||||||
|
</div>
|
||||||
|
<div class='col-sm-6'>
|
||||||
|
<h3>
|
||||||
|
<div style='float: right;'>
|
||||||
|
<div class="dropdown" style="float: right;">
|
||||||
|
<a href="{% url 'build-allocate' build.id %}">
|
||||||
|
<button class='btn btn-info' type='button' title='Allocate Parts' id='build-allocate'>Allocate Parts</button>
|
||||||
|
</a>
|
||||||
|
<button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown">Options
|
||||||
|
<span class="caret"></span></button>
|
||||||
|
<ul class="dropdown-menu">
|
||||||
|
<li><a href='#' id='build-edit' title='Edit build'>Edit build</a></li>
|
||||||
|
{% if build.is_active %}
|
||||||
|
<li><a href='#' id='build-complete' title='Complete Build'>Complete Build</a></li>
|
||||||
|
<li><a href='#' id='build-cancel' title='Cancel build'>Cancel build</a></li>
|
||||||
|
{% endif %}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</h3>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
<div class='container-fluid'>
|
||||||
|
{% block details %}
|
||||||
|
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{% include "modals.html" %}
|
||||||
|
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block js_ready %}
|
||||||
|
|
||||||
|
$("#build-edit").click(function () {
|
||||||
|
launchModalForm("{% url 'build-edit' build.id %}",
|
||||||
|
{
|
||||||
|
reload: true
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
$("#build-cancel").click(function() {
|
||||||
|
launchModalForm("{% url 'build-cancel' build.id %}",
|
||||||
|
{
|
||||||
|
reload: true,
|
||||||
|
submit_text: "Cancel Build",
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
$("#build-complete").on('click', function() {
|
||||||
|
launchModalForm(
|
||||||
|
"{% url 'build-complete' build.id %}",
|
||||||
|
{
|
||||||
|
reload: true,
|
||||||
|
submit_text: "Complete Build",
|
||||||
|
}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
{% endblock %}
|
@ -1,39 +1,11 @@
|
|||||||
{% extends "base.html" %}
|
{% extends "build/build_base.html" %}
|
||||||
{% load static %}
|
{% load static %}
|
||||||
|
|
||||||
{% block page_title %}
|
{% block details %}
|
||||||
InvenTree | Build - {{ build }}
|
|
||||||
{% endblock %}
|
|
||||||
|
|
||||||
{% block content %}
|
{% include "build/tabs.html" with tab='details' %}
|
||||||
|
|
||||||
<div class='row'>
|
<h4>Build Details</h4>
|
||||||
<div class='col-sm-6'>
|
|
||||||
<h3>Build Details</h3>
|
|
||||||
<p><b>{{ build.title }}</b>{% include "build_status.html" with build=build %}</p>
|
|
||||||
<p>Building {{ build.quantity }} × {{ build.part.full_name }}</p>
|
|
||||||
</div>
|
|
||||||
<div class='col-sm-6'>
|
|
||||||
<h3>
|
|
||||||
<div style='float: right;'>
|
|
||||||
<div class="dropdown" style="float: right;">
|
|
||||||
<a href="{% url 'build-allocate' build.id %}">
|
|
||||||
<button class='btn btn-info' type='button' title='Allocate Parts' id='build-allocate'>Allocate Parts</button>
|
|
||||||
</a>
|
|
||||||
<button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown">Options
|
|
||||||
<span class="caret"></span></button>
|
|
||||||
<ul class="dropdown-menu">
|
|
||||||
<li><a href='#' id='build-edit' title='Edit build'>Edit build</a></li>
|
|
||||||
{% if build.is_active %}
|
|
||||||
<li><a href='#' id='build-complete' title='Complete Build'>Complete Build</a></li>
|
|
||||||
<li><a href='#' id='build-cancel' title='Cancel build'>Cancel build</a></li>
|
|
||||||
{% endif %}
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</h3>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<table class='table table-striped'>
|
<table class='table table-striped'>
|
||||||
<tr>
|
<tr>
|
||||||
@ -95,60 +67,4 @@ InvenTree | Build - {{ build }}
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
{% if build.is_active %}
|
|
||||||
<h3>Required Parts</h3>
|
|
||||||
<table class='table table-striped' id='build-list' data-sorting='true'>
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th>Part</th>
|
|
||||||
<th>Required</th>
|
|
||||||
<th>Available</th>
|
|
||||||
<th>Allocated</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
{% for item in build.required_parts %}
|
|
||||||
<tr>
|
|
||||||
<td><a href="{% url 'part-detail' item.part.id %}">{{ item.part.full_name }}</a></td>
|
|
||||||
<td>{{ item.quantity }}</td>
|
|
||||||
<td>{{ item.part.total_stock }}</td>
|
|
||||||
<td>{{ item.allocated }}</td>
|
|
||||||
</tr>
|
|
||||||
{% endfor %}
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% include 'modals.html' %}
|
|
||||||
|
|
||||||
{% endblock %}
|
|
||||||
|
|
||||||
{% block js_ready %}
|
|
||||||
{{ block.super }}
|
|
||||||
$("#build-edit").click(function () {
|
|
||||||
launchModalForm("{% url 'build-edit' build.id %}",
|
|
||||||
{
|
|
||||||
reload: true
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
$("#build-cancel").click(function() {
|
|
||||||
launchModalForm("{% url 'build-cancel' build.id %}",
|
|
||||||
{
|
|
||||||
reload: true,
|
|
||||||
submit_text: "Cancel Build",
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
$("#build-complete").on('click', function() {
|
|
||||||
launchModalForm(
|
|
||||||
"{% url 'build-complete' build.id %}",
|
|
||||||
{
|
|
||||||
reload: true,
|
|
||||||
submit_text: "Complete Build",
|
|
||||||
}
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
36
InvenTree/build/templates/build/required.html
Normal file
36
InvenTree/build/templates/build/required.html
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
{% extends "build/build_base.html" %}
|
||||||
|
{% load static %}
|
||||||
|
|
||||||
|
{% block details %}
|
||||||
|
|
||||||
|
{% include "build/tabs.html" with tab='required' %}
|
||||||
|
|
||||||
|
<h4>Required Parts</h4>
|
||||||
|
<table class='table table-striped' id='build-list' data-sorting='true'>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Part</th>
|
||||||
|
<th>Available</th>
|
||||||
|
<th>Required</th>
|
||||||
|
<th>Allocated</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{% for item in build.required_parts %}
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<a class='hover-icon'>
|
||||||
|
<img class='hover-img-thumb' src='{% if item.part.image %}{{ item.part.image.url }}{% endif %}'>
|
||||||
|
<img class='hover-img-large' src='{% if item.part.image %}{{ item.part.image.url }}{% endif %}'>
|
||||||
|
</a>
|
||||||
|
<a class='hover-icon'a href="{% url 'part-detail' item.part.id %}">{{ item.part.full_name }}</a>
|
||||||
|
</td>
|
||||||
|
<td>{{ item.part.total_stock }}</td>
|
||||||
|
<td>{{ item.quantity }}</td>
|
||||||
|
<td>{{ item.allocated }}</td>
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
{% endblock %}
|
10
InvenTree/build/templates/build/tabs.html
Normal file
10
InvenTree/build/templates/build/tabs.html
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<ul class='nav nav-tabs'>
|
||||||
|
<li{% if tab == 'details' %} class='active'{% endif %}>
|
||||||
|
<a href="{% url 'build-detail' build.id %}">Details</a>
|
||||||
|
</li>
|
||||||
|
<li{% if tab == 'required' %} class='active'{% endif %}>
|
||||||
|
<a href="{% url 'build-required' build.id %}">Required</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<br>
|
@ -24,6 +24,8 @@ build_detail_urls = [
|
|||||||
url(r'^auto-allocate/?', views.BuildAutoAllocate.as_view(), name='build-auto-allocate'),
|
url(r'^auto-allocate/?', views.BuildAutoAllocate.as_view(), name='build-auto-allocate'),
|
||||||
url(r'^unallocate/', views.BuildUnallocate.as_view(), name='build-unallocate'),
|
url(r'^unallocate/', views.BuildUnallocate.as_view(), name='build-unallocate'),
|
||||||
|
|
||||||
|
url(r'^required/', views.BuildDetail.as_view(template_name='build/required.html'), name='build-required'),
|
||||||
|
|
||||||
url(r'^.*$', views.BuildDetail.as_view(), name='build-detail'),
|
url(r'^.*$', views.BuildDetail.as_view(), name='build-detail'),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user