mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-11-04 07:05:41 +00:00 
			
		
		
		
	Add buttons to expand / collapse shipment tables
This commit is contained in:
		@@ -275,13 +275,8 @@
 | 
				
			|||||||
                    </div>
 | 
					                    </div>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    {% if build.has_tracked_bom_items %}
 | 
					                    {% if build.has_tracked_bom_items %}
 | 
				
			||||||
                    <button id='outputs-expand' class='btn btn-outline-secondary' type='button' title='{% trans "Expand all build output rows" %}'>
 | 
					                    {% include "expand_rows.html" with label="outputs" %}
 | 
				
			||||||
                        <span class='fas fa-expand'></span>
 | 
					                    {% include "collapse_rows.html" with label="outputs" %}
 | 
				
			||||||
                    </button>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                    <button id='outputs-collapse' class='btn btn-outline-secondary' type='button' title='{% trans "Collapse all build output rows" %}'>
 | 
					 | 
				
			||||||
                        <span class='fas fa-compress'></span>
 | 
					 | 
				
			||||||
                    </button>
 | 
					 | 
				
			||||||
                    {% endif %}
 | 
					                    {% endif %}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    {% include "filter_list.html" with id='incompletebuilditems' %}
 | 
					                    {% include "filter_list.html" with id='incompletebuilditems' %}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -86,6 +86,8 @@
 | 
				
			|||||||
        {% if roles.sales_order.change %}
 | 
					        {% if roles.sales_order.change %}
 | 
				
			||||||
        <div id='pending-shipment-toolbar' class='btn-group' style='float: right;'>
 | 
					        <div id='pending-shipment-toolbar' class='btn-group' style='float: right;'>
 | 
				
			||||||
            <div class='btn-group' role='group'>
 | 
					            <div class='btn-group' role='group'>
 | 
				
			||||||
 | 
					                {% include "expand_rows.html" with label="pending-shipments" %}
 | 
				
			||||||
 | 
					                {% include "collapse_rows.html" with label="pending-shipments" %}
 | 
				
			||||||
                {% include "filter_list.html" with id="pending-shipments" %}
 | 
					                {% include "filter_list.html" with id="pending-shipments" %}
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
@@ -102,6 +104,8 @@
 | 
				
			|||||||
    <div class='panel-content'>
 | 
					    <div class='panel-content'>
 | 
				
			||||||
        <div id='completed-shipment-toolbar' class='btn-group' style='float: right;'>
 | 
					        <div id='completed-shipment-toolbar' class='btn-group' style='float: right;'>
 | 
				
			||||||
            <div class='btn-group' role='group'>
 | 
					            <div class='btn-group' role='group'>
 | 
				
			||||||
 | 
					                {% include "expand_rows.html" with label="completed-shipments" %}
 | 
				
			||||||
 | 
					                {% include "collapse_rows.html" with label="completed-shipments" %}
 | 
				
			||||||
                {% include "filter_list.html" with id="completed-shipments" %}
 | 
					                {% include "filter_list.html" with id="completed-shipments" %}
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										5
									
								
								InvenTree/templates/collapse_rows.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								InvenTree/templates/collapse_rows.html
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,5 @@
 | 
				
			|||||||
 | 
					{% load i18n %}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<button id='{{ label }}-collapse' class='btn btn-outline-secondary' type='button' title='{% trans "Collapse all rows" %}'>
 | 
				
			||||||
 | 
					    <span class='fas fa-compress'></span>
 | 
				
			||||||
 | 
					</button>
 | 
				
			||||||
							
								
								
									
										5
									
								
								InvenTree/templates/expand_rows.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								InvenTree/templates/expand_rows.html
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,5 @@
 | 
				
			|||||||
 | 
					{% load i18n %}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<button id='{{ label }}-expand' class='btn btn-outline-secondary' type='button' title='{% trans "Expand all rows" %}'>
 | 
				
			||||||
 | 
					    <span class='fas fa-expand'></span>
 | 
				
			||||||
 | 
					</button>
 | 
				
			||||||
@@ -2540,6 +2540,17 @@ function loadSalesOrderShipmentTable(table, options={}) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    setupFilterList('salesordershipment', $(table), options.filter_target);
 | 
					    setupFilterList('salesordershipment', $(table), options.filter_target);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    // Add callbacks for expand / collapse buttons
 | 
				
			||||||
 | 
					    var prefix = options.shipped ? 'completed' : 'pending';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    $(`#${prefix}-shipments-expand`).click(function() {
 | 
				
			||||||
 | 
					        $(table).bootstrapTable('expandAllRows');
 | 
				
			||||||
 | 
					    });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    $(`#${prefix}-shipments-collapse`).click(function() {
 | 
				
			||||||
 | 
					        $(table).bootstrapTable('collapseAllRows');
 | 
				
			||||||
 | 
					    });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    function makeShipmentActions(row) {
 | 
					    function makeShipmentActions(row) {
 | 
				
			||||||
        // Construct "actions" for the given shipment row
 | 
					        // Construct "actions" for the given shipment row
 | 
				
			||||||
        var pk = row.pk;
 | 
					        var pk = row.pk;
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user