spree_backend 2.0.3 → 2.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (87) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/fonts/FontAwesome.otf +0 -0
  3. data/app/assets/fonts/fontawesome-webfont.eot +0 -0
  4. data/app/assets/fonts/fontawesome-webfont.svg +399 -0
  5. data/app/assets/fonts/fontawesome-webfont.ttf +0 -0
  6. data/app/assets/fonts/fontawesome-webfont.woff +0 -0
  7. data/app/assets/images/credit_cards/credit_card.gif +0 -0
  8. data/app/assets/javascripts/admin/admin.js.erb +6 -5
  9. data/app/assets/javascripts/admin/option_type_autocomplete.js.erb +1 -2
  10. data/app/assets/javascripts/admin/shipments.js.erb +3 -3
  11. data/app/assets/javascripts/admin/spree_backend.js +2 -2
  12. data/app/assets/javascripts/admin/stock_transfer.js.coffee +3 -3
  13. data/app/assets/javascripts/admin/variant_autocomplete.js.erb +9 -9
  14. data/app/assets/javascripts/admin/zone.js.coffee +8 -4
  15. data/app/assets/stylesheets/admin/components/_date-picker.scss +1 -1
  16. data/app/assets/stylesheets/admin/components/_navigation.scss +12 -8
  17. data/app/assets/stylesheets/admin/components/_sidebar.scss +2 -0
  18. data/app/assets/stylesheets/admin/globals/_variables.scss +53 -47
  19. data/app/assets/stylesheets/admin/globals/_variables_override.scss +2 -2
  20. data/app/assets/stylesheets/admin/plugins/_font-awesome.scss +1475 -0
  21. data/app/assets/stylesheets/admin/plugins/_jstree.scss +0 -1
  22. data/app/assets/stylesheets/admin/plugins/_select2.scss +40 -31
  23. data/app/assets/stylesheets/admin/shared/_forms.scss +7 -2
  24. data/app/assets/stylesheets/admin/shared/_icons.scss +7 -6
  25. data/app/assets/stylesheets/admin/shared/_layout.scss +2 -3
  26. data/app/assets/stylesheets/admin/shared/_tables.scss +7 -0
  27. data/app/assets/stylesheets/admin/spree_backend.css +1 -1
  28. data/app/controllers/spree/admin/orders/customer_details_controller.rb +3 -0
  29. data/app/controllers/spree/admin/orders_controller.rb +8 -0
  30. data/app/controllers/spree/admin/payments_controller.rb +2 -1
  31. data/app/controllers/spree/admin/products_controller.rb +9 -3
  32. data/app/controllers/spree/admin/stock_items_controller.rb +29 -6
  33. data/app/controllers/spree/admin/stock_locations_controller.rb +12 -0
  34. data/app/controllers/spree/admin/stock_movements_controller.rb +4 -31
  35. data/app/controllers/spree/admin/stock_transfers_controller.rb +1 -1
  36. data/app/controllers/spree/admin/tax_categories_controller.rb +1 -1
  37. data/app/controllers/spree/admin/variants_controller.rb +1 -2
  38. data/app/helpers/spree/admin/orders_helper.rb +4 -0
  39. data/app/views/spree/admin/mail_methods/_form.html.erb +3 -7
  40. data/app/views/spree/admin/orders/_shipment.html.erb +96 -126
  41. data/app/views/spree/admin/orders/_shipment_manifest.html.erb +33 -0
  42. data/app/views/spree/admin/orders/edit.html.erb +10 -4
  43. data/app/views/spree/admin/orders/index.html.erb +1 -1
  44. data/app/views/spree/admin/payments/_form.html.erb +3 -1
  45. data/app/views/spree/admin/product_properties/index.html.erb +1 -1
  46. data/app/views/spree/admin/products/_add_stock_form.html.erb +31 -2
  47. data/app/views/spree/admin/products/_form.html.erb +2 -2
  48. data/app/views/spree/admin/products/edit.html.erb +5 -3
  49. data/app/views/spree/admin/products/index.html.erb +4 -4
  50. data/app/views/spree/admin/products/new.html.erb +10 -0
  51. data/app/views/spree/admin/products/stock.html.erb +17 -17
  52. data/app/views/spree/admin/promotions/_promotion_action.html.erb +2 -1
  53. data/app/views/spree/admin/promotions/_promotion_rule.html.erb +1 -0
  54. data/app/views/spree/admin/prototypes/index.html.erb +1 -1
  55. data/app/views/spree/admin/shared/_product_tabs.html.erb +10 -9
  56. data/app/views/spree/admin/shared/_routes.html.erb +4 -0
  57. data/app/views/spree/admin/shared/_tabs.html.erb +1 -1
  58. data/app/views/spree/admin/shared/_translations.html.erb +27 -25
  59. data/app/views/spree/admin/shipping_methods/_form.html.erb +9 -4
  60. data/app/views/spree/admin/states/index.html.erb +1 -1
  61. data/app/views/spree/admin/stock_items/destroy.js.erb +1 -0
  62. data/app/views/spree/admin/stock_locations/_form.html.erb +8 -0
  63. data/app/views/spree/admin/stock_locations/index.html.erb +35 -31
  64. data/app/views/spree/admin/stock_locations/new.html.erb +2 -2
  65. data/app/views/spree/admin/stock_movements/index.html.erb +3 -6
  66. data/app/views/spree/admin/stock_transfers/index.html.erb +1 -1
  67. data/app/views/spree/admin/stock_transfers/new.html.erb +1 -1
  68. data/app/views/spree/admin/stock_transfers/show.html.erb +1 -2
  69. data/app/views/spree/admin/taxonomies/edit.erb +1 -1
  70. data/app/views/spree/admin/variants/_autocomplete.js.erb +1 -1
  71. data/app/views/spree/admin/zones/_member_type.html.erb +3 -3
  72. data/app/views/spree/layouts/admin.html.erb +9 -15
  73. data/config/routes.rb +2 -2
  74. data/lib/spree/backend.rb +1 -0
  75. data/vendor/assets/javascripts/jquery.jstree/jquery.jstree.js +2 -2
  76. data/vendor/assets/javascripts/jquery.jstree/themes/apple/style.css +2 -2
  77. data/vendor/assets/stylesheets/jquery-ui.datepicker.css.erb +5 -5
  78. metadata +35 -21
  79. data/app/assets/images/admin/bg/spree_50.png +0 -0
  80. data/app/assets/stylesheets/admin/plugins/font-awesome.scss +0 -303
  81. data/app/views/spree/admin/shared/_stock_movement_form.html.erb +0 -30
  82. data/vendor/assets/fonts/fontawesome-webfont.eot +0 -0
  83. data/vendor/assets/fonts/fontawesome-webfont.svg +0 -255
  84. data/vendor/assets/fonts/fontawesome-webfont.ttf +0 -0
  85. data/vendor/assets/fonts/fontawesome-webfont.woff +0 -0
  86. data/vendor/assets/stylesheets/font-awesome-ie7.css +0 -645
  87. data/vendor/assets/stylesheets/font-awesome.css.erb +0 -303
