Add (empty) page for displaying part test templates

This commit is contained in:
Oliver Walters 2020-05-17 14:26:53 +10:00
parent bc8b3a68f0
commit 66f2c01d5d
5 changed files with 41 additions and 3 deletions

View File

@ -0,0 +1,29 @@
{% extends "part/part_base.html" %}
{% load static %}
{% load i18n %}
{% block details %}
{% include 'part/tabs.html' with tab='tests' %}
<h4>{% trans "Part Test Templates" %}</h4>
<hr>
<div id='button-toolbar'>
<div class='button-toolbar container-fluid' style="float: right;">
<div class='btn-group' role='group'>
<button type='button' class='btn btn-success' id='add-test-template'>{% trans "Add Test Template" %}</button>
</div>
<div class='filter-list' id='filter-list-parttests'>
<!-- Empty div -->
</div>
</div>
</div>
<table class='table table-striped table-condensed' data-toolbar='#button-toolbar' id='test-template-table'></table>
{% endblock %}
{% block js_ready %}
{{ block.super }}
{% endblock %}

View File

@ -48,7 +48,9 @@
<a href="{% url 'part-sales-orders' part.id %}">{% trans "Sales Orders" %} <span class='badge'>{{ part.sales_orders|length }}</span></a>
</li>
{% endif %}
{% if 0 and part.trackable %}
{% if part.trackable %}
{% if 0 %}
<!-- TODO - Add the 'tracking' tab back in -->
<li{% ifequal tab 'track' %} class="active"{% endifequal %}>
<a href="{% url 'part-track' part.id %}">{% trans "Tracking" %}
{% if parts.serials.all|length > 0 %}
@ -56,6 +58,12 @@
{% endif %}
</a></li>
{% endif %}
<li{% ifequal tab 'tests' %} class='active'{% endifequal %}>
<a href='{% url "part-test-templates" part.id %}'>{% trans "Tests" %}
{% if part.getTestTemplates.count > 0 %}<span class='badge'>{{ part.getTestTemplates.count }}</span>{% endif %}
</a>
</li>
{% endif %}
<li{% ifequal tab 'attachments' %} class="active"{% endifequal %}>
<a href="{% url 'part-attachments' part.id %}">{% trans "Attachments" %} {% if part.attachment_count > 0 %}<span class="badge">{{ part.attachment_count }}</span>{% endif %}</a>
</li>

View File

@ -52,6 +52,7 @@ part_detail_urls = [
url(r'^suppliers/?', views.PartDetail.as_view(template_name='part/supplier.html'), name='part-suppliers'),
url(r'^orders/?', views.PartDetail.as_view(template_name='part/orders.html'), name='part-orders'),
url(r'^sales-orders/', views.PartDetail.as_view(template_name='part/sales_orders.html'), name='part-sales-orders'),
url(r'^tests/', views.PartDetail.as_view(template_name='part/part_tests.html'), name='part-test-templates'),
url(r'^track/?', views.PartDetail.as_view(template_name='part/track.html'), name='part-track'),
url(r'^attachments/?', views.PartDetail.as_view(template_name='part/attachments.html'), name='part-attachments'),
url(r'^notes/?', views.PartNotes.as_view(), name='part-notes'),

View File

@ -13,7 +13,7 @@
<div id='button-toolbar'>
<div class='button-toolbar container-fluid' style="float: right;">
<div class='btn-group' role='group'>
<button type='button' class='btn btn-success' id='add-test-result'>{% trans "Add Test Result" %}</button>
<button type='button' class='btn btn-success' id='add-test-result'>{% trans "Add Test Data" %}</button>
</div>
<div class='filter-list' id='filter-list-stocktests'>
<!-- Empty div -->

View File

@ -10,7 +10,7 @@
{% if item.part.trackable %}
<li{% if tab == 'tests' %} class='active'{% endif %}>
<a href="{% url 'stock-item-test-results' item.id %}">
{% trans "Test Results" %}
{% trans "Test Data" %}
{% if item.test_results.count > 0 %}<span class='badge'>{{ item.test_results.count }}</span>{% endif %}
</a>
</li>