-
Notifications
You must be signed in to change notification settings - Fork 4.9k
/
_shipment.html.erb
116 lines (106 loc) · 4.93 KB
/
_shipment.html.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<div id="<%= "shipment_#{shipment.id}" %>" data-hook="admin_shipment_form">
<%= render :partial => "spree/admin/variants/split", :formats => :js %>
<fieldset class="no-border-bottom">
<legend align="center" class="stock-location" data-hook="stock-location">
<span class="shipment-number"><%= shipment.number %></span>
-
<span class="shipment-state"><%= Spree.t("shipment_states.#{shipment.state}") %></span>
<%= Spree.t(:package_from) %>
<strong class="stock-location-name" data-hook="stock-location-name">'<%= shipment.stock_location.name %>'</strong>
<% if shipment.ready? and can? :update, shipment %>
-
<%= link_to Spree.t(:ship), '#', :class => 'ship button fa fa-arrow-right', :data => {'shipment-number' => shipment.number} %>
<% end %>
</legend>
</fieldset>
<table class="stock-contents index" data-hook="stock-contents">
<colgroup>
<col style="width: 10%;" />
<col style="width: 30%;" />
<col style="width: 15%;" />
<col style="width: 15%;" />
<col style="width: 15%;" />
<col style="width: 15%;" />
</colgroup>
<thead>
<th colspan="2"><%= Spree.t(:item_description) %></th>
<th><%= Spree.t(:price) %></th>
<th><%= Spree.t(:quantity) %></th>
<th><%= Spree.t(:total) %></th>
<th class="orders-actions actions" data-hook="admin_order_form_line_items_header_actions"></th>
</thead>
<tbody data-shipment-number="<%= shipment.number %>" data-order-number="<%= order.number %>">
<%= render 'spree/admin/orders/shipment_manifest', shipment: shipment %>
<% unless shipment.shipped? %>
<tr class="edit-method hidden total">
<td colspan="5">
<div class="field alpha five columns">
<%= label_tag 'selected_shipping_rate_id', Spree.t(:shipping_method) %>
<%= select_tag :selected_shipping_rate_id,
options_for_select(shipment.shipping_rates.map {|sr| ["#{sr.name} #{sr.display_price}", sr.id] }, shipment.selected_shipping_rate_id),
{:class => 'select2 fullwidth', :data => {'shipment-number' => shipment.number } } %>
</div>
</td>
<td class="actions">
<% if can? :update, shipment %>
<%= link_to '', '#', :class => 'save-method fa fa-ok no-text with-tip',
:data => {'shipment-number' => shipment.number, :action => 'save'}, title: Spree.t('actions.save') %>
<%= link_to '', '#', :class => 'cancel-method fa fa-cancel no-text with-tip',
:data => {:action => 'cancel'}, :title => Spree.t('actions.cancel') %>
<% end %>
</td>
</tr>
<% end %>
<tr class="show-method total">
<% if rate = shipment.selected_shipping_rate %>
<td colspan="4">
<strong><%= rate.name %></strong>
</td>
<td class="total" align="center">
<span><%= shipment.display_cost %></span>
</td>
<% else %>
<td colspan='5'><%= Spree.t(:no_shipping_method_selected) %></td>
<% end %>
<td class="actions">
<% if( (can? :update, shipment) and !shipment.shipped?) %>
<%= link_to '', '#', :class => 'edit-method fa fa-edit no-text with-tip', :data => {:action => 'edit'}, :title => Spree.t('edit') %>
<% end %>
</td>
</tr>
<tr class="edit-tracking hidden total">
<td colspan="5">
<label><%= Spree.t(:tracking_number) %>:</label>
<%= text_field_tag :tracking, shipment.tracking %>
</td>
<td class="actions">
<% if can? :update, shipment %>
<%= link_to '', '#', :class => 'save-tracking fa fa-ok no-text with-tip', :data => {'shipment-number' => shipment.number, :action => 'save'}, :title => Spree.t('actions.save') %>
<%= link_to '', '#', :class => 'cancel-tracking fa fa-cancel no-text with-tip', :data => {:action => 'cancel'}, :title => Spree.t('actions.cancel') %>
<% end %>
</td>
</tr>
<% if order.special_instructions.present? %>
<tr class='special_instructions'>
<td colspan="5">
<strong><%= Spree.t(:special_instructions) %>: </strong><%= order.special_instructions %>
</td>
</tr>
<% end %>
<tr class="show-tracking total">
<td colspan="5" class="tracking-value">
<% if shipment.tracking.present? %>
<strong><%= Spree.t(:tracking) %>:</strong> <%= shipment.tracking %>
<% else %>
<%= Spree.t(:no_tracking_present) %>
<% end %>
</td>
<td class="actions">
<% if can? :update, shipment %>
<%= link_to '', '#', :class => 'edit-tracking fa fa-edit no-text with-tip', :data => {:action => 'edit'}, :title => Spree.t('edit') %>
<% end %>
</td>
</tr>
</tbody>
</table>
</div>