@@ -2,7 +2,7 @@ module Spree
2
2
  module Admin
3
3
  class TaxCategoriesController < ResourceController
4
4
  def destroy
5
- if @object.mark_deleted!
5
+ if @object.destroy
6
6
  flash[:success] = flash_message_for(@object, :successfully_removed)
7
7
  respond_with(@object) do |format|
8
8
  format.html { redirect_to collection_url }
@@ -8,8 +8,7 @@ module Spree
8
8
  # instead of actually deleting the product.
9
9
  def destroy
10
10
  @variant = Variant.find(params[:id])
11
- @variant.deleted_at = Time.now()
12
- if @variant.save
11
+ if @variant.destroy
13
12
  flash[:success] = Spree.t('notice_messages.variant_deleted')
14
13
  else
15
14
  flash[:success] = Spree.t('notice_messages.variant_not_deleted')
@@ -14,6 +14,10 @@ module Spree
14
14
  end
15
15
  links.join('&nbsp;').html_safe
16
16
  end
17
+
18
+ def line_item_shipment_price(line_item, quantity)
19
+ Spree::Money.new(line_item.price * quantity, { currency: line_item.currency })
20
+ end
17
21
  end
18
22
  end
19
23
  end
@@ -1,6 +1,6 @@
1
1
  <div data-hook="admin_mail_method_form_fields">
2
2
  <div class="row">
