spree_backend 3.4.6 → 3.5.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. checksums.yaml +5 -5
  2. data/app/assets/javascripts/spree/backend.js +1 -1
  3. data/app/assets/javascripts/spree/backend/shipments.js +24 -3
  4. data/app/assets/javascripts/spree/backend/taxonomy.js.coffee +10 -6
  5. data/app/assets/javascripts/spree/backend/users/edit.js +18 -0
  6. data/app/assets/stylesheets/spree/backend/components/_buttons.scss +7 -3
  7. data/app/assets/stylesheets/spree/backend/components/_taxon_products_view.scss +2 -0
  8. data/app/assets/stylesheets/spree/backend/global/_variables.scss +2 -2
  9. data/app/controllers/spree/admin/adjustments_controller.rb +1 -1
  10. data/app/controllers/spree/admin/general_settings_controller.rb +0 -14
  11. data/app/controllers/spree/admin/orders_controller.rb +15 -1
  12. data/app/controllers/spree/admin/products_controller.rb +4 -4
  13. data/app/controllers/spree/admin/promotions_controller.rb +16 -1
  14. data/app/controllers/spree/admin/shipping_methods_controller.rb +2 -2
  15. data/app/controllers/spree/admin/stock_locations_controller.rb +4 -3
  16. data/app/controllers/spree/admin/stores_controller.rb +79 -0
  17. data/app/controllers/spree/admin/users_controller.rb +8 -6
  18. data/app/controllers/spree/admin/variants_controller.rb +6 -1
  19. data/app/helpers/spree/admin/navigation_helper.rb +18 -2
  20. data/app/models/spree/backend_configuration.rb +2 -1
  21. data/app/views/spree/admin/general_settings/edit.html.erb +0 -50
  22. data/app/views/spree/admin/orders/_store_form.html.erb +18 -0
  23. data/app/views/spree/admin/orders/index.html.erb +11 -4
  24. data/app/views/spree/admin/orders/store.html.erb +7 -0
  25. data/app/views/spree/admin/products/_form.html.erb +7 -7
  26. data/app/views/spree/admin/products/edit.html.erb +3 -0
  27. data/app/views/spree/admin/promotions/_form.html.erb +7 -0
  28. data/app/views/spree/admin/promotions/_promotion_action.html.erb +1 -1
  29. data/app/views/spree/admin/promotions/_promotion_rule.html.erb +1 -1
  30. data/app/views/spree/admin/promotions/actions/_free_shipping.html.erb +0 -0
  31. data/app/views/spree/admin/promotions/index.html.erb +1 -0
  32. data/app/views/spree/admin/shared/_destroy.js.erb +1 -0
  33. data/app/views/spree/admin/shared/_order_tabs.html.erb +6 -0
  34. data/app/views/spree/admin/shared/_update_store_credit.js.erb +1 -0
  35. data/app/views/spree/admin/shared/sub_menu/_configuration.html.erb +1 -1
  36. data/app/views/spree/admin/shipping_methods/_form.html.erb +1 -1
  37. data/app/views/spree/admin/shipping_methods/index.html.erb +1 -1
  38. data/app/views/spree/admin/stores/_form.html.erb +48 -0
  39. data/app/views/spree/admin/{trackers → stores}/edit.html.erb +5 -5
  40. data/app/views/spree/admin/stores/index.html.erb +38 -0
  41. data/app/views/spree/admin/stores/new.html.erb +11 -0
  42. data/app/views/spree/admin/users/_addresses_form.html.erb +7 -0
  43. data/app/views/spree/admin/users/_lifetime_stats.html.erb +2 -2
  44. data/config/routes.rb +11 -1
  45. data/vendor/assets/javascripts/handlebars.js +7 -2724
  46. data/vendor/assets/javascripts/modernizr.js +3 -4
  47. data/vendor/assets/javascripts/underscore-min.js +3 -4
  48. metadata +20 -16
  49. data/app/controllers/spree/admin/trackers_controller.rb +0 -6
  50. data/app/views/spree/admin/trackers/_form.html.erb +0 -36
  51. data/app/views/spree/admin/trackers/index.html.erb +0 -44
  52. data/app/views/spree/admin/trackers/new.html.erb +0 -13
  53. data/vendor/assets/javascripts/underscore-min.map +0 -1
  54. data/vendor/assets/javascripts/velocity.js +0 -3831
