add review submission flow (phase 3)
All checks were successful
deploy / deploy (push) Successful in 1m10s
All checks were successful
deploy / deploy (push) Successful in 1m10s
- Add ReviewNotifier for verification emails - Add review token generation and verification - Add request_review_verification function - Update reviews_section component with write-a-review form - Create ReviewForm LiveView for submitting/editing reviews - Add /reviews/new and /reviews/:id/edit routes - Add review buttons to order detail page - Update block_types to load real review data - Tests for token and verification functions Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -812,8 +812,13 @@ defmodule BerrypodWeb.PageRenderer do
|
||||
<.reviews_section
|
||||
:if={@theme_settings.pdp_reviews}
|
||||
reviews={assigns[:reviews] || []}
|
||||
average_rating={assigns[:average_rating] || 5}
|
||||
total_count={assigns[:total_count]}
|
||||
average_rating={assigns[:average_rating]}
|
||||
total_count={assigns[:review_count]}
|
||||
product={assigns[:product]}
|
||||
email_session={assigns[:email_session]}
|
||||
existing_review={assigns[:existing_review]}
|
||||
review_form={assigns[:review_form]}
|
||||
review_status={assigns[:review_status]}
|
||||
/>
|
||||
"""
|
||||
end
|
||||
@@ -1388,7 +1393,7 @@ defmodule BerrypodWeb.PageRenderer do
|
||||
<%= if info && info.thumb do %>
|
||||
<img src={info.thumb} alt={item.product_name} class="checkout-item-thumb" />
|
||||
<% end %>
|
||||
<div>
|
||||
<div class="checkout-item-details">
|
||||
<%= if info && info.slug do %>
|
||||
<.link
|
||||
patch={R.product(info.slug)}
|
||||
@@ -1403,6 +1408,23 @@ defmodule BerrypodWeb.PageRenderer do
|
||||
<p class="checkout-item-detail">{item.variant_title}</p>
|
||||
<% end %>
|
||||
<p class="checkout-item-detail">Qty: {item.quantity}</p>
|
||||
<%= if info && info.slug do %>
|
||||
<%= if info[:existing_review] do %>
|
||||
<.link
|
||||
href={"/reviews/#{info.existing_review.id}/edit?product=#{info.slug}"}
|
||||
class="checkout-item-review-link"
|
||||
>
|
||||
Edit your review
|
||||
</.link>
|
||||
<% else %>
|
||||
<.link
|
||||
patch={R.product(info.slug) <> "#reviews"}
|
||||
class="checkout-item-review-link"
|
||||
>
|
||||
Write a review
|
||||
</.link>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
<span class="checkout-item-price">
|
||||
{Cart.format_price(item.unit_price * item.quantity)}
|
||||
|
||||
Reference in New Issue
Block a user