diff --git a/modules/productcomments/views/templates/hook/alert-modal.tpl b/modules/productcomments/views/templates/hook/alert-modal.tpl index 33457613e..8eeda6249 100644 --- a/modules/productcomments/views/templates/hook/alert-modal.tpl +++ b/modules/productcomments/views/templates/hook/alert-modal.tpl @@ -3,7 +3,7 @@ * file that was distributed with this source code. *} -{assign var='icon' value=$icon|default:'check_circle'} +{assign var='icon' value=$icon|default:'check'} {assign var='modal_message' value=$modal_message|default:''} +
+ -
-
- {l s='Comments' d='Modules.Productcomments.Shop'} ({$nb_comments}) +
+

+ {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/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'} + {if $post_allowed && $nb_comments != 0} +
+ +
+ {/if} -
-
+ {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'} - diff --git a/src/img/small_stars.png b/src/img/small_stars.png new file mode 100644 index 000000000..02c688237 Binary files /dev/null and b/src/img/small_stars.png differ diff --git a/src/img/stars.png b/src/img/stars.png new file mode 100644 index 000000000..84fb4738a Binary files /dev/null and b/src/img/stars.png differ diff --git a/src/scss/core/modules/_productcomments.scss b/src/scss/core/modules/_productcomments.scss index 8ba9adc53..f09e103a4 100644 --- a/src/scss/core/modules/_productcomments.scss +++ b/src/scss/core/modules/_productcomments.scss @@ -21,6 +21,82 @@ .average-grade { align-self: center; margin-left: 0.25rem; + color: var(--bs-gray-600); + } +} + +.star-content div.star, +.star-content div.star-on, +.star-content div.star-hover { + // stylelint-disable-next-line + background-image: url("../img/stars.png") !important; +} + +.small-stars .star-content div.star, +.small-stars .star-content div.star-on, +.small-stars .star-content div.star-hover { + // stylelint-disable-next-line + background-image: url("../img/small_stars.png") !important; +} + +// Comment modal +.modal.product-comment-modal { + --bs-modal-padding: 1.5rem; + --bs-modal-header-padding: 1.5rem; + + .modal { + &-dialog { + width: auto; + } + + &-header { + padding: var(--bs-modal-header-padding); + padding-bottom: calc(var(--bs-modal-header-padding) * 0.5); + + .material-icons { + font-size: 1.5rem; + line-height: 1; + color: var(--bs-primary); + + &.check { + color: var(--bs-success); + } + + &.error { + color: var(--bs-danger); + } + + &.feedback { + color: var(--bs-warning); + } + } + } + + &-body { + padding: var(--bs-modal-padding); + padding-block: calc(var(--bs-modal-header-padding) * 0.5); + } + + &-footer { + padding: calc(var(--bs-modal-padding) - var(--bs-modal-footer-gap) * 0.5); + } + } + + input[name="comment_title"].error, + input[name="customer_name"].error, + textarea.error { + @extend .is-invalid; + } + + input[name="comment_title"].valid, + input[name="customer_name"].valid, + textarea.valid { + @extend .is-valid; + } + + textarea, + .form-control { + @extend .form-control; } } @@ -41,6 +117,7 @@ .product-list-reviews { position: initial; inset: auto; + display: flex; justify-content: start; padding: 0.5rem 0 1rem; @@ -56,47 +133,292 @@ inset: auto; align-items: center; justify-content: start; - padding: 0.5rem 0 1.5rem; + padding: 0 0 1rem; + + .grade-stars { + height: 20px; + } } // Specific product page styles .page-product { + .product-comments-additional-info { + display: flex; + flex: 0 0 0; + gap: 1rem; + align-items: center; + margin: 1rem 0 0; + + .comments-note { + margin: 0; + } + + .additional-links { + display: flex; + gap: 1rem; + align-items: center; + width: 100%; + + .link-comment { + display: flex; + gap: 0.25rem; + align-items: center; + padding-inline: 0; + margin-inline: 0; + border: none; + + &:hover { + text-decoration: none; + + .material-icons { + color: var(--bs-body-color); + } + } + + .material-icons { + font-size: 1.25rem; + color: var(--bs-gray-600); + } + } + } + } + #product-comments-list-header { - padding: 1rem 0; + flex-wrap: wrap; + gap: 1rem; + align-items: center; + justify-content: normal; + padding: 1rem 0 0; + margin: 0 0 1rem; + + .section-title { + margin-block: 0; + } .comments-nb { padding: 0; font-size: 1.25rem; - font-weight: 700; + font-weight: 600; + } + } + + // Empty comments + #empty-product-comment { + text-align: left; + } + + .product-comment-list-item { + padding: 0; + margin: 0; + background-color: transparent; + } + + // Footer comments + #product-comments-list-footer { + min-height: initial; + } + + // Pagination + #product-comments-list-pagination { + position: initial; + inset: initial; + height: auto; + + .pagination { + flex-wrap: wrap; + gap: 0.25rem; + align-items: center; + margin: 1.5rem 0; + + // Number items + &-container { + align-items: center; + margin-block: 1rem; + } + + &-number { + color: var(--bs-gray-600); + } + + // Pagination + .page-item { + &.active { + font-weight: 600; + + .page-link { + font-weight: 600; + color: var(--bs-primary); + background-color: transparent; + } + } + + &.disabled { + .page-link { + color: var(--bs-gray-600); + opacity: 0.65; + } + } + } + + .page-link { + padding: 0.25rem 0.5rem; + color: var(--bs-body-color); + border-color: transparent; + + &:hover { + background-color: transparent; + } + + i { + width: auto; + height: auto; + font-size: 1.25rem; + line-height: 1.5rem; + } + + &.previous, + &.next { + color: var(--bs-body-color); + + &:hover { + color: var(--bs-primary); + } + } + + &.disabled { + opacity: 1; + } + } + + @include media-breakpoint-up(xs) { + gap: 0.5rem; + } } } // Add comment modal #post-product-comment-modal { + .product { + &__cover { + width: auto; + height: auto; - .h3 { - font-size: inherit; + img { + width: auto; + height: auto; + } + } + + &__title { + margin-bottom: 0.5rem; + font-size: 1rem; + font-weight: 600; + } } - .product-cover { - width: auto; - height: auto; + // Criterions + // stylelint-disable-next-line + #criterions_list { + .criterion-rating { + display: block; + justify-content: flex-start; - img { - width: auto; - height: auto; + label { + display: block; + margin-bottom: 0.5rem; + font-size: inherit; + font-weight: 600; + } + + .star-content { + margin-left: 0; + } + } + + // stylelint-disable-next-line + #ratingNotChosen { + font-size: 0.875rem; + color: var(--bs-danger); + text-align: left; } } + + .required { + color: var(--bs-danger); + } } // Comments list #product-comments-list { - .product-comment-list-item { - margin: 0 0 1.5rem; + .comment { + padding: 1rem 0; + margin: 0; + background-color: transparent; border-bottom: 1px solid var(--bs-gray-200); - .comment-infos { - padding-right: 1.5rem; + &-top { + display: flex; + gap: 1rem; + align-items: center; + justify-content: space-between; + margin-bottom: 0.25rem; + font-size: 0.875rem; + } + + &-author { + color: var(--bs-body-color); + } + + &-date { + color: var(--bs-gray-600); + } + + &-title { + margin: 0.125rem 0 0; + font-size: 1rem; + font-weight: 600; + color: var(--bs-body-color); + } + + &-text { + margin: 0 0 1rem; + font-size: 1rem; + line-height: 1.5; + letter-spacing: initial; + } + + &-infos { + display: flex; + flex-wrap: wrap; + gap: 0.25rem; + align-items: center; + height: auto; + min-height: inherit; + margin-bottom: 1rem; + + .grade-stars { + margin: 0 0 0 calc(-1 * 0.25rem); + + .star-content { + top: 0; + margin: 0; + } + } + } + + &-buttons { + display: flex; + gap: 1rem; + align-items: center; + + a { + color: var(--bs-gray-600); + + &:hover { + color: var(--bs-body-color); + cursor: pointer; + } + } } } } diff --git a/src/scss/custom/components/category/_pagination.scss b/src/scss/custom/components/category/_pagination.scss index 296e723c8..70458541e 100644 --- a/src/scss/custom/components/category/_pagination.scss +++ b/src/scss/custom/components/category/_pagination.scss @@ -1,63 +1,65 @@ $component-name: pagination; .#{$component-name} { - margin: 3rem 0; + &--custom { + margin: 3rem 0; - &-number { - font-size: 1rem; - color: var(--bs-gray-600); - } + &-number { + font-size: 1rem; + color: var(--bs-gray-600); + } - @include media-breakpoint-down(sm) { - position: relative; - margin-bottom: 3.5rem; + @include media-breakpoint-down(sm) { + position: relative; + margin-bottom: 3.5rem; - .page-item { - &:nth-child(2) { - .page-link { - border-top-left-radius: var(--bs-pagination-border-radius); - border-bottom-left-radius: var(--bs-pagination-border-radius); + .page-item { + &:nth-child(2) { + .page-link { + border-top-left-radius: var(--bs-pagination-border-radius); + border-bottom-left-radius: var(--bs-pagination-border-radius); + } } - } - &:nth-last-child(2) { - .page-link { - border-top-right-radius: var(--bs-pagination-border-radius); - border-bottom-right-radius: var(--bs-pagination-border-radius); + &:nth-last-child(2) { + .page-link { + border-top-right-radius: var(--bs-pagination-border-radius); + border-bottom-right-radius: var(--bs-pagination-border-radius); + } } - } - &.disabled { - .page-link { - padding-inline: 0.375rem; + &.disabled { + .page-link { + padding-inline: 0.375rem; + } } - } - &:has(.previous), - &:has(.next) { - position: absolute; - top: calc(100% + 0.5rem); - transform-origin: center; - } + &:has(.previous), + &:has(.next) { + position: absolute; + top: calc(100% + 0.5rem); + transform-origin: center; + } - &:has(.previous) { - left: 50%; - transform: translateX(calc(-100% - 0.25rem)); - } + &:has(.previous) { + left: 50%; + transform: translateX(calc(-100% - 0.25rem)); + } - &:has(.next) { - right: 50%; - transform: translateX(calc(100% + 0.25rem)); + &:has(.next) { + right: 50%; + transform: translateX(calc(100% + 0.25rem)); + } } - } - .page-link { - padding-inline: 0.625rem; + .page-link { + padding-inline: 0.625rem; - &.previous, - &.next { - padding: 0.5rem; - border-radius: 50%; + &.previous, + &.next { + padding: 0.5rem; + border-radius: 50%; + } } } } diff --git a/templates/_partials/pagination.tpl b/templates/_partials/pagination.tpl index ef99b5891..8157e1e76 100644 --- a/templates/_partials/pagination.tpl +++ b/templates/_partials/pagination.tpl @@ -15,7 +15,7 @@ {block name='pagination_page_list'}