spree_reviews_rating 0.70.7.1 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +7 -7
- data/app/assets/javascripts/store/review/index.js +13 -12
- data/app/assets/javascripts/store/spree_reviews_rating.js +15 -4
- data/app/assets/stylesheets/admin/spree_reviews_rating.css +1 -1
- data/app/assets/stylesheets/store/spree_reviews_rating.css +43 -0
- data/app/controllers/spree/admin/review_settings_controller.rb +25 -0
- data/app/controllers/spree/admin/reviews_controller.rb +30 -0
- data/app/controllers/spree/products_controller_decorator.rb +3 -0
- data/app/controllers/spree/reviews_controller.rb +55 -0
- data/app/helpers/spree/reviews_helper.rb +14 -0
- data/app/models/spree/ability_decorator.rb +11 -0
- data/app/models/{app_configuration_decorator.rb → spree/app_configuration_decorator.rb} +6 -3
- data/app/models/spree/product_decorator.rb +17 -0
- data/app/models/spree/review.rb +18 -0
- data/app/models/spree/review_sweeper.rb +24 -0
- data/app/models/spree/user_decorator.rb +7 -0
- data/app/overrides/add_review_bottom_sidebar.rb +2 -2
- data/app/overrides/reviews_admin_configuration_menu.rb +11 -0
- data/app/overrides/{add_reviews_tab_to_admin.rb → reviews_admin_tab.rb} +1 -1
- data/app/overrides/reviews_global_rating_product.rb +4 -0
- data/app/overrides/reviews_product_properties.rb +4 -0
- data/app/views/spree/admin/review_settings/edit.html.erb +18 -0
- data/app/views/spree/admin/review_settings/show.html.erb +44 -0
- data/app/views/spree/admin/reviews/_form.html.erb +6 -0
- data/app/views/spree/admin/reviews/edit.html.erb +19 -0
- data/app/views/{admin → spree/admin}/reviews/index.html.erb +7 -11
- data/app/views/spree/admin/shared/_reviews_setting_configurations_menu.html.erb +4 -0
- data/app/views/spree/reviews/_fine_print.html.erb +8 -0
- data/app/views/spree/reviews/_form.html.erb +22 -0
- data/app/views/spree/reviews/_new.html.erb +4 -0
- data/app/views/{reviews → spree/reviews}/_stars.html.erb +4 -1
- data/app/views/{reviews → spree/reviews}/all_list.html.erb +0 -0
- data/app/views/spree/reviews/error.js.erb +2 -0
- data/app/views/spree/reviews/index.html.erb +1 -0
- data/app/views/{reviews → spree/reviews}/new.html.erb +2 -3
- data/app/views/spree/reviews/success.js.erb +2 -0
- data/app/views/spree/shared/_rating.html.erb +28 -0
- data/app/views/spree/shared/_review.html.erb +19 -0
- data/app/views/{shared → spree/shared}/_review_link.html.erb +0 -0
- data/app/views/spree/shared/_review_summary.html.erb +7 -0
- data/app/views/spree/shared/_reviews.html.erb +23 -0
- data/app/views/{shared → spree/shared}/_shortrating.html.erb +1 -1
- data/app/views/spree/shared/_single_rating.html.erb +20 -0
- data/config/locales/en.yml +72 -6
- data/config/locales/it.yml +78 -12
- data/config/routes.rb +2 -9
- data/db/migrate/20081020220724_create_reviews.rb +2 -6
- data/db/migrate/20110406083603_add_rating_to_products.rb +3 -8
- data/db/migrate/20120123141326_recalculate_ratings.rb +3 -3
- data/db/migrate/20120323165848_reviews_rating_namespace.rb +5 -0
- data/lib/generators/spree_reviews_rating/install/install_generator.rb +1 -11
- data/lib/spree_reviews_rating.rb +0 -1
- metadata +135 -114
- data/app/controllers/admin/feedback_reviews_controller.rb +0 -6
- data/app/controllers/admin/review_settings_controller.rb +0 -16
- data/app/controllers/admin/reviews_controller.rb +0 -20
- data/app/controllers/feedback_reviews_controller.rb +0 -20
- data/app/controllers/products_controller_decorator.rb +0 -3
- data/app/controllers/reviews_controller.rb +0 -52
- data/app/helpers/admin/feedback_reviews_helper.rb +0 -2
- data/app/helpers/feedback_reviews_helper.rb +0 -2
- data/app/helpers/reviews_helper.rb +0 -11
- data/app/models/ability_decorator.rb +0 -14
- data/app/models/feedback_review.rb +0 -12
- data/app/models/product_decorator.rb +0 -15
- data/app/models/review.rb +0 -21
- data/app/models/review_sweeper.rb +0 -21
- data/app/models/user_decorator.rb +0 -7
- data/app/overrides/add_reviews_after_product_properties.rb +0 -4
- data/app/overrides/add_reviews_to_admin_configuration_menu.rb +0 -4
- data/app/views/admin/feedback_reviews/index.html.erb +0 -21
- data/app/views/admin/review_settings/edit.html.erb +0 -30
- data/app/views/admin/review_settings/show.html.erb +0 -30
- data/app/views/admin/reviews/_form.html.erb +0 -10
- data/app/views/admin/reviews/edit.html.erb +0 -17
- data/app/views/feedback_reviews/_form.html.erb +0 -15
- data/app/views/feedback_reviews/_summary.html.erb +0 -6
- data/app/views/feedback_reviews/create.js.erb +0 -7
- data/app/views/reviews/_fine_print.html.erb +0 -9
- data/app/views/reviews/_form.html.erb +0 -23
- data/app/views/reviews/index.html.erb +0 -1
- data/app/views/reviews/submissionguidelines.html.erb +0 -6
- data/app/views/reviews/terms.html.erb +0 -6
- data/app/views/shared/_rating.html.erb +0 -25
- data/app/views/shared/_review.html.erb +0 -17
- data/app/views/shared/_review_summary.html.erb +0 -10
- data/app/views/shared/_reviews.html.erb +0 -13
- data/config/initializers/helpers.rb +0 -2
- data/config/initializers/load_preferences.rb +0 -5
- data/db/migrate/20101222083309_create_feedback_reviews.rb +0 -18
@@ -1,17 +0,0 @@
|
|
1
|
-
<h1><%= t(:editing_review_for) %> <%= link_to @review.product.name, product_path(@review.product) %></h1>
|
2
|
-
|
3
|
-
<h2><%= t(:original_version) %></h2>
|
4
|
-
|
5
|
-
<p>
|
6
|
-
<%= @review.review %>
|
7
|
-
</p>
|
8
|
-
<br/>
|
9
|
-
|
10
|
-
<h2><%= t(:edited_version) %></h2>
|
11
|
-
|
12
|
-
<% semantic_form_for([:admin, @review]) do |f| %>
|
13
|
-
<%= render :partial => f,
|
14
|
-
:locals => { :button_name => t(:update) } %>
|
15
|
-
<% end %>
|
16
|
-
|
17
|
-
<%= link_to t('back_reviews'), admin_reviews_path %>
|
@@ -1,15 +0,0 @@
|
|
1
|
-
<%= render :partial => "feedback_reviews/summary", :locals => {:review => review}%>
|
2
|
-
<%= form_for((@feedback_review ||= review.feedback_reviews.build), :url => feedback_review_path(review), :method => :post, :remote => true) do |f| %>
|
3
|
-
<% unless @feedback_review.errors.empty? %>
|
4
|
-
<span class="error"><%= @feedback_review.errors[:rating] %></span>
|
5
|
-
<br />
|
6
|
-
<% end %>
|
7
|
-
<%= t(:was_this_review_helpful) %>
|
8
|
-
<% for i in 1..NB_STARS %>
|
9
|
-
<%= radio_button_tag "feedback_review[rating]", pluralize(i, 'stars'), false, :class => "star" %>
|
10
|
-
<% end %>
|
11
|
-
<%= hidden_field_tag "feedback_review[user_id]", current_user.try(:id) %>
|
12
|
-
<button class="feedback-review"><span><%= t("yes") %></span></button>
|
13
|
-
<% end %>
|
14
|
-
|
15
|
-
|
@@ -1,7 +0,0 @@
|
|
1
|
-
<% if @feedback_review.valid? %>
|
2
|
-
$("div#feedback_review_<%= @review.id %>").html('<%= escape_javascript(render(:partial => "feedback_reviews/summary", :locals => {:review => @review})) %>');
|
3
|
-
<% else %>
|
4
|
-
$("div#feedback_review_<%= @review.id %>").html('<%= escape_javascript(render(:partial => "feedback_reviews/form", :locals => {:review => @review})) %>');
|
5
|
-
|
6
|
-
<% end %>
|
7
|
-
$(document).ready(function(){$("div#feedback_review_<%= @review.id %>").find(".star").rating({required:true});});
|
@@ -1,9 +0,0 @@
|
|
1
|
-
<div class="review_fine_print">
|
2
|
-
<h2><%= t('the_fine_print') %></h2>
|
3
|
-
<ul>
|
4
|
-
<li><%= t('terms_text') %>: <%= link_to t(:terms_and_conditions), url_for(:action => 'terms') %></li>
|
5
|
-
<li><%= t('approved_text') %></li>
|
6
|
-
<li><%= t('guideline_text') %>
|
7
|
-
: <%= link_to t(:review_guidelines), url_for(:action => 'submissionguidelines') %></li>
|
8
|
-
</ul>
|
9
|
-
</div>
|
@@ -1,23 +0,0 @@
|
|
1
|
-
<%= form_for review, :url => product_reviews_path(product) do |f| %>
|
2
|
-
<%= render "shared/error_messages", :target => review %>
|
3
|
-
|
4
|
-
<div class="review_rating_field">
|
5
|
-
<%= f.label :rating %> <span class="required">*</span><br />
|
6
|
-
<%= render :partial => "reviews/stars" %>
|
7
|
-
<%= f.hidden_field :rating %>
|
8
|
-
</div>
|
9
|
-
|
10
|
-
<p class="review_name_field">
|
11
|
-
<%= f.label :name %> <span class="required">*</span><br />
|
12
|
-
<%= f.text_field :name, :maxlength => "255" %>
|
13
|
-
</p>
|
14
|
-
|
15
|
-
<p class="review_review_field">
|
16
|
-
<%= f.label :review %> <span class="required">*</span><br />
|
17
|
-
<%= f.text_area :review, :wrap => "virtual" %>
|
18
|
-
</p>
|
19
|
-
|
20
|
-
<p class="review_submit">
|
21
|
-
<%= button_tag I18n.t('submit_your_review'), :class => "button-submit" %>
|
22
|
-
</p>
|
23
|
-
<% end %>
|
@@ -1 +0,0 @@
|
|
1
|
-
<%= render :partial => 'shared/reviews' %>
|
@@ -1,25 +0,0 @@
|
|
1
|
-
<% stars = product.get_stars
|
2
|
-
if !stars.blank? %>
|
3
|
-
<div class="ratings">
|
4
|
-
<p><%= t('average_customer_rating') %>: </p>
|
5
|
-
<div id="star" data-rating="<%= stars[:star] || 0 %>"></div>
|
6
|
-
<p>(<%= t('based_upon') %> <%= stars[:rcount] %> <%= t('reviews') %>)</p>
|
7
|
-
<div itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">
|
8
|
-
<meta itemprop="ratingValue" content="<%= stars[:star] %>" />
|
9
|
-
<meta itemprop="reviewCount" content="<%= stars[:rcount] %>" />
|
10
|
-
</div>
|
11
|
-
</div>
|
12
|
-
<% end %>
|
13
|
-
<script type="text/javascript">
|
14
|
-
<!--//
|
15
|
-
jQuery(document).ready(function() {
|
16
|
-
$("#star").raty({
|
17
|
-
readOnly: true,
|
18
|
-
start: <%= stars[:star] %>,
|
19
|
-
half: true,
|
20
|
-
width: 180,
|
21
|
-
path: '/assets/'
|
22
|
-
});
|
23
|
-
});
|
24
|
-
//-->
|
25
|
-
</script>
|
@@ -1,17 +0,0 @@
|
|
1
|
-
<div class="review" itemprop="reviews" itemscope itemtype="http://schema.org/Review">
|
2
|
-
<meta itemprop="reviewRating" content="<%= review.rating %>" />
|
3
|
-
<% if Spree::Config[:show_email] && review.user %>
|
4
|
-
<span itemprop="author"><%= review.user.email %></span>
|
5
|
-
<% else %>
|
6
|
-
<span itemprop="author"><%= raw review.name %></span>
|
7
|
-
<% end %>
|
8
|
-
<span class="attribution"><%= t('submitted_on') %> <strong itemprop="datePublished"><%= l review.created_at.to_date %></strong></span>
|
9
|
-
<div itemprop="reviewBody">
|
10
|
-
<%= raw simple_format(review.review) %>
|
11
|
-
</div>
|
12
|
-
<% if Spree::Config[:feedback_rating] && (!Spree::Config[:require_login] || current_user) %>
|
13
|
-
<div class="feedback_review" id="feedback_review_<%= review.id %>">
|
14
|
-
<%= render :partial => "feedback_reviews/form", :locals => {:review => review} %>
|
15
|
-
</div>
|
16
|
-
<% end %>
|
17
|
-
</div>
|
@@ -1,10 +0,0 @@
|
|
1
|
-
<div id="reviews">
|
2
|
-
<%= render :partial => 'shared/rating', :locals => {:product => @product} %>
|
3
|
-
<% for review in @product.reviews.approved.preview %>
|
4
|
-
<%= render :partial => 'shared/review', :locals => {:review => review} %>
|
5
|
-
<% end %>
|
6
|
-
<% if Spree::Config[:feedback_rating] && (!Spree::Config[:require_login] || current_user) %>
|
7
|
-
<%= link_to t('write_your_own_review'), new_product_review_path(@product), :class => "button" %>
|
8
|
-
<% end %>
|
9
|
-
</div>
|
10
|
-
|
@@ -1,13 +0,0 @@
|
|
1
|
-
<div id="reviews">
|
2
|
-
<h6 class="product-section-title"><%= t(:reviews).titleize %></h6>
|
3
|
-
<%= render :partial => 'shared/rating', :locals => {:product => @product} %>
|
4
|
-
<% for review in @product.reviews.approved.limit(3) %>
|
5
|
-
<%= render :partial => 'shared/review', :locals => {:review => review} %>
|
6
|
-
<% end %>
|
7
|
-
<% if !Spree::Config[:require_login] || current_user %>
|
8
|
-
<%= link_to(t('write_your_own_review'), new_product_review_path(@product), :class => "button-review", :rel => "nofollow,noindex") %>
|
9
|
-
<% end %>
|
10
|
-
<div id="new_review"></div>
|
11
|
-
</div>
|
12
|
-
<%= javascript_include_tag 'store/review/index.js' %>
|
13
|
-
<%= javascript_include_tag 'store/review/new.js' %>
|
@@ -1,18 +0,0 @@
|
|
1
|
-
class CreateFeedbackReviews < ActiveRecord::Migration
|
2
|
-
def self.up
|
3
|
-
create_table :feedback_reviews do |t|
|
4
|
-
t.integer :rating, :default => 0
|
5
|
-
t.text :comment
|
6
|
-
|
7
|
-
t.references :user, :review
|
8
|
-
|
9
|
-
t.timestamps
|
10
|
-
end
|
11
|
-
add_index :feedback_reviews, :review_id
|
12
|
-
add_index :feedback_reviews, :user_id
|
13
|
-
end
|
14
|
-
|
15
|
-
def self.down
|
16
|
-
drop_table :feedback_reviews
|
17
|
-
end
|
18
|
-
end
|