@@ -12,8 +12,8 @@ module Spree
12
12
  def create
13
13
  @user = Spree.user_class.new(user_params)
14
14
  if @user.save
15
- flash.now[:success] = flash_message_for(@user, :successfully_created)
16
- render :edit
15
+ flash[:success] = flash_message_for(@user, :successfully_created)
16
+ redirect_to edit_admin_user_path(@user)
17
17
  else
18
18
  render :new
19
19
  end
@@ -26,10 +26,11 @@ module Spree
26
26
  end
27
27
 
28
28
  if @user.update_attributes(user_params)
29
- flash.now[:success] = Spree.t(:account_updated)
29
+ flash[:success] = Spree.t(:account_updated)
30
+ redirect_to edit_admin_user_path(@user)
31
+ else
32
+ render :edit
30
33
  end
31
-
32
- render :edit
33
34
  end
34
35
 
35
36
  def addresses
@@ -88,7 +89,8 @@ module Spree
88
89
 
89
90
  def user_params
90
91
  params.require(:user).permit(permitted_user_attributes |
91
- [spree_role_ids: [],
92
+ [:use_billing,
93
+ spree_role_ids: [],
92
94
  ship_address_attributes: permitted_address_attributes,
93
95
  bill_address_attributes: permitted_address_attributes])
94
96
  end
@@ -3,6 +3,7 @@ module Spree
3
3
  class VariantsController < ResourceController
4
4
  belongs_to 'spree/product', find_by: :slug
5
5
  new_action.before :new_before
6
+ before_action :redirect_on_empty_option_values, only: [:new]
6
7
  before_action :load_data, only: [:new, :create, :edit, :update]
7
8
 
8
9
  # override the destroy method to set deleted_at value
@@ -12,7 +13,7 @@ module Spree
12
13
  if @variant.destroy
13
14
  flash[:success] = Spree.t('notice_messages.variant_deleted')
14
15
  else
15
- flash[:error] = Spree.t('notice_messages.variant_not_deleted')
16
+ flash[:error] = Spree.t('notice_messages.variant_not_deleted', error: @variant.errors.full_messages.to_sentence)
16
17
  end
17
18
 
18
19
  respond_with(@variant) do |format|
@@ -54,6 +55,10 @@ module Spree
54
55
  def load_data
55
56
  @tax_categories = TaxCategory.order(:name)
56
57
  end
58
+
59
+ def redirect_on_empty_option_values
60
+ redirect_to admin_product_variants_url(params[:product_id]) if @product.empty_option_values?
61
+ end
57
62
  end
58
63
  end
59
64
  end
@@ -41,7 +41,7 @@ module Spree
41
41
  request.fullpath.starts_with?("#{spree.admin_path}#{options[:match_path]}")
42
42
  else
43
43
  args.include?(controller.controller_name.to_sym)
44
- end
44
+ end
45
45
  css_classes << 'selected' if selected
46
46
 
47
47
  css_classes << options[:css_class] if options[:css_class]
@@ -117,6 +117,14 @@ module Spree
117
117
  button_link_to '', clone_object_url(resource), options
118
118
  end
119
119
 
120
+ def link_to_clone_promotion(promotion, options = {})
121
+ options[:data] = { action: 'clone', 'original-title': Spree.t(:clone) }
122
+ options[:class] = 'btn btn-warning btn-sm with-tip'
123
+ options[:method] = :post
124
+ options[:icon] = :clone
125
+ button_link_to '', clone_admin_promotion_path(promotion), options
126
+ end
127
+
120
128
  def link_to_edit(resource, options = {})
121
129
  url = options[:url] || edit_object_url(resource)
122
130
  options[:data] = { action: 'edit' }
@@ -151,10 +159,18 @@ module Spree
151
159
  link_to(text.html_safe, url, options)
152
160
  end
153
161
 
154
- def icon(icon_name)
162
+ def spree_icon(icon_name)
155
163
  icon_name ? content_tag(:i, '', class: icon_name) : ''
156
164
  end
157
165
 
166
+ def icon(icon_name)
167
+ ActiveSupport::Deprecation.warn(<<-EOS, caller)
168
+ Admin::NavigationHelper#icon was renamed to Admin::NavigationHelper#spree_icon
169
+ and will be removed in Spree 3.6. Please update your code to avoid problems after update
170
+ EOS
171
+ spree_icon(icon_name)
172
+ end
173
+
158
174
  # Override: Add disable_with option to prevent multiple request on consecutive clicks
159
175
  def button(text, icon_name = nil, button_type = 'submit', options = {})
160
176
  if icon_name
@@ -14,7 +14,8 @@ module Spree
14
14
  :payment_methods, :shipping_methods,
15
15
  :shipping_categories, :stock_transfers,
16
16
  :stock_locations, :trackers, :refund_reasons,
17
- :reimbursement_types, :return_authorization_reasons]
17
+ :reimbursement_types, :return_authorization_reasons,
18
+ :stores]
18
19
  PROMOTION_TABS ||= [:promotions, :promotion_categories]
