Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Shop] Tweak product reviews UI and routing
- Loading branch information
1 parent
71ecc80
commit 495dbbf
Showing
17 changed files
with
105 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
src/Sylius/Bundle/ShopBundle/Resources/config/routing/partial/product_review.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
sylius_shop_partial_product_review_latest: | ||
path: /latest/{count} | ||
methods: [GET] | ||
defaults: | ||
count: 3 | ||
|
||
_controller: sylius.controller.product_review:indexAction | ||
_sylius: | ||
template: $template | ||
repository: | ||
method: findLatestByProductId | ||
arguments: | ||
- $productId | ||
- $count |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 0 additions & 20 deletions
20
src/Sylius/Bundle/ShopBundle/Resources/views/Product/Review/_breadcrumb.html.twig
This file was deleted.
Oops, something went wrong.
20 changes: 20 additions & 0 deletions
20
src/Sylius/Bundle/ShopBundle/Resources/views/Product/Review/_form.html.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<div class="field"> | ||
<div class="ui huge star rating" data-rating="0" data-max-rating="5"></div> | ||
<br/> | ||
{{ form_errors(form.rating) }} | ||
{{ form_widget(form.rating, {'attr': {'style': 'display: none'} }) }} | ||
</div> | ||
<div class="field"> | ||
{{ form_widget(form.title, {'attr': {'placeholder': 'sylius.ui.title'|trans} }) }} | ||
{{ form_errors(form.title) }} | ||
</div> | ||
<div class="field"> | ||
{{ form_widget(form.comment, {'attr': {'placeholder': 'sylius.ui.write_your_own_review'|trans} }) }} | ||
{{ form_errors(form.comment) }} | ||
</div> | ||
{% if not is_granted("IS_AUTHENTICATED_FULLY") %} | ||
<div class="field"> | ||
{{ form_widget(form.author.email, {'attr': {'placeholder': 'sylius.ui.email'|trans}}) }} | ||
{{ form_errors(form.author.email) }} | ||
</div> | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 6 additions & 2 deletions
8
src/Sylius/Bundle/ShopBundle/Resources/views/Product/Review/index.html.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 6 additions & 5 deletions
11
src/Sylius/Bundle/ShopBundle/Resources/views/Product/Show/Tab/_reviews.html.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
<div class="ui bottom attached tab segment" data-tab="reviews"> | ||
{{ render(url('sylius_shop_partial_product_reviews_latest', { 'productId': product.id, 'template': '@SyliusShop/Product/_reviews.html.twig' })) }} | ||
<a href="{{ path('sylius_shop_product_reviews_index', { 'slug': product.slug }) }}"> | ||
<div class="ui blue labeled icon button"><i class="icon list"></i> {{ 'sylius.ui.view_more'|trans }}</div> | ||
{{ render(url('sylius_shop_partial_product_review_latest', {'productId': product.id, 'template': '@SyliusShop/Product/_reviews.html.twig'})) }} | ||
|
||
<a href="{{ path('sylius_shop_product_review_index', {'slug': product.slug}) }}"> | ||
<div class="ui labeled icon button"><i class="icon list"></i> {{ 'sylius.ui.view_more'|trans }}</div> | ||
</a> | ||
<a href="{{ path('sylius_shop_product_reviews_create', { 'slug': product.slug }) }}"> | ||
<div class="ui green labeled icon button"><i class="icon plus"></i> {{ 'sylius.ui.new_review'|trans }}</div> | ||
<a href="{{ path('sylius_shop_product_review_create', {'slug': product.slug}) }}"> | ||
<div class="ui blue labeled icon button"><i class="icon plus"></i> {{ 'sylius.ui.add_your_review'|trans }}</div> | ||
</a> | ||
</div> |
6 changes: 3 additions & 3 deletions
6
src/Sylius/Bundle/ShopBundle/Resources/views/Product/Show/_header.html.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
<h1 id="sylius-product-name" class="ui monster header">{{ product.name }}</h1> | ||
<h1 id="sylius-product-name" class="ui monster dividing header">{{ product.name }}</h1> | ||
<div class="ui text menu"> | ||
<div class="item"> | ||
<div id="average-rating" class="ui star large rating" data-rating="{{ product.averageRating|round }}" data-max-rating="5" data-average-rating="{{ product.averageRating|round(2) }}" style="pointer-events: none;"></div> | ||
</div> | ||
<a href="{{ path('sylius_shop_product_reviews_index', { 'slug': product.slug }) }}" class="item">{{ product.reviews|length }} {{ 'sylius.ui.reviews'|trans }}</a> | ||
<a href="{{ path('sylius_shop_product_reviews_create', { 'slug': product.slug }) }}" class="item">{{ 'sylius.ui.add_your_review'|trans }}</a> | ||
<a href="{{ path('sylius_shop_product_review_index', {'slug': product.slug}) }}" class="item">{{ product.acceptedReviews|length }} {{ 'sylius.ui.reviews'|trans }}</a> | ||
<a href="{{ path('sylius_shop_product_review_create', {'slug': product.slug}) }}" class="item">{{ 'sylius.ui.add_your_review'|trans }}</a> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters