diff --git a/modules/productcomments/views/templates/hook/average-grade-stars.tpl b/modules/productcomments/views/templates/hook/average-grade-stars.tpl new file mode 100644 index 000000000..fc99bebdb --- /dev/null +++ b/modules/productcomments/views/templates/hook/average-grade-stars.tpl @@ -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} +
+
+ {if isset($showNbComments) && $showNbComments} +
({$nb_comments})
+ {elseif isset($showGradeAverage) && $showGradeAverage} +
({$grade|number_format:1})
+ {/if} +
+{/if} diff --git a/modules/productcomments/views/templates/hook/empty-product-comment.tpl b/modules/productcomments/views/templates/hook/empty-product-comment.tpl index 314582606..dd6f3ffa3 100644 --- a/modules/productcomments/views/templates/hook/empty-product-comment.tpl +++ b/modules/productcomments/views/templates/hook/empty-product-comment.tpl @@ -3,7 +3,7 @@ * file that was distributed with this source code. *} -
+
{if $post_allowed} + {/if} + {else} + {include file='module:productcomments/views/templates/hook/average-grade-stars.tpl' grade=$average_grade showGradeAverage=true} + + {/if} +
+{/if} diff --git a/modules/productcomments/views/templates/hook/product-comments-list.tpl b/modules/productcomments/views/templates/hook/product-comments-list.tpl index 730061c89..9fcc350d4 100644 --- a/modules/productcomments/views/templates/hook/product-comments-list.tpl +++ b/modules/productcomments/views/templates/hook/product-comments-list.tpl @@ -2,42 +2,49 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. *} + -
-
-
- - {l s='Comments' d='Modules.Productcomments.Shop'} ({$nb_comments}) -
- {include file='module:productcomments/views/templates/hook/average-grade-stars.tpl' grade=$average_grade} +
+
+ {l s='Comments' d='Modules.Productcomments.Shop'} ({$nb_comments})
+ {include file='module:productcomments/views/templates/hook/average-grade-stars.tpl' grade=$average_grade showGradeAverage=true showNbComments=false}
{include file='module:productcomments/views/templates/hook/product-comment-item-prototype.tpl' assign="comment_prototype"} {include file='module:productcomments/views/templates/hook/empty-product-comment.tpl'} -
-
-
+ +
-
-