2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-04-30 12:36:45 +00:00

More tweaks

This commit is contained in:
Oliver 2021-10-30 13:18:11 +11:00
parent c4c533bee0
commit a689b77cfb
5 changed files with 61 additions and 38 deletions

View File

@ -24,16 +24,6 @@
<div id='bom-button-toolbar'> <div id='bom-button-toolbar'>
<div class="btn-group" role="group" aria-label="..."> <div class="btn-group" role="group" aria-label="...">
<!-- Export menu -->
<div class='btn-group'>
<button id='export-options' title='{% trans "Export actions" %}' class='btn btn-outline-secondary dropdown-toggle' type='button' data-bs-toggle='dropdown'>
<span class='fas fa-download'></span> <span class='caret'></span>
</button>
<ul class='dropdown-menu' role='menu'>
<li><a class='dropdown-item' href='#' id='download-bom'><span class='fas fa-file-download'></span> {% trans "Export BOM" %}</a></li>
<li><a class='dropdown-item' href='#' id='print-bom-report'><span class='fas fa-file-pdf'></span> {% trans "Print BOM Report" %}</a></li>
</ul>
</div>
{% if roles.part.change %} {% if roles.part.change %}
<!-- Action menu --> <!-- Action menu -->
<div class='btn-group'> <div class='btn-group'>
@ -41,13 +31,6 @@
<span class='fas fa-wrench'></span> <span class='caret'></span> <span class='fas fa-wrench'></span> <span class='caret'></span>
</button> </button>
<ul class='dropdown-menu' role='menu'> <ul class='dropdown-menu' role='menu'>
<li><a class='dropdown-item' href='#' id='bom-upload'><span class='fas fa-file-upload'></span> {% trans "Upload BOM" %}</a></li>
{% if part.variant_of %}
<li><a class='dropdown-item' href='#' id='bom-duplicate'><span class='fas fa-clone'></span> {% trans "Copy BOM" %}</a></li>
{% endif %}
{% if not part.is_bom_valid %}
<li><a class='dropdown-item' href='#' id='validate-bom'><span class='fas fa-clipboard-check icon-green'></span> {% trans "Validate BOM" %}</a></li>
{% endif %}
<li><a class='dropdown-item' href='#' id='bom-item-delete'><span class='fas fa-trash-alt icon-red'></span> {% trans "Delete Items" %}</a></li> <li><a class='dropdown-item' href='#' id='bom-item-delete'><span class='fas fa-trash-alt icon-red'></span> {% trans "Delete Items" %}</a></li>
</ul> </ul>
</div> </div>

View File

@ -346,6 +346,32 @@
<h4>{% trans "Bill of Materials" %}</h4> <h4>{% trans "Bill of Materials" %}</h4>
{% include "spacer.html" %} {% include "spacer.html" %}
<div class='btn-group' role='group'> <div class='btn-group' role='group'>
<!-- Export menu -->
<div class='btn-group'>
<button id='export-options' title='{% trans "Export actions" %}' class='btn btn-outline-secondary dropdown-toggle' type='button' data-bs-toggle='dropdown'>
<span class='fas fa-download'></span> <span class='caret'></span>
</button>
<ul class='dropdown-menu' role='menu'>
<li><a class='dropdown-item' href='#' id='download-bom'><span class='fas fa-file-download'></span> {% trans "Export BOM" %}</a></li>
<li><a class='dropdown-item' href='#' id='print-bom-report'><span class='fas fa-file-pdf'></span> {% trans "Print BOM Report" %}</a></li>
</ul>
</div>
<!-- Actions menu -->
<div class='btn-group'>
<button id='bom-actions' title='{% trans "BOM actions" %}' class='btn btn-outline-secondary dropdown-toggle' type='button' data-bs-toggle='dropdown'>
<span class='fas fa-wrench'></span> <span class='caret'></span>
</button>
<ul class='dropdown-menu' role='menu'>
<li><a class='dropdown-item' href='#' id='bom-upload'><span class='fas fa-file-upload'></span> {% trans "Upload BOM" %}</a></li>
{% if part.variant_of %}
<li><a class='dropdown-item' href='#' id='bom-duplicate'><span class='fas fa-clone'></span> {% trans "Copy BOM" %}</a></li>
{% endif %}
{% if not part.is_bom_valid %}
<li><a class='dropdown-item' href='#' id='validate-bom'><span class='fas fa-clipboard-check icon-green'></span> {% trans "Validate BOM" %}</a></li>
{% endif %}
</ul>
</div>
{% if roles.part.change %} {% if roles.part.change %}
<button class='btn btn-success' type='button' title='{% trans "New BOM Item" %}' id='bom-item-new'> <button class='btn btn-success' type='button' title='{% trans "New BOM Item" %}' id='bom-item-new'>
<span class='fas fa-plus-circle'></span> {% trans "Add BOM Item" %} <span class='fas fa-plus-circle'></span> {% trans "Add BOM Item" %}

View File

