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.
Files changed (90) hide show
  1. data/README.md +7 -7
  2. data/app/assets/javascripts/store/review/index.js +13 -12
  3. data/app/assets/javascripts/store/spree_reviews_rating.js +15 -4
  4. data/app/assets/stylesheets/admin/spree_reviews_rating.css +1 -1
  5. data/app/assets/stylesheets/store/spree_reviews_rating.css +43 -0
  6. data/app/controllers/spree/admin/review_settings_controller.rb +25 -0
  7. data/app/controllers/spree/admin/reviews_controller.rb +30 -0
  8. data/app/controllers/spree/products_controller_decorator.rb +3 -0
  9. data/app/controllers/spree/reviews_controller.rb +55 -0
  10. data/app/helpers/spree/reviews_helper.rb +14 -0
  11. data/app/models/spree/ability_decorator.rb +11 -0
  12. data/app/models/{app_configuration_decorator.rb → spree/app_configuration_decorator.rb} +6 -3
  13. data/app/models/spree/product_decorator.rb +17 -0
  14. data/app/models/spree/review.rb +18 -0
  15. data/app/models/spree/review_sweeper.rb +24 -0
  16. data/app/models/spree/user_decorator.rb +7 -0
  17. data/app/overrides/add_review_bottom_sidebar.rb +2 -2
  18. data/app/overrides/reviews_admin_configuration_menu.rb +11 -0
  19. data/app/overrides/{add_reviews_tab_to_admin.rb → reviews_admin_tab.rb} +1 -1
  20. data/app/overrides/reviews_global_rating_product.rb +4 -0
  21. data/app/overrides/reviews_product_properties.rb +4 -0
  22. data/app/views/spree/admin/review_settings/edit.html.erb +18 -0
  23. data/app/views/spree/admin/review_settings/show.html.erb +44 -0
  24. data/app/views/spree/admin/reviews/_form.html.erb +6 -0
  25. data/app/views/spree/admin/reviews/edit.html.erb +19 -0
  26. data/app/views/{admin → spree/admin}/reviews/index.html.erb +7 -11
  27. data/app/views/spree/admin/shared/_reviews_setting_configurations_menu.html.erb +4 -0
  28. data/app/views/spree/reviews/_fine_print.html.erb +8 -0
  29. data/app/views/spree/reviews/_form.html.erb +22 -0
  30. data/app/views/spree/reviews/_new.html.erb +4 -0
  31. data/app/views/{reviews → spree/reviews}/_stars.html.erb +4 -1
  32. data/app/views/{reviews → spree/reviews}/all_list.html.erb +0 -0
  33. data/app/views/spree/reviews/error.js.erb +2 -0
  34. data/app/views/spree/reviews/index.html.erb +1 -0
  35. data/app/views/{reviews → spree/reviews}/new.html.erb +2 -3
  36. data/app/views/spree/reviews/success.js.erb +2 -0
  37. data/app/views/spree/shared/_rating.html.erb +28 -0
  38. data/app/views/spree/shared/_review.html.erb +19 -0
  39. data/app/views/{shared → spree/shared}/_review_link.html.erb +0 -0
  40. data/app/views/spree/shared/_review_summary.html.erb +7 -0
  41. data/app/views/spree/shared/_reviews.html.erb +23 -0
  42. data/app/views/{shared → spree/shared}/_shortrating.html.erb +1 -1
  43. data/app/views/spree/shared/_single_rating.html.erb +20 -0
  44. data/config/locales/en.yml +72 -6
  45. data/config/locales/it.yml +78 -12
  46. data/config/routes.rb +2 -9
  47. data/db/migrate/20081020220724_create_reviews.rb +2 -6
  48. data/db/migrate/20110406083603_add_rating_to_products.rb +3 -8
  49. data/db/migrate/20120123141326_recalculate_ratings.rb +3 -3
  50. data/db/migrate/20120323165848_reviews_rating_namespace.rb +5 -0
  51. data/lib/generators/spree_reviews_rating/install/install_generator.rb +1 -11
  52. data/lib/spree_reviews_rating.rb +0 -1
  53. metadata +135 -114
  54. data/app/controllers/admin/feedback_reviews_controller.rb +0 -6
  55. data/app/controllers/admin/review_settings_controller.rb +0 -16
  56. data/app/controllers/admin/reviews_controller.rb +0 -20
  57. data/app/controllers/feedback_reviews_controller.rb +0 -20
  58. data/app/controllers/products_controller_decorator.rb +0 -3
  59. data/app/controllers/reviews_controller.rb +0 -52
  60. data/app/helpers/admin/feedback_reviews_helper.rb +0 -2
  61. data/app/helpers/feedback_reviews_helper.rb +0 -2
  62. data/app/helpers/reviews_helper.rb +0 -11
  63. data/app/models/ability_decorator.rb +0 -14
  64. data/app/models/feedback_review.rb +0 -12
  65. data/app/models/product_decorator.rb +0 -15
  66. data/app/models/review.rb +0 -21
  67. data/app/models/review_sweeper.rb +0 -21
  68. data/app/models/user_decorator.rb +0 -7
  69. data/app/overrides/add_reviews_after_product_properties.rb +0 -4
  70. data/app/overrides/add_reviews_to_admin_configuration_menu.rb +0 -4
  71. data/app/views/admin/feedback_reviews/index.html.erb +0 -21
  72. data/app/views/admin/review_settings/edit.html.erb +0 -30
  73. data/app/views/admin/review_settings/show.html.erb +0 -30
  74. data/app/views/admin/reviews/_form.html.erb +0 -10
  75. data/app/views/admin/reviews/edit.html.erb +0 -17
  76. data/app/views/feedback_reviews/_form.html.erb +0 -15
  77. data/app/views/feedback_reviews/_summary.html.erb +0 -6
  78. data/app/views/feedback_reviews/create.js.erb +0 -7
  79. data/app/views/reviews/_fine_print.html.erb +0 -9
  80. data/app/views/reviews/_form.html.erb +0 -23
  81. data/app/views/reviews/index.html.erb +0 -1
  82. data/app/views/reviews/submissionguidelines.html.erb +0 -6
  83. data/app/views/reviews/terms.html.erb +0 -6
  84. data/app/views/shared/_rating.html.erb +0 -25
  85. data/app/views/shared/_review.html.erb +0 -17
  86. data/app/views/shared/_review_summary.html.erb +0 -10
  87. data/app/views/shared/_reviews.html.erb +0 -13
  88. data/config/initializers/helpers.rb +0 -2
  89. data/config/initializers/load_preferences.rb +0 -5
  90. 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,6 +0,0 @@
1
- <p>
2
- <%= t('voice', :count => review.feedback_reviews.count) %>.
3
- <span title="<%=pluralize(review.feedback_stars, 'star')%> out of 5">
4
- <%= render :partial => "reviews/stars", :locals => {:stars => review.feedback_stars} %>
5
- </span> &nbsp;
6
- </p>
@@ -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,6 +0,0 @@
1
- <h2> <%= t('submission_guidelines') %> </h2>
2
-
3
- <p>
4
- Dummy document - expected to be over-ridden in specific instantiations
5
- </p>
6
-
@@ -1,6 +0,0 @@
1
- <h2> <%= t('terms_and_conditions') %> </h2>
2
-
3
- <p>
4
- Dummy document - expected to be over-ridden in specific instantiations
5
- </p>
6
-
@@ -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,2 +0,0 @@
1
- #Spree::ProductsHelper.send(:include, Spree::ReviewsHelper)
2
- #Spree::Admin::ReviewsController.cache_sweeper Spree::ReviewSweeper
@@ -1,5 +0,0 @@
1
- #module Spree
2
- # module Reviews
3
- # Config = ReviewsConfiguration.new
4
- # end
5
- #end
@@ -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