spree_backend 2.4.0.rc3 → 2.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/spree/backend/general_settings.js.coffee +13 -0
- data/app/controllers/spree/admin/general_settings_controller.rb +8 -0
- data/app/controllers/spree/admin/reimbursements_controller.rb +0 -6
- data/app/views/spree/admin/general_settings/edit.html.erb +9 -0
- data/app/views/spree/admin/option_types/_option_value_fields.html.erb +7 -5
- data/app/views/spree/admin/option_types/edit.html.erb +2 -9
- data/app/views/spree/admin/promotion_categories/index.html.erb +22 -31
- data/app/views/spree/admin/promotions/index.html.erb +1 -1
- data/app/views/spree/admin/return_authorizations/_form.html.erb +10 -9
- data/config/routes.rb +1 -0
- data/lib/spree/backend/callbacks.rb +5 -0
- metadata +9 -9
- data/app/views/spree/admin/promotion_categories/new.js.erb +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a6b7f7e1b021d4babc31a7b8ecdecef76de49f0b
|
4
|
+
data.tar.gz: 53aa1e90ecf3ea1a3f66c4af5e121eda36dbae2a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d4dea2af0ee3bfb392f049811c8fcfee71f50c8e1403b01b06257ec62e90ebaea12e7ff88e4a603ea53c513bc0350393472b8e07595b243ed4483543e650e359
|
7
|
+
data.tar.gz: 0a47836a0f067fb5f06799593afbee09ea6164d55f729e3b2778f56bb521be8ad43454edee8283517aa2032f441e70abd21d7f3f531ebe9fbe999f8bdef63819
|
@@ -0,0 +1,13 @@
|
|
1
|
+
$(@).ready( ->
|
2
|
+
$('[data-hook=general_settings_clear_cache] #clear_cache').click ->
|
3
|
+
$.ajax
|
4
|
+
type: 'POST'
|
5
|
+
url: '/admin/general_settings/clear_cache'
|
6
|
+
success: ->
|
7
|
+
show_flash 'success', "Cache was flushed."
|
8
|
+
error: (msg) ->
|
9
|
+
if msg.responseJSON["error"]
|
10
|
+
show_flash 'error', msg.responseJSON["error"]
|
11
|
+
else
|
12
|
+
show_flash 'error', "There was a problem while flushing cache."
|
13
|
+
)
|
@@ -1,6 +1,8 @@
|
|
1
1
|
module Spree
|
2
2
|
module Admin
|
3
3
|
class GeneralSettingsController < Spree::Admin::BaseController
|
4
|
+
include Spree::Backend::Callbacks
|
5
|
+
|
4
6
|
before_action :set_store
|
5
7
|
|
6
8
|
def edit
|
@@ -31,6 +33,12 @@ module Spree
|
|
31
33
|
end
|
32
34
|
end
|
33
35
|
|
36
|
+
def clear_cache
|
37
|
+
Rails.cache.clear
|
38
|
+
invoke_callbacks(:clear_cache, :after)
|
39
|
+
head :no_content
|
40
|
+
end
|
41
|
+
|
34
42
|
private
|
35
43
|
def store_params
|
36
44
|
params.require(:store).permit(permitted_params)
|
@@ -33,12 +33,6 @@ module Spree
|
|
33
33
|
def load_simulated_refunds
|
34
34
|
@reimbursement_objects = @reimbursement.simulate
|
35
35
|
end
|
36
|
-
|
37
|
-
# TODO: Remove this when https://github.com/spree/spree/pull/5158 gets merged in
|
38
|
-
def permitted_resource_params
|
39
|
-
params[object_name].present? ? super : ActionController::Parameters.new
|
40
|
-
end
|
41
|
-
|
42
36
|
end
|
43
37
|
end
|
44
38
|
end
|
@@ -60,6 +60,15 @@
|
|
60
60
|
</div>
|
61
61
|
<% end %>
|
62
62
|
</fieldset>
|
63
|
+
<fieldset class="security no-border-bottom">
|
64
|
+
<legend align="center"><%= Spree.t(:clear_cache)%></legend>
|
65
|
+
<div>
|
66
|
+
<%= Spree.t(:clear_cache_warning) %>
|
67
|
+
</div>
|
68
|
+
<div class="field" data-hook="general_settings_clear_cache">
|
69
|
+
<%= button Spree.t(:clear_cache), '', 'button', id: "clear_cache" %>
|
70
|
+
</div>
|
71
|
+
</fieldset>
|
63
72
|
</div>
|
64
73
|
<div class="omega six columns">
|
65
74
|
<fieldset class="currency no-border-bottom">
|
@@ -1,9 +1,11 @@
|
|
1
1
|
<tr class="option_value fields" id="spree_<%= dom_id(f.object) %>" data-hook="option_value" class="<%= cycle('odd', 'even')%>">
|
2
|
-
|
3
|
-
<
|
4
|
-
|
5
|
-
|
6
|
-
|
2
|
+
<% if f.object.persisted? %>
|
3
|
+
<td class="no-border">
|
4
|
+
<span class="handle"></span>
|
5
|
+
<%= f.hidden_field :id %>
|
6
|
+
</td>
|
7
|
+
<% end %>
|
8
|
+
<td colspan="<%= f.object.persisted? ? '' : '2' %>" class="name"><%= f.text_field :name %></td>
|
7
9
|
<td class="presentation"><%= f.text_field :presentation %></td>
|
8
10
|
<td class="actions"><%= link_to_remove_fields Spree.t(:remove), f, :no_text => true %></td>
|
9
11
|
</tr>
|
@@ -32,15 +32,8 @@
|
|
32
32
|
</tr>
|
33
33
|
</thead>
|
34
34
|
<tbody id="option_values">
|
35
|
-
|
36
|
-
|
37
|
-
<td colspan="2"><%= Spree.t(:none) %></td>
|
38
|
-
<td class="actions"></td>
|
39
|
-
</tr>
|
40
|
-
<% else %>
|
41
|
-
<%= f.fields_for :option_values do |option_value_form| %>
|
42
|
-
<%= render :partial => 'option_value_fields', :locals => { :f => option_value_form } %>
|
43
|
-
<% end %>
|
35
|
+
<%= f.fields_for :option_values, @option_values do |option_value_form| %>
|
36
|
+
<%= render :partial => 'option_value_fields', :locals => { :f => option_value_form } %>
|
44
37
|
<% end %>
|
45
38
|
</tbody>
|
46
39
|
</table>
|
@@ -4,39 +4,30 @@
|
|
4
4
|
|
5
5
|
<% content_for :page_actions do %>
|
6
6
|
<li>
|
7
|
-
<%= button_link_to Spree.t(:new_promotion_category), spree.new_admin_promotion_category_path, icon
|
7
|
+
<%= button_link_to Spree.t(:new_promotion_category), spree.new_admin_promotion_category_path, :icon => 'plus' %>
|
8
8
|
</li>
|
9
9
|
<% end %>
|
10
10
|
|
11
11
|
<%= render 'spree/admin/shared/promotion_sub_menu' %>
|
12
12
|
|
13
|
-
<
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
<% end %>
|
35
|
-
</tbody>
|
36
|
-
</table>
|
37
|
-
<% else %>
|
38
|
-
<div class="alpha sixteen columns no-objects-found">
|
39
|
-
<%= Spree.t(:no_resource_found, resource: I18n.t(:other, scope: 'activerecord.models.spree/promotion_category')) %>
|
40
|
-
<%= link_to Spree.t(:add_one) + '!', spree.new_admin_promotion_category_path, remote: true, id: 'new_promotion_category_link' %>
|
41
|
-
</div>
|
42
|
-
<% end %>
|
13
|
+
<table>
|
14
|
+
<colgroup>
|
15
|
+
<col style="width: 85%">
|
16
|
+
<col style="width: 15%">
|
17
|
+
</colgroup>
|
18
|
+
<thead>
|
19
|
+
<th><%= Spree::PromotionCategory.human_attribute_name :name %></th>
|
20
|
+
<th class='actions'></th>
|
21
|
+
</thead>
|
22
|
+
<tbody>
|
23
|
+
<% @promotion_categories.each do |promotion_category| %>
|
24
|
+
<tr>
|
25
|
+
<td><%= promotion_category.name %></td>
|
26
|
+
<td class="actions">
|
27
|
+
<%= link_to_edit promotion_category, :no_text => true %>
|
28
|
+
<%= link_to_delete promotion_category, :no_text => true %>
|
29
|
+
</td>
|
30
|
+
</tr>
|
31
|
+
<% end %>
|
32
|
+
</tbody>
|
33
|
+
</table>
|
@@ -99,7 +99,7 @@
|
|
99
99
|
</tbody>
|
100
100
|
</table>
|
101
101
|
<% else %>
|
102
|
-
<div class="alpha
|
102
|
+
<div class="alpha twelve columns no-objects-found">
|
103
103
|
<%= Spree.t(:no_resource_found, resource: I18n.t(:other, scope: 'activerecord.models.spree/promotion')) %>,
|
104
104
|
<%= link_to Spree.t(:add_one), spree.new_admin_promotion_path %>!
|
105
105
|
</div>
|
@@ -21,9 +21,10 @@
|
|
21
21
|
<%= f.fields_for :return_items, @form_return_items do |item_fields| %>
|
22
22
|
<% return_item = item_fields.object %>
|
23
23
|
<% inventory_unit = return_item.inventory_unit %>
|
24
|
+
<% editable = inventory_unit.shipped? && allow_return_item_changes && return_item.reimbursement.nil? %>
|
24
25
|
<tr>
|
25
26
|
<td class="align-center" class="inventory-unit-checkbox">
|
26
|
-
<% if
|
27
|
+
<% if editable %>
|
27
28
|
<%= item_fields.hidden_field :inventory_unit_id %>
|
28
29
|
<%= item_fields.check_box :_destroy, {checked: return_item.persisted?, class: 'add-item', "data-price" => return_item.pre_tax_amount}, '0', '1' %>
|
29
30
|
<% end %>
|
@@ -37,24 +38,24 @@
|
|
37
38
|
<%= return_item.display_pre_tax_amount %>
|
38
39
|
</td>
|
39
40
|
<td class="align-center">
|
40
|
-
<% if
|
41
|
+
<% if editable %>
|
41
42
|
<%= item_fields.text_field :pre_tax_amount, { class: 'refund-amount-input' } %>
|
42
43
|
<% else %>
|
43
44
|
<%= return_item.display_pre_tax_amount %>
|
44
45
|
<% end %>
|
45
46
|
</td>
|
46
47
|
<td>
|
47
|
-
<% if
|
48
|
+
<% if editable %>
|
48
49
|
<%= item_fields.select :preferred_reimbursement_type_id, @reimbursement_types.collect{|r|[r.name.humanize, r.id]}, {include_blank: true}, {class: 'select2 fullwidth'} %>
|
50
|
+
<% else %>
|
51
|
+
<%= return_item.preferred_reimbursement_type.try(:name) %>
|
49
52
|
<% end %>
|
50
53
|
</td>
|
51
54
|
<td class="align-center">
|
52
|
-
<% if
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
<%= item_fields.collection_select :exchange_variant_id, return_item.eligible_exchange_variants, :id, :options_text, { include_blank: true }, { class: "select2 fullwidth return-item-exchange-selection" } %>
|
57
|
-
<% end %>
|
55
|
+
<% if editable %>
|
56
|
+
<%= item_fields.collection_select :exchange_variant_id, return_item.eligible_exchange_variants, :id, :options_text, { include_blank: true }, { class: "select2 fullwidth return-item-exchange-selection" } %>
|
57
|
+
<% elsif return_item.exchange_processed? %>
|
58
|
+
<%= return_item.exchange_variant.options_text %>
|
58
59
|
<% end %>
|
59
60
|
</td>
|
60
61
|
</tr>
|
data/config/routes.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spree_backend
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.4.0
|
4
|
+
version: 2.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sean Schofield
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-11-
|
11
|
+
date: 2014-11-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: spree_api
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 2.4.0
|
19
|
+
version: 2.4.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 2.4.0
|
26
|
+
version: 2.4.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: spree_core
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - '='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 2.4.0
|
33
|
+
version: 2.4.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - '='
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 2.4.0
|
40
|
+
version: 2.4.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: jquery-rails
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -96,6 +96,7 @@ files:
|
|
96
96
|
- app/assets/javascripts/spree/backend/calculator.js
|
97
97
|
- app/assets/javascripts/spree/backend/checkouts/edit.js
|
98
98
|
- app/assets/javascripts/spree/backend/gateway.js
|
99
|
+
- app/assets/javascripts/spree/backend/general_settings.js.coffee
|
99
100
|
- app/assets/javascripts/spree/backend/handlebar_extensions.js
|
100
101
|
- app/assets/javascripts/spree/backend/images/index.js.coffee
|
101
102
|
- app/assets/javascripts/spree/backend/images/new.js.coffee
|
@@ -317,7 +318,6 @@ files:
|
|
317
318
|
- app/views/spree/admin/promotion_categories/edit.html.erb
|
318
319
|
- app/views/spree/admin/promotion_categories/index.html.erb
|
319
320
|
- app/views/spree/admin/promotion_categories/new.html.erb
|
320
|
-
- app/views/spree/admin/promotion_categories/new.js.erb
|
321
321
|
- app/views/spree/admin/promotion_rules/create.js.erb
|
322
322
|
- app/views/spree/admin/promotion_rules/destroy.js.erb
|
323
323
|
- app/views/spree/admin/promotions/_actions.html.erb
|
@@ -553,9 +553,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
553
553
|
version: 1.9.3
|
554
554
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
555
555
|
requirements:
|
556
|
-
- - "
|
556
|
+
- - ">="
|
557
557
|
- !ruby/object:Gem::Version
|
558
|
-
version:
|
558
|
+
version: '0'
|
559
559
|
requirements:
|
560
560
|
- none
|
561
561
|
rubyforge_project: spree_backend
|
@@ -1,5 +0,0 @@
|
|
1
|
-
$("#new_promotion_category").html('<%= escape_javascript(render template: "spree/admin/promotion_categories/new", formats: [:html], handlers: [:erb]) %>');
|
2
|
-
<% unless Rails.env.test? %>
|
3
|
-
$('.select2').select2();
|
4
|
-
<% end %>
|
5
|
-
$("#new_promotion_category_link").parent().hide();
|