@ -60,23 +60,28 @@
<div class='panel panel-hidden' id='panel-test-data'> <div class='panel panel-hidden' id='panel-test-data'>
<div class='panel-heading'> <div class='panel-heading'>
<h4>{% trans "Test Data" %}</h4> <div class='d-flex flex-row'>
<h4>{% trans "Test Data" %}</h4>
{% include "spacer.html" %}
<div class='btn-group' role='group'>
<button type='button' class='btn btn-outline-secondary' id='test-report'>
<span class='fas fa-file-pdf'></span> {% trans "Test Report" %}
</button>
{% if user.is_staff %}
<button type='button' class='btn btn-danger' id='delete-test-results'>
<span class='fas fa-trash-alt'></span> {% trans "Delete Test Data" %}
</button>
{% endif %}
<button type='button' class='btn btn-success' id='add-test-result'>
<span class='fas fa-plus-circle'></span> {% trans "Add Test Data" %}
</button>
</div>
</div>
</div> </div>
<div class='panel-content'> <div class='panel-content'>
<div id='test-button-toolbar'> <div id='test-button-toolbar'>
<div class='button-toolbar container-fluid' style="float: right;"> <div class='button-toolbar container-fluid' style="float: right;">
<div class='btn-group' role='group'> <div class='btn-group' role='group'>
{% if user.is_staff %}
<button type='button' class='btn btn-danger' id='delete-test-results'>
<span class='fas fa-trash-alt'></span> {% trans "Delete Test Data" %}
</button>
{% endif %}
<button type='button' class='btn btn-success' id='add-test-result'>
<span class='fas fa-plus-circle'></span> {% trans "Add Test Data" %}
</button>
<button type='button' class='btn btn-outline-secondary' id='test-report'>
<span class='fas fa-tasks'></span> {% trans "Test Report" %}
</button>
</div> </div>
<div class='filter-list' id='filter-list-stocktests'> <div class='filter-list' id='filter-list-stocktests'>
<!-- Empty div --> <!-- Empty div -->
@ -128,13 +133,18 @@
<div class='panel panel-hidden' id='panel-installed-items'> <div class='panel panel-hidden' id='panel-installed-items'>
<div class='panel-heading'> <div class='panel-heading'>
<h4>{% trans "Installed Stock Items" %}</h4> <div class='d-flex flex-row'>
<h4>{% trans "Installed Stock Items" %}</h4>
{% include "spacer.html" %}
<div class='btn-group' role='group'>
<button type='button' class='btn btn-success' id='stock-item-install'>
<span class='fas fa-plus-circle'></span> {% trans "Install Stock Item" %}
</button>
</div>
</div>
</div> </div>
<div class='panel-content'> <div class='panel-content'>
<div class='btn-group'> <div class='btn-group'>
<button type='button' class='btn btn-success' id='stock-item-install'>
<span class='fas fa-plus-circle'></span> {% trans "Install Stock Item" %}
</button>
</div> </div>
<table class='table table-striped table-condensed' id='installed-table'></table> <table class='table table-striped table-condensed' id='installed-table'></table>
</div> </div>

View File

@ -27,7 +27,7 @@ function loadAttachmentTable(url, options) {
return '{% trans "No attachments found" %}'; return '{% trans "No attachments found" %}';
}, },
sortable: true, sortable: true,
search: false, search: true,
queryParams: options.filters || {}, queryParams: options.filters || {},
onPostBody: function() { onPostBody: function() {
// Add callback for 'edit' button // Add callback for 'edit' button
@ -58,12 +58,16 @@ function loadAttachmentTable(url, options) {
var fn = value.toLowerCase(); var fn = value.toLowerCase();
if (fn.endsWith('.pdf')) { if (fn.endsWith('.csv')) {
icon = 'fa-file-csv';
} else if (fn.endsWith('.pdf')) {
icon = 'fa-file-pdf'; icon = 'fa-file-pdf';
} else if (fn.endsWith('.xls') || fn.endsWith('.xlsx')) { } else if (fn.endsWith('.xls') || fn.endsWith('.xlsx')) {
icon = 'fa-file-excel'; icon = 'fa-file-excel';
} else if (fn.endsWith('.doc') || fn.endsWith('.docx')) { } else if (fn.endsWith('.doc') || fn.endsWith('.docx')) {
icon = 'fa-file-word'; icon = 'fa-file-word';
} else if (fn.endsWith('.zip') || fn.endsWith('.7z')) {
icon = 'fa-file-archive';
} else { } else {
var images = ['.png', '.jpg', '.bmp', '.gif', '.svg', '.tif']; var images = ['.png', '.jpg', '.bmp', '.gif', '.svg', '.tif'];

View File

@ -453,14 +453,14 @@ function removeStockRow(e) {
function passFailBadge(result) { function passFailBadge(result) {
if (result) { if (result) {
return `<span class='badge rounded-pill bg-success'>{% trans "PASS" %}</span>`; return `<span class='badge badge-right rounded-pill bg-success'>{% trans "PASS" %}</span>`;
} else { } else {
return `<span class='badge rounded-pill bg-danger'>{% trans "FAIL" %}</span>`; return `<span class='badge badge-right rounded-pill bg-danger'>{% trans "FAIL" %}</span>`;
} }
} }
function noResultBadge() { function noResultBadge() {
return `<span class='badge rounded-pill bg-info'>{% trans "NO RESULT" %}</span>`; return `<span class='badge badge-right rounded-pill bg-info'>{% trans "NO RESULT" %}</span>`;
} }
function formatDate(row) { function formatDate(row) {