19
20
  USER_TABS ||= [:users]
20
21
  end
@@ -7,56 +7,6 @@
7
7
 
8
8
  <fieldset class="general no-border-top">
9
9
 
10
- <%= fields_for :store do |f| %>
11
- <div class="row">
12
- <div class="col-xs-12 col-md-6">
13
- <div class="form-group" data-hook="admin_general_setting_input_name">
14
- <%= f.label :name %>
15
- <%= f.text_field :name, class: 'form-control' %>
16
- </div>
17
- </div>
18
-
19
- <div class="col-xs-12 col-md-6">
20
- <div class="form-group" data-hook="admin_general_setting_input_seo_title">
21
- <%= f.label :seo_title %>
22
- <%= f.text_field :seo_title, class: 'form-control' %>
23
- </div>
24
- </div>
25
- </div>
26
-
27
- <div class="row">
28
- <div class="col-xs-12 col-md-6">
29
- <div class="form-group" data-hook="admin_general_setting_input_meta_keywords">
30
- <%= f.label :meta_keywords %>
31
- <%= f.text_field :meta_keywords, class: 'form-control' %>
32
- </div>
33
- </div>
34
-
35
- <div class="col-xs-12 col-md-6">
36
- <div class="form-group" data-hook="admin_general_setting_input_meta_description">
37
- <%= f.label :meta_description %>
38
- <%= f.text_field :meta_description, class: 'form-control' %>
39
- </div>
40
- </div>
41
- </div>
42
-
43
- <div class="row">
44
- <div class="col-xs-12 col-md-6">
45
- <div class="form-group" data-hook="admin_general_setting_input_url">
46
- <%= f.label :url %>
47
- <%= f.text_field :url, class: 'form-control' %>
48
- </div>
49
- </div>
50
-
51
- <div class="col-xs-12 col-md-6">
52
- <div class="form-group" data-hook="admin_general_setting_mail_from_address">
53
- <%= f.label :mail_from_address %>
54
- <%= f.text_field :mail_from_address, class: 'form-control' %>
55
- </div>
56
- </div>
57
- </div>
58
- <% end %>
59
-
60
10
  <div class="row">
61
11
  <div class="col-xs-12 col-md-6">
62
12
  <%#-------------------------------------------------%>
@@ -0,0 +1,18 @@
1
+ <div data-hook="store-form-container">
2
+ <%= form_for [:admin, order], method: :put, url: set_store_admin_order_url do |f| %>
3
+ <fieldset>
4
+ <div data-hook="admin_order_store_field">
5
+ <%= f.field_container :store_id, class: ['form-group'] do %>
6
+ <%= f.label :store_id, Spree.t(:store) %>
7
+ <%= f.collection_select(:store_id, @stores, :id, :name, { include_blank: false }, { class: "select2" }) %>
8
+ <%= f.error_message_on :store_id %>
9
+ <% end %>
10
+ </div>
11
+ <div class="form-actions" data-hook="buttons">
12
+ <%= button Spree.t('actions.update'), 'refresh', 'submit', {class: 'btn-success', data: { disable_with: "#{ Spree.t(:saving) }..." }} %>
13
+ <span class="or"><%= Spree.t(:or) %></span>
14
+ <%= button_link_to Spree.t('actions.cancel'), edit_admin_order_url(order), icon: 'delete' %>
15
+ </div>
16
+ <fieldset>
17
+ <% end %>
18
+ </div>
@@ -50,21 +50,21 @@
50
50
  <div class="col-xs-12 col-md-4">
