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
@@ -1,8 +1,10 @@
1
1
  <% content_for :page_actions do %>
2
2
  <li><%= button_link_to Spree.t(:back_to_products_list), session[:return_to] || admin_products_url, :icon => 'icon-arrow-left' %></li>
3
- <li id="new_product_link">
4
- <%= button_link_to Spree.t(:new_product), new_object_url, { :icon => 'icon-plus', :id => 'admin_new_product' } %>
5
- </li>
3
+ <% if can?(:create, Spree::Product) %>
4
+ <li id="new_product_link">
5
+ <%= button_link_to Spree.t(:new_product), new_object_url, { :icon => 'icon-plus', :id => 'admin_new_product' } %>
6
+ </li>
7
+ <% end %>
6
8
  <% end %>
7
9
 
8
10
  <%= render :partial => 'spree/admin/shared/product_sub_menu' %>
@@ -6,7 +6,7 @@
6
6
  <li id="new_product_link">
7
7
  <%= button_link_to Spree.t(:new_product), new_object_url, { :remote => true, :icon => 'icon-plus', :id => 'admin_new_product' } %>
8
8
  </li>
9
- <% end %>
9
+ <% end if can?(:create, Spree::Product) %>
10
10
 
11
11
  <%= render :partial => 'spree/admin/shared/product_sub_menu' %>
12
12
 
@@ -82,11 +82,11 @@
82
82
  <td><%= link_to product.try(:name), edit_admin_product_path(product) %></td>
83
83
  <td class="align-center"><%= product.display_price.to_html rescue '' %></td>
84
84
  <td class="actions" data-hook="admin_products_index_row_actions">
85
- <%= link_to_edit product, :no_text => true, :class => 'edit' unless product.deleted? %>
85
+ <%= link_to_edit product, :no_text => true, :class => 'edit' if can?(:edit, product) && !product.deleted? %>
86
86
  &nbsp;
87
- <%= link_to_clone product, :no_text => true, :class => 'clone' %>
87
+ <%= link_to_clone product, :no_text => true, :class => 'clone' if can?(:clone, product) %>
88
88
  &nbsp;
89
- <%= link_to_delete product, :no_text => true unless product.deleted? %>
89
+ <%= link_to_delete product, :no_text => true if can?(:delete, product) && !product.deleted? %>
90
90
  </td>
91
91
  </tr>
92
92
  <% end %>
@@ -49,6 +49,16 @@
49
49
 
50
50
  </div>
51
51
 
52
+ <div class='row'>
53
+ <div class="alpha four columns">
54
+ <%= f.field_container :shipping_category do %>
55
+ <%= f.label :shipping_category_id, Spree.t(:shipping_categories) %><span class="required">*</span><br />
56
+ <%= f.collection_select(:shipping_category_id, @shipping_categories, :id, :name, { :include_blank => Spree.t('match_choices.none') }, { :class => 'select2 fullwidth' }) %>
57
+ <%= f.error_message_on :shipping_category_id %>
58
+ <% end %>
59
+ </div>
60
+ </div>
61
+
52
62
  <div class="clearfix" data-hook="product-from-prototype" id="product-from-prototype">
53
63
  <%= render :file => 'spree/admin/prototypes/show' if @prototype %>
54
64
  </div>
@@ -3,12 +3,9 @@
3
3
  <% end %>
4
4
 
5
5
  <%= render :partial => 'spree/admin/shared/product_sub_menu' %>
6
-
7
6
  <%= render :partial => 'spree/admin/shared/product_tabs', :locals => { :current => 'Stock Management' } %>
8
-
9
7
  <%= render :partial => 'spree/shared/error_messages', :locals => { :target => @product } %>
10
8
 
11
-
12
9
  <div id="add_stock_form">
13
10
  <%= render 'add_stock_form' %>
14
11
  </div>
@@ -37,10 +34,11 @@
37
34
  <%= image_tag variant.images.first.attachment.url(:mini) %>
38
35
  <% end %>
39
36
  </td>
40
- <td colspan="3" class="stock_location_info">
37
+ <td colspan="4" class="stock_location_info">
41
38
  <table>
