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 %} - {% trans "Target Date" %} + + {% trans "Target Date" %} + {{ build.target_date }} {% if build.is_overdue %} - {% trans "Overdue" %} + {% trans "Overdue" %} {% endif %} diff --git a/InvenTree/templates/InvenTree/index.html b/InvenTree/templates/InvenTree/index.html index 545b03c7de..88ee6e53f2 100644 --- a/InvenTree/templates/InvenTree/index.html +++ b/InvenTree/templates/InvenTree/index.html @@ -9,56 +9,14 @@ {% block sidebar %} - -{% include "sidebar_header.html" with text="Parts" icon="fa-shapes" %} -{% include "sidebar_item.html" with label='starred-parts' text="Starred Parts" icon="fa-star" badge=True %} -{% include "sidebar_item.html" with label='latest-parts' text="Latest Parts" icon="fa-newspaper" badge=True %} -{% include "sidebar_item.html" with label='bom-validation' text="BOM Requires Attention" icon="fa-times-circle" badge=True %} - - -{% include "sidebar_header.html" with text="Stock" icon="fa-boxes" %} -{% include "sidebar_item.html" with label='recently-updated-stock' text="Recently Updates" icon="fa-clock" badge=True %} -{% include "sidebar_item.html" with label='low-stock' text="Low Stock" icon="fa-shopping-cart" badge=True %} -{% include "sidebar_item.html" with label='depleted-stock' text="Depleted Stock" icon="fa-times badge=True" %} -{% include "sidebar_item.html" with label='stock-to-build' text="Need to Build" icon="fa-bullhorn" badge=True %} -{% include "sidebar_item.html" with label='expired-stock' text="Expired Stock" icon="fa-calendar-times" badge=True %} -{% include "sidebar_item.html" with label='stale-stock' text="Stale Stock" icon="fa-stopwatch" badge=True %} - - -{% include "sidebar_header.html" with text="Build Orders" icon="fa-tools" %} -{% include "sidebar_item.html" with label='build-pending' text="In Progress" icon="fa-cogs" badge=True %} -{% include "sidebar_item.html" with label='build-overdue' text="Overdue" icon="fa-calendar-times" badge=True %} - - -{% include "sidebar_header.html" with text="Purchase Orders" icon="fa-shopping-cart" %} -{% include "sidebar_item.html" with label='po-outstanding' text="Outstanding" icon="fa-sign-in-alt" badge=True %} -{% include "sidebar_item.html" with label='po-overdue' text="Overdue" icon="fa-calendar-times" badge=True %} - - -{% include "sidebar_header.html" with text="Sales Orders" icon="fa-truck" %} -{% include "sidebar_item.html" with label='so-outstanding' text="Outstanding" icon="fa-sign-out-alt" badge=True %} -{% include "sidebar_item.html" with label='so-overdue' text="Overdue" icon="fa-calendar-times" badge=True %} - + {% endblock %} {% block content %} +

{% inventree_title %}


- -
-
- -
-
-
- +
{% 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( + `
    +
    +

    ${title}

    +
    +
    +
    +
    +
    ` ); - $(`#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 @@