spree_product_reviews 1.0.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/controllers/spree/admin/product_reviews_controller.rb +15 -7
- data/app/controllers/spree/admin/review_settings_controller.rb +23 -0
- data/app/controllers/spree/admin/reviews_controller.rb +18 -0
- data/app/controllers/spree/product_reviews_controller.rb +40 -9
- data/app/models/spree_product_reviews/spree/store_decorator.rb +19 -0
- data/app/views/spree/admin/product_reviews/_product_review.html.erb +60 -52
- data/app/views/spree/admin/product_reviews/_table.html.erb +8 -2
- data/app/views/spree/admin/product_reviews/index.html.erb +83 -10
- data/app/views/spree/admin/review_settings/edit.html.erb +259 -0
- data/app/views/spree/admin/reviews/index.html.erb +16 -0
- data/app/views/spree/page_sections/_product_reviews.html.erb +9 -6
- data/app/views/spree/product_reviews/_form.html.erb +1 -3
- data/app/views/spree/product_reviews/new.html.erb +40 -0
- data/app/views/{spree → themes/default/spree}/products/_json_ld.html.erb +1 -1
- data/config/initializers/spree_product_reviews.rb +15 -7
- data/config/locales/en.yml +38 -6
- data/config/routes.rb +11 -3
- data/db/migrate/20250501173852_add_reviews.rb +1 -1
- data/db/migrate/20250501174531_add_review_info_to_products.rb +1 -1
- data/db/migrate/20260105145731_add_spam_to_spree_product_reviews.rb +5 -0
- data/lib/generators/spree_product_reviews/install/install_generator.rb +2 -3
- data/lib/spree_product_reviews/configuration.rb +5 -10
- data/lib/spree_product_reviews/engine.rb +1 -6
- data/lib/spree_product_reviews/version.rb +1 -1
- metadata +11 -8
- data/app/views/themes/default/spree/page_sections/_product_details.html.erb +0 -89
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: spree_product_reviews
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Umesh Ravani
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: spree_core
|
|
@@ -88,6 +87,8 @@ extensions: []
|
|
|
88
87
|
extra_rdoc_files: []
|
|
89
88
|
files:
|
|
90
89
|
- app/controllers/spree/admin/product_reviews_controller.rb
|
|
90
|
+
- app/controllers/spree/admin/review_settings_controller.rb
|
|
91
|
+
- app/controllers/spree/admin/reviews_controller.rb
|
|
91
92
|
- app/controllers/spree/home_controller.rb
|
|
92
93
|
- app/controllers/spree/product_reviews_controller.rb
|
|
93
94
|
- app/models/spree/page_blocks/product_review_form.rb
|
|
@@ -98,6 +99,7 @@ files:
|
|
|
98
99
|
- app/models/spree/product_reviews_ability.rb
|
|
99
100
|
- app/models/spree_product_reviews/spree/product_decorator.rb
|
|
100
101
|
- app/models/spree_product_reviews/spree/product_review_decorator.rb
|
|
102
|
+
- app/models/spree_product_reviews/spree/store_decorator.rb
|
|
101
103
|
- app/models/spree_product_reviews/spree/user_decorator.rb
|
|
102
104
|
- app/views/spree/admin/page_blocks/forms/_product_review_form.html.erb
|
|
103
105
|
- app/views/spree/admin/page_blocks/forms/_reviews.html.erb
|
|
@@ -107,6 +109,8 @@ files:
|
|
|
107
109
|
- app/views/spree/admin/product_reviews/edit.html.erb
|
|
108
110
|
- app/views/spree/admin/product_reviews/index.html.erb
|
|
109
111
|
- app/views/spree/admin/product_reviews/update.turbo_stream.erb
|
|
112
|
+
- app/views/spree/admin/review_settings/edit.html.erb
|
|
113
|
+
- app/views/spree/admin/reviews/index.html.erb
|
|
110
114
|
- app/views/spree/page_blocks/products/reviews/_reviews.html.erb
|
|
111
115
|
- app/views/spree/page_sections/_add_a_review.html.erb
|
|
112
116
|
- app/views/spree/page_sections/_product_reviews.html.erb
|
|
@@ -114,14 +118,15 @@ files:
|
|
|
114
118
|
- app/views/spree/product_reviews/_images.html.erb
|
|
115
119
|
- app/views/spree/product_reviews/_pending.html.erb
|
|
116
120
|
- app/views/spree/product_reviews/_review.html.erb
|
|
117
|
-
- app/views/spree/
|
|
121
|
+
- app/views/spree/product_reviews/new.html.erb
|
|
118
122
|
- app/views/spree_product_reviews/admin/_product_reviews_dropdown.html.erb
|
|
119
|
-
- app/views/themes/default/spree/
|
|
123
|
+
- app/views/themes/default/spree/products/_json_ld.html.erb
|
|
120
124
|
- config/initializers/spree_product_reviews.rb
|
|
121
125
|
- config/locales/en.yml
|
|
122
126
|
- config/routes.rb
|
|
123
127
|
- db/migrate/20250501173852_add_reviews.rb
|
|
124
128
|
- db/migrate/20250501174531_add_review_info_to_products.rb
|
|
129
|
+
- db/migrate/20260105145731_add_spam_to_spree_product_reviews.rb
|
|
125
130
|
- lib/generators/spree_product_reviews/install/install_generator.rb
|
|
126
131
|
- lib/spree_product_reviews.rb
|
|
127
132
|
- lib/spree_product_reviews/configuration.rb
|
|
@@ -134,7 +139,6 @@ licenses:
|
|
|
134
139
|
metadata:
|
|
135
140
|
source_code_uri: https://github.com/umeshravani/spree_product_reviews
|
|
136
141
|
changelog_uri: https://github.com/umeshravani/spree_product_reviews/blob/main/CHANGELOG.md
|
|
137
|
-
post_install_message:
|
|
138
142
|
rdoc_options: []
|
|
139
143
|
require_paths:
|
|
140
144
|
- lib
|
|
@@ -149,8 +153,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
149
153
|
- !ruby/object:Gem::Version
|
|
150
154
|
version: '0'
|
|
151
155
|
requirements: []
|
|
152
|
-
rubygems_version: 3.
|
|
153
|
-
signing_key:
|
|
156
|
+
rubygems_version: 3.6.9
|
|
154
157
|
specification_version: 4
|
|
155
158
|
summary: Spree Commerce Product Reviews Extension
|
|
156
159
|
test_files: []
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
<turbo-frame id="main-product-<%= product.id %>" target="_top">
|
|
2
|
-
<% current_variant = @selected_variant || @variant_from_options || product.first_or_default_variant(current_currency) %>
|
|
3
|
-
<div class="main-product-container" style="<%= section_styles(section) %>">
|
|
4
|
-
<div
|
|
5
|
-
class="page-container lg:mb-16"
|
|
6
|
-
<%= 'data-controller=product-form' %>
|
|
7
|
-
data-product-form-required-options-value='<%= product.option_type_ids.map(&:to_s).to_json %>'
|
|
8
|
-
data-product-form-selected-variant-disabled-value='<%= !@selected_variant&.in_stock? %>'
|
|
9
|
-
data-product-form-variant-from-options-disabled-value='<%= !@variant_from_options&.in_stock? %>'
|
|
10
|
-
data-product-form-frame-name-value="main-product-<%= product.id %>"
|
|
11
|
-
data-product-form-url-value="<%= spree.product_url(product) %>">
|
|
12
|
-
<template data-product-form-target="spinnerTemplate">
|
|
13
|
-
<%= render "spree/shared/icons/spinner" %>
|
|
14
|
-
</template>
|
|
15
|
-
|
|
16
|
-
<div id="product-details-page" class="grid grid-cols-1 lg:grid-cols-12 gap-x-14">
|
|
17
|
-
<% images = product_media_gallery_images(product, selected_variant: @selected_variant, variant_from_options: @variant_from_options) %>
|
|
18
|
-
|
|
19
|
-
<div class="lg:col-span-7 relative">
|
|
20
|
-
<div class="lg:hidden mb-6">
|
|
21
|
-
<%= render 'spree/products/media_gallery', images: images, product: product %>
|
|
22
|
-
</div>
|
|
23
|
-
<div class="hidden lg:block" data-product-form-target="desktopMediaGallery">
|
|
24
|
-
<%= render 'spree/products/media_gallery', images: images, desktop: true, product: product %>
|
|
25
|
-
</div>
|
|
26
|
-
</div>
|
|
27
|
-
|
|
28
|
-
<div class="lg:col-span-5 lg:col-start-8">
|
|
29
|
-
<% show_waitlist_modal = spree.respond_to?(:waitlists_path) && current_variant.present? %>
|
|
30
|
-
<div
|
|
31
|
-
<% if show_waitlist_modal %>
|
|
32
|
-
data-controller="modal"
|
|
33
|
-
<% end %>
|
|
34
|
-
data-modal-allow-background-close="true"
|
|
35
|
-
class="h-full w-full waitlist-modal"
|
|
36
|
-
data-modal-backdrop-color-value="rgba(0,0,0,0.32)">
|
|
37
|
-
<%= form_with(url: spree.line_items_path, method: :post, data: { controller: "turbo-stream-form", product_form_target: "form" }) do |f| %>
|
|
38
|
-
<%= hidden_field_tag :variant_id, current_variant&.id %>
|
|
39
|
-
|
|
40
|
-
<div data-product-form-target="productDetails">
|
|
41
|
-
<% section.blocks.each do |block| %>
|
|
42
|
-
<div <%= block_attributes(block) %>>
|
|
43
|
-
<% case block.class.name %>
|
|
44
|
-
<% when 'Spree::PageBlocks::Products::Title' %>
|
|
45
|
-
<h1 class="text-2xl uppercase tracking-tight font-medium">
|
|
46
|
-
<%= product.name %>
|
|
47
|
-
</h1>
|
|
48
|
-
<% when 'Spree::PageBlocks::Products::Brand' %>
|
|
49
|
-
<% if product.brand_taxon %>
|
|
50
|
-
<%= link_to spree.nested_taxons_path(product.brand_taxon), title: product.brand_name do %>
|
|
51
|
-
<h3 class="text-sm lg:mt-0 inline-block mb-1">
|
|
52
|
-
<%= product.brand_name %>
|
|
53
|
-
</h3>
|
|
54
|
-
<% end %>
|
|
55
|
-
<% end %>
|
|
56
|
-
<% when 'Spree::PageBlocks::Products::Price' %>
|
|
57
|
-
<%= render 'spree/products/price', product: product, use_variant: true, selected_variant: @selected_variant, price_class: "lg:text-lg lg:font-medium", price_container_class: "w-full" %>
|
|
58
|
-
<% when 'Spree::PageBlocks::Products::VariantPicker' %>
|
|
59
|
-
<%= render 'spree/products/variant_picker', product: product, selected_variant: @selected_variant %>
|
|
60
|
-
<% when 'Spree::PageBlocks::Products::QuantitySelector' %>
|
|
61
|
-
<%= render 'spree/products/quantity_selector', product: product, selected_variant: @selected_variant %>
|
|
62
|
-
<% when 'Spree::PageBlocks::Products::BuyButtons' %>
|
|
63
|
-
<div class="flex w-full" data-controller='sticky-button'>
|
|
64
|
-
<%= render 'spree/products/add_to_cart_button', product: product, selected_variant: @selected_variant, sticky_button_classes: "w-full" %>
|
|
65
|
-
<%= render 'spree/products/add_to_wishlist', variant: current_variant, css_classes: 'btn-secondary ml-5 h-12 !py-0 !px-3 border-default', icon_size: 24 %>
|
|
66
|
-
</div>
|
|
67
|
-
<% when 'Spree::PageBlocks::Products::Description' %>
|
|
68
|
-
<%= render 'spree/products/description', product: product, block: block, section: section %>
|
|
69
|
-
<% when 'Spree::PageBlocks::Metafields' %>
|
|
70
|
-
<%= render 'spree/products/metafields', product: product, block: block, section: section %>
|
|
71
|
-
<% when 'Spree::PageBlocks::Products::RazorpayAffordability' %>
|
|
72
|
-
<%= block.render(self, product: product) %>
|
|
73
|
-
|
|
74
|
-
<% when 'Spree::PageBlocks::Products::Reviews' %>
|
|
75
|
-
<%= block.render(self, product: product) %>
|
|
76
|
-
<% end %>
|
|
77
|
-
</div>
|
|
78
|
-
<% end %>
|
|
79
|
-
</div>
|
|
80
|
-
<% end %>
|
|
81
|
-
|
|
82
|
-
<%= render 'spree/products/add_to_waitlist', variant: current_variant if show_waitlist_modal %>
|
|
83
|
-
</div>
|
|
84
|
-
</div>
|
|
85
|
-
</div>
|
|
86
|
-
</div>
|
|
87
|
-
</div>
|
|
88
|
-
<%= render 'spree/products/json_ld', product: product, selected_variant: @selected_variant %>
|
|
89
|
-
</turbo-frame>
|