3
-
3
+
4
4
  <div class="alpha six columns" data-hook="general">
5
5
  <fieldset class="no-border-bottom">
6
6
  <legend align="center"><%= Spree.t(:general) %></legend>
@@ -56,15 +56,11 @@
56
56
  </div>
57
57
  <div class="field">
58
58
  <%= label_tag :secure_connection_type, Spree.t(:secure_connection_type) %><br />
59
- <%= select_tag(:secure_connection_type,
60
- options_from_collection_for_select(Spree::Core::MailSettings::SECURE_CONNECTION_TYPES, :to_s, :to_s, Spree::Config[:secure_connection_type]),
61
- :class => 'select2 fullwidth') %>
59
+ <%= select_tag(:secure_connection_type, options_from_collection_for_select(Spree::Core::MailSettings::SECURE_CONNECTION_TYPES.map{|w| Spree.t(w.downcase.to_sym, :default => w)}, :to_s, :to_s, Spree::Config[:secure_connection_type]), :class => 'select2 fullwidth') %>
62
60
  </div>
63
61
  <div class="field">
64
62
  <%= label_tag :mail_auth_type, Spree.t(:smtp_authentication_type) %><br />
65
- <%= select_tag(:mail_auth_type,
66
- options_from_collection_for_select(Spree::Core::MailSettings::MAIL_AUTH, :to_s, :to_s, Spree::Config[:mail_auth_type]),
67
- :class => 'select2 fullwidth') %>
63
+ <%= select_tag(:mail_auth_type, options_from_collection_for_select(Spree::Core::MailSettings::MAIL_AUTH.map{|w| Spree.t(w.downcase.to_sym, :default => w)}, :to_s, :to_s, Spree::Config[:mail_auth_type]), :class => 'select2 fullwidth') %>
68
64
  </div>
69
65
  <div class="field">
70
66
  <%= label_tag :smtp_username, Spree.t(:smtp_username) %><br />
@@ -1,150 +1,120 @@
1
- <%= render :partial => "spree/admin/variants/split", :formats => :js %>
2
- <fieldset class="no-border-bottom">
3
- <legend align="center" class="stock-location" data-hook="stock-location">
4
- <span class="shipment-number"><%= shipment.number %></span>
5
- -
6
- <span class="shipment-state"><%= shipment.state %></span>
7
- <%= Spree.t(:package_from) %>
8
- <strong class="stock-location-name" data-hook="stock-location-name">'<%= shipment.stock_location.name %>'</strong>
9
- <% if shipment.ready? and can? :update, shipment %>
1
+ <div id="<%= "shipment_#{shipment.id}" %>">
2
+ <%= render :partial => "spree/admin/variants/split", :formats => :js %>
3
+ <fieldset class="no-border-bottom">
4
+ <legend align="center" class="stock-location" data-hook="stock-location">
5
+ <span class="shipment-number"><%= shipment.number %></span>
10
6
  -
11
- <%= link_to 'ship', '#', :class => 'ship button icon-arrow-right', :data => {'shipment-number' => shipment.number} %>
12
- <% end %>
13
- </legend>
14
- </fieldset>
7
+ <span class="shipment-state"><%= Spree.t("shipment_states.#{shipment.state}") %></span>
8
+ <%= Spree.t(:package_from) %>
9
+ <strong class="stock-location-name" data-hook="stock-location-name">'<%= shipment.stock_location.name %>'</strong>
10
+ <% if shipment.ready? and can? :update, shipment %>
11
+ -
12
+ <%= link_to 'ship', '#', :class => 'ship button icon-arrow-right', :data => {'shipment-number' => shipment.number} %>
13
+ <% end %>
14
+ </legend>
15
+ </fieldset>
15
16
 
16
- <table class="stock-contents index" data-hook="stock-contents">
17
- <colgroup>
18
- <col style="width: 10%;" />
19
- <col style="width: 30%;" />
20
- <col style="width: 15%;" />
21
- <col style="width: 15%;" />
22
- <col style="width: 15%;" />
23
- <col style="width: 15%;" />
24
- </colgroup>
17
+ <table class="stock-contents index" data-hook="stock-contents">
18
+ <colgroup>
19
+ <col style="width: 10%;" />
20
+ <col style="width: 30%;" />
21
+ <col style="width: 15%;" />
22
+ <col style="width: 15%;" />
23
+ <col style="width: 15%;" />
24
+ <col style="width: 15%;" />
25
+ </colgroup>
25
26
 
