-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make productcomments work again, and small display improvements has been added
- Loading branch information
Showing
8 changed files
with
190 additions
and
33 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
modules/productcomments/views/templates/hook/average-grade-stars.tpl
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,15 @@ | ||
{** | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*} | ||
|
||
{if $nb_comments != 0} | ||
<div class="comments-note"> | ||
<div class="grade-stars" data-grade="{$grade}"></div> | ||
{if isset($showNbComments) && $showNbComments} | ||
<div class="comments-number">({$nb_comments})</div> | ||
{elseif isset($showGradeAverage) && $showGradeAverage} | ||
<div class="average-grade">({$grade|number_format:1})</div> | ||
{/if} | ||
</div> | ||
{/if} |
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
31 changes: 31 additions & 0 deletions
31
modules/productcomments/views/templates/hook/product-additional-info.tpl
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,31 @@ | ||
{** | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*} | ||
|
||
{if $nb_comments != 0 || $post_allowed} | ||
<div class="product-comments-additional-info"> | ||
{if $nb_comments == 0} | ||
{if $post_allowed} | ||
<button class="btn btn-primary btn-with-icon post-product-comment"> | ||
<i class="material-icons edit" data-icon="edit"></i> | ||
{l s='Write your review' d='Modules.Productcomments.Shop'} | ||
</button> | ||
{/if} | ||
{else} | ||
{include file='module:productcomments/views/templates/hook/average-grade-stars.tpl' grade=$average_grade showGradeAverage=true} | ||
<div class="additional-links"> | ||
<a class="link-comment" href="#product-comments-list-header"> | ||
<i class="material-icons chat" data-icon="chat"></i> | ||
{l s='Read user reviews' d='Modules.Productcomments.Shop'} ({$nb_comments}) | ||
</a> | ||
{if $post_allowed} | ||
<a class="link-comment post-product-comment" href="#product-comments-list-header"> | ||
<i class="material-icons edit" data-icon="edit"></i> | ||
{l s='Write your review' d='Modules.Productcomments.Shop'} | ||
</a> | ||
{/if} | ||
</div> | ||
{/if} | ||
</div> | ||
{/if} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ | |
@import "shoppingcart"; | ||
@import "customersignin"; | ||
@import "nouislider"; | ||
@import "productcomments"; |
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,103 @@ | ||
// Global styles | ||
.product-quickview-review, | ||
.product-list-reviews, | ||
.comments-note { | ||
.grade-stars { | ||
display: flex; | ||
align-items: stretch; | ||
height: 28px; | ||
|
||
&.small-stars{ | ||
height: 20px; | ||
} | ||
|
||
.star-content { | ||
margin: 0; | ||
} | ||
} | ||
|
||
.comments-nb, | ||
.comments-number, | ||
.average-grade { | ||
align-self: center; | ||
margin-left: 0.25rem; | ||
} | ||
} | ||
|
||
// Average grade | ||
.comments-note { | ||
display: flex; | ||
align-items: center; | ||
} | ||
|
||
// Specific product miniature styles | ||
.product-miniature { | ||
&:not(.reviews-loaded) { | ||
.product-list-reviews { | ||
min-height: 2.5rem; | ||
} | ||
} | ||
|
||
.product-list-reviews { | ||
position: initial; | ||
inset: auto; | ||
justify-content: start; | ||
padding: 0.5rem 0 1rem; | ||
|
||
.comments-nb { | ||
margin: 0; | ||
} | ||
} | ||
} | ||
|
||
// Specific product quickview styles | ||
.product-quickview-review { | ||
position: initial; | ||
inset: auto; | ||
align-items: center; | ||
justify-content: start; | ||
padding: 0.5rem 0 1.5rem; | ||
} | ||
|
||
// Specific product page styles | ||
.page-product { | ||
#product-comments-list-header { | ||
padding: 1rem 0; | ||
|
||
.comments-nb { | ||
padding: 0; | ||
font-size: 1.25rem; | ||
font-weight: 700; | ||
} | ||
} | ||
|
||
// Add comment modal | ||
#post-product-comment-modal { | ||
|
||
.h3 { | ||
font-size: inherit; | ||
} | ||
|
||
.product-cover { | ||
width: auto; | ||
height: auto; | ||
|
||
img { | ||
width: auto; | ||
height: auto; | ||
} | ||
} | ||
} | ||
|
||
// Comments list | ||
#product-comments-list { | ||
.product-comment-list-item { | ||
margin: 0 0 1.5rem; | ||
border-bottom: 1px solid var(--bs-gray-200); | ||
|
||
.comment-infos { | ||
padding-right: 1.5rem; | ||
} | ||
} | ||
} | ||
} |
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