42
39
  <colgroup>
43
- <col style="width: 60%" />
40
+ <col style="width: 40%" />
41
+ <col style="width: 20%" />
44
42
  <col style="width: 20%" />
45
43
  <col style="width: 20%" />
46
44
  </colgroup>
@@ -48,24 +46,26 @@
48
46
  <th><%= Spree.t(:stock_location) %></th>
49
47
  <th><%= Spree.t(:count_on_hand) %></th>
50
48
  <th><%= Spree.t(:backorderable) %></th>
49
+ <th></th>
51
50
  </thead>
52
51
  <tbody>
53
- <% @stock_locations.each do |stock_location| %>
54
- <% next if stock_location.stock_item(variant).nil? %>
55
- <tr class="<%= cycle('odd', 'even', :name => 'stock_locations')%>">
56
- <td><%= stock_location.name %></td>
57
- <td class="align-center">
58
- <%= stock_location.stock_item(variant).count_on_hand %>
59
- </td>
52
+ <% variant.stock_items.each do |item| %>
53
+ <% next unless @stock_locations.include?(item.stock_location) %>
54
+
55
+ <tr id="stock-item-<%= item.id %>" class="<%= cycle('odd', 'even', :name => 'stock_locations')%>">
56
+ <td><%= item.stock_location.name %></td>
57
+ <td class="align-center"><%= item.count_on_hand %></td>
60
58
  <td class="align-center">
61
- <% url = admin_stock_item_path(stock_location.stock_item(variant)) %>
62
- <%= form_tag url, method: :put, class: 'toggle_stock_item_backorderable' do %>
63
- <%= check_box_tag 'stock_item[backorderable]', true,
64
- stock_location.stock_item(variant).backorderable?,
59
+ <%= form_tag admin_stock_item_path(item), method: :put, class: 'toggle_stock_item_backorderable' do %>
60
+ <%= check_box_tag 'stock_item[backorderable]', 1, item.backorderable?,
65
61
  class: 'stock_item_backorderable',
66
- id: "stock_item_backorderable_#{stock_location.id}" %>
62
+ id: "stock_item_backorderable_#{item.stock_location.id}" %>
67
63
  <% end %>
68
64
  </td>
65
+ <td class="align-center">
66
+ <%= link_to "", [:admin, item], method: :delete, remote: true,
67
+ confirm: Spree.t(:are_you_sure), class: "icon_link with-tip icon-trash" %>
68
+ </td>
69
69
  </tr>
70
70
  <% end %>
71
71
  </tbody>
@@ -6,6 +6,7 @@
6
6
  <% param_prefix = "promotion[promotion_actions_attributes][#{promotion_action.id}]" %>
7
7
  <%= hidden_field_tag "#{param_prefix}[id]", promotion_action.id %>
8
8
 
9
+ <%= render :partial => "spree/shared/error_messages", :locals => { :target => promotion_action } %>
9
10
  <%= render :partial => "spree/admin/promotions/actions/#{type_name}",
10
11
  :locals => { :promotion_action => promotion_action, :param_prefix => param_prefix } %>
11
- </div>
12
+ </div>
@@ -5,5 +5,6 @@
5
5
 
6
6
  <% param_prefix = "promotion[promotion_rules_attributes][#{promotion_rule.id}]" %>
7
7
  <%= hidden_field_tag "#{param_prefix}[id]", promotion_rule.id %>
8
+ <%= render :partial => "spree/shared/error_messages", :locals => { :target => promotion_rule } %>
8
9
  <%= render :partial => "spree/admin/promotions/rules/#{type_name}", :locals => { :promotion_rule => promotion_rule, :param_prefix => param_prefix } %>
9
10
  </div>
@@ -10,7 +10,7 @@
10
10
 
11
11
  <%= render :partial => 'spree/admin/shared/product_sub_menu' %>
12
12
 
13
- <%= image_tag 'spinner.gif', :plugin => 'spree', :style => 'display: none', :id => 'busy_indicator' %>
13
+ <%= image_tag 'select2-spinner.gif', :plugin => 'spree', :style => 'display: none', :id => 'busy_indicator' %>
14
14
 