26
- <thead>
27
- <th colspan="2"><%= Spree.t(:item_description) %></th>
28
- <th><%= Spree.t(:price) %></th>
29
- <th><%= Spree.t(:quantity) %></th>
30
- <th><%= Spree.t(:total) %></th>
31
- <th class="orders-actions actions" data-hook="admin_order_form_line_items_header_actions"></th>
32
- </thead>
27
+ <thead>
28
+ <th colspan="2"><%= Spree.t(:item_description) %></th>
29
+ <th><%= Spree.t(:price) %></th>
30
+ <th><%= Spree.t(:quantity) %></th>
31
+ <th><%= Spree.t(:total) %></th>
32
+ <th class="orders-actions actions" data-hook="admin_order_form_line_items_header_actions"></th>
33
+ </thead>
33
34
 
34
- <tbody data-shipment-number="<%= shipment.number %>" data-order-number="<%= order.number %>">
35
- <% shipment.manifest.each do |item| %>
36
- <% line_item = order.find_line_item_by_variant(item.variant) %>
35
+ <tbody data-shipment-number="<%= shipment.number %>" data-order-number="<%= order.number %>">
36
+ <%= render 'spree/admin/orders/shipment_manifest', order: order, shipment: shipment %>
37
37
 
38
- <tr class="stock-item" data-item-quantity="<%= item.quantity %>">
39
- <td class="item-image"><%= mini_image(item.variant) %></td>
40
- <td class="item-name">
41
- <%= item.variant.product.name %><br><%= "(" + variant_options(item.variant) + ")" unless item.variant.option_values.empty? %>
42
- </td>
43
- <td class="item-price align-center"><%= line_item.single_money.to_html %></td>
44
- <td class="item-qty-show align-center">
45
- <% item.states.each do |state,count| %>
46
- <%= count %> x <%= state.humanize.downcase %>
38
+ <% unless shipment.shipped? %>
39
+ <tr class="edit-method hidden total">
40
+ <td colspan="5">
41
+ <div class="field alpha five columns">
42
+ <%= label_tag 'selected_shipping_rate_id', Spree.t(:shipping_method) %>
43
+ <%= select_tag :selected_shipping_rate_id,
44
+ options_for_select(shipment.shipping_rates.backend.map {|sr| ["#{sr.name} #{sr.display_price}", sr.id] }, shipment.selected_shipping_rate_id),
45
+ {:class => 'select2 fullwidth', :data => {'shipment-number' => shipment.number } } %>
46
+ </div>
47
+
48
+ <% if shipment.adjustment && shipment.adjustment.closed? %>
49
+ <div class="field omega four columns">
50
+ <label><%= Spree.t(:associated_adjustment_closed) %></label>
51
+ <ul>
52
+ <li><%= radio_button_tag :open_adjustment, 'yes', false, :data => {'shipment-number' => shipment.number } %> Yes</li>
53
+ <li><%= radio_button_tag :open_adjustment, 'no', true, :data => {'shipment-number' => shipment.number } %> No</li>
54
+ </ul>
55
+ </div>
47
56
  <% end %>
48
- </td>
49
- <% unless shipment.shipped? %>
50
- <td class="item-qty-edit hidden">
51
- <%= number_field_tag :quantity, item.quantity, :min => 0, :class => "line_item_quantity", :size => 5 %>
52
57
  </td>
