diff --git a/InvenTree/build/templates/build/build_base.html b/InvenTree/build/templates/build/build_base.html
index 155f665548..ea094204e0 100644
--- a/InvenTree/build/templates/build/build_base.html
+++ b/InvenTree/build/templates/build/build_base.html
@@ -88,11 +88,13 @@ src="{% static 'img/blank_image.png' %}"
{% if build.target_date %}
-
- -
-
-
-
-
-
+
{% endblock %}
@@ -68,67 +26,51 @@
{{ block.super }}
function addHeaderTitle(title) {
- // Add a header block to the action list
- $("#action-item-list").append(
- `
${title}`
- );
+
+ addSidebarHeader({
+ text: title,
+ });
}
function addHeaderAction(label, title, icon, options) {
- // Add an action block to the action list
- $("#action-item-list").append(
- `
-
-
- ${title}
-
-
-
-
- `
- );
+
+ // Construct a "badge" to add to the sidebar item
+ var badge = `
+
+ `;
+
+ addSidebarItem({
+ label: label,
+ text: title,
+ icon: icon,
+ content_after: badge
+ });
// Add a detail item to the detail item-panel
- $("#detail-item-list").append(
- `
- ${title}
-
- `
+ $("#detail-panels").append(
+ `
`
);
- $(`#detail-${label}`).hide();
-
- $(`#action-${label}`).click(function() {
-
- // Hide all child elements
- $('#detail-item-list').children('li').each(function() {
- $(this).hide();
- });
-
- // Show the one we want
- $(`#detail-${label}`).fadeIn();
-
- // Remove css class from all action items
- $("#action-item-list").children('li').each(function() {
- $(this).removeClass('index-action-selected');
- });
-
- // Add css class to the action we are interested in
- $(`#action-${label}`).addClass('index-action-selected');
- });
-
// Connect a callback to the table
$(`#table-${label}`).on('load-success.bs.table', function() {
var count = $(`#table-${label}`).bootstrapTable('getData').length;
- $(`#badge-${label}`).html(count);
+ var badge = $(`#sidebar-badge-${label}`);
- $(`#badge-${label}`).removeClass('bg-dark');
+ badge.html(count);
if (count > 0) {
- $(`#badge-${label}`).addClass('bg-primary');
- } else {
- $(`#badge-${label}`).addClass('bg-warning');
+ badge.removeClass('bg-dark');
+ badge.addClass('bg-primary');
}
});
}
diff --git a/InvenTree/templates/base.html b/InvenTree/templates/base.html
index d253475e49..d399781aeb 100644
--- a/InvenTree/templates/base.html
+++ b/InvenTree/templates/base.html
@@ -73,7 +73,7 @@