mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Add overdue builds to the index page
This commit is contained in:
parent
c8c50af54b
commit
17d23fa47c
15
InvenTree/templates/InvenTree/build_overdue.html
Normal file
15
InvenTree/templates/InvenTree/build_overdue.html
Normal file
@ -0,0 +1,15 @@
|
||||
{% extends "collapse_index.html" %}
|
||||
|
||||
{% load i18n %}
|
||||
|
||||
{% block collapse_title %}
|
||||
<span class='fas fa-calendar-times icon-header'></span>
|
||||
{% trans "Overdue Builds" %}<span class='badge' id='build-overdue-count'><span class='fas fa-spin fa-spinner'></span></span>
|
||||
{% endblock %}
|
||||
|
||||
{% block collapse_content %}
|
||||
|
||||
<table class='table table-striped table-condensed' id='build-overdue-table'>
|
||||
</table>
|
||||
|
||||
{% endblock %}
|
@ -16,6 +16,7 @@ InvenTree | {% trans "Index" %}
|
||||
{% endif %}
|
||||
{% if roles.build.view %}
|
||||
{% include "InvenTree/build_pending.html" with collapse_id="build_pending" %}
|
||||
{% include "InvenTree/build_overdue.html" with collapse_id="build_overdue" %}
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class='col-sm-6'>
|
||||
@ -72,6 +73,15 @@ loadBuildTable("#build-pending-table", {
|
||||
disableFilters: true,
|
||||
});
|
||||
|
||||
loadBuildTable("#build-overdue-table", {
|
||||
url: "{% url 'api-build-list' %}",
|
||||
params: {
|
||||
part_detail: true,
|
||||
overdue: true,
|
||||
},
|
||||
disableFilters: true,
|
||||
});
|
||||
|
||||
loadSimplePartTable("#low-stock-table", "{% url 'api-part-list' %}", {
|
||||
params: {
|
||||
low_stock: true,
|
||||
@ -126,6 +136,12 @@ $("#build-pending-table").on('load-success.bs.table', function() {
|
||||
$("#build-pending-count").html(count);
|
||||
});
|
||||
|
||||
$("#build-overdue-table").on('load-success.bs.table', function() {
|
||||
var count = $("#build-overdue-table").bootstrapTable('getData').length;
|
||||
|
||||
$("#build-overdue-count").html(count);
|
||||
});
|
||||
|
||||
$("#low-stock-table").on('load-success.bs.table', function() {
|
||||
var count = $("#low-stock-table").bootstrapTable('getData').length;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user