53
- <% end %>
54
- <td class="item-total align-center"><%= line_item.display_amount.to_html %></td>
55
- <% unless shipment.shipped? %>
56
- <td class="cart-item-delete actions" data-hook="cart_item_delete">
57
- <% if can? :update, item %>
58
- <%= link_to '', '#', :class => 'save-item icon_link icon-ok no-text with-tip', :data => {'shipment-number' => shipment.number, 'variant-id' => item.variant.id, :action => 'save'}, :title => Spree.t('actions.save'), :style => 'display: none' %>
59
- <%= link_to '', '#', :class => 'cancel-item icon_link icon-cancel no-text with-tip', :data => {:action => 'cancel'}, :title => Spree.t('actions.cancel'), :style => 'display: none' %>
60
- <%= link_to '', '#', :class => 'edit-item icon_link icon-edit no-text with-tip', :data => {:action => 'edit'}, :title => Spree.t('edit') %>
61
- <%= link_to '', '#', :class => 'split-item icon_link icon-resize-horizontal no-text with-tip', :data => {:action => 'split', 'variant-id' => item.variant.id}, :title => Spree.t('split') %>
62
- <%= link_to '', '#', :class => 'delete-item icon-trash no-text with-tip', :data => {'shipment-number' => shipment.number, 'variant-id' => item.variant.id, :action => 'remove'}, :title => Spree.t('delete') %>
58
+ <td class="actions">
59
+ <% if can? :update, shipment %>
60
+ <%= link_to '', '#', :class => 'save-method icon_link icon-ok no-text with-tip',
61
+ :data => {'shipment-number' => shipment.number, :action => 'save'}, title: Spree.t('actions.save') %>
62
+ <%= link_to '', '#', :class => 'cancel-method icon_link icon-cancel no-text with-tip',
63
+ :data => {:action => 'cancel'}, :title => Spree.t('actions.cancel') %>
64
+ <% end %>
65
+ </td>
66
+ </tr>
67
+ <% end %>
68
+
69
+ <tr class="show-method total">
70
+ <td colspan="4">
71
+ <% if shipment.adjustment.present? %>
72
+ <strong><%= shipment.adjustment.label %>: <%= shipment.shipping_method.name %></strong>
73
+ <% else %>
74
+ <%= Spree.t(:cannot_set_shipping_method_without_address) %>
75
+ <% end %>
76
+ </td>
77
+ <td class="total" align="center">
78
+ <% if shipment.adjustment.present? %>
79
+ <span><%= shipment.adjustment.display_amount %></span>
80
+ <% end %>
81
+ </td>
82
+ <% if shipment.adjustment.present? && !shipment.shipped? %>
83
+ <td class="actions">
84
+ <% if can? :update, shipment %>
85
+ <%= link_to '', '#', :class => 'edit-method icon_link icon-edit no-text with-tip', :data => {:action => 'edit'}, :title => Spree.t('edit') %>
63
86
  <% end %>
64
87
  </td>
65
88
  <% end %>
66
89
  </tr>
67
- <% end %>
68
90
 
69
- <% unless shipment.shipped? %>
70
- <tr class="edit-method hidden total">
91
+ <tr class="edit-tracking hidden total">
71
92
  <td colspan="5">
72
- <div class="field alpha five columns">
73
- <%= label_tag 'selected_shipping_rate_id', Spree.t(:shipping_method) %>
74
- <%= select_tag :selected_shipping_rate_id,
75
- options_for_select(shipment.shipping_rates.backend.map {|sr| ["#{sr.name} #{sr.display_price}", sr.id] }, shipment.selected_shipping_rate_id),
76
- {:class => 'select2 fullwidth', :data => {'shipment-number' => shipment.number } } %>
77
- </div>
78
-
79
- <% if shipment.adjustment && shipment.adjustment.closed? %>
80
- <div class="field omega four columns">
81
- <label><%= Spree.t(:associated_adjustment_closed) %></label>
82
- <ul>
83
- <li><%= radio_button_tag :open_adjustment, 'yes', false, :data => {'shipment-number' => shipment.number } %> Yes</li>
84
- <li><%= radio_button_tag :open_adjustment, 'no', true, :data => {'shipment-number' => shipment.number } %> No</li>
85
- </ul>
86
- </div>
87
- <% end %>
93
+ <label><%= Spree.t(:tracking_number) %>:</label>
94
+ <%= text_field_tag :tracking, shipment.tracking %>
88
95
  </td>
89
96
  <td class="actions">
90
97
  <% if can? :update, shipment %>
91
- <%= link_to '', '#', :class => 'save-method icon_link icon-ok no-text with-tip',
92
- :data => {'shipment-number' => shipment.number, :action => 'save'}, title: Spree.t('actions.save') %>
93
- <%= link_to '', '#', :class => 'cancel-method icon_link icon-cancel no-text with-tip',
94
- :data => {:action => 'cancel'}, :title => Spree.t('actions.cancel') %>
98
+ <%= link_to '', '#', :class => 'save-tracking icon_link icon-ok no-text with-tip', :data => {'shipment-number' => shipment.number, :action => 'save'}, :title => Spree.t('actions.save') %>
99
+ <%= link_to '', '#', :class => 'cancel-tracking icon_link icon-cancel no-text with-tip', :data => {:action => 'cancel'}, :title => Spree.t('actions.cancel') %>
95
100
  <% end %>
