|
67 | 67 | <!-- Default box --> |
68 | 68 | <div class="card card-primary card-outline card-outline-tabs"> |
69 | 69 | <div class="card-header p-0 border-bottom-0"> |
70 | | - <% show_flow_tab = params[:tab] == "flow" %> |
71 | | - <% date_range_filters = params.fetch(:filters, {}).permit(:date_range, :date_range_label).to_h.compact_blank %> |
72 | 70 | <ul class="nav nav-tabs" id="custom-tabs-three-tab" role="tablist"> |
73 | 71 | <li class="nav-item"> |
74 | | - <a class="nav-link <%= 'active' unless show_flow_tab %>" id="custom-tabs-inventory-tab" data-bs-toggle="pill" href="#custom-tabs-inventory" role="tab" aria-controls="custom-tabs-inventory" aria-selected="<%= !show_flow_tab %>">Inventory</a> |
| 72 | + <a class="nav-link <%= 'active' unless @show_flow_tab %>" id="custom-tabs-inventory-tab" data-bs-toggle="pill" href="#custom-tabs-inventory" role="tab" aria-controls="custom-tabs-inventory" aria-selected="<%= !@show_flow_tab %>">Inventory</a> |
75 | 73 | </li> |
76 | 74 | <li class="nav-item"> |
77 | | - <a class="nav-link <%= 'active' if show_flow_tab %>" id="custom-tabs-inventory-flow-tab" data-bs-toggle="pill" href="#custom-tabs-inventory-flow" role="tab" aria-controls="custom-tabs-inventory-flow" aria-selected="<%= show_flow_tab %>">Inventory Flow</a> |
| 75 | + <a class="nav-link <%= 'active' if @show_flow_tab %>" id="custom-tabs-inventory-flow-tab" data-bs-toggle="pill" href="#custom-tabs-inventory-flow" role="tab" aria-controls="custom-tabs-inventory-flow" aria-selected="<%= @show_flow_tab %>">Inventory Flow</a> |
78 | 76 | </li> |
79 | 77 | </ul> |
80 | 78 | </div> |
81 | 79 | <div class="card-body"> |
82 | 80 | <div class="tab-content" id="custom-tabs-three-tabContent"> |
83 | 81 |
|
84 | | - <div class="tab-pane fade <%= 'show active' unless show_flow_tab %>" id="custom-tabs-inventory" role="tabpanel" aria-labelledby="custom-tabs-inventory-tab"> |
| 82 | + <div class="tab-pane fade <%= 'show active' unless @show_flow_tab %>" id="custom-tabs-inventory" role="tabpanel" aria-labelledby="custom-tabs-inventory-tab"> |
85 | 83 | <%= form_for @storage_location, method: :get do %> |
86 | | - <% date_range_filters.each do |name, value| %> |
| 84 | + <% @date_range_filters.each do |name, value| %> |
87 | 85 | <%= hidden_field_tag "filters[#{name}]", value, id: nil %> |
88 | 86 | <% end %> |
89 | 87 | Show Inventory at Date: <%= date_field_tag 'version_date', params[:version_date], min: InventoryItem::EARLIEST_VERSION, autocomplete: "on" %> |
|
132 | 130 | </table> |
133 | 131 | </div><!-- /.box-body.table-responsive --> |
134 | 132 |
|
135 | | - <div class="tab-pane fade <%= 'show active' if show_flow_tab %>" id="custom-tabs-inventory-flow" role="tabpanel" aria-labelledby="custom-tabs-inventory-flow-tab"> |
| 133 | + <div class="tab-pane fade <%= 'show active' if @show_flow_tab %>" id="custom-tabs-inventory-flow" role="tabpanel" aria-labelledby="custom-tabs-inventory-flow-tab"> |
136 | 134 | <%= form_for @storage_location, method: :get do %> |
137 | 135 | <%= hidden_field_tag :tab, "flow", id: nil %> |
138 | 136 | <%= hidden_field_tag :version_date, params[:version_date], id: nil if params[:version_date].present? %> |
|
148 | 146 | </div> |
149 | 147 | </div> |
150 | 148 | <% end %> |
151 | | - <%= turbo_frame_tag "inventory_flow", loading: :lazy, |
152 | | - src: inventory_flow_storage_location_path(@storage_location, filters: date_range_filters.presence) do %> |
| 149 | + <%= turbo_frame_tag "inventory_flow", loading: :lazy, target: "_top", |
| 150 | + src: inventory_flow_storage_location_path(@storage_location, filters: @date_range_filters.presence) do %> |
153 | 151 | <p class="text-muted">Loading inventory flow…</p> |
154 | 152 | <% end %> |
155 | 153 | </div><!-- /.box-body.table-responsive --> |
|
0 commit comments