15
15
  <%# Placeholder for new prototype form %>
16
16
  <div id="new_prototype"></div>
@@ -9,20 +9,21 @@
9
9
  <% content_for :sidebar do %>
10
10
  <nav class="menu">
11
11
  <ul data-hook="admin_product_tabs">
12
- <li<%== ' class="active"' if current == 'Product Details' %>>
12
+ <%= content_tag :li, :class => ('active' if current == 'Product Details') do %>
13
13
  <%= link_to_with_icon 'icon-edit', Spree.t(:product_details), edit_admin_product_url(@product) %>
14
- </li>
15
- <li<%== ' class="active"' if current == 'Images' %>>
14
+ <% end if can?(:admin, Spree::Product) %>
15
+ <%= content_tag :li, :class => ('active' if current == 'Images') do %>
16
16
  <%= link_to_with_icon 'icon-picture', Spree.t(:images), admin_product_images_url(@product) %>
17
- </li>
18
- <li<%== ' class="active"' if current == 'Variants' %>>
17
+ <% end if can?(:admin, Spree::Image) %>
18
+ <%= content_tag :li, :class => ('active' if current == 'Variants') do %>
19
19
  <%= link_to_with_icon 'icon-th-large', Spree.t(:variants), admin_product_variants_url(@product) %>
20
- </li>
21
- <li<%== ' class="active"' if current == 'Product Properties' %>>
20
+ <% end if can?(:admin, Spree::Variant) %>
21
+ <%= content_tag :li, :class => ('active' if current == 'Product Properties') do %>
22
22
  <%= link_to_with_icon 'icon-tasks', Spree.t(:product_properties), admin_product_product_properties_url(@product) %>
23
- </li>
24
- <li<%== ' class="active"' if current == 'Stock Management' %>>
23
+ <% end if can?(:admin, Spree::ProductProperty) %>
24
+ <%= content_tag :li, :class => ('active' if current == 'Stock Management') do %>
25
25
  <%= link_to_with_icon 'icon-tasks', Spree.t(:stock_management), stock_admin_product_url(@product) %>
26
+ <% end if can?(:stock, Spree::Product) %>
26
27
  </li>
27
28
  </ul>
28
29
  </nav>
@@ -5,4 +5,8 @@
5
5
  Spree.routes.user_search = "<%= spree.admin_search_users_url(:format => 'json') %>";
6
6
  Spree.routes.product_search = "<%= spree.api_products_url(:format => 'json') %>";
7
7
  Spree.routes.option_type_search = "<%= spree.api_option_types_url(:format => 'json') %>";
8
+ Spree.routes.orders_api = "<%= spree.api_orders_url(:format => 'json') %>";
9
+ Spree.routes.stock_locations_api = "<%= spree.api_stock_locations_url(:format => 'json') %>";
10
+ Spree.routes.variants_api = "<%= spree.api_variants_url(:format => 'json') %>";
11
+
8
12
  </script>
@@ -2,7 +2,7 @@
2
2
  <%= tab :orders, :payments, :creditcard_payments, :shipments, :credit_cards, :return_authorizations, :icon => 'icon-shopping-cart' %>
3
3
  <% end %>
4
4
  <% if can? :admin, Spree::Product %>
5
- <%= tab :products , :option_types, :properties, :prototypes, :variants, :product_properties, :icon => 'icon-th-large' %>
5
+ <%= tab :products, :option_types, :properties, :prototypes, :variants, :product_properties, :icon => 'icon-th-large' %>
6
6
  <% end %>
7
7
  <% if can? :admin, Spree::Admin::ReportsController %>
8
8
  <%= tab :reports, :icon => 'icon-file' %>
@@ -1,32 +1,34 @@
1
1
  <script>
2
2
  Spree.translations = <%==
