mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-10-31 13:15:43 +00:00 
			
		
		
		
	Added latest parts and invalid BOMs on homepage
This commit is contained in:
		
							
								
								
									
										15
									
								
								InvenTree/templates/InvenTree/bom_invalid.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								InvenTree/templates/InvenTree/bom_invalid.html
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,15 @@ | ||||
| {% extends "collapse_index.html" %} | ||||
|  | ||||
| {% load i18n %} | ||||
|  | ||||
| {% block collapse_title %} | ||||
| <span class='fas fa-times-circle icon-header'></span> | ||||
| {% trans "BOM - Missing Validation" %}<span class='badge' id='bom-invalid-count'>0</span> | ||||
| {% endblock %} | ||||
|  | ||||
| {% block collapse_content %} | ||||
|  | ||||
| <table class='table table-striped table-condensed' id='bom-invalid-table'> | ||||
| </table> | ||||
|  | ||||
| {% endblock %} | ||||
| @@ -7,9 +7,24 @@ InvenTree | Index | ||||
| {% block content %} | ||||
| <h3>InvenTree</h3> | ||||
| <hr> | ||||
| {% include "InvenTree/starred_parts.html" with collapse_id="starred" %} | ||||
|  | ||||
| {% include "InvenTree/low_stock.html" with collapse_id="order" %} | ||||
| <div class="row"> | ||||
|     <div class="col-sm-6"> | ||||
|         {% include "InvenTree/latest_parts.html" with collapse_id="latest" %} | ||||
|     </div> | ||||
|     <div class="col-sm-6"> | ||||
|         {% include "InvenTree/bom_invalid.html" with collapse_id="bom_invalid" %} | ||||
|     </div> | ||||
| </div> | ||||
|  | ||||
| <div class="row"> | ||||
|     <div class="col-sm-6"> | ||||
|         {% include "InvenTree/starred_parts.html" with collapse_id="starred" %} | ||||
|     </div> | ||||
|     <div class="col-sm-6"> | ||||
|         {% include "InvenTree/low_stock.html" with collapse_id="order" %} | ||||
|     </div> | ||||
| </div> | ||||
|  | ||||
| {% endblock %} | ||||
|  | ||||
| @@ -21,6 +36,18 @@ InvenTree | Index | ||||
|  | ||||
| {{ block.super }} | ||||
|  | ||||
| loadPartTable("#latest-parts-table", "{% url 'api-part-list' %}", { | ||||
|     params: { | ||||
|         "latest_parts": true, | ||||
|     } | ||||
| }); | ||||
|  | ||||
| loadPartTable("#bom-invalid-table", "{% url 'api-part-list' %}", { | ||||
|     params: { | ||||
|         "bom_invalid": true, | ||||
|     } | ||||
| }); | ||||
|  | ||||
| loadPartTable("#starred-parts-table", "{% url 'api-part-list' %}", { | ||||
|     params: { | ||||
|         "starred": true, | ||||
| @@ -33,6 +60,19 @@ loadPartTable("#low-stock-table", "{% url 'api-part-list' %}", { | ||||
|     } | ||||
| }); | ||||
|  | ||||
| $("#bom-invalid-table").on('load-success.bs.table', function() { | ||||
|     var count = $("#bom-invalid-table").bootstrapTable('getData').length; | ||||
|  | ||||
|     $("#bom-invalid-count").html(count); | ||||
| }); | ||||
|  | ||||
|  | ||||
| $("#latest-parts-table").on('load-success.bs.table', function() { | ||||
|     var count = $("#latest-parts-table").bootstrapTable('getData').length; | ||||
|  | ||||
|     $("#latest-parts-count").html(count); | ||||
| }); | ||||
|  | ||||
| $("#starred-parts-table").on('load-success.bs.table', function() { | ||||
|     var count = $("#starred-parts-table").bootstrapTable('getData').length; | ||||
|  | ||||
|   | ||||
							
								
								
									
										15
									
								
								InvenTree/templates/InvenTree/latest_parts.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								InvenTree/templates/InvenTree/latest_parts.html
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,15 @@ | ||||
| {% extends "collapse_index.html" %} | ||||
|  | ||||
| {% load i18n %} | ||||
|  | ||||
| {% block collapse_title %} | ||||
| <span class='fas fa-newspaper icon-header'></span> | ||||
| {% trans "Latest Parts" %}<span class='badge' id='latest-parts-count'>0</span> | ||||
| {% endblock %} | ||||
|  | ||||
| {% block collapse_content %} | ||||
|  | ||||
| <table class='table table-striped table-condensed' id='latest-parts-table'> | ||||
| </table> | ||||
|  | ||||
| {% endblock %} | ||||
| @@ -9,7 +9,7 @@ | ||||
|  | ||||
| {% block collapse_content %} | ||||
|  | ||||
| <table class='table tabe-striped table-condensed' id='starred-parts-table'> | ||||
| <table class='table table-striped table-condensed' id='starred-parts-table'> | ||||
| </table> | ||||
|  | ||||
| {% endblock %} | ||||
							
								
								
									
										19
									
								
								InvenTree/templates/collapse_index.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								InvenTree/templates/collapse_index.html
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,19 @@ | ||||
| {% block collapse_preamble %} | ||||
| {% endblock %} | ||||
| <div class='panel-group'> | ||||
|     <div class='panel panel-default'> | ||||
|         <div {% block collapse_panel_setup %}class='panel panel-heading'{% endblock %}> | ||||
|             <div class='panel-title'> | ||||
|                 <a data-toggle='collapse' href="#collapse-item-{{ collapse_id }}">{% block collapse_title %}Title{% endblock %}</a> | ||||
|             </div> | ||||
|         {% block collapse_heading %} | ||||
|         {% endblock %} | ||||
|         </div> | ||||
|         <div class='panel-collapse collapse' id='collapse-item-{{ collapse_id }}'> | ||||
|             <div class='panel-body'> | ||||
|                 {% block collapse_content %} | ||||
|                 {% endblock %} | ||||
|             </div> | ||||
|         </div> | ||||
|     </div> | ||||
| </div> | ||||
		Reference in New Issue
	
	Block a user