Fixed company templates

This commit is contained in:
eeintech 2021-08-19 10:47:46 -04:00
parent c16ce925dd
commit ec7392303d
4 changed files with 49 additions and 47 deletions

View File

@ -24,19 +24,17 @@
</button> </button>
{% endif %} {% endif %}
<div class='btn-group'> <div class='btn-group'>
<div class="dropdown" style="float: right;"> <button class="btn btn-primary dropdown-toggle" id='supplier-table-options' type="button" data-toggle="dropdown">{% trans "Options" %}
<button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown">{% trans "Options" %} <span class="caret"></span>
<span class="caret"></span> </button>
</button> <ul class="dropdown-menu">
<ul class="dropdown-menu"> {% if roles.purchase_order.add %}
{% if roles.purchase_order.add %} <li><a href='#' id='multi-supplier-part-order' title='{% trans "Order parts" %}'>{% trans "Order Parts" %}</a></li>
<li><a href='#' id='multi-part-order' title='{% trans "Order parts" %}'>{% trans "Order Parts" %}</a></li> {% endif %}
{% endif %} {% if roles.purchase_order.delete %}
{% if roles.purchase_order.delete %} <li><a href='#' id='multi-supplier-part-delete' title='{% trans "Delete parts" %}'>{% trans "Delete Parts" %}</a></li>
<li><a href='#' id='multi-part-delete' title='{% trans "Delete parts" %}'>{% trans "Delete Parts" %}</a></li> {% endif %}
{% endif %} </ul>
</ul>
</div>
</div> </div>
</div> </div>
<div class='filter-list' id='filter-list-supplier-part'> <div class='filter-list' id='filter-list-supplier-part'>
@ -59,27 +57,25 @@
{% if roles.purchase_order.change %} {% if roles.purchase_order.change %}
<div id='manufacturer-part-button-toolbar'> <div id='manufacturer-part-button-toolbar'>
<div class='button-toolbar container-fluid'> <div class='button-toolbar container-fluid'>
<div class='btn-group role='group'> <div class='btn-group' role='group'>
{% if roles.purchase_order.add %} {% if roles.purchase_order.add %}
<button class="btn btn-success" id='manufacturer-part-create' title='{% trans "Create new manufacturer part" %}'> <button type="button" class="btn btn-success" id='manufacturer-part-create' title='{% trans "Create new manufacturer part" %}'>
<span class='fas fa-plus-circle'></span> {% trans "New Manufacturer Part" %} <span class='fas fa-plus-circle'></span> {% trans "New Manufacturer Part" %}
</button> </button>
{% endif %} {% endif %}
<div class='btn-group'> <div class='btn-group' role='group'>
<div class="dropdown" style="float: right;"> <button class="btn btn-primary dropdown-toggle" id='manufacturer-table-options' type="button" data-toggle="dropdown">{% trans "Options" %}
<button class="btn btn-primary dropdown-toggle" id='table-options', type="button" data-toggle="dropdown">{% trans "Options" %} <span class="caret"></span>
<span class="caret"></span> </button>
</button> <ul class="dropdown-menu">
<ul class="dropdown-menu"> {% if roles.purchase_order.add %}
{% if roles.purchase_order.add %} <li><a href='#' id='multi-manufacturer-part-order' title='{% trans "Order parts" %}'>{% trans "Order Parts" %}</a></li>
<li><a href='#' id='multi-part-order' title='{% trans "Order parts" %}'>{% trans "Order Parts" %}</a></li> {% endif %}
{% endif %} {% if roles.purchase_order.delete %}
{% if roles.purchase_order.delete %} <li><a href='#' id='multi-manufacturer-part-delete' title='{% trans "Delete parts" %}'>{% trans "Delete Parts" %}</a></li>
<li><a href='#' id='multi-part-delete' title='{% trans "Delete parts" %}'>{% trans "Delete Parts" %}</a></li> {% endif %}
{% endif %} </ul>
</ul> </div>
</div>
</div>
</div> </div>
<div class='filter-list' id='filter-list-supplier-part'> <div class='filter-list' id='filter-list-supplier-part'>
<!-- Empty div (will be filled out with available BOM filters) --> <!-- Empty div (will be filled out with available BOM filters) -->
@ -87,7 +83,7 @@
</div> </div>
</div> </div>
{% endif %} {% endif %}
<table class='table table-striped table-condensed' id='part-table' data-toolbar='#manufacturer-part-button-toolbar'> <table class='table table-striped table-condensed' id='manufacturer-part-table' data-toolbar='#manufacturer-part-button-toolbar'>
</table> </table>
</div> </div>
</div> </div>
@ -274,6 +270,10 @@
{% if company.is_manufacturer %} {% if company.is_manufacturer %}
function reloadManufacturerPartTable() {
$('#manufacturer-part-table').bootstrapTable('refresh');
}
$("#manufacturer-part-create").click(function () { $("#manufacturer-part-create").click(function () {
createManufacturerPart({ createManufacturerPart({
@ -285,7 +285,7 @@
}); });
loadManufacturerPartTable( loadManufacturerPartTable(
"#part-table", "#manufacturer-part-table",
"{% url 'api-manufacturer-part-list' %}", "{% url 'api-manufacturer-part-list' %}",
{ {
params: { params: {
@ -296,20 +296,20 @@
} }
); );
linkButtonsToSelection($("#manufacturer-table"), ['#table-options']); linkButtonsToSelection($("#manufacturer-part-table"), ['#manufacturer-table-options']);
$("#multi-part-delete").click(function() { $("#multi-manufacturer-part-delete").click(function() {
var selections = $("#part-table").bootstrapTable("getSelections"); var selections = $("#manufacturer-part-table").bootstrapTable("getSelections");
deleteManufacturerParts(selections, { deleteManufacturerParts(selections, {
onSuccess: function() { onSuccess: function() {
$("#part-table").bootstrapTable("refresh"); $("#manufacturer-part-table").bootstrapTable("refresh");
} }
}); });
}); });
$("#multi-part-order").click(function() { $("#multi-manufacturer-part-order").click(function() {
var selections = $("#part-table").bootstrapTable("getSelections"); var selections = $("#manufacturer-part-table").bootstrapTable("getSelections");
var parts = []; var parts = [];
@ -353,9 +353,9 @@
} }
); );
{% endif %} linkButtonsToSelection($("#supplier-part-table"), ['#supplier-table-options']);
$("#multi-part-delete").click(function() { $("#multi-supplier-part-delete").click(function() {
var selections = $("#supplier-part-table").bootstrapTable("getSelections"); var selections = $("#supplier-part-table").bootstrapTable("getSelections");
var requests = []; var requests = [];
@ -379,8 +379,8 @@
); );
}); });
$("#multi-part-order").click(function() { $("#multi-supplier-part-order").click(function() {
var selections = $("#part-table").bootstrapTable("getSelections"); var selections = $("#supplier-part-table").bootstrapTable("getSelections");
var parts = []; var parts = [];
@ -395,6 +395,8 @@
}); });
}); });
{% endif %}
attachNavCallbacks({ attachNavCallbacks({
name: 'company', name: 'company',
default: 'company-stock' default: 'company-stock'

View File

@ -109,7 +109,7 @@ src="{% static 'img/blank_image.png' %}"
<span class='fas fa-plus-circle'></span> {% trans "New Supplier Part" %} <span class='fas fa-plus-circle'></span> {% trans "New Supplier Part" %}
</button> </button>
<div id='opt-dropdown' class="btn-group"> <div id='opt-dropdown' class="btn-group">
<button id='supplier-part-options' class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown">{% trans "Options" %}<span class="caret"></span></button> <button id='supplier-part-options' class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown">{% trans "Options" %} <span class="caret"></span></button>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
<li><a href='#' id='supplier-part-delete' title='{% trans "Delete supplier parts" %}'>{% trans "Delete" %}</a></li> <li><a href='#' id='supplier-part-delete' title='{% trans "Delete supplier parts" %}'>{% trans "Delete" %}</a></li>
</ul> </ul>
@ -133,7 +133,7 @@ src="{% static 'img/blank_image.png' %}"
<span class='fas fa-plus-circle'></span> {% trans "New Parameter" %} <span class='fas fa-plus-circle'></span> {% trans "New Parameter" %}
</button> </button>
<div id='opt-dropdown' class="btn-group"> <div id='opt-dropdown' class="btn-group">
<button id='parameter-options' class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown">{% trans "Options" %}<span class="caret"></span></button> <button id='parameter-options' class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown">{% trans "Options" %} <span class="caret"></span></button>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
<li><a href='#' id='multi-parameter-delete' title='{% trans "Delete parameters" %}'>{% trans "Delete" %}</a></li> <li><a href='#' id='multi-parameter-delete' title='{% trans "Delete parameters" %}'>{% trans "Delete" %}</a></li>
</ul> </ul>

View File

@ -132,7 +132,7 @@
</button> </button>
{% endif %} {% endif %}
<div class='btn-group'> <div class='btn-group'>
<button id='part-options' class='btn btn-primary dropdown-toggle' type='button' data-toggle="dropdown">{% trans "Options" %}<span class='caret'></span></button> <button id='part-options' class='btn btn-primary dropdown-toggle' type='button' data-toggle="dropdown">{% trans "Options" %} <span class='caret'></span></button>
<ul class='dropdown-menu'> <ul class='dropdown-menu'>
{% if roles.part.change %} {% if roles.part.change %}
<li><a href='#' id='multi-part-category' title='{% trans "Set category" %}'>{% trans "Set Category" %}</a></li> <li><a href='#' id='multi-part-category' title='{% trans "Set category" %}'>{% trans "Set Category" %}</a></li>

View File

@ -289,7 +289,7 @@
<span class='fas fa-plus-circle'></span> {% trans "New Supplier Part" %} <span class='fas fa-plus-circle'></span> {% trans "New Supplier Part" %}
</button> </button>
<div id='opt-dropdown' class="btn-group"> <div id='opt-dropdown' class="btn-group">
<button id='supplier-part-options' class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown">{% trans "Options" %}<span class="caret"></span></button> <button id='supplier-part-options' class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown">{% trans "Options" %} <span class="caret"></span></button>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
<li><a href='#' id='supplier-part-delete' title='{% trans "Delete supplier parts" %}'>{% trans "Delete" %}</a></li> <li><a href='#' id='supplier-part-delete' title='{% trans "Delete supplier parts" %}'>{% trans "Delete" %}</a></li>
</ul> </ul>
@ -312,7 +312,7 @@
<span class='fas fa-plus-circle'></span> {% trans "New Manufacturer Part" %} <span class='fas fa-plus-circle'></span> {% trans "New Manufacturer Part" %}
</button> </button>
<div id='opt-dropdown' class="btn-group"> <div id='opt-dropdown' class="btn-group">
<button id='manufacturer-part-options' class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown">{% trans "Options" %}<span class="caret"></span></button> <button id='manufacturer-part-options' class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown">{% trans "Options" %} <span class="caret"></span></button>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
<li><a href='#' id='manufacturer-part-delete' title='{% trans "Delete manufacturer parts" %}'>{% trans "Delete" %}</a></li> <li><a href='#' id='manufacturer-part-delete' title='{% trans "Delete manufacturer parts" %}'>{% trans "Delete" %}</a></li>
</ul> </ul>