3
3
  { :date_picker => Spree.t(:js_format,
4
- :scope => 'spree.date_picker',
4
+ :scope => 'date_picker',
5
5
  :default => 'yy/mm/dd'),
6
- :abbr_day_names => I18n.t(:abbr_day_names, :scope => :date),
7
- :add => Spree.t(:add),
8
- :are_you_sure_delete => Spree.t(:are_you_sure_delete),
9
- :bill_address => Spree.t(:bill_address),
10
- :choose_a_customer => Spree.t(:choose_a_customer),
11
- :confirm_delete => Spree.t(:confirm_delete),
12
- :cut => Spree.t(:cut),
13
- :destroy => Spree.t(:destroy),
14
- :edit => Spree.t(:edit),
15
- :loading => Spree.t(:loading),
16
- :month_names => I18n.t(:month_names, :scope => :date).reject(&:blank?),
17
- :more => Spree.t(:more),
18
- :name => Spree.t(:name),
19
- :next => Spree.t(:next),
20
- :no_results => Spree.t(:no_results),
21
- :paste => Spree.t(:paste),
22
- :previous => Spree.t(:previous),
23
- :remove => Spree.t(:remove),
24
- :rename => Spree.t(:rename),
25
- :searching => Spree.t(:searching),
26
- :sku => Spree.t(:sku),
27
- :type_to_search => Spree.t(:type_to_search),
28
- :taxon_placeholder => Spree.t(:taxon_placeholder),
29
- :value => Spree.t(:value)
6
+ :abbr_day_names => I18n.t(:abbr_day_names, :scope => :date),
7
+ :add => Spree.t(:add),
8
+ :are_you_sure_delete => Spree.t(:are_you_sure_delete),
9
+ :bill_address => Spree.t(:bill_address),
10
+ :choose_a_customer => Spree.t(:choose_a_customer),
11
+ :confirm_delete => Spree.t(:confirm_delete),
12
+ :cut => Spree.t(:cut),
13
+ :destroy => Spree.t(:destroy),
14
+ :edit => Spree.t(:edit),
15
+ :loading => Spree.t(:loading),
16
+ :month_names => I18n.t(:month_names, :scope => :date).reject(&:blank?),
17
+ :more => Spree.t(:more),
18
+ :name => Spree.t(:name),
19
+ :next => Spree.t(:next),
20
+ :no_results => Spree.t(:no_results),
21
+ :option_type_placeholder => Spree.t(:option_type_placeholder),
22
+ :paste => Spree.t(:paste),
23
+ :previous => Spree.t(:previous),
24
+ :remove => Spree.t(:remove),
25
+ :rename => Spree.t(:rename),
26
+ :searching => Spree.t(:searching),
27
+ :sku => Spree.t(:sku),
28
+ :type_to_search => Spree.t(:type_to_search),
29
+ :taxon_placeholder => Spree.t(:taxon_placeholder),
30
+ :variant_placeholder => Spree.t(:variant_placeholder),
31
+ :value => Spree.t(:value)
30
32
  }.to_json
31
33
  %>
32
34
  </script>
@@ -30,8 +30,10 @@
30
30
  <legend align="center"><%= Spree.t(:categories) %></legend>
31
31
  <%= f.field_container :categories do %>
32
32
  <% Spree::ShippingCategory.all.each do |category| %>
33
- <%= f.label :shipping_category_id, category.name %>
34
- <%= check_box_tag('shipping_method[shipping_categories][]', category.id, @shipping_method.shipping_categories.include?(category)) %><br>
33
+ <%= label_tag do %>
34
+ <%= check_box_tag('shipping_method[shipping_categories][]', category.id, @shipping_method.shipping_categories.include?(category)) %>
35
+ <%= category.name %><br>
36
+ <% end %>
35
37
  <% end %>
36
38
  <%= error_message_on :shipping_method, :shipping_category_id %>
37
39
  <% end %>
@@ -43,8 +45,11 @@
43
45
  <legend align="center"><%= Spree.t(:zones) %></legend>
44
46
  <%= f.field_container :zones do %>
45
47
  <% Spree::Zone.all.each do |zone| %>