51
51
  <div class="form-group">
52
52
  <%= label_tag :q_state_eq, Spree.t(:status) %>
53
- <%= f.select :state_eq, Spree::Order.state_machines[:state].states.map {|s| [Spree.t("order_state.#{s.name}"), s.value]}, {include_blank: true}, class: 'select2 js-filterable' %>
53
+ <%= f.select :state_eq, Spree::Order.state_machines[:state].states.map {|s| [Spree.t("order_state.#{s.name}"), s.value]}, { include_blank: true }, class: 'select2 js-filterable' %>
54
54
  </div>
55
55
  </div>
56
56
 
57
57
  <div class="col-xs-12 col-md-4">
58
58
  <div class="form-group">
59
59
  <%= label_tag :q_payment_state_eq, Spree.t(:payment_state) %>
60
- <%= f.select :payment_state_eq, Spree::Order::PAYMENT_STATES.map {|s| [Spree.t("payment_states.#{s}"), s]}, {include_blank: true}, class: 'select2 js-filterable' %>
60
+ <%= f.select :payment_state_eq, Spree::Order::PAYMENT_STATES.map {|s| [Spree.t("payment_states.#{s}"), s]}, { include_blank: true }, class: 'select2 js-filterable' %>
61
61
  </div>
62
62
  </div>
63
63
 
64
64
  <div class="col-xs-12 col-md-4">
65
65
  <div class="form-group">
66
66
  <%= label_tag :q_shipment_state_eq, Spree.t(:shipment_state) %>
67
- <%= f.select :shipment_state_eq, Spree::Order::SHIPMENT_STATES.map {|s| [Spree.t("shipment_states.#{s}"), s]}, {include_blank: true}, class: 'select2 js-filterable' %>
67
+ <%= f.select :shipment_state_eq, Spree::Order::SHIPMENT_STATES.map {|s| [Spree.t("shipment_states.#{s}"), s]}, { include_blank: true }, class: 'select2 js-filterable' %>
68
68
  </div>
69
69
  </div>
70
70
 
@@ -107,7 +107,14 @@
107
107
  <div class="col-xs-12 col-md-4">
108
108
  <div class="form-group">
109
109
  <%= label_tag :q_promotions_id_in, Spree.t(:promotion) %>
110
- <%= f.select :promotions_id_in, Spree::Promotion.applied.pluck(:name, :id), {include_blank: true}, class: 'select2' %>
110
+ <%= f.select :promotions_id_in, Spree::Promotion.applied.pluck(:name, :id), { include_blank: true }, class: 'select2' %>
111
+ </div>
112
+ </div>
113
+
114
+ <div class="col-xs-12 col-md-4">
115
+ <div class="form-group">
116
+ <%= label_tag :q_store_id_in, Spree.t(:store) %>
117
+ <%= f.select :store_id_in, Spree::Store.order(:name).pluck(:name, :id), { include_blank: true }, class: 'select2' %>
111
118
  </div>
112
119
  </div>
113
120
 
@@ -0,0 +1,7 @@
1
+ <%= render 'spree/admin/shared/order_tabs', current: :store %>
2
+
3
+ <div data-hook="admin_order_edit_header">
4
+ <%= render 'spree/admin/shared/error_messages', target: @order %>
5
+ </div>
6
+
7
+ <%= render 'store_form', order: @order if can?(:update, @order) %>
@@ -77,6 +77,13 @@
77
77
  <% end %>
78
78
  </div>
79
79
 
80
+ <div data-hook="admin_product_form_sku">
81
+ <%= f.field_container :master_sku, class: ['form-group'] do %>
82
+ <%= f.label :master_sku, Spree.t(:master_sku) %>
83
+ <%= f.text_field :sku, size: 16, class: 'form-control' %>
84
+ <% end %>
85
+ </div>
86
+
80
87
  <% if @product.has_variants? %>
81
88
  <div data-hook="admin_product_form_multiple_variants" class="well">
82
89
  <%= f.label :skus, Spree.t(:sku).pluralize %>
@@ -100,13 +107,6 @@
100
107
  </div>
101
108
  </div>
102
109
  <% else %>