96
101
  </td>
97
102
  </tr>
98
- <% end %>
99
103
 
100
- <tr class="show-method total">
101
- <td colspan="4">
102
- <% if shipment.adjustment.present? %>
103
- <strong><%= shipment.adjustment.label %>: <%= shipment.shipping_method.name %></strong>
104
- <% else %>
105
- <%= Spree.t(:cannot_set_shipping_method_without_address) %>
106
- <% end %>
107
- </td>
108
- <td class="total" align="center">
109
- <% if shipment.adjustment.present? %>
110
- <span><%= shipment.adjustment.display_amount %></span>
111
- <% end %>
112
- </td>
113
- <% if shipment.adjustment.present? && !shipment.shipped? %>
104
+ <tr class="show-tracking total">
105
+ <td colspan="5">
106
+ <% if shipment.tracking.present? %>
107
+ <strong><%= Spree.t(:tracking) %>:</strong> <%= shipment.tracking %>
108
+ <% else %>
109
+ <%= Spree.t(:no_tracking_present) %>
110
+ <% end %>
111
+ </td>
114
112
  <td class="actions">
115
113
  <% if can? :update, shipment %>
116
- <%= link_to '', '#', :class => 'edit-method icon_link icon-edit no-text with-tip', :data => {:action => 'edit'}, :title => Spree.t('edit') %>
114
+ <%= link_to '', '#', :class => 'edit-tracking icon_link icon-edit no-text with-tip', :data => {:action => 'edit'}, :title => Spree.t('edit') %>
117
115
  <% end %>
118
116
  </td>
119
- <% end %>
120
- </tr>
121
-
122
- <tr class="edit-tracking hidden total">
123
- <td colspan="5">
124
- <label><%= Spree.t(:tracking_number) %>:</label>
125
- <%= text_field_tag :tracking, shipment.tracking %>
126
- </td>
127
- <td class="actions">
128
- <% if can? :update, shipment %>
129
- <%= link_to '', '#', :class => 'save-tracking icon_link icon-ok no-text with-tip', :data => {'shipment-number' => shipment.number, :action => 'save'}, :title => Spree.t('actions.save') %>
130
- <%= link_to '', '#', :class => 'cancel-tracking icon_link icon-cancel no-text with-tip', :data => {:action => 'cancel'}, :title => Spree.t('actions.cancel') %>
131
- <% end %>
132
- </td>
133
- </tr>
134
-
135
- <tr class="show-tracking total">
136
- <td colspan="5">
137
- <% if shipment.tracking.present? %>
138
- <strong><%= Spree.t(:tracking) %>:</strong> <%= shipment.tracking %>
139
- <% else %>
140
- <%= Spree.t(:no_tracking_present) %>
141
- <% end %>
142
- </td>
143
- <td class="actions">
144
- <% if can? :update, shipment %>
145
- <%= link_to '', '#', :class => 'edit-tracking icon_link icon-edit no-text with-tip', :data => {:action => 'edit'}, :title => Spree.t('edit') %>
146
- <% end %>
147
- </td>
148
- </tr>
149
- </tbody>
150
- </table>
117
+ </tr>
118
+ </tbody>
119
+ </table>
120
+ </div>
@@ -0,0 +1,33 @@
1
+ <% shipment.manifest.each do |item| %>
2
+ <% line_item = order.find_line_item_by_variant(item.variant) %>
3
+
4
+ <tr class="stock-item" data-item-quantity="<%= item.quantity %>">
5
+ <td class="item-image"><%= mini_image(item.variant) %></td>
6
+ <td class="item-name">
7
+ <%= item.variant.product.name %><br><%= "(" + variant_options(item.variant) + ")" unless item.variant.option_values.empty? %>
8
+ </td>
9
+ <td class="item-price align-center"><%= line_item.single_money.to_html %></td>
10
+ <td class="item-qty-show align-center">
11
+ <% item.states.each do |state,count| %>
12
+ <%= count %> x <%= state.humanize.downcase %>
13
+ <% end %>
14
+ </td>
15
+ <% unless shipment.shipped? %>
16
+ <td class="item-qty-edit hidden">
17
+ <%= number_field_tag :quantity, item.quantity, :min => 0, :class => "line_item_quantity", :size => 5 %>
18
+ </td>
19
+ <% end %>
20
+ <td class="item-total align-center"><%= line_item_shipment_price(line_item, item.quantity) %></td>
21
+ <% unless shipment.shipped? %>
22
+ <td class="cart-item-delete actions" data-hook="cart_item_delete">
23
+ <% if can? :update, item %>
24
+ <%= link_to '', '#', :class => 'save-item icon_link icon-ok no-text with-tip', :data => {'shipment-number' => shipment.number, 'variant-id' => item.variant.id, :action => 'save'}, :title => Spree.t('actions.save'), :style => 'display: none' %>
25
+ <%= link_to '', '#', :class => 'cancel-item icon_link icon-cancel no-text with-tip', :data => {:action => 'cancel'}, :title => Spree.t('actions.cancel'), :style => 'display: none' %>
26
+ <%= link_to '', '#', :class => 'edit-item icon_link icon-edit no-text with-tip', :data => {:action => 'edit'}, :title => Spree.t('edit') %>
27
+ <%= link_to '', '#', :class => 'split-item icon_link icon-resize-horizontal no-text with-tip', :data => {:action => 'split', 'variant-id' => item.variant.id}, :title => Spree.t('split') %>
28
+ <%= link_to '', '#', :class => 'delete-item icon-trash no-text with-tip', :data => {'shipment-number' => shipment.number, 'variant-id' => item.variant.id, :action => 'remove', :confirm => Spree.t(:are_you_sure)}, :title => Spree.t('delete') %>
29
+ <% end %>
30
+ </td>
31
+ <% end %>
32
+ </tr>
33
+ <% end %>
@@ -1,8 +1,14 @@
1
1
  <%= csrf_meta_tags %>