46
- <%= f.label :zone_id, zone.name %>
47
- <%= check_box_tag('shipping_method[zones][]', zone.id, @shipping_method.zones.include?(zone)) %><br>
48
+ <%= label_tag do %>
49
+ <%= check_box_tag('shipping_method[zones][]', zone.id, @shipping_method.zones.include?(zone)) %>
50
+ <%= zone.name %>
51
+ <% end %>
52
+ <br>
48
53
  <% end %>
49
54
  <%= error_message_on :shipping_method, :zone_id %>
50
55
  <% end %>
@@ -17,7 +17,7 @@
17
17
  </select>
18
18
  </div>
19
19
 
20
- <%= image_tag 'spinner.gif', :plugin => 'spree', :style => 'display:none;', :id => 'busy_indicator' %>
20
+ <%= image_tag 'select2-spinner.gif', :plugin => 'spree', :style => 'display:none;', :id => 'busy_indicator' %>
21
21
 
22
22
  <div id="state-list" data-hook>
23
23
  <%= render :partial => 'state_list'%>
@@ -0,0 +1 @@
1
+ $("#stock-item-<%= @stock_item.id %>").fadeOut();
@@ -14,6 +14,14 @@
14
14
  <%= f.label :active, Spree.t(:active) + ':' %>
15
15
  <%= f.check_box :active %>
16
16
  </li>
17
+ <li>
18
+ <%= f.label :active, Spree.t(:backorderable_default) + ':' %>
19
+ <%= f.check_box :backorderable_default %>
20
+ </li>
21
+ <li>
22
+ <%= f.label :active, Spree.t(:propagate_all_variants) + ':' %>
23
+ <%= f.check_box :propagate_all_variants %>
24
+ </li>
17
25
  </ul>
18
26
  <% end %>
19
27
  </div>
@@ -15,35 +15,39 @@
15
15
  </ul>
16
16
  <% end %>
17
17
 
18
- <table class="index" id='listing_stock_locations' data-hook>
19
- <colgroup>
20
- <col style="width: 50%" />
21
- <col style="width: 15%" />
22
- <col style="width: 20%" />
23
- <col style="width: 15%" />
24
- </colgroup>
25
- <thead>
26
- <tr data-hook="stock_locations_header">
27
- <th><%= Spree.t(:name) %></th>
28
- <th><%= Spree.t(:state) %></th>
29
- <th><%= Spree.t(:stock_movements) %></th>
30
- <th class="actions"></th>
31
- </tr>
32
- </thead>
33
- <tbody>
34
- <% @stock_locations.each do |stock_location|
35
- @edit_url = edit_admin_stock_location_path(stock_location)
36
- @delete_url = admin_stock_location_path(stock_location)
37
- %>
38
- <tr id="<%= spree_dom_id stock_location %>" data-hook="stock_location_row" class="<%= cycle('odd', 'even')%>">
39
- <td><%= stock_location.name %></td>
40
- <td><span class="state <%= stock_location.active? ? 'active' : 'inactive' %>"><%= stock_location.active? ? 'active' : 'inactive' %></span></td>
41
- <td><%= link_to Spree.t(:stock_movements), admin_stock_location_stock_movements_path(stock_location.id) %> </td>
42
- <td class="actions">
43
- <%= link_to_edit stock_location, :no_text => true %>
44
- <%= link_to_delete stock_location, :no_text => true %>
45
- </td>
18
+ <% if @stock_locations.any? %>
19
+ <table class="index" id='listing_stock_locations' data-hook>
20
+ <colgroup>
21
+ <col style="width: 50%" />
22
+ <col style="width: 15%" />
23
+ <col style="width: 20%" />
24
+ <col style="width: 15%" />
25
+ </colgroup>
26
+ <thead>
27
+ <tr data-hook="stock_locations_header">
28
+ <th><%= Spree.t(:name) %></th>
29
+ <th><%= Spree.t(:state) %></th>
30
+ <th><%= Spree.t(:stock_movements) %></th>
31
+ <th class="actions"></th>
46
32
  </tr>
