|
1 | 1 | <div class="<%= stimulus_id %>" data-controller="<%= stimulus_id %>">
|
2 | 2 | <div class="rounded p-2">
|
3 |
| - <%= render component('ui/panel').new(title: @shipment.number) do |panel| %> |
| 3 | + <%= render component('ui/panel').new do |panel| %> |
| 4 | + <% panel.with_section(wide: true, high: true) do %> |
| 5 | + <section class="border-gray-100 border-t w-full first-of-type:border-t-0 p-6"> |
| 6 | + <h2> |
| 7 | + <span class="text-xl"> |
| 8 | + #<%= @index %>: <%= @shipment.number %> from <%= @shipment.stock_location.name %> <%= render component('ui/badge').new(name: @shipment.state.titleize) %> |
| 9 | + </span> |
| 10 | + </h2> |
| 11 | + </section> |
| 12 | + <% end %> |
| 13 | + |
4 | 14 | <% panel.with_section(wide: true, high: true) do %>
|
5 | 15 | <div class="rounded-b-lg overflow-hidden">
|
6 | 16 | <table class="table-auto w-full">
|
7 | 17 | <thead>
|
8 | 18 | <tr>
|
9 |
| - <th class="text-left body-small-bold text-gray-800 bg-gray-15 px-6 py-3 leading-none">Product</th> |
10 |
| - <th class="text-left body-small-bold text-gray-800 bg-gray-15 px-6 py-3 leading-none w-16">Quantity</th> |
11 |
| - <th class="text-left body-small-bold text-gray-800 bg-gray-15 px-6 py-3 leading-none w-16 whitespace-nowrap">Total Price</th> |
12 |
| - <th class="text-left body-small-bold text-gray-800 bg-gray-15 px-6 py-3 leading-none w-16"><span class="sr-only">Actions</span></th> |
| 19 | + <th class="text-left body-small-bold text-gray-800 bg-gray-15 px-6 py-3 leading-none"><%= t(".product") %></th> |
| 20 | + <th class="text-left body-small-bold text-gray-800 bg-gray-15 px-6 py-3 leading-none w-16"><%= t(".quantity") %></th> |
| 21 | + <th class="text-left body-small-bold text-gray-800 bg-gray-15 px-6 py-3 leading-none w-16 whitespace-nowrap"><%= t(".total") %>/th> |
| 22 | + <th class="text-left body-small-bold text-gray-800 bg-gray-15 px-6 py-3 leading-none w-16"><span class="sr-only"><%= t(".actions") %></span></th> |
13 | 23 | </tr>
|
14 | 24 | </thead>
|
15 | 25 | <tbody>
|
16 |
| - <% |
17 |
| - shipment_manifest = Spree::ShippingManifest.new( |
18 |
| - inventory_units: @shipment.last.inventory_units.where(carton_id: nil), |
19 |
| - ).items.sort_by { |item| item.line_item.created_at } |
20 |
| - %> |
21 |
| - |
22 |
| - <% shipment_manifest.each do |item| %> |
| 26 | + <% manifest.each do |item| %> |
23 | 27 | <tr class="border-gray-100 border-t">
|
24 | 28 | <td class="px-6 py-4">
|
25 | 29 | <div class="flex gap-2 grow">
|
|
63 | 67 | <% end %>
|
64 | 68 | <tr class="border-gray-100 border-t">
|
65 | 69 | <td colspan="4" class="px-6 py-4">
|
66 |
| - <%= form_for(@shipment, url: '#') do |f| %> |
67 |
| - <%= render component("ui/forms/field").select( |
68 |
| - f, |
69 |
| - :shipping_method, |
70 |
| - Spree::ShippingMethod.order(:name).pluck(:name, :id), |
71 |
| - class: "mb-4" |
72 |
| - ) %> |
| 70 | + <ul class="text-sm"> |
| 71 | + <li class="flex justify-between py-1.5"> |
| 72 | + <label class="flex flex-col w-full"> |
| 73 | + <span class="text-gray-700 body-tiny-bold body-text-xs-semibold"> |
| 74 | + <%= @shipment.class.human_attribute_name(:shipping_method) %> |
| 75 | + </span> |
| 76 | + <%= @shipment.shipping_method.name %> - <%= @shipment.display_cost %> |
| 77 | + </label> |
| 78 | + |
| 79 | + <%= render component("ui/icon").new(name: 'edit-line', class: 'w-5 h-5 cursor-pointer') %> |
| 80 | + </li> |
| 81 | + <li class="flex justify-between py-1.5"> |
| 82 | + <label class="flex flex-col w-full py-1.5"> |
| 83 | + <span class="text-gray-700 body-tiny-bold body-text-xs-semibold"> |
| 84 | + <%= @shipment.class.human_attribute_name(:tracking) %> |
| 85 | + </span> |
| 86 | + <%= @shipment.tracking || t(".none") %> |
| 87 | + </label> |
73 | 88 |
|
74 |
| - <%= render component("ui/forms/field").text_field( |
75 |
| - f, |
76 |
| - :tracking |
77 |
| - ) %> |
78 |
| - <% end %> |
| 89 | + <%= render component("ui/icon").new(name: 'edit-line', class: 'w-5 h-5 cursor-pointer') %> |
| 90 | + </li> |
| 91 | + </ul> |
79 | 92 | </td>
|
80 | 93 | </tr>
|
81 | 94 | </tbody>
|
|
0 commit comments