2
2
  <% content_for :page_actions do %>
3
- <li><%= event_links %></li>
4
- <li><%= button_link_to Spree.t(:resend), resend_admin_order_url(@order), :method => :post, :icon => 'icon-email' %></li>
5
- <li><%= button_link_to Spree.t(:back_to_orders_list), admin_orders_path, :icon => 'icon-arrow-left' %></li>
3
+ <% if can?(:fire, @order) %>
4
+ <li><%= event_links %></li>
5
+ <% end %>
6
+ <% if can?(:resend, @order) %>
7
+ <li><%= button_link_to Spree.t(:resend), resend_admin_order_url(@order), :method => :post, :icon => 'icon-email' %></li>
8
+ <% end %>
9
+ <% if can?(:admin, Spree::Order) %>
10
+ <li><%= button_link_to Spree.t(:back_to_orders_list), admin_orders_path, :icon => 'icon-arrow-left' %></li>
11
+ <% end %>
6
12
  <% end %>
7
13
 
8
14
  <%= render :partial => 'spree/admin/shared/order_tabs', :locals => { :current => 'Order Details' } %>
@@ -11,7 +17,7 @@
11
17
  <%= render :partial => 'spree/shared/error_messages', :locals => { :target => @order } %>
12
18
  </div>
13
19
 
14
- <%= render :partial => 'add_product' %>
20
+ <%= render :partial => 'add_product' if can?(:update, @order) %>
15
21
 
16
22
  <% if @order.line_items.empty? %>
17
23
  <div class="no-objects-found">
@@ -6,7 +6,7 @@
6
6
  <li>
7
7
  <%= button_link_to Spree.t(:new_order), new_admin_order_url, :icon => 'icon-plus', :id => 'admin_new_order' %>
8
8
  </li>
9
- <% end %>
9
+ <% end if can? :edit, Spree::Order.new %>
10
10
 
11
11
  <% content_for :table_filter_title do %>
12
12
  <%= Spree.t(:search) %>
@@ -20,7 +20,9 @@
20
20
  </ul>
21
21
  <div class="payment-method-settings">
22
22
  <% @payment_methods.each do |method| %>