103
- <div data-hook="admin_product_form_sku">
104
- <%= f.field_container :sku, class: ['form-group'] do %>
105
- <%= f.label :sku, Spree.t(:sku) %>
106
- <%= f.text_field :sku, size: 16, class: 'form-control' %>
107
- <% end %>
108
- </div>
109
-
110
110
  <div id="shipping_specs" class="row">
111
111
  <div class="col-xs-12 col-md-6">
112
112
  <div id="shipping_specs_weight_field" data-hook="admin_product_form_weight" class="form-group">
@@ -1,4 +1,7 @@
1
1
  <% content_for :page_actions do %>
2
+ <% if frontend_available? %>
3
+ <%= button_link_to Spree.t(:preview_product), product_url(@product), { class: "btn-default", icon: 'eye-open', id: 'admin_preview_product', target: :_blank } %>
4
+ <% end %>
2
5
  <% if can?(:create, Spree::Product) %>
3
6
  <%= button_link_to Spree.t(:new_product), new_object_url, { class: "btn-success", icon: 'add', id: 'admin_new_product' } %>
4
7
  <% end %>
@@ -13,6 +13,13 @@
13
13
  <%= f.text_field :code, class: 'form-control' %>
14
14
  <% end %>
15
15
 
16
+ <%= f.field_container :generate_code, class: ['checkbox'] do %>
17
+ <%= f.label :generate_code do %>
18
+ <%= f.check_box :generate_code %>
19
+ <%= Spree.t(:generate_code) %>
20
+ <% end %>
21
+ <% end %>
22
+
16
23
  <%= f.field_container :path, class: ['form-group'] do %>
17
24
  <%= f.label :path %>
18
25
  <%= f.text_field :path, class: 'form-control' %>
@@ -8,5 +8,5 @@
8
8
  <%= hidden_field_tag "#{param_prefix}[id]", promotion_action.id %>
9
9
 
10
10
  <%= render partial: "spree/admin/promotions/actions/#{type_name}",
11
- locals: { promotion_action: promotion_action, param_prefix: param_prefix } rescue nil %>
11
+ locals: { promotion_action: promotion_action, param_prefix: param_prefix } %>
12
12
  </div>
@@ -7,5 +7,5 @@
7
7
  <% param_prefix = "promotion[promotion_rules_attributes][#{promotion_rule.id}]" %>
8
8
  <%= hidden_field_tag "#{param_prefix}[id]", promotion_rule.id %>
9
9
 
10
- <%= render partial: "spree/admin/promotions/rules/#{type_name}", locals: { promotion_rule: promotion_rule, param_prefix: param_prefix } rescue nil %>
10
+ <%= render partial: "spree/admin/promotions/rules/#{type_name}", locals: { promotion_rule: promotion_rule, param_prefix: param_prefix } %>
11
11
  </div>
@@ -68,6 +68,7 @@
68
68
  <td><%= promotion.expires_at.to_date.to_s(:short_date) if promotion.expires_at %></td>
69
69
  <td class="actions actions-2" data-hook="admin_promotions_index_row_actions">
70
70
  <%= link_to_edit promotion, no_text: true if can?(:edit, promotion) %>
71
+ <%= link_to_clone_promotion promotion, no_text: true if can?(:clone, promotion) %>
71
72
  <%= link_to_delete promotion, no_text: true if can?(:delete, promotion) %>
72
73
  </td>
73
74
  </tr>
@@ -7,3 +7,4 @@
7
7
  <% end %>
8
8
 
9
9
  <%= render partial: '/spree/admin/shared/update_order_state' if @order %>
10
+ <%= render partial: '/spree/admin/shared/update_store_credit' if @store_credit %>
@@ -11,6 +11,12 @@
11
11
  </li>
12
12
  <% end %>
13
13
 
14
+ <% if ((can? :update, @order) && (@order.shipments.size.zero? || @order.shipments.shipped.size.zero?)) %>
15
+ <li<%== ' class="active"' if current == :store %> data-hook='admin_order_tabs_store_details'>
16
+ <%= link_to_with_icon 'home', Spree.t(:store), store_admin_order_url(@order) %>
17
+ </li>
18
+ <% end %>
19
+
14
20
  <% if can?(:update, @order) && @order.checkout_steps.include?("address") %>