47
- <% end %>
48
- </tbody>
49
- </table>
33
+ </thead>
34
+ <tbody>
35
+ <% @stock_locations.each do |stock_location|
36
+ @edit_url = edit_admin_stock_location_path(stock_location)
37
+ @delete_url = admin_stock_location_path(stock_location)
38
+ %>
39
+ <tr id="<%= spree_dom_id stock_location %>" data-hook="stock_location_row" class="<%= cycle('odd', 'even')%>">
40
+ <td><%= stock_location.name %></td>
41
+ <td><span class="state <%= stock_location.active? ? 'active' : 'inactive' %>"><%= stock_location.active? ? 'active' : 'inactive' %></span></td>
42
+ <td><%= link_to Spree.t(:stock_movements), admin_stock_location_stock_movements_path(stock_location.id) %> </td>
43
+ <td class="actions">
44
+ <%= link_to_edit stock_location, :no_text => true %>
45
+ <%= link_to_delete stock_location, :no_text => true %>
46
+ </td>
47
+ </tr>
48
+ <% end %>
49
+ </tbody>
50
+ </table>
51
+ <% else %>
52
+ <div class="alpha twelve columns no-objects-found"><%= Spree.t(:no_stock_locations_found) %></div>
53
+ <% end %>
@@ -7,10 +7,10 @@
7
7
  <% end %>
8
8
 
9
9
  <%= render :partial => 'spree/shared/error_messages', :locals => { :target => @stock_locations } %>
10
- <% @stock_location.country = Spree::Country.find(Spree::Config[:default_country_id]) %>
10
+
11
11
  <%= form_for [:admin, @stock_location] do |f| %>
12
12
  <fieldset class="no-border-top">
13
13
  <%= render :partial => 'form', :locals => { :f => f } %>
14
14
  <%= render :partial => 'spree/admin/shared/new_resource_links' %>
15
15
  </fieldset>
16
- <% end %>
16
+ <% end %>
@@ -8,6 +8,9 @@
8
8
  <li>
9
9
  <%= button_link_to Spree.t(:new_stock_movement), new_admin_stock_location_stock_movement_path(@stock_location), icon: 'icon-plus', id: 'admin_new_stock_movement_link' %>
10
10
  </li>
11
+ <li>
12
+ <%= link_to_with_icon 'icon-arrow-left', Spree.t(:back_to_stock_locations_list), admin_stock_locations_path, :class => 'button' %>
13
+ </li>
11
14
  <% end %>
12
15
 
13
16
  <table class="index" id='listing_stock_movements'>
@@ -21,7 +24,6 @@
21
24
  <th><%= Spree.t(:stock_item) %>
22
25
  <th><%= Spree.t(:quantity) %></th>
23
26
  <th><%= Spree.t(:action) %></th>
24
- <th data-hook="admin_stock_movements_index_header_actions" class="actions"></th>
25
27
  </tr>
26
28
  </thead>
27
29
  <tbody>
@@ -30,11 +32,6 @@
30
32
  <td class="align-center"><%= stock_movement.stock_item.variant_name %></td>
31
33
  <td class="align-center"><%= stock_movement.quantity %></td>
32
34
  <td class="align-center"><%= pretty_originator(stock_movement) %></td>
33
- <td data-hook="admin_stock_movements_index_row_actions" class="actions">
34
- <%= link_to_with_icon 'icon-edit', Spree.t(:edit), edit_admin_stock_location_stock_movement_path(@stock_location, stock_movement), data: { action: 'edit' }, no_text: true %>
35
- <%= link_to_with_icon 'icon-trash', Spree.t(:delete), admin_stock_location_stock_movement_path(@stock_location, stock_movement), method: :delete,
36
- data: { confirm: t(:are_you_sure), action: 'remove' }, no_text: true %>
37
- </td>
38
35
  </tr>
39
36
  <% end %>
40
37
  </tbody>
@@ -17,7 +17,7 @@
17
17
 
18
18
  <div class="field-block alpha four columns">
19
19
  <div class="field">
20
- <%= f.label :reference_cont %>
20
+ <%= f.label :reference_cont, Spree.t(:reference_cont) %>
21
21
  <%= f.text_field :reference_cont, class: 'fullwidth' %>
22
22
  </div>
23
23
  </div>