23
- <%= render :partial => "spree/admin/payments/source_forms/#{method.method_type}", :locals => { :payment_method => method } %>
23
+ <% if method.source_required? %>
24
+ <%= render :partial => "spree/admin/payments/source_forms/#{method.method_type}", :locals => { :payment_method => method } %>
25
+ <% end %>
24
26
  <% end %>
25
27
  </div>
26
28
  </div>
@@ -22,7 +22,7 @@
22
22
  <div class="add_product_properties" data-hook="add_product_properties"></div>
23
23
 
24
24
  <div id="prototypes" data-hook></div>
25
- <%= image_tag 'spinner.gif', :plugin => 'spree', :style => 'display:none;', :id => 'busy_indicator' %>
25
+ <%= image_tag 'select2-spinner.gif', :plugin => 'spree', :style => 'display:none;', :id => 'busy_indicator' %>
26
26
 
27
27
  <table class="index sortable" data-hook data-sortable-link="<%= update_positions_admin_product_product_properties_url %>">
28
28
  <thead>
@@ -1,6 +1,35 @@
1
- <%= form_for [:admin, Spree::StockMovement.new] do |f| %>
1
+ <%= form_for [:admin, Spree::StockMovement.new], url: admin_stock_items_path do |f| %>
2
2
  <fieldset>
3
3
  <legend align="center"><%= Spree.t(:add_stock_management) %></legend>
4
- <%= render :partial => 'spree/admin/shared/stock_movement_form', :locals => { :f => f } %>
4
+
5
+ <div data-hook="admin_stock_movements_form_fields" class="row">
6
+ <div class="alpha two columns">
7
+ <%= f.field_container :quantity do %>
8
+ <%= f.label :quantity, Spree.t(:quantity) %>
9
+ <%= f.number_field :quantity, class: 'fullwidth', value: 1 %>
10
+ <% end %>
11
+ </div>
12
+ <div class="five columns">
13
+ <%= f.field_container :stock_location do %>
14
+ <%= label_tag :stock_location_id, Spree.t(:stock_location) %>
15
+ <%= select_tag 'stock_location_id', options_from_collection_for_select(@stock_locations, :id, :name),
16
+ class: 'select2 fullwidth' %>
17
+ <% end %>
18
+ </div>
19
+
20
+ <div class="five columns omega">
21
+ <%= f.field_container :variant_id do %>
22
+ <%= label_tag 'variant_id', Spree.t(:variant) %>
23
+ <%= select_tag 'variant_id', options_from_collection_for_select(@variants, :id, :sku),
24
+ class: 'select2 fullwidth' %>
25
+ <% end %>
26
+ </div>
27
+ </div>
28
+
29
+ <div class="form-buttons filter-actions actions" data-hook="buttons">
30
+ <%= button Spree.t(:add_stock), 'icon-plus' %>
31
+ <span class="or"><%= Spree.t(:or) %></span>
32
+ <%= link_to_with_icon 'icon-remove', Spree.t('actions.cancel'), collection_url, :class => 'button' %>
33
+ </div>
5
34
  </fieldset>
6
35
  <% end %>
@@ -78,13 +78,13 @@
78
78
 
79
79
  <%= f.field_container :shipping_categories do %>
80
80
  <%= f.label :shipping_category_id, Spree.t(:shipping_categories) %>
81
- <%= f.collection_select(:shipping_category_id, @shipping_categories, :id, :name, { :include_blank => 'None' }, { :class => 'select2' }) %>
81
+ <%= f.collection_select(:shipping_category_id, @shipping_categories, :id, :name, { :include_blank => Spree.t('match_choices.none') }, { :class => 'select2' }) %>
82
82
  <%= f.error_message_on :shipping_category %>
83
83
  <% end %>
84
84
 
85
85
  <%= f.field_container :tax_category do %>
86
86
  <%= f.label :tax_category_id, Spree.t(:tax_category) %>
87
- <%= f.collection_select(:tax_category_id, @tax_categories, :id, :name, { :include_blank => 'None' }, { :class => 'select2' }) %>
87
+ <%= f.collection_select(:tax_category_id, @tax_categories, :id, :name, { :include_blank => Spree.t('match_choices.none') }, { :class => 'select2' }) %>
88
88
  <%= f.error_message_on :tax_category %>
89
89
  <% end %>
90
90
  </div>