solidus_reviews 1.2.0 → 1.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +6 -0
- data/.gem_release.yml +5 -0
- data/.gitignore +13 -6
- data/.rspec +1 -1
- data/.rubocop.yml +3 -321
- data/.rubocop_todo.yml +197 -0
- data/CHANGELOG.md +155 -0
- data/Gemfile +14 -17
- data/{LICENSE.md → LICENSE} +1 -1
- data/README.md +63 -41
- data/Rakefile +3 -20
- data/app/assets/stylesheets/spree/frontend/solidus_reviews.css +4 -0
- data/app/controllers/spree/feedback_reviews_controller.rb +2 -8
- data/app/controllers/spree/reviews_controller.rb +29 -2
- data/app/decorators/controllers/solidus_reviews/spree/{admin/products_controller_decorator.rb → products_controller_decorator.rb} +0 -4
- data/app/decorators/models/solidus_reviews/spree/product_decorator.rb +6 -5
- data/app/helpers/spree/reviews_helper.rb +6 -6
- data/app/models/spree/feedback_review.rb +2 -2
- data/app/models/spree/permission_sets/review_display.rb +11 -0
- data/app/models/spree/permission_sets/review_management.rb +11 -0
- data/app/models/spree/review.rb +25 -10
- data/app/models/spree/reviews_ability.rb +7 -2
- data/app/models/spree/reviews_configuration.rb +10 -1
- data/app/overrides/add_reviews_tab_to_admin.rb +12 -4
- data/app/overrides/add_reviews_to_admin_configuration_sidebar.rb +12 -5
- data/app/views/spree/admin/review_settings/edit.html.erb +7 -0
- data/app/views/spree/admin/reviews/edit.html.erb +4 -2
- data/app/views/spree/admin/reviews/index.html.erb +9 -5
- data/app/views/spree/api/reviews/_feedback_review.json.jbuilder +1 -1
- data/app/views/spree/api/reviews/_review.json.jbuilder +1 -1
- data/app/views/spree/reviews/_form.html.erb +6 -4
- data/app/views/spree/reviews/edit.html.erb +3 -0
- data/app/views/spree/shared/_review.html.erb +6 -4
- data/bin/console +17 -0
- data/bin/rails +5 -5
- data/bin/rails-engine +13 -0
- data/bin/rails-sandbox +16 -0
- data/bin/rake +7 -0
- data/bin/sandbox +86 -0
- data/bin/setup +8 -0
- data/config/locales/de-CH.yml +1 -1
- data/config/locales/de.yml +1 -1
- data/config/locales/en-GB.yml +2 -1
- data/config/locales/en.yml +2 -1
- data/config/locales/es.yml +2 -1
- data/config/locales/fr.yml +1 -1
- data/config/locales/it.yml +1 -1
- data/config/locales/pl.yml +1 -1
- data/config/locales/pt-BR.yml +1 -1
- data/config/locales/pt.yml +1 -1
- data/config/locales/ro.yml +1 -1
- data/config/locales/sv.yml +1 -1
- data/config/locales/tr.yml +1 -1
- data/config/locales/uk.yml +1 -1
- data/config/locales/zh-CN.yml +1 -1
- data/config/locales/zh-TW.yml +1 -1
- data/config/routes.rb +3 -1
- data/db/migrate/20120123141326_recalculate_ratings.rb +1 -2
- data/db/migrate/20190613165528_add_verified_purchaser_to_reviews.rb +2 -0
- data/lib/controllers/spree/api/feedback_reviews_controller.rb +91 -0
- data/lib/controllers/spree/api/reviews_controller.rb +16 -14
- data/lib/generators/solidus_reviews/install/install_generator.rb +8 -7
- data/lib/solidus_reviews/engine.rb +26 -0
- data/lib/solidus_reviews/version.rb +5 -0
- data/lib/solidus_reviews.rb +4 -4
- data/solidus_reviews.gemspec +31 -34
- data/spec/controllers/spree/admin/feedback_reviews_controller_spec.rb +1 -1
- data/spec/controllers/spree/admin/review_settings_controller_spec.rb +3 -4
- data/spec/controllers/spree/admin/reviews_controller_spec.rb +3 -3
- data/spec/controllers/spree/api/feedback_reviews_controller_spec.rb +136 -0
- data/spec/controllers/spree/api/reviews_controller_spec.rb +27 -25
- data/spec/controllers/spree/feedback_reviews_controller_spec.rb +8 -8
- data/spec/controllers/spree/reviews_controller_spec.rb +145 -8
- data/spec/features/admin_spec.rb +6 -6
- data/spec/features/reviews_spec.rb +33 -32
- data/spec/fixtures/thinking-cat.jpg +0 -0
- data/spec/models/feedback_review_spec.rb +13 -13
- data/spec/models/product_spec.rb +13 -10
- data/spec/models/review_spec.rb +64 -41
- data/spec/models/reviews_ability_spec.rb +14 -14
- data/spec/models/reviews_configuration_spec.rb +21 -10
- data/spec/spec_helper.rb +18 -13
- data/spec/support/config.rb +7 -0
- data/spec/support/factories.rb +3 -0
- metadata +52 -213
- data/CONTRIBUTING.md +0 -28
- data/lib/spree_reviews/engine.rb +0 -22
- data/spec/controllers/spree/products_controller_spec.rb +0 -11
@@ -7,11 +7,16 @@ class Spree::ReviewsAbility
|
|
7
7
|
review_ability_class = self.class
|
8
8
|
|
9
9
|
can :create, Spree::Review do |_review|
|
10
|
-
review_ability_class.allow_anonymous_reviews? ||
|
10
|
+
review_ability_class.allow_anonymous_reviews? || user.email.present?
|
11
11
|
end
|
12
12
|
|
13
13
|
can :create, Spree::FeedbackReview do |_review|
|
14
|
-
review_ability_class.allow_anonymous_reviews? ||
|
14
|
+
review_ability_class.allow_anonymous_reviews? || user.email.present?
|
15
|
+
end
|
16
|
+
|
17
|
+
# You can only change your own feedback_review
|
18
|
+
can [:update, :destroy], Spree::FeedbackReview do |feedback_review|
|
19
|
+
feedback_review.user == user
|
15
20
|
end
|
16
21
|
|
17
22
|
# You can read your own reviews, and everyone can read approved ones
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
class Spree::ReviewsConfiguration < Spree::Preferences::Configuration
|
4
4
|
def self.boolean_preferences
|
5
|
-
%w(display_unapproved_reviews include_unapproved_reviews feedback_rating show_email require_login track_locale)
|
5
|
+
%w(display_unapproved_reviews include_unapproved_reviews feedback_rating show_email require_login track_locale allow_image_upload)
|
6
6
|
end
|
7
7
|
|
8
8
|
# include non-approved reviews in (public) listings
|
@@ -31,4 +31,13 @@ class Spree::ReviewsConfiguration < Spree::Preferences::Configuration
|
|
31
31
|
|
32
32
|
# render checkbox for a user to approve to show their identifier (name or email) on their review
|
33
33
|
preference :render_show_identifier_checkbox, :boolean, default: false
|
34
|
+
|
35
|
+
# Approves star only reviews automatically (Reviews without a Title/Review)
|
36
|
+
preference :approve_star_only, :boolean, default: false
|
37
|
+
|
38
|
+
# Approves star only reviews for verified purchasers only.
|
39
|
+
preference :approve_star_only_for_verified_purchaser, :boolean, default: false
|
40
|
+
|
41
|
+
# allow customer to update image with the review
|
42
|
+
preference :allow_image_upload, :boolean, default: true
|
34
43
|
end
|
@@ -6,7 +6,15 @@ Spree::Backend::Config.configure do |config|
|
|
6
6
|
}.sections << :reviews
|
7
7
|
end
|
8
8
|
|
9
|
-
Deface::Override.new(
|
10
|
-
|
11
|
-
|
12
|
-
|
9
|
+
Deface::Override.new(
|
10
|
+
virtual_path: "spree/admin/shared/_product_sub_menu",
|
11
|
+
name: "reviews_admin_tab",
|
12
|
+
insert_bottom: "[data-hook='admin_product_sub_tabs']",
|
13
|
+
disabled: false
|
14
|
+
) do
|
15
|
+
<<-HTML
|
16
|
+
<% if can? :admin, Spree::Review %>
|
17
|
+
<%= tab(:reviews, label: 'review_management') %>
|
18
|
+
<% end %>
|
19
|
+
HTML
|
20
|
+
end
|
@@ -6,8 +6,15 @@ Spree::Backend::Config.configure do |config|
|
|
6
6
|
}.sections << :review_settings
|
7
7
|
end
|
8
8
|
|
9
|
-
Deface::Override.new(
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
9
|
+
Deface::Override.new(
|
10
|
+
virtual_path: "spree/admin/shared/_settings_sub_menu",
|
11
|
+
name: "converted_admin_configurations_menu",
|
12
|
+
insert_bottom: "[data-hook='admin_settings_sub_tabs']",
|
13
|
+
disabled: false
|
14
|
+
) do
|
15
|
+
<<-HTML
|
16
|
+
<% if can? :admin, Spree::ReviewsConfiguration %>
|
17
|
+
<%= tab :reviews, url: spree.edit_admin_review_settings_path, match_path: /review_settings/ %>
|
18
|
+
<% end %>
|
19
|
+
HTML
|
20
|
+
end
|
@@ -56,6 +56,13 @@
|
|
56
56
|
<%= I18n.t("spree.spree_reviews.track_locale") %>
|
57
57
|
</label>
|
58
58
|
</div>
|
59
|
+
<div class="field">
|
60
|
+
<label>
|
61
|
+
<%= check_box_tag('preferences[allow_image_upload]', "1", Spree::Reviews::Config[:allow_image_upload]) %>
|
62
|
+
<%= I18n.t("spree.spree_reviews.allow_image_upload") %>
|
63
|
+
</label>
|
64
|
+
</div>
|
65
|
+
|
59
66
|
<div class="field">
|
60
67
|
<label><%= I18n.t("spree.spree_reviews.preview_size") %></label><br>
|
61
68
|
<%= text_field_tag('preferences[preview_size]', Spree::Reviews::Config[:preview_size], size: 3) %>
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<% content_for :page_title do %>
|
2
|
-
<%= I18n.t("spree.editing_review_for_html",
|
2
|
+
<%= I18n.t("spree.editing_review_for_html", product_name: @review.product.name) %>
|
3
3
|
<% end %>
|
4
4
|
|
5
5
|
<% render 'spree/admin/shared/product_sub_menu' %>
|
@@ -21,6 +21,8 @@
|
|
21
21
|
<div class="clear"></div>
|
22
22
|
|
23
23
|
<fieldset class="no-border-top">
|
24
|
-
|
24
|
+
<% if can? :manage, Spree::Review %>
|
25
|
+
<%= render 'spree/admin/shared/edit_resource_links' %>
|
26
|
+
<% end %>
|
25
27
|
</fieldset>
|
26
28
|
<% end %>
|
@@ -5,7 +5,9 @@
|
|
5
5
|
<% end %>
|
6
6
|
|
7
7
|
<% content_for :table_filter_title do %>
|
8
|
-
|
8
|
+
<% if can? :display, Spree::Review %>
|
9
|
+
<%= I18n.t("spree.search") %>
|
10
|
+
<% end %>
|
9
11
|
<% end %>
|
10
12
|
|
11
13
|
<% content_for :table_filter do %>
|
@@ -94,7 +96,7 @@
|
|
94
96
|
<% end %>
|
95
97
|
</td>
|
96
98
|
<td class="align-center">
|
97
|
-
|
99
|
+
<p><%= review.user_id ? link_to(review.user.try(:email), [:admin, review.user]) : I18n.t("spree.anonymous") %></p>
|
98
100
|
<p><%= Spree::Review.human_attribute_name(:ip_address) %>: <%= review.ip_address ? link_to(review.ip_address, "http://whois.domaintools.com/#{review.ip_address}") : '-' %></p>
|
99
101
|
</td>
|
100
102
|
<td class="align-center">
|
@@ -106,9 +108,11 @@
|
|
106
108
|
<% end %>
|
107
109
|
</td>
|
108
110
|
<td class="actions">
|
109
|
-
|
110
|
-
|
111
|
-
|
111
|
+
<% if can? :manage, Spree::Review %>
|
112
|
+
<%= link_to_with_icon 'ok', I18n.t("spree.approve"), approve_admin_review_url(review), no_text: true, class: 'approve' unless review.approved %>
|
113
|
+
<%= link_to_edit review, no_text: true, class: 'edit' %>
|
114
|
+
<%= link_to_delete review, no_text: true %>
|
115
|
+
<% end %>
|
112
116
|
</td>
|
113
117
|
</tr>
|
114
118
|
<% end %>
|
@@ -21,10 +21,12 @@
|
|
21
21
|
<%= f.text_area :review, wrap: "virtual", rows: "10", cols: "50" %>
|
22
22
|
</p>
|
23
23
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
24
|
+
<% if Spree::Reviews::Config[:allow_image_upload] %>
|
25
|
+
<p class="review_images_field">
|
26
|
+
<%= f.label :images %><br>
|
27
|
+
<%= f.file_field :images, :accept => "image/*", multiple: true %>
|
28
|
+
</p>
|
29
|
+
<% end %>
|
28
30
|
|
29
31
|
<% if Spree::Reviews::Config[:render_show_identifier_checkbox] %>
|
30
32
|
<p class="review_show_identifier_field">
|
@@ -24,10 +24,12 @@
|
|
24
24
|
<div itemprop="reviewBody">
|
25
25
|
<%= simple_format(review.review) %>
|
26
26
|
</div>
|
27
|
-
<%
|
28
|
-
|
29
|
-
|
30
|
-
|
27
|
+
<% if Spree::Reviews::Config[:allow_image_upload] %>
|
28
|
+
<% review.images.each do |image| %>
|
29
|
+
<div itemprop="image">
|
30
|
+
<%= link_to image_tag(image.url(:product)), image.url(:original) %>
|
31
|
+
</div>
|
32
|
+
<% end %>
|
31
33
|
<% end %>
|
32
34
|
<% if Spree::Reviews::Config[:feedback_rating] && (!Spree::Reviews::Config[:require_login] || spree_current_user) %>
|
33
35
|
<div class="feedback_review" id="feedback_review_<%= review.id %>">
|
data/bin/console
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
# frozen_string_literal: true
|
4
|
+
|
5
|
+
require "bundler/setup"
|
6
|
+
require "solidus_reviews"
|
7
|
+
|
8
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
9
|
+
# with your gem easier. You can also use a different console, if you like.
|
10
|
+
$LOAD_PATH.unshift(*Dir["#{__dir__}/../app/*"])
|
11
|
+
|
12
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
13
|
+
# require "pry"
|
14
|
+
# Pry.start
|
15
|
+
|
16
|
+
require "irb"
|
17
|
+
IRB.start(__FILE__)
|
data/bin/rails
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
# frozen_string_literal: true
|
3
2
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
3
|
+
if %w[g generate].include? ARGV.first
|
4
|
+
exec "#{__dir__}/rails-engine", *ARGV
|
5
|
+
else
|
6
|
+
exec "#{__dir__}/rails-sandbox", *ARGV
|
7
|
+
end
|
data/bin/rails-engine
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# This command will automatically be run when you run "rails" with Rails gems
|
3
|
+
# installed from the root of your application.
|
4
|
+
|
5
|
+
ENGINE_ROOT = File.expand_path('..', __dir__)
|
6
|
+
ENGINE_PATH = File.expand_path('../lib/solidus_reviews/engine', __dir__)
|
7
|
+
|
8
|
+
# Set up gems listed in the Gemfile.
|
9
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
|
10
|
+
require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
|
11
|
+
|
12
|
+
require 'rails/all'
|
13
|
+
require 'rails/engine/commands'
|
data/bin/rails-sandbox
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
app_root = 'sandbox'
|
4
|
+
|
5
|
+
unless File.exist? "#{app_root}/bin/rails"
|
6
|
+
warn 'Creating the sandbox app...'
|
7
|
+
Dir.chdir "#{__dir__}/.." do
|
8
|
+
system "#{__dir__}/sandbox" or begin
|
9
|
+
warn 'Automatic creation of the sandbox app failed'
|
10
|
+
exit 1
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
Dir.chdir app_root
|
16
|
+
exec 'bin/rails', *ARGV
|
data/bin/rake
ADDED
data/bin/sandbox
ADDED
@@ -0,0 +1,86 @@
|
|
1
|
+
#!/usr/bin/env bash
|
2
|
+
|
3
|
+
set -e
|
4
|
+
|
5
|
+
case "$DB" in
|
6
|
+
postgres|postgresql)
|
7
|
+
RAILSDB="postgresql"
|
8
|
+
;;
|
9
|
+
mysql)
|
10
|
+
RAILSDB="mysql"
|
11
|
+
;;
|
12
|
+
sqlite|'')
|
13
|
+
RAILSDB="sqlite3"
|
14
|
+
;;
|
15
|
+
*)
|
16
|
+
echo "Invalid DB specified: $DB"
|
17
|
+
exit 1
|
18
|
+
;;
|
19
|
+
esac
|
20
|
+
|
21
|
+
if [ ! -z $SOLIDUS_BRANCH ]
|
22
|
+
then
|
23
|
+
BRANCH=$SOLIDUS_BRANCH
|
24
|
+
else
|
25
|
+
BRANCH="master"
|
26
|
+
fi
|
27
|
+
|
28
|
+
extension_name="solidus_reviews"
|
29
|
+
|
30
|
+
# Stay away from the bundler env of the containing extension.
|
31
|
+
function unbundled {
|
32
|
+
ruby -rbundler -e'b = proc {system *ARGV}; Bundler.respond_to?(:with_unbundled_env) ? Bundler.with_unbundled_env(&b) : Bundler.with_clean_env(&b)' -- $@
|
33
|
+
}
|
34
|
+
|
35
|
+
rm -rf ./sandbox
|
36
|
+
unbundled bundle exec rails new sandbox --database="$RAILSDB" \
|
37
|
+
--skip-bundle \
|
38
|
+
--skip-git \
|
39
|
+
--skip-keeps \
|
40
|
+
--skip-rc \
|
41
|
+
--skip-spring \
|
42
|
+
--skip-test \
|
43
|
+
--skip-javascript
|
44
|
+
|
45
|
+
if [ ! -d "sandbox" ]; then
|
46
|
+
echo 'sandbox rails application failed'
|
47
|
+
exit 1
|
48
|
+
fi
|
49
|
+
|
50
|
+
cd ./sandbox
|
51
|
+
cat <<RUBY >> Gemfile
|
52
|
+
gem 'solidus', github: 'solidusio/solidus', branch: '$BRANCH'
|
53
|
+
gem 'solidus_auth_devise', '>= 2.1.0'
|
54
|
+
gem 'rails-i18n'
|
55
|
+
gem 'solidus_i18n'
|
56
|
+
|
57
|
+
gem '$extension_name', path: '..'
|
58
|
+
|
59
|
+
group :test, :development do
|
60
|
+
platforms :mri do
|
61
|
+
gem 'pry-byebug'
|
62
|
+
end
|
63
|
+
end
|
64
|
+
RUBY
|
65
|
+
|
66
|
+
unbundled bundle install --gemfile Gemfile
|
67
|
+
|
68
|
+
unbundled bundle exec rake db:drop db:create
|
69
|
+
|
70
|
+
unbundled bundle exec rails generate spree:install \
|
71
|
+
--auto-accept \
|
72
|
+
--user_class=Spree::User \
|
73
|
+
--enforce_available_locales=true \
|
74
|
+
--with-authentication=false \
|
75
|
+
--payment-method=none
|
76
|
+
$@
|
77
|
+
|
78
|
+
unbundled bundle exec rails generate solidus:auth:install
|
79
|
+
unbundled bundle exec rails generate ${extension_name}:install
|
80
|
+
|
81
|
+
echo
|
82
|
+
echo "🚀 Sandbox app successfully created for $extension_name!"
|
83
|
+
echo "🚀 Using $RAILSDB and Solidus $BRANCH"
|
84
|
+
echo "🚀 Use 'export DB=[postgres|mysql|sqlite]' to control the DB adapter"
|
85
|
+
echo "🚀 Use 'export SOLIDUS_BRANCH=<BRANCH-NAME>' to control the Solidus version"
|
86
|
+
echo "🚀 This app is intended for test purposes."
|
data/bin/setup
ADDED
data/config/locales/de-CH.yml
CHANGED
@@ -36,7 +36,7 @@ de-CH:
|
|
36
36
|
one: basiert auf einer Rezension
|
37
37
|
other: "basiert auf %{count} Rezensionen"
|
38
38
|
by: Von
|
39
|
-
editing_review_for_html: 'Rezension über %{
|
39
|
+
editing_review_for_html: 'Rezension über %{product_name} bearbeiten'
|
40
40
|
error_approve_review: Fehler bei der Freischaltung
|
41
41
|
error_no_product: Das rezensierte Produkt existiert nicht mehr.
|
42
42
|
feedback: Feedback
|
data/config/locales/de.yml
CHANGED
@@ -36,7 +36,7 @@ de:
|
|
36
36
|
one: basiert auf einer Rezension
|
37
37
|
other: "basiert auf %{count} Rezensionen"
|
38
38
|
by: Von
|
39
|
-
editing_review_for_html: 'Rezension über %{
|
39
|
+
editing_review_for_html: 'Rezension über %{product_name} bearbeiten'
|
40
40
|
error_approve_review: Fehler bei der Freischaltung
|
41
41
|
error_no_product: Das rezensierte Produkt existiert nicht mehr.
|
42
42
|
feedback: Feedback
|
data/config/locales/en-GB.yml
CHANGED
@@ -35,7 +35,7 @@ en-GB:
|
|
35
35
|
one: based upon one review
|
36
36
|
other: "based upon %{count} reviews"
|
37
37
|
by: by
|
38
|
-
editing_review_for_html: 'Editing review for %{
|
38
|
+
editing_review_for_html: 'Editing review for %{product_name}'
|
39
39
|
error_approve_review: Error approving review
|
40
40
|
error_no_product: The reviewed product doesn't exist anymore
|
41
41
|
feedback: Feedback
|
@@ -64,6 +64,7 @@ en-GB:
|
|
64
64
|
show_email: Show email addresses
|
65
65
|
show_verified_purchaser: Show verified purchaser
|
66
66
|
track_locale: Track user's locale
|
67
|
+
allow_image_upload: Allow images to be attached to reviews
|
67
68
|
star:
|
68
69
|
one: "1"
|
69
70
|
other: "%{count}"
|
data/config/locales/en.yml
CHANGED
@@ -35,7 +35,7 @@ en:
|
|
35
35
|
one: based upon one review
|
36
36
|
other: "based upon %{count} reviews"
|
37
37
|
by: by
|
38
|
-
editing_review_for_html: 'Editing review for %{
|
38
|
+
editing_review_for_html: 'Editing review for %{product_name}'
|
39
39
|
error_approve_review: Error approving review
|
40
40
|
error_no_product: The reviewed product doesn't exist anymore
|
41
41
|
feedback: Feedback
|
@@ -64,6 +64,7 @@ en:
|
|
64
64
|
show_email: Show email addresses
|
65
65
|
show_verified_purchaser: Show verified purchaser
|
66
66
|
track_locale: Track user's locale
|
67
|
+
allow_image_upload: Allow images to be attached to reviews
|
67
68
|
star:
|
68
69
|
one: "1"
|
69
70
|
other: "%{count}"
|
data/config/locales/es.yml
CHANGED
@@ -35,7 +35,7 @@ es:
|
|
35
35
|
one: "basado en una valoración"
|
36
36
|
other: "basado en %{count} valoraciones"
|
37
37
|
by: por
|
38
|
-
editing_review_for_html: 'Editando la valoración para %{
|
38
|
+
editing_review_for_html: 'Editando la valoración para %{product_name}'
|
39
39
|
error_approve_review: "Error aprobando la valoración"
|
40
40
|
error_no_product: "El producto valorado ya no existe"
|
41
41
|
feedback: Feedback
|
@@ -64,6 +64,7 @@ es:
|
|
64
64
|
show_email: "Mostrar las direcciones de correo"
|
65
65
|
show_verified_purchaser: Mostrar comprador verificado
|
66
66
|
track_locale: "Rastrear el locale del usuario"
|
67
|
+
allow_image_upload: "Permitir adjuntar imagenes con el comentario"
|
67
68
|
star:
|
68
69
|
one: "1"
|
69
70
|
other: "%{count}"
|
data/config/locales/fr.yml
CHANGED
@@ -35,7 +35,7 @@ fr:
|
|
35
35
|
one: basé sur un commentaire
|
36
36
|
other: "basé sur %{count} commentaires"
|
37
37
|
by: par
|
38
|
-
editing_review_for_html: 'Modification du commentaire pour %{
|
38
|
+
editing_review_for_html: 'Modification du commentaire pour %{product_name}'
|
39
39
|
error_approve_review: Erreur en approuvant le commentaire
|
40
40
|
error_no_product: Le produit commenté n'existe plus
|
41
41
|
feedback: Réaction
|
data/config/locales/it.yml
CHANGED
@@ -34,7 +34,7 @@ it:
|
|
34
34
|
one: basato su una recensione
|
35
35
|
other: "basato su %{count} recensioni"
|
36
36
|
by: da
|
37
|
-
editing_review_for_html: 'Modifica la recensione per %{
|
37
|
+
editing_review_for_html: 'Modifica la recensione per %{product_name}'
|
38
38
|
error_approve_review: Errore approvazione recensione
|
39
39
|
error_no_product: "Il prodotto recensito non esiste più"
|
40
40
|
feedback: Feedback
|
data/config/locales/pl.yml
CHANGED
@@ -37,7 +37,7 @@ pl:
|
|
37
37
|
few: "na podstawie %{count} opinii"
|
38
38
|
other: "na podstawie %{count} opinii"
|
39
39
|
by: "przez"
|
40
|
-
editing_review_for_html: 'Edycja opinii dla %{
|
40
|
+
editing_review_for_html: 'Edycja opinii dla %{product_name}'
|
41
41
|
error_approve_review: Błąd przy zatwierdzaniu opinii
|
42
42
|
error_no_product: Oceniamy produkt nie istnieje
|
43
43
|
feedback: Komentarz
|
data/config/locales/pt-BR.yml
CHANGED
@@ -35,7 +35,7 @@ pt-BR:
|
|
35
35
|
one: 'baseado em uma avaliação'
|
36
36
|
other: "baseado em %{count} avaliações"
|
37
37
|
by: 'por'
|
38
|
-
editing_review_for_html: 'Editando avaliação para %{
|
38
|
+
editing_review_for_html: 'Editando avaliação para %{product_name}'
|
39
39
|
error_approve_review: 'Erro aprovando avaliação'
|
40
40
|
error_no_product: "O produto avaliado não existe mais"
|
41
41
|
feedback: 'Parecer'
|
data/config/locales/pt.yml
CHANGED
@@ -35,7 +35,7 @@ pt:
|
|
35
35
|
one: baseada numa avaliação
|
36
36
|
other: "baseada em %{count} avaliações"
|
37
37
|
by: por
|
38
|
-
editing_review_for_html: 'Editando a avaliação para %{
|
38
|
+
editing_review_for_html: 'Editando a avaliação para %{product_name}'
|
39
39
|
error_approve_review: Erro aprovando a avaliação
|
40
40
|
error_no_product: O produto avaliado já não existe
|
41
41
|
feedback: Feedback
|
data/config/locales/ro.yml
CHANGED
@@ -39,7 +39,7 @@ ro:
|
|
39
39
|
other: "bazată pe %{count} recenzii"
|
40
40
|
many: "bazată pe %{count} de recenzii"
|
41
41
|
by: de
|
42
|
-
editing_review_for_html: 'Editare recenzie pentru %{
|
42
|
+
editing_review_for_html: 'Editare recenzie pentru %{product_name}'
|
43
43
|
error_approve_review: Eroare la aprobarea recenziei
|
44
44
|
error_no_product: Produsul recenziat nu mai există
|
45
45
|
feedback: Feedback
|
data/config/locales/sv.yml
CHANGED
@@ -35,7 +35,7 @@ sv:
|
|
35
35
|
one: "baserad på en recension"
|
36
36
|
other: "baserad på %{count} recensioner"
|
37
37
|
by: av
|
38
|
-
editing_review_for_html: "Editerad recension för %{
|
38
|
+
editing_review_for_html: "Editerad recension för %{product_name}"
|
39
39
|
error_approve_review: "Problem med att godkänna recension"
|
40
40
|
error_no_product: "Den betygsatta produkten finns inte längre"
|
41
41
|
feedback: Återkoppling
|
data/config/locales/tr.yml
CHANGED
@@ -35,7 +35,7 @@ tr:
|
|
35
35
|
one: bir incelemeye göre
|
36
36
|
other: "%{count} incelemeye göre"
|
37
37
|
by: tarafından
|
38
|
-
editing_review_for_html: 'Yorumu düzenle %{
|
38
|
+
editing_review_for_html: 'Yorumu düzenle %{product_name}'
|
39
39
|
error_approve_review: Yorum onaylamada hata
|
40
40
|
error_no_product: Yorumlanan ürün artık yok
|
41
41
|
feedback: Geri bildirim
|
data/config/locales/uk.yml
CHANGED
@@ -39,7 +39,7 @@ uk:
|
|
39
39
|
many: "на основі %{count} відгуків"
|
40
40
|
other: "на основі %{count} відгуків"
|
41
41
|
by: від
|
42
|
-
editing_review_for_html: 'Редагувати відгук на %{
|
42
|
+
editing_review_for_html: 'Редагувати відгук на %{product_name}'
|
43
43
|
error_approve_review: Не вдалось схвалити відгук
|
44
44
|
error_no_product: Товару, на який писався відгук, більше не існує
|
45
45
|
feedback: Корисність
|
data/config/locales/zh-CN.yml
CHANGED
data/config/locales/zh-TW.yml
CHANGED
data/config/routes.rb
CHANGED
@@ -13,7 +13,7 @@ Spree::Core::Engine.routes.draw do
|
|
13
13
|
end
|
14
14
|
|
15
15
|
resources :products, only: [] do
|
16
|
-
resources :reviews, only: [:index, :new, :create] do
|
16
|
+
resources :reviews, only: [:index, :new, :create, :edit, :update] do
|
17
17
|
end
|
18
18
|
end
|
19
19
|
post '/reviews/:review_id/feedback(.:format)' => 'feedback_reviews#create', as: :feedback_reviews
|
@@ -22,6 +22,8 @@ Spree::Core::Engine.routes.draw do
|
|
22
22
|
namespace :api, defaults: { format: 'json' } do
|
23
23
|
resources :reviews, only: [:show, :create, :update, :destroy]
|
24
24
|
|
25
|
+
resources :feedback_reviews, only: [:create, :update, :destroy]
|
26
|
+
|
25
27
|
resources :products do
|
26
28
|
resources :reviews, only: [:index]
|
27
29
|
end
|