15
21
  <li<%== ' class="active"' if current == :customer_details %> data-hook='admin_order_tabs_customer_details'>
16
22
  <%= link_to_with_icon 'user', Spree.t(:customer), spree.admin_order_customer_url(@order) %>
@@ -0,0 +1 @@
1
+ $('#user-lifetime-stats #store_credit').html('<%= Spree::Money.new(@user.total_available_store_credit) %>');
@@ -1,5 +1,6 @@
1
1
  <ul data-hook="admin_configurations_sidebar_menu" class="collapse nav nav-pills nav-stacked" id="sidebar-configuration">
2
2
  <%= configurations_sidebar_menu_item(Spree.t(:general_settings), spree.edit_admin_general_settings_path) if can? :manage, Spree::Config %>
3
+ <%= configurations_sidebar_menu_item(Spree.t(:stores), spree.admin_stores_path) if can? :manage, Spree::Store %>
3
4
  <%= configurations_sidebar_menu_item(Spree.t(:tax_categories), spree.admin_tax_categories_path) if can? :manage, Spree::TaxCategory %>
4
5
  <%= configurations_sidebar_menu_item(Spree.t(:tax_rates), spree.admin_tax_rates_path) if can? :manage, Spree::TaxRate %>
5
6
  <%= configurations_sidebar_menu_item(Spree.t(:zones), spree.admin_zones_path) if can? :manage, Spree::Zone %>
@@ -15,7 +16,6 @@
15
16
  <%= configurations_sidebar_menu_item(Spree.t(:stock_transfers), spree.admin_stock_transfers_path) if can? :manage, Spree::StockTransfer %>
16
17
  <%= configurations_sidebar_menu_item(Spree.t(:stock_locations), spree.admin_stock_locations_path) if can? :manage, Spree::StockLocation %>
17
18
  <%= configurations_sidebar_menu_item(Spree.t(:store_credit_categories), spree.admin_store_credit_categories_path) if can? :manage, Spree::StoreCreditCategory %>
18
- <%= configurations_sidebar_menu_item(Spree.t(:analytics_trackers), spree.admin_trackers_path) if can? :manage, Spree::Tracker %>
19
19
  <%= configurations_sidebar_menu_item(Spree.t(:refund_reasons), spree.admin_refund_reasons_path) if can? :manage, Spree::RefundReason %>
20
20
  <%= configurations_sidebar_menu_item(Spree.t(:reimbursement_types), spree.admin_reimbursement_types_path) if can? :manage, Spree::ReimbursementType %>
21
21
  <%= configurations_sidebar_menu_item(Spree.t(:return_authorization_reasons), spree.admin_return_authorization_reasons_path) if can? :manage, Spree::ReturnAuthorizationReason %>
@@ -11,7 +11,7 @@
11
11
  <div data-hook="admin_shipping_method_form_display_field" class="col-xs-12 col-md-6">
12
12
  <%= f.field_container :display_on, class: ['form-group'] do %>
13
13
  <%= f.label :display_on, Spree.t(:display) %>
14
- <%= select(:shipping_method, :display_on, Spree::ShippingMethod::DISPLAY.collect { |display| [Spree.t(display), display.to_s] }, {}, { class: 'select2' }) %>
14
+ <%= select(:shipping_method, :display_on, Spree::ShippingMethod::DISPLAY.collect { |display| [Spree.t(display), display.to_s] }, { include_blank: true }, { class: 'select2' }) %>
15
15
  <%= f.error_message_on :display_on %>
16
16
  <% end %>
17
17
  </div>
@@ -23,7 +23,7 @@
23
23
  <td><%= shipping_method.admin_name + ' / ' if shipping_method.admin_name.present? %><%= shipping_method.name %></td>
24
24
  <td><%= shipping_method.zones.collect(&:name).join(", ") if shipping_method.zones %></td>
25
25
  <td><%= shipping_method.calculator.description %></td>
26
- <td class="text-center"><%= shipping_method.display_on.blank? ? Spree.t(:both) : Spree.t(shipping_method.display_on) %></td>
26
+ <td class="text-center"><%= shipping_method.display_on.blank? ? Spree.t(:none) : Spree.t(shipping_method.display_on) %></td>
27
27
  <td data-hook="admin_shipping_methods_index_row_actions" class="actions actions-2 text-right">
