|
68 | 68 | <div class="card card-primary card-outline card-outline-tabs"> |
69 | 69 | <div class="card-header p-0 border-bottom-0"> |
70 | 70 | <ul class="nav nav-tabs" id="custom-tabs-three-tab" role="tablist"> |
71 | | - <li class="nav-item active"> |
72 | | - <a class="nav-link active" id="custom-tabs-inventory-tab" data-bs-toggle="pill" href="#custom-tabs-inventory" role="tab" aria-controls="custom-tabs-one-home-tab" aria-selected="true">Inventory</a> |
| 71 | + <li class="nav-item <%= params.dig(:filters, :date_range).nil? ? 'active' : '' %>"> |
| 72 | + <a class="nav-link <%= params.dig(:filters, :date_range).nil? ? 'active' : '' %>" id="custom-tabs-inventory-tab" data-bs-toggle="pill" href="#custom-tabs-inventory" role="tab" aria-controls="custom-tabs-one-home-tab" aria-selected="true">Inventory</a> |
73 | 73 | </li> |
74 | | - <li class="nav-item"> |
75 | | - <a class="nav-link" id="custom-tabs-inventory-flow-tab" data-bs-toggle="pill" href="#custom-tabs-inventory-flow" role="tab" aria-controls="custom-tabs-two-home-tab" aria-selected="false">Inventory Flow</a> |
| 74 | + <li class="nav-item <%= params.dig(:filters, :date_range).present? ? 'active' : '' %>"> |
| 75 | + <a class="nav-link <%= params.dig(:filters, :date_range).present? ? 'active' : '' %>" id="custom-tabs-inventory-flow-tab" data-bs-toggle="pill" href="#custom-tabs-inventory-flow" role="tab" aria-controls="custom-tabs-two-home-tab" aria-selected="false">Inventory Flow</a> |
76 | 76 | </li> |
77 | 77 | </ul> |
78 | 78 | </div> |
79 | 79 | <div class="card-body"> |
80 | 80 | <div class="tab-content" id="custom-tabs-three-tabContent"> |
81 | 81 |
|
82 | | - <div class="tab-pane fade show active" id="custom-tabs-inventory" role="tabpanel" aria-labelledby="custom-tabs-one-home-tab"> |
| 82 | + <div class="tab-pane fade <%= params.dig(:filters, :date_range).nil? ? 'show active' : '' %>" id="custom-tabs-inventory" role="tabpanel" aria-labelledby="custom-tabs-one-home-tab"> |
83 | 83 | <%= form_for @storage_location, method: :get do %> |
84 | 84 | Show Inventory at Date: <%= date_field_tag 'version_date', params[:version_date], min: InventoryItem::EARLIEST_VERSION, autocomplete: "on" %> |
85 | 85 | <%= filter_button(text: 'View') %> |
|
128 | 128 | </table> |
129 | 129 | </div><!-- /.box-body.table-responsive --> |
130 | 130 |
|
131 | | - <div class="tab-pane fade show" id="custom-tabs-inventory-flow" role="tabpanel" aria-labelledby="custom-two-home-tab"> |
| 131 | + <div class="tab-pane fade <%= params.dig(:filters, :date_range).present? ? 'show active' : '' %>" id="custom-tabs-inventory-flow" role="tabpanel" aria-labelledby="custom-two-home-tab"> |
132 | 132 | <%= form_for @storage_location, method: :get do %> |
133 | 133 | <%= label_tag "Date Range" %> |
134 | 134 | <div class="row"> |
|
0 commit comments