28
28
  <%= link_to_edit(shipping_method, no_text: true) if can? :edit, shipping_method %>
29
29
  <%= link_to_delete(shipping_method, no_text: true) if can? :delete, shipping_method %>
@@ -0,0 +1,48 @@
1
+ <div data-hook="admin_store_form_fields">
2
+ <%= f.field_container :name, class: ['form-group'] do %>
3
+ <%= f.label :name, Spree.t(:name) %>
4
+ <%= f.text_field :name, class: 'form-control', required: true %>
5
+ <%= f.error_message_on :name %>
6
+ <% end %>
7
+ <%= f.field_container :url, class: ['form-group'] do %>
8
+ <%= f.label :url, Spree.t(:url) %>
9
+ <%= f.text_field :url, class: 'form-control', required: true %>
10
+ <%= f.error_message_on :url %>
11
+ <% end %>
12
+ <%= f.field_container :meta_description, class: ['form-group'] do %>
13
+ <%= f.label :meta_description, Spree.t(:meta_description) %>
14
+ <%= f.text_field :meta_description, class: 'form-control' %>
15
+ <%= f.error_message_on :meta_description %>
16
+ <% end %>
17
+ <%= f.field_container :meta_keywords, class: ['form-group'] do %>
18
+ <%= f.label :meta_keywords, Spree.t(:meta_keywords) %>
19
+ <%= f.text_field :meta_keywords, class: 'form-control' %>
20
+ <%= f.error_message_on :meta_keywords %>
21
+ <% end %>
22
+ <%= f.field_container :seo_title, class: ['form-group'] do %>
23
+ <%= f.label :seo_title, Spree.t(:seo_title) %>
24
+ <%= f.text_field :seo_title, class: 'form-control' %>
25
+ <%= f.error_message_on :seo_title %>
26
+ <% end %>
27
+ <%= f.field_container :mail_from_address, class: ['form-group'] do %>
28
+ <%= f.label :mail_from_address, Spree.t(:mail_from_address) %>
29
+ <%= f.text_field :mail_from_address, class: 'form-control', required: true %>
30
+ <%= f.error_message_on :mail_from_address %>
31
+ <% end %>
32
+ <%# TODO: uncomment this and add support for default_currency in store %>
33
+ <%# <%= f.field_container :default_currency, class: ['form-group'] do %1> %>
34
+ <%# <%= f.label :default_currency, Spree.t(:default_currency) %1> %>
35
+ <%# <%= f.text_field :default_currency, class: 'form-control' %1> %>
36
+ <%# <%= f.error_message_on :default_currency %1> %>
37
+ <%# <% end %1> %>
38
+ <%= f.field_container :code, class: ['form-group'] do %>
39
+ <%= f.label :code, Spree.t(:code) %>
40
+ <%= f.text_field :code, class: 'form-control', required: true %>
41
+ <%= f.error_message_on :code %>
42
+ <% end %>
43
+ <%= f.field_container :default, class: ['form-group'] do %>
44
+ <%= f.label :default, Spree.t(:default) %>
45
+ <%= f.check_box :default %>
46
+ <%= f.error_message_on :default %>
47
+ <% end %>
48
+ </div>
@@ -1,13 +1,13 @@
1
1
  <% content_for :page_title do %>
2
- <%= link_to Spree.t(:analytics_trackers), spree.admin_trackers_url %> /
3
- <%= @tracker.analytics_id %>
2
+ <%= link_to Spree.t(:stores), spree.admin_stores_url %> /
3
+ <%= @store.name %>
4
4
  <% end %>
5
5
 
6
- <%= render partial: 'spree/admin/shared/error_messages', locals: { target: @tracker } %>
6
+ <%= render partial: 'spree/admin/shared/error_messages', locals: { target: @store } %>
7
7
 
8
- <%= form_for [:admin, @tracker] do |f| %>
8
+ <%= form_for [:admin, @store] do |f| %>
9
9
  <fieldset>
10
10
  <%= render partial: 'form', locals: { f: f } %>
11
- <%= render partial: 'spree/admin/shared/edit_resource_links' %>
11
+ <%= render partial: 'spree/admin/shared/edit_resource_links', locals: { collection_url: spree.admin_stores_path(@store) } %>
12
12
  </fieldset>
13
13
  <% end %>