first commit
This commit is contained in:
1017
themes/ayon/modules/productcomments/views/css/productcomments.css
Normal file
1017
themes/ayon/modules/productcomments/views/css/productcomments.css
Normal file
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
After Width: | Height: | Size: 5.6 KiB |
34
themes/ayon/modules/productcomments/views/img/index.php
Normal file
34
themes/ayon/modules/productcomments/views/img/index.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright since 2007 PrestaShop SA and Contributors
|
||||
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
|
||||
* that is bundled with this package in the file LICENSE.md.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/licenses/AFL-3.0
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||
*
|
||||
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
|
||||
*/
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../');
|
||||
exit;
|
||||
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>4</title><g id="Layer_4" data-name="Layer 4"><path d="M12.81,3.93l2.82,4.53,4.92,1.09a.71.71,0,0,1,.39,1.06L17.6,14.54l.4,5.18a.71.71,0,0,1-.93.63l-4.82-2.07L7.44,20.34a.71.71,0,0,1-.93-.63L7,14.46l-3.4-3.87a.71.71,0,0,1,.37-1.06L9.18,8.46,11.66,3.9A.71.71,0,0,1,12.81,3.93Z" style="fill:none;stroke:#000;stroke-linecap:round;stroke-linejoin:round;stroke-width:2px"/></g></svg>
|
||||
|
After Width: | Height: | Size: 444 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>4</title><g id="Layer_4" data-name="Layer 4"><path d="M20.55,9.55,15.63,8.46,12.81,3.93a.71.71,0,0,0-1.14,0L9.18,8.46,3.93,9.52a.71.71,0,0,0-.37,1.06L7,14.46l-.45,5.26a.71.71,0,0,0,.93.63l4.81-2.07,4.82,2.07a.71.71,0,0,0,.93-.63l-.4-5.18,3.34-3.93A.71.71,0,0,0,20.55,9.55Z" style="stroke:#000;stroke-linecap:round;stroke-linejoin:round;stroke-width:2px"/></g></svg>
|
||||
|
After Width: | Height: | Size: 432 B |
BIN
themes/ayon/modules/productcomments/views/img/small_stars.png
Normal file
BIN
themes/ayon/modules/productcomments/views/img/small_stars.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.2 KiB |
BIN
themes/ayon/modules/productcomments/views/img/stars.png
Normal file
BIN
themes/ayon/modules/productcomments/views/img/stars.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.2 KiB |
35
themes/ayon/modules/productcomments/views/index.php
Normal file
35
themes/ayon/modules/productcomments/views/index.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2016 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2016 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
|
||||
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
|
||||
|
||||
header("Cache-Control: no-store, no-cache, must-revalidate");
|
||||
header("Cache-Control: post-check=0, pre-check=0", false);
|
||||
header("Pragma: no-cache");
|
||||
|
||||
header("Location: ../../");
|
||||
exit;
|
||||
34
themes/ayon/modules/productcomments/views/js/index.php
Normal file
34
themes/ayon/modules/productcomments/views/js/index.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright since 2007 PrestaShop SA and Contributors
|
||||
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
|
||||
* that is bundled with this package in the file LICENSE.md.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/licenses/AFL-3.0
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||
*
|
||||
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
|
||||
*/
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../');
|
||||
exit;
|
||||
@@ -0,0 +1,159 @@
|
||||
/**
|
||||
* Copyright since 2007 PrestaShop SA and Contributors
|
||||
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
|
||||
* that is bundled with this package in the file LICENSE.md.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/licenses/AFL-3.0
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||
*
|
||||
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
|
||||
*/
|
||||
|
||||
jQuery.fn.rating = function(generalOptions) {
|
||||
const $ratings = $(this);
|
||||
|
||||
$ratings.each(function initRating() {
|
||||
const $ratingComponent = $(this);
|
||||
var options = generalOptions ? generalOptions : {};
|
||||
if (!options.grade && $ratingComponent.data('grade')) {
|
||||
options.grade = $ratingComponent.data('grade');
|
||||
}
|
||||
if (!options.min && $ratingComponent.data('min')) {
|
||||
options.min = $ratingComponent.data('min');
|
||||
}
|
||||
if (!options.max && $ratingComponent.data('max')) {
|
||||
options.max = $ratingComponent.data('max');
|
||||
}
|
||||
if (!options.input && $ratingComponent.data('input')) {
|
||||
options.input = $ratingComponent.data('input');
|
||||
}
|
||||
var componentOptions = jQuery.extend({
|
||||
grade: null,
|
||||
input: null,
|
||||
min: 1,
|
||||
max: 5,
|
||||
starWidth: 20
|
||||
}, options);
|
||||
|
||||
const minValue = Math.min(componentOptions.min, componentOptions.max);
|
||||
const maxValue = Math.max(componentOptions.min, componentOptions.max);
|
||||
const ratingValue = Math.min(Math.max(minValue, componentOptions.grade), maxValue);
|
||||
|
||||
$ratingComponent.html('');
|
||||
$ratingComponent.append('<div class="star-content star-empty clearfix"></div>');
|
||||
$ratingComponent.append('<div class="star-content star-full clearfix"></div>');
|
||||
|
||||
const emptyStars = $('.star-empty', this);
|
||||
const fullStars = $('.star-full', this);
|
||||
const emptyStar = $('<div class="star"></div>');
|
||||
const fullStar = $('<div class="star-on"></div>');
|
||||
|
||||
var ratingInput;
|
||||
if (componentOptions.input) {
|
||||
ratingInput = $('<input type="number" name="'+componentOptions.input+'" id="'+componentOptions.input+'" />');
|
||||
ratingInput.val(ratingValue);
|
||||
ratingInput.css('display', 'none');
|
||||
ratingInput.change(displayInteractiveGrade);
|
||||
$ratingComponent.append(ratingInput);
|
||||
initInteractiveGrade();
|
||||
} else {
|
||||
displayGrade(ratingValue);
|
||||
}
|
||||
|
||||
function initInteractiveGrade() {
|
||||
emptyStars.html('');
|
||||
fullStars.html('');
|
||||
var newStar;
|
||||
for (var i = minValue; i <= maxValue; ++i) {
|
||||
newStar = emptyStar.clone();
|
||||
newStar.data('grade', i);
|
||||
newStar.hover(function overStar() {
|
||||
var overIndex = $('.star', fullStars).index($(this));
|
||||
$('.star', fullStars).each(function overStars() {
|
||||
$(this).removeClass('star-on');
|
||||
var starIndex = $('.star', fullStars).index($(this));
|
||||
if (starIndex <= overIndex) {
|
||||
$(this).addClass('star-hover');
|
||||
} else {
|
||||
$(this).removeClass('star-hover');
|
||||
}
|
||||
});
|
||||
});
|
||||
newStar.click(function selectGrade() {
|
||||
var selectedGrade = $(this).data('grade');
|
||||
ratingInput.val(selectedGrade);
|
||||
});
|
||||
fullStars.append(newStar);
|
||||
}
|
||||
|
||||
fullStars.hover(function(){}, displayInteractiveGrade);
|
||||
displayInteractiveGrade();
|
||||
}
|
||||
|
||||
function displayInteractiveGrade() {
|
||||
$('.star', fullStars).each(function displayStar() {
|
||||
var starValue = $(this).data('grade');
|
||||
$(this).removeClass('star-hover');
|
||||
if (starValue <= ratingInput.val()) {
|
||||
$(this).addClass('star-on');
|
||||
} else {
|
||||
$(this).removeClass('star-on');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function displayGrade(grade) {
|
||||
emptyStars.html('');
|
||||
fullStars.html('');
|
||||
var newStar;
|
||||
for (var i = minValue; i <= maxValue; ++i) {
|
||||
if (i <= Math.floor(grade)) {
|
||||
newStar = emptyStar.clone();
|
||||
newStar.css('visibility', 'hidden');
|
||||
emptyStars.append(newStar);
|
||||
fullStars.append(fullStar.clone());
|
||||
} else if (i > Math.ceil(grade)) {
|
||||
newStar = emptyStar.clone();
|
||||
emptyStars.append(newStar.clone());
|
||||
} else {
|
||||
//This the partial star composed of
|
||||
// - one invisible partial empty star
|
||||
// - one visible partial empty star (remaining part)
|
||||
// - one visible partial full star
|
||||
var fullWidth = (grade - i + 1) * componentOptions.starWidth;
|
||||
var emptyWidth = componentOptions.starWidth - fullWidth;
|
||||
newStar = emptyStar.clone();
|
||||
newStar.css('visibility', 'hidden');
|
||||
newStar.css('width', fullWidth);
|
||||
emptyStars.append(newStar);
|
||||
|
||||
newStar = emptyStar.clone();
|
||||
newStar.css('width', emptyWidth);
|
||||
newStar.css('background-position', '0px -'+fullWidth+'px');
|
||||
newStar.css('background-position', '-'+fullWidth+'px 0px');
|
||||
newStar.css('marginLeft', 0);
|
||||
newStar.addClass('right-half');
|
||||
emptyStars.append(newStar);
|
||||
|
||||
fullStar.css('width', fullWidth);
|
||||
fullStar.addClass('left-half');
|
||||
fullStars.append(fullStar.clone());
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,398 @@
|
||||
/**
|
||||
* simplePagination.js v1.6
|
||||
* A simple jQuery pagination plugin.
|
||||
* http://flaviusmatis.github.com/simplePagination.js/
|
||||
*
|
||||
* Copyright 2012, Flavius Matis
|
||||
* Released under the MIT license.
|
||||
* http://flaviusmatis.github.com/license.html
|
||||
*/
|
||||
|
||||
(function($){
|
||||
|
||||
var methods = {
|
||||
init: function(options) {
|
||||
var o = $.extend({
|
||||
items: 1,
|
||||
itemsOnPage: 1,
|
||||
pages: 0,
|
||||
displayedPages: 5,
|
||||
edges: 2,
|
||||
currentPage: 0,
|
||||
useAnchors: true,
|
||||
hrefTextPrefix: '#page-',
|
||||
hrefTextSuffix: '',
|
||||
prevText: 'Prev',
|
||||
nextText: 'Next',
|
||||
ellipseText: '…',
|
||||
ellipsePageSet: true,
|
||||
cssStyle: 'light-theme',
|
||||
listStyle: '',
|
||||
labelMap: [],
|
||||
selectOnClick: true,
|
||||
nextAtFront: false,
|
||||
invertPageOrder: false,
|
||||
useStartEdge : true,
|
||||
useEndEdge : true,
|
||||
onPageClick: function(pageNumber, event) {
|
||||
// Callback triggered when a page is clicked
|
||||
// Page number is given as an optional parameter
|
||||
},
|
||||
onInit: function() {
|
||||
// Callback triggered immediately after initialization
|
||||
}
|
||||
}, options || {});
|
||||
|
||||
var self = this;
|
||||
|
||||
o.pages = o.pages ? o.pages : Math.ceil(o.items / o.itemsOnPage) ? Math.ceil(o.items / o.itemsOnPage) : 1;
|
||||
if (o.currentPage)
|
||||
o.currentPage = o.currentPage - 1;
|
||||
else
|
||||
o.currentPage = !o.invertPageOrder ? 0 : o.pages - 1;
|
||||
o.halfDisplayed = o.displayedPages / 2;
|
||||
|
||||
this.each(function() {
|
||||
self.addClass(o.cssStyle + ' simple-pagination').data('pagination', o);
|
||||
methods._draw.call(self);
|
||||
});
|
||||
|
||||
o.onInit();
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
selectPage: function(page) {
|
||||
methods._selectPage.call(this, page - 1);
|
||||
return this;
|
||||
},
|
||||
|
||||
prevPage: function() {
|
||||
var o = this.data('pagination');
|
||||
if (!o.invertPageOrder) {
|
||||
if (o.currentPage > 0) {
|
||||
methods._selectPage.call(this, o.currentPage - 1);
|
||||
}
|
||||
} else {
|
||||
if (o.currentPage < o.pages - 1) {
|
||||
methods._selectPage.call(this, o.currentPage + 1);
|
||||
}
|
||||
}
|
||||
return this;
|
||||
},
|
||||
|
||||
nextPage: function() {
|
||||
var o = this.data('pagination');
|
||||
if (!o.invertPageOrder) {
|
||||
if (o.currentPage < o.pages - 1) {
|
||||
methods._selectPage.call(this, o.currentPage + 1);
|
||||
}
|
||||
} else {
|
||||
if (o.currentPage > 0) {
|
||||
methods._selectPage.call(this, o.currentPage - 1);
|
||||
}
|
||||
}
|
||||
return this;
|
||||
},
|
||||
|
||||
getPagesCount: function() {
|
||||
return this.data('pagination').pages;
|
||||
},
|
||||
|
||||
setPagesCount: function(count) {
|
||||
this.data('pagination').pages = count;
|
||||
},
|
||||
|
||||
getCurrentPage: function () {
|
||||
return this.data('pagination').currentPage + 1;
|
||||
},
|
||||
|
||||
destroy: function(){
|
||||
this.empty();
|
||||
return this;
|
||||
},
|
||||
|
||||
drawPage: function (page) {
|
||||
var o = this.data('pagination');
|
||||
o.currentPage = page - 1;
|
||||
this.data('pagination', o);
|
||||
methods._draw.call(this);
|
||||
return this;
|
||||
},
|
||||
|
||||
redraw: function(){
|
||||
methods._draw.call(this);
|
||||
return this;
|
||||
},
|
||||
|
||||
disable: function(){
|
||||
var o = this.data('pagination');
|
||||
o.disabled = true;
|
||||
this.data('pagination', o);
|
||||
methods._draw.call(this);
|
||||
return this;
|
||||
},
|
||||
|
||||
enable: function(){
|
||||
var o = this.data('pagination');
|
||||
o.disabled = false;
|
||||
this.data('pagination', o);
|
||||
methods._draw.call(this);
|
||||
return this;
|
||||
},
|
||||
|
||||
updateItems: function (newItems) {
|
||||
var o = this.data('pagination');
|
||||
o.items = newItems;
|
||||
o.pages = methods._getPages(o);
|
||||
this.data('pagination', o);
|
||||
methods._draw.call(this);
|
||||
},
|
||||
|
||||
updateItemsOnPage: function (itemsOnPage) {
|
||||
var o = this.data('pagination');
|
||||
o.itemsOnPage = itemsOnPage;
|
||||
o.pages = methods._getPages(o);
|
||||
this.data('pagination', o);
|
||||
methods._selectPage.call(this, 0);
|
||||
return this;
|
||||
},
|
||||
|
||||
getItemsOnPage: function() {
|
||||
return this.data('pagination').itemsOnPage;
|
||||
},
|
||||
|
||||
_draw: function() {
|
||||
var o = this.data('pagination'),
|
||||
interval = methods._getInterval(o),
|
||||
i,
|
||||
tagName;
|
||||
|
||||
methods.destroy.call(this);
|
||||
|
||||
tagName = (typeof this.prop === 'function') ? this.prop('tagName') : this.attr('tagName');
|
||||
|
||||
var $panel = tagName === 'UL' ? this : $('<ul' + (o.listStyle ? ' class="' + o.listStyle + '"' : '') + '></ul>').appendTo(this);
|
||||
|
||||
// Generate Prev link
|
||||
if (o.prevText) {
|
||||
methods._appendItem.call(this, !o.invertPageOrder ? o.currentPage - 1 : o.currentPage + 1, {text: o.prevText, classes: 'prev'});
|
||||
}
|
||||
|
||||
// Generate Next link (if option set for at front)
|
||||
if (o.nextText && o.nextAtFront) {
|
||||
methods._appendItem.call(this, !o.invertPageOrder ? o.currentPage + 1 : o.currentPage - 1, {text: o.nextText, classes: 'next'});
|
||||
}
|
||||
|
||||
// Generate start edges
|
||||
if (!o.invertPageOrder) {
|
||||
if (interval.start > 0 && o.edges > 0) {
|
||||
if(o.useStartEdge) {
|
||||
var end = Math.min(o.edges, interval.start);
|
||||
for (i = 0; i < end; i++) {
|
||||
methods._appendItem.call(this, i);
|
||||
}
|
||||
}
|
||||
if (o.edges < interval.start && (interval.start - o.edges != 1)) {
|
||||
$panel.append('<li class="disabled"><span class="ellipse">' + o.ellipseText + '</span></li>');
|
||||
} else if (interval.start - o.edges == 1) {
|
||||
methods._appendItem.call(this, o.edges);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (interval.end < o.pages && o.edges > 0) {
|
||||
if(o.useStartEdge) {
|
||||
var begin = Math.max(o.pages - o.edges, interval.end);
|
||||
for (i = o.pages - 1; i >= begin; i--) {
|
||||
methods._appendItem.call(this, i);
|
||||
}
|
||||
}
|
||||
|
||||
if (o.pages - o.edges > interval.end && (o.pages - o.edges - interval.end != 1)) {
|
||||
$panel.append('<li class="disabled"><span class="ellipse">' + o.ellipseText + '</span></li>');
|
||||
} else if (o.pages - o.edges - interval.end == 1) {
|
||||
methods._appendItem.call(this, interval.end);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Generate interval links
|
||||
if (!o.invertPageOrder) {
|
||||
for (i = interval.start; i < interval.end; i++) {
|
||||
methods._appendItem.call(this, i);
|
||||
}
|
||||
} else {
|
||||
for (i = interval.end - 1; i >= interval.start; i--) {
|
||||
methods._appendItem.call(this, i);
|
||||
}
|
||||
}
|
||||
|
||||
// Generate end edges
|
||||
if (!o.invertPageOrder) {
|
||||
if (interval.end < o.pages && o.edges > 0) {
|
||||
if (o.pages - o.edges > interval.end && (o.pages - o.edges - interval.end != 1)) {
|
||||
$panel.append('<li class="disabled"><span class="ellipse">' + o.ellipseText + '</span></li>');
|
||||
} else if (o.pages - o.edges - interval.end == 1) {
|
||||
methods._appendItem.call(this, interval.end);
|
||||
}
|
||||
if(o.useEndEdge) {
|
||||
var begin = Math.max(o.pages - o.edges, interval.end);
|
||||
for (i = begin; i < o.pages; i++) {
|
||||
methods._appendItem.call(this, i);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (interval.start > 0 && o.edges > 0) {
|
||||
if (o.edges < interval.start && (interval.start - o.edges != 1)) {
|
||||
$panel.append('<li class="disabled"><span class="ellipse">' + o.ellipseText + '</span></li>');
|
||||
} else if (interval.start - o.edges == 1) {
|
||||
methods._appendItem.call(this, o.edges);
|
||||
}
|
||||
|
||||
if(o.useEndEdge) {
|
||||
var end = Math.min(o.edges, interval.start);
|
||||
for (i = end - 1; i >= 0; i--) {
|
||||
methods._appendItem.call(this, i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Generate Next link (unless option is set for at front)
|
||||
if (o.nextText && !o.nextAtFront) {
|
||||
methods._appendItem.call(this, !o.invertPageOrder ? o.currentPage + 1 : o.currentPage - 1, {text: o.nextText, classes: 'next'});
|
||||
}
|
||||
|
||||
if (o.ellipsePageSet && !o.disabled) {
|
||||
methods._ellipseClick.call(this, $panel);
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
_getPages: function(o) {
|
||||
var pages = Math.ceil(o.items / o.itemsOnPage);
|
||||
return pages || 1;
|
||||
},
|
||||
|
||||
_getInterval: function(o) {
|
||||
return {
|
||||
start: Math.ceil(o.currentPage > o.halfDisplayed ? Math.max(Math.min(o.currentPage - o.halfDisplayed, (o.pages - o.displayedPages)), 0) : 0),
|
||||
end: Math.ceil(o.currentPage > o.halfDisplayed ? Math.min(o.currentPage + o.halfDisplayed, o.pages) : Math.min(o.displayedPages, o.pages))
|
||||
};
|
||||
},
|
||||
|
||||
_appendItem: function(pageIndex, opts) {
|
||||
var self = this, options, $link, o = self.data('pagination'), $linkWrapper = $('<li></li>'), $ul = self.find('ul');
|
||||
|
||||
pageIndex = pageIndex < 0 ? 0 : (pageIndex < o.pages ? pageIndex : o.pages - 1);
|
||||
|
||||
options = {
|
||||
text: pageIndex + 1,
|
||||
classes: ''
|
||||
};
|
||||
|
||||
if (o.labelMap.length && o.labelMap[pageIndex]) {
|
||||
options.text = o.labelMap[pageIndex];
|
||||
}
|
||||
|
||||
options = $.extend(options, opts || {});
|
||||
|
||||
if (pageIndex == o.currentPage || o.disabled) {
|
||||
if (o.disabled || options.classes === 'prev' || options.classes === 'next') {
|
||||
$linkWrapper.addClass('disabled');
|
||||
} else {
|
||||
$linkWrapper.addClass('active');
|
||||
}
|
||||
$link = $('<span class="current">' + (options.text) + '</span>');
|
||||
} else {
|
||||
if (o.useAnchors) {
|
||||
$link = $('<a href="' + o.hrefTextPrefix + (pageIndex + 1) + o.hrefTextSuffix + '" class="page-link">' + (options.text) + '</a>');
|
||||
} else {
|
||||
$link = $('<span >' + (options.text) + '</span>');
|
||||
}
|
||||
$link.click(function(event){
|
||||
return methods._selectPage.call(self, pageIndex, event);
|
||||
});
|
||||
}
|
||||
|
||||
if (options.classes) {
|
||||
$link.addClass(options.classes);
|
||||
}
|
||||
|
||||
$linkWrapper.append($link);
|
||||
|
||||
if ($ul.length) {
|
||||
$ul.append($linkWrapper);
|
||||
} else {
|
||||
self.append($linkWrapper);
|
||||
}
|
||||
},
|
||||
|
||||
_selectPage: function(pageIndex, event) {
|
||||
var o = this.data('pagination');
|
||||
o.currentPage = pageIndex;
|
||||
if (o.selectOnClick) {
|
||||
methods._draw.call(this);
|
||||
}
|
||||
return o.onPageClick(pageIndex + 1, event);
|
||||
},
|
||||
|
||||
|
||||
_ellipseClick: function($panel) {
|
||||
var self = this,
|
||||
o = this.data('pagination'),
|
||||
$ellip = $panel.find('.ellipse');
|
||||
$ellip.addClass('clickable').parent().removeClass('disabled');
|
||||
$ellip.click(function(event) {
|
||||
if (!o.disable) {
|
||||
var $this = $(this),
|
||||
val = (parseInt($this.parent().prev().text(), 10) || 0) + 1;
|
||||
$this
|
||||
.html('<input type="number" min="1" max="' + o.pages + '" step="1" value="' + val + '">')
|
||||
.find('input')
|
||||
.focus()
|
||||
.click(function(event) {
|
||||
// prevent input number arrows from bubbling a click event on $ellip
|
||||
event.stopPropagation();
|
||||
})
|
||||
.keyup(function(event) {
|
||||
var val = $(this).val();
|
||||
if (event.which === 13 && val !== '') {
|
||||
// enter to accept
|
||||
if ((val>0)&&(val<=o.pages))
|
||||
methods._selectPage.call(self, val - 1);
|
||||
} else if (event.which === 27) {
|
||||
// escape to cancel
|
||||
$ellip.empty().html(o.ellipseText);
|
||||
}
|
||||
})
|
||||
.bind('blur', function(event) {
|
||||
var val = $(this).val();
|
||||
if (val !== '') {
|
||||
methods._selectPage.call(self, val - 1);
|
||||
}
|
||||
$ellip.empty().html(o.ellipseText);
|
||||
return false;
|
||||
});
|
||||
}
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
$.fn.pagination = function(method) {
|
||||
|
||||
// Method calling logic
|
||||
if (methods[method] && method.charAt(0) != '_') {
|
||||
return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
|
||||
} else if (typeof method === 'object' || !method) {
|
||||
return methods.init.apply(this, arguments);
|
||||
} else {
|
||||
$.error('Method ' + method + ' does not exist on jQuery.pagination');
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
})(jQuery);
|
||||
168
themes/ayon/modules/productcomments/views/js/list-comments.js
Normal file
168
themes/ayon/modules/productcomments/views/js/list-comments.js
Normal file
@@ -0,0 +1,168 @@
|
||||
/**
|
||||
* Copyright since 2007 PrestaShop SA and Contributors
|
||||
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
|
||||
* that is bundled with this package in the file LICENSE.md.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/licenses/AFL-3.0
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||
*
|
||||
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
|
||||
*/
|
||||
|
||||
jQuery(document).ready(function () {
|
||||
const $ = jQuery;
|
||||
const commentsList = $('#product-comments-list');
|
||||
const emptyProductComment = $('#empty-product-comment');
|
||||
const commentsListUrl = commentsList.data('list-comments-url');
|
||||
const updateCommentUsefulnessUrl = commentsList.data('update-comment-usefulness-url');
|
||||
const reportCommentUrl = commentsList.data('report-comment-url');
|
||||
const commentPrototype = commentsList.data('comment-item-prototype');
|
||||
|
||||
emptyProductComment.hide();
|
||||
$('.grade-stars').rating();
|
||||
|
||||
prestashop.on('updatedProduct', function() {
|
||||
$('.product-comments-additional-info .grade-stars').rating();
|
||||
})
|
||||
|
||||
document.addEventListener('updateRating', function() {
|
||||
$('.grade-stars').rating();
|
||||
});
|
||||
|
||||
const updateCommentPostErrorModal = $('#update-comment-usefulness-post-error');
|
||||
|
||||
const confirmAbuseModal = $('#report-comment-confirmation');
|
||||
const reportCommentPostErrorModal = $('#report-comment-post-error');
|
||||
const reportCommentPostedModal = $('#report-comment-posted');
|
||||
|
||||
function showUpdatePostCommentErrorModal(errorMessage) {
|
||||
$('#update-comment-usefulness-post-error-message').html(errorMessage);
|
||||
updateCommentPostErrorModal.modal('show');
|
||||
}
|
||||
|
||||
function showReportCommentErrorModal(errorMessage) {
|
||||
$('#report-comment-post-error-message').html(errorMessage);
|
||||
reportCommentPostErrorModal.modal('show');
|
||||
}
|
||||
|
||||
function paginateComments(page) {
|
||||
$.get(commentsListUrl, {page: page}, function(jsonResponse) {
|
||||
if (jsonResponse.comments && jsonResponse.comments.length > 0) {
|
||||
populateComments(jsonResponse.comments);
|
||||
if (jsonResponse.comments_nb > jsonResponse.comments_per_page) {
|
||||
$('#product-comments-list-pagination').pagination({
|
||||
currentPage: page,
|
||||
items: jsonResponse.comments_nb,
|
||||
itemsOnPage: jsonResponse.comments_per_page,
|
||||
cssStyle: '',
|
||||
prevText: '<i class="material-icons">chevron_left</i>',
|
||||
nextText: '<i class="material-icons">chevron_right</i>',
|
||||
useAnchors: false,
|
||||
displayedPages: 2,
|
||||
onPageClick: paginateComments
|
||||
});
|
||||
} else {
|
||||
$('#product-comments-list-pagination').hide();
|
||||
}
|
||||
} else {
|
||||
commentsList.html('');
|
||||
emptyProductComment.show();
|
||||
commentsList.append(emptyProductComment);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function populateComments(comments) {
|
||||
commentsList.html('');
|
||||
comments.forEach(addComment);
|
||||
}
|
||||
|
||||
function addComment(comment) {
|
||||
var commentTemplate = commentPrototype;
|
||||
var customerName = comment.customer_name;
|
||||
if (!customerName) {
|
||||
customerName = comment.firstname+' '+comment.lastname;
|
||||
}
|
||||
commentTemplate = commentTemplate.replace(/@COMMENT_ID@/, comment.id_product_comment);
|
||||
commentTemplate = commentTemplate.replace(/@PRODUCT_ID@/, comment.id_product);
|
||||
commentTemplate = commentTemplate.replace(/@CUSTOMER_NAME@/, customerName);
|
||||
commentTemplate = commentTemplate.replace(/@COMMENT_DATE@/, comment.date_add);
|
||||
commentTemplate = commentTemplate.replace(/@COMMENT_TITLE@/, comment.title);
|
||||
commentTemplate = commentTemplate.replace(/@COMMENT_COMMENT@/, comment.content);
|
||||
commentTemplate = commentTemplate.replace(/@COMMENT_USEFUL_ADVICES@/, comment.usefulness);
|
||||
commentTemplate = commentTemplate.replace(/@COMMENT_NOT_USEFUL_ADVICES@/, (comment.total_usefulness - comment.usefulness));
|
||||
commentTemplate = commentTemplate.replace(/@COMMENT_TOTAL_ADVICES@/, comment.total_usefulness);
|
||||
|
||||
const $comment = $(commentTemplate);
|
||||
$('.grade-stars', $comment).rating({
|
||||
grade: comment.grade
|
||||
});
|
||||
$('.useful-review', $comment).click(function() {
|
||||
updateCommentUsefulness($comment, comment.id_product_comment, 1);
|
||||
});
|
||||
$('.not-useful-review', $comment).click(function() {
|
||||
updateCommentUsefulness($comment, comment.id_product_comment, 0);
|
||||
});
|
||||
$('.report-abuse', $comment).click(function() {
|
||||
confirmCommentAbuse(comment.id_product_comment);
|
||||
});
|
||||
|
||||
commentsList.append($comment);
|
||||
}
|
||||
|
||||
function updateCommentUsefulness($comment, commentId, usefulness) {
|
||||
$.post(updateCommentUsefulnessUrl, {id_product_comment: commentId, usefulness: usefulness}, function(jsonData){
|
||||
if (jsonData) {
|
||||
if (jsonData.success) {
|
||||
$('.useful-review-value', $comment).html(jsonData.usefulness);
|
||||
$('.not-useful-review-value', $comment).html(jsonData.total_usefulness - jsonData.usefulness);
|
||||
} else {
|
||||
const decodedErrorMessage = $("<div/>").html(jsonData.error).text();
|
||||
showUpdatePostCommentErrorModal(decodedErrorMessage);
|
||||
}
|
||||
} else {
|
||||
showUpdatePostCommentErrorModal(productCommentUpdatePostErrorMessage);
|
||||
}
|
||||
}).fail(function() {
|
||||
showUpdatePostCommentErrorModal(productCommentUpdatePostErrorMessage);
|
||||
});
|
||||
}
|
||||
|
||||
function confirmCommentAbuse(commentId) {
|
||||
confirmAbuseModal.modal('show');
|
||||
confirmAbuseModal.one('modal:confirm', function(event, confirm) {
|
||||
if (!confirm) {
|
||||
return;
|
||||
}
|
||||
$.post(reportCommentUrl, {id_product_comment: commentId}, function(jsonData){
|
||||
if (jsonData) {
|
||||
if (jsonData.success) {
|
||||
reportCommentPostedModal.modal('show');
|
||||
} else {
|
||||
showReportCommentErrorModal(jsonData.error);
|
||||
}
|
||||
} else {
|
||||
showReportCommentErrorModal(productCommentAbuseReportErrorMessage);
|
||||
}
|
||||
}).fail(function() {
|
||||
showReportCommentErrorModal(productCommentAbuseReportErrorMessage);
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
paginateComments(1);
|
||||
});
|
||||
131
themes/ayon/modules/productcomments/views/js/post-comment.js
Normal file
131
themes/ayon/modules/productcomments/views/js/post-comment.js
Normal file
@@ -0,0 +1,131 @@
|
||||
/**
|
||||
* Copyright since 2007 PrestaShop SA and Contributors
|
||||
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
|
||||
* that is bundled with this package in the file LICENSE.md.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/licenses/AFL-3.0
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||
*
|
||||
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
|
||||
*/
|
||||
|
||||
jQuery(document).ready(function () {
|
||||
const $ = jQuery;
|
||||
$('body').on('click', '.post-product-comment', function (event) {
|
||||
event.preventDefault();
|
||||
showPostCommentModal();
|
||||
});
|
||||
|
||||
const postCommentModal = $('#post-product-comment-modal');
|
||||
postCommentModal.on('hidden.bs.modal', function () {
|
||||
postCommentModal.modal('hide');
|
||||
clearPostCommentForm();
|
||||
});
|
||||
|
||||
const commentPostedModal = $('#product-comment-posted-modal');
|
||||
const commentPostErrorModal = $('#product-comment-post-error');
|
||||
|
||||
function showPostCommentModal() {
|
||||
commentPostedModal.modal('hide');
|
||||
commentPostErrorModal.modal('hide');
|
||||
postCommentModal.modal('show');
|
||||
}
|
||||
|
||||
function showCommentPostedModal() {
|
||||
postCommentModal.modal('hide');
|
||||
commentPostErrorModal.modal('hide');
|
||||
clearPostCommentForm();
|
||||
commentPostedModal.modal('show');
|
||||
}
|
||||
|
||||
function showPostErrorModal(errorMessage) {
|
||||
postCommentModal.modal('hide');
|
||||
commentPostedModal.modal('hide');
|
||||
clearPostCommentForm();
|
||||
$('#product-comment-post-error-message').html(errorMessage);
|
||||
commentPostErrorModal.modal('show');
|
||||
}
|
||||
|
||||
function clearPostCommentForm() {
|
||||
$('#post-product-comment-form input[type="text"]').val('');
|
||||
$('#post-product-comment-form input[type="text"]').removeClass('valid error');
|
||||
$('#post-product-comment-form textarea').val('');
|
||||
$('#post-product-comment-form textarea').removeClass('valid error');
|
||||
$('#post-product-comment-form .criterion-rating input').val(3).change();
|
||||
}
|
||||
|
||||
function initCommentModal() {
|
||||
$('#post-product-comment-modal .grade-stars').rating();
|
||||
$('body').on('click', '.post-product-comment', function (event) {
|
||||
event.preventDefault();
|
||||
showPostCommentModal();
|
||||
});
|
||||
|
||||
$('#post-product-comment-form').submit(submitCommentForm);
|
||||
}
|
||||
|
||||
function submitCommentForm(event) {
|
||||
event.preventDefault();
|
||||
var formData = $(this).serializeArray();
|
||||
if (!validateFormData(formData)) {
|
||||
return;
|
||||
}
|
||||
$.post($(this).attr('action'), $(this).serialize(), function(jsonData) {
|
||||
if (jsonData) {
|
||||
if (jsonData.success) {
|
||||
clearPostCommentForm();
|
||||
showCommentPostedModal();
|
||||
} else {
|
||||
if (jsonData.errors) {
|
||||
var errorList = '<ul>';
|
||||
for (var i = 0; i < jsonData.errors.length; ++i) {
|
||||
errorList += '<li>' + jsonData.errors[i] + '</li>';
|
||||
}
|
||||
errorList += '</ul>';
|
||||
showPostErrorModal(errorList);
|
||||
} else {
|
||||
const decodedErrorMessage = $("<div/>").html(jsonData.error).text();
|
||||
showPostErrorModal(decodedErrorMessage);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
showPostErrorModal(productCommentPostErrorMessage);
|
||||
}
|
||||
}).fail(function() {
|
||||
showPostErrorModal(productCommentPostErrorMessage);
|
||||
});
|
||||
}
|
||||
|
||||
function validateFormData(formData) {
|
||||
var isValid = true;
|
||||
formData.forEach(function(formField) {
|
||||
const fieldSelector = '#post-product-comment-form [name="'+formField.name+'"]';
|
||||
if (!formField.value) {
|
||||
$(fieldSelector).addClass('error');
|
||||
$(fieldSelector).removeClass('valid');
|
||||
isValid = false;
|
||||
} else {
|
||||
$(fieldSelector).removeClass('error');
|
||||
$(fieldSelector).addClass('valid');
|
||||
}
|
||||
});
|
||||
|
||||
return isValid;
|
||||
}
|
||||
|
||||
initCommentModal();
|
||||
});
|
||||
@@ -0,0 +1,151 @@
|
||||
/**
|
||||
* 2007-2019 PrestaShop SA and Contributors
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2019 PrestaShop SA and Contributors
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
productListingComments.init();
|
||||
productListingComments.load();
|
||||
});
|
||||
|
||||
|
||||
var productListingComments = (function () {
|
||||
|
||||
var data = {
|
||||
productIDs: [],
|
||||
commentsLoadingInProgress: false,
|
||||
ajaxIDsLimit: 50,
|
||||
ajaxUrl: ''
|
||||
}
|
||||
|
||||
var DOMStrings = {
|
||||
productListReviewsContainer: '.product-list-reviews',
|
||||
productListReviewsNumberOfComments: '.comments-nb',
|
||||
productListReviewsStarsContainer: '.grade-stars',
|
||||
productContainer: '.thumbnail-container'
|
||||
};
|
||||
|
||||
var DOMClasses = {
|
||||
inProgress: 'reviews-loading',
|
||||
reviewsLoaded: 'reviews-loaded',
|
||||
hasReviews: 'has-reviews'
|
||||
};
|
||||
|
||||
function setEvents() {
|
||||
prestashop.on('updateProductList', function() {
|
||||
addProductsIDs();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function setAjaxUrl() {
|
||||
if (data.ajaxUrl !== '')
|
||||
return;
|
||||
|
||||
var url = $(DOMStrings.productListReviewsContainer).first().data('url');
|
||||
data.ajaxUrl = url;
|
||||
}
|
||||
|
||||
function getNewProductsReviewsElements() {
|
||||
var $productListReviews = $(DOMStrings.productContainer)
|
||||
.not('.' + DOMClasses.reviewsLoaded + ', .' + DOMClasses.inProgress)
|
||||
.addClass(DOMClasses.inProgress)
|
||||
.find(DOMStrings.productListReviewsContainer);
|
||||
|
||||
return $productListReviews;
|
||||
}
|
||||
|
||||
function addProductsIDs() {
|
||||
|
||||
var $productsList = getNewProductsReviewsElements(),
|
||||
seenIds = {};
|
||||
|
||||
$productsList.each(function () {
|
||||
var id = $(this).data('id');
|
||||
seenIds[id] = true;
|
||||
});
|
||||
|
||||
|
||||
var IDsArray = Object.keys(seenIds);
|
||||
var prevDataIDs = data.productIDs.splice(0);
|
||||
data.productIDs = prevDataIDs.concat(IDsArray);
|
||||
|
||||
if (!data.commentsLoadingInProgress) {
|
||||
loadProductsData();
|
||||
}
|
||||
}
|
||||
|
||||
function loadProductsData() {
|
||||
if (data.productIDs.length === 0)
|
||||
return;
|
||||
|
||||
data.commentsLoadingInProgress = true;
|
||||
|
||||
var dataIDsCopy = data.productIDs.slice(0);
|
||||
selectedProductIDs = dataIDsCopy.splice(0, data.ajaxIDsLimit);
|
||||
|
||||
|
||||
$.get(data.ajaxUrl, { id_products: selectedProductIDs }, function (jsonData) {
|
||||
if (jsonData) {
|
||||
$.each(jsonData.products, function(i, elem) {
|
||||
var productData = elem;
|
||||
var $productsReviewsContainer = $('.product-list-reviews[data-id="' + productData.id_product + '"]');
|
||||
|
||||
$productsReviewsContainer.each(function () {
|
||||
var $self = $(this);
|
||||
|
||||
if (productData.comments_nb > 0) {
|
||||
$self.find(DOMStrings.productListReviewsStarsContainer).rating({ grade: productData.average_grade, starWidth: 16 });
|
||||
$self.find(DOMStrings.productListReviewsNumberOfComments).text('(' + productData.comments_nb + ')');
|
||||
$self.closest(DOMStrings.productContainer).addClass(DOMClasses.hasReviews);
|
||||
$self.css('visibility', 'visible');
|
||||
}
|
||||
|
||||
$self.closest(DOMStrings.productContainer).addClass(DOMClasses.reviewsLoaded);
|
||||
$self.closest(DOMStrings.productContainer).removeClass(DOMClasses.inProgress);
|
||||
|
||||
});
|
||||
data.productIDs.shift();
|
||||
});
|
||||
|
||||
data.commentsLoadingInProgress = false;
|
||||
if (data.productIDs.length > 0) {
|
||||
loadProductsData();
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
return {
|
||||
load: function () {
|
||||
addProductsIDs();
|
||||
},
|
||||
init: function () {
|
||||
setAjaxUrl();
|
||||
setEvents();
|
||||
}
|
||||
}
|
||||
})();
|
||||
@@ -0,0 +1,73 @@
|
||||
{*
|
||||
* 2007-2016 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2016 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*
|
||||
* MODIFIED BY MYPRESTA.EU FOR PRESTASHOP 1.7 PURPOSES !
|
||||
*
|
||||
*}
|
||||
|
||||
{extends file="helpers/form/form.tpl"}
|
||||
|
||||
{block name="input"}
|
||||
{if $input.type == 'products'}
|
||||
<table id="{$input.name}">
|
||||
<tr>
|
||||
<th></th>
|
||||
<th>ID</th>
|
||||
<th width="80%">{l s='Product Name'}</th>
|
||||
</tr>
|
||||
{foreach $input.values as $value}
|
||||
<tr>
|
||||
<td>
|
||||
<input type="checkbox" name="{$input.name}[]" value="{$value.id_product}"
|
||||
{if isset($value.selected) && $value.selected == 1} checked {/if} />
|
||||
</td>
|
||||
<td>{$value.id_product}</td>
|
||||
<td width="80%">{$value.name}</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</table>
|
||||
{elseif $input.type == 'switch' && $smarty.const._PS_VERSION_|@addcslashes:'\'' < '1.6'}
|
||||
{foreach $input.values as $value}
|
||||
<input type="radio" name="{$input.name}" id="{$value.id}" value="{$value.value|escape:'html':'UTF-8'}"
|
||||
{if $fields_value[$input.name] == $value.value}checked="checked"{/if}
|
||||
{if isset($input.disabled) && $input.disabled}disabled="disabled"{/if} />
|
||||
<label class="t" for="{$value.id}">
|
||||
{if isset($input.is_bool) && $input.is_bool == true}
|
||||
{if $value.value == 1}
|
||||
<img src="../img/admin/enabled.gif" alt="{$value.label}" title="{$value.label}" />
|
||||
{else}
|
||||
<img src="../img/admin/disabled.gif" alt="{$value.label}" title="{$value.label}" />
|
||||
{/if}
|
||||
{else}
|
||||
{$value.label}
|
||||
{/if}
|
||||
</label>
|
||||
{if isset($input.br) && $input.br}<br />{/if}
|
||||
{if isset($value.p) && $value.p}<p>{$value.p}</p>{/if}
|
||||
{/foreach}
|
||||
{else}
|
||||
{$smarty.block.parent}
|
||||
{/if}
|
||||
|
||||
{/block}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2016 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2016 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
|
||||
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
|
||||
|
||||
header("Cache-Control: no-store, no-cache, must-revalidate");
|
||||
header("Cache-Control: post-check=0, pre-check=0", false);
|
||||
header("Pragma: no-cache");
|
||||
|
||||
header("Location: ../");
|
||||
exit;
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2016 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2016 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
|
||||
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
|
||||
|
||||
header("Cache-Control: no-store, no-cache, must-revalidate");
|
||||
header("Cache-Control: post-check=0, pre-check=0", false);
|
||||
header("Pragma: no-cache");
|
||||
|
||||
header("Location: ../");
|
||||
exit;
|
||||
@@ -0,0 +1,250 @@
|
||||
<tbody>
|
||||
{if count($list)}
|
||||
{foreach $list AS $index => $tr}
|
||||
<tr{if $position_identifier} id="tr_{$position_group_identifier}_{$tr.$identifier}_{if isset($tr.position['position'])}{$tr.position['position']}{else}0{/if}"{/if} class="{if isset($tr.class)}{$tr.class}{/if} {if $tr@iteration is odd by 1}odd{/if}"{if isset($tr.color) && $color_on_bg} style="background-color: {$tr.color}"{/if} >
|
||||
{if $bulk_actions && $has_bulk_actions}
|
||||
<td class="row-selector text-center">
|
||||
{if isset($list_skip_actions.delete)}
|
||||
{if !in_array($tr.$identifier, $list_skip_actions.delete)}
|
||||
<input type="checkbox" name="{$list_id}Box[]" value="{$tr.$identifier}"{if isset($checked_boxes) && is_array($checked_boxes) && in_array({$tr.$identifier}, $checked_boxes)} checked="checked"{/if} class="noborder"/>
|
||||
{/if}
|
||||
{else}
|
||||
<input type="checkbox" name="{$list_id}Box[]" value="{$tr.$identifier}"{if isset($checked_boxes) && is_array($checked_boxes) && in_array({$tr.$identifier}, $checked_boxes)} checked="checked"{/if} class="noborder"/>
|
||||
{/if}
|
||||
</td>
|
||||
{/if}
|
||||
{foreach $fields_display AS $key => $params}
|
||||
{block name="open_td"}
|
||||
<td
|
||||
{if isset($params.position)}
|
||||
id="td_{if !empty($position_group_identifier)}{$position_group_identifier}{else}0{/if}_{$tr.$identifier}{if $smarty.capture.tr_count > 1}_{($smarty.capture.tr_count - 1)|intval}{/if}"
|
||||
{/if}
|
||||
class="{strip}{if !$no_link}pointer{/if}
|
||||
{if isset($params.position) && $order_by == 'position' && $order_way != 'DESC'} dragHandle{/if}
|
||||
{if isset($params.class)} {$params.class}{/if}
|
||||
{if isset($params.align)} {$params.align}{/if}{/strip}"
|
||||
{if (!isset($params.position) && !$no_link && !isset($params.remove_onclick))}
|
||||
onclick="document.location = '{$current_index|escape:'html':'UTF-8'}&{$identifier|escape:'html':'UTF-8'}={$tr.$identifier|escape:'html':'UTF-8'}{if $view}&view{else}&update{/if}{$table|escape:'html':'UTF-8'}{if $page > 1}&page={$page|intval}{/if}&token={$token|escape:'html':'UTF-8'}'">
|
||||
{else}
|
||||
>
|
||||
{/if}
|
||||
{/block}
|
||||
{block name="td_content"}
|
||||
{if isset($params.prefix)}{$params.prefix}{/if}
|
||||
{if isset($params.badge_success) && $params.badge_success && isset($tr.badge_success) && $tr.badge_success == $params.badge_success}<span class="badge badge-success">{/if}
|
||||
{if isset($params.badge_warning) && $params.badge_warning && isset($tr.badge_warning) && $tr.badge_warning == $params.badge_warning}<span class="badge badge-warning">{/if}
|
||||
{if isset($params.badge_danger) && $params.badge_danger && isset($tr.badge_danger) && $tr.badge_danger == $params.badge_danger}<span class="badge badge-danger">{/if}
|
||||
{if isset($params.color) && isset($tr[$params.color])}
|
||||
<span class="label color_field" style="background-color:{$tr[$params.color]};color:{if Tools::getBrightness($tr[$params.color]) < 128}white{else}#383838{/if}">
|
||||
{/if}
|
||||
{if isset($tr.$key)}
|
||||
{if isset($params.active)}
|
||||
{$tr.$key}
|
||||
{elseif isset($params.callback)}
|
||||
{if isset($params.maxlength) && Tools::strlen($tr.$key) > $params.maxlength}
|
||||
<span title="{$tr.$key}">{$tr.$key|truncate:$params.maxlength:'...'}</span>
|
||||
{else}
|
||||
{$tr.$key}
|
||||
{/if}
|
||||
{elseif isset($params.activeVisu)}
|
||||
{if $tr.$key}
|
||||
<i class="icon-check-ok"></i>
|
||||
|
||||
|
||||
|
||||
{l s='Enabled' d='Admin.Global'}
|
||||
{else}
|
||||
|
||||
|
||||
|
||||
|
||||
<i class="icon-remove"></i>
|
||||
{l s='Disabled' d='Admin.Global'}
|
||||
{/if}
|
||||
{elseif isset($params.position)}
|
||||
{if !$filters_has_value && $order_by == 'position' && $order_way != 'DESC'}
|
||||
<div class="dragGroup">
|
||||
<div class="positions">
|
||||
{$tr.$key.position + 1}
|
||||
</div>
|
||||
</div>
|
||||
{else}
|
||||
{$tr.$key.position + 1}
|
||||
{/if}
|
||||
{elseif isset($params.image)}
|
||||
{$tr.$key}
|
||||
{elseif isset($params.icon)}
|
||||
{if is_array($tr[$key])}
|
||||
{if isset($tr[$key]['class'])}
|
||||
<i class="{$tr[$key]['class']}"></i>
|
||||
|
||||
|
||||
|
||||
|
||||
{else}
|
||||
|
||||
|
||||
|
||||
|
||||
<img src="../img/admin/{$tr[$key]['src']}" alt="{$tr[$key]['alt']}" title="{$tr[$key]['alt']}"/>
|
||||
{/if}
|
||||
{/if}
|
||||
{elseif isset($params.type) && $params.type == 'price'}
|
||||
{displayPrice price=$tr.$key}
|
||||
{elseif isset($params.float)}
|
||||
{$tr.$key}
|
||||
{elseif isset($params.type) && $params.type == 'date'}
|
||||
{dateFormat date=$tr.$key full=0}
|
||||
{elseif isset($params.type) && $params.type == 'datetime'}
|
||||
{dateFormat date=$tr.$key full=1}
|
||||
{elseif isset($params.type) && $params.type == 'decimal'}
|
||||
{$tr.$key|string_format:"%.2f"}
|
||||
{elseif isset($params.type) && $params.type == 'percent'}
|
||||
{$tr.$key} {l s='%'}
|
||||
{elseif isset($params.type) && $params.type == 'bool'}
|
||||
{if $tr.$key == 1}
|
||||
{l s='Yes' d='Admin.Global'}
|
||||
{elseif $tr.$key == 0 && $tr.$key != ''}
|
||||
{l s='No' d='Admin.Global'}
|
||||
{/if}
|
||||
{* If type is 'editable', an input is created *}
|
||||
{elseif isset($params.type) && $params.type == 'editable' && isset($tr.id)}
|
||||
|
||||
|
||||
|
||||
|
||||
<input type="text" name="{$key}_{$tr.id}" value="{$tr.$key|escape:'html':'UTF-8'}" class="{$key}"/>
|
||||
|
||||
|
||||
|
||||
|
||||
{elseif $key == 'color'}
|
||||
{if !is_array($tr.$key)}
|
||||
<div style="background-color: {$tr.$key};" class="attributes-color-container"></div>
|
||||
|
||||
|
||||
|
||||
|
||||
{else}
|
||||
{*TEXTURE*}
|
||||
|
||||
|
||||
|
||||
|
||||
<img src="{$tr.$key.texture}" alt="{$tr.name}" class="attributes-color-container"/>
|
||||
{/if}
|
||||
{elseif isset($params.maxlength) && Tools::strlen($tr.$key) > $params.maxlength}
|
||||
|
||||
|
||||
|
||||
|
||||
<span title="{$tr.$key|escape:'html':'UTF-8'}">{$tr.$key|truncate:$params.maxlength:'...'|escape:'html':'UTF-8'}</span>
|
||||
{else}
|
||||
{$tr.$key|escape:'html':'UTF-8'}
|
||||
{/if}
|
||||
{else}
|
||||
{block name="default_field"}--{/block}
|
||||
{/if}
|
||||
{if isset($params.suffix)}{$params.suffix}{/if}
|
||||
{if isset($params.color) && isset($tr.color)}
|
||||
</span>
|
||||
{/if}
|
||||
{if isset($params.badge_danger) && $params.badge_danger && isset($tr.badge_danger) && $tr.badge_danger == $params.badge_danger}</span>{/if}
|
||||
{if isset($params.badge_warning) && $params.badge_warning && isset($tr.badge_warning) && $tr.badge_warning == $params.badge_warning}</span>{/if}
|
||||
{if isset($params.badge_success) && $params.badge_success && isset($tr.badge_success) && $tr.badge_success == $params.badge_success}</span>{/if}
|
||||
{/block}
|
||||
{block name="close_td"}
|
||||
</td>
|
||||
{/block}
|
||||
{/foreach}
|
||||
|
||||
{if $multishop_active && $shop_link_type}
|
||||
<td title="{$tr.shop_name}">
|
||||
{if isset($tr.shop_short_name)}
|
||||
{$tr.shop_short_name}
|
||||
{else}
|
||||
{$tr.shop_name}
|
||||
{/if}
|
||||
</td>
|
||||
{/if}
|
||||
{if $has_actions}
|
||||
<td class="text-right">
|
||||
{assign var='compiled_actions' value=array()}
|
||||
{foreach $actions AS $key => $action}
|
||||
{if isset($tr.$action)}
|
||||
{if $key == 0}
|
||||
{assign var='action' value=$action}
|
||||
{/if}
|
||||
{if $action == 'delete' && $actions|@count > 2}
|
||||
{$compiled_actions[] = 'divider'}
|
||||
{/if}
|
||||
{$compiled_actions[] = $tr.$action}
|
||||
{/if}
|
||||
{/foreach}
|
||||
{if $compiled_actions|count > 0}
|
||||
{if $compiled_actions|count > 1}<div class="btn-group-action">{/if}
|
||||
<div class="btn-group pull-right">
|
||||
{$compiled_actions[0]}
|
||||
{if $compiled_actions|count > 1}
|
||||
<button class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
<i class="icon-caret-down"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
{foreach $compiled_actions AS $key => $action}
|
||||
{if $key != 0}
|
||||
<li{if $action == 'divider' && $compiled_actions|count > 3} class="divider"{/if}>
|
||||
{if $action != 'divider'}{$action}{/if}
|
||||
</li>
|
||||
{/if}
|
||||
{/foreach}
|
||||
</ul>
|
||||
{/if}
|
||||
</div>
|
||||
{if $compiled_actions|count > 1}</div>{/if}
|
||||
{/if}
|
||||
{if isset(Module::getInstanceByName('reviewsreply')->active)}
|
||||
{if Module::getInstanceByName('reviewsreply')->active == true && $identifier == 'id_product_comment'}
|
||||
<div class="pull-right">
|
||||
<a onclick="$(this).closest('tr').next('tr').show();" class="btn btn-small btn-default"><i class="icon-pencil"></i> {l s='Reply'}</a>
|
||||
</div>
|
||||
{/if}
|
||||
{/if}
|
||||
</td>
|
||||
{/if}
|
||||
</tr>
|
||||
{if isset(Module::getInstanceByName('reviewsreply')->active)}
|
||||
{if Module::getInstanceByName('reviewsreply')->active == true && $identifier == 'id_product_comment'}
|
||||
<tr style="display:none;">
|
||||
<td colspan="8" class="center" style="padding:8px">
|
||||
{assign var='reply' value=rreply::getByIdProductCommentAll($tr.id_product_comment)}
|
||||
<form method="post">
|
||||
<input type="hidden" name="action" value="addreply"/>
|
||||
<input type="hidden" name="id_product_comment" value="{$tr.id_product_comment}"/>
|
||||
{if isset($reply.0)}
|
||||
{if isset($reply.0->body)}
|
||||
<input type="hidden" name="id_rreply" value="{$reply.0->id_rreply}"/>
|
||||
{/if}
|
||||
{/if}
|
||||
<textarea name="body" style="height:100px; margin-bottom:20px;" class="col-lg-12">{if isset($reply.0)}{if isset($reply.0->body)}{$reply.0->body}{/if}{/if}</textarea>
|
||||
<div class="col-lg-12">
|
||||
<button class="btn btn-large btn-success">
|
||||
<i class="icon-save"></i> {if isset($reply.0)}{l s='Save reply'}{else}{l s='Add reply'}{/if}
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
{/if}
|
||||
{/if}
|
||||
{/foreach}
|
||||
{else}
|
||||
<tr>
|
||||
<td class="list-empty" colspan="{count($fields_display)+1}">
|
||||
<div class="list-empty-msg">
|
||||
<i class="icon-warning-sign list-empty-icon"></i>
|
||||
{l s='No records found'}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{/if}
|
||||
</tbody>
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
{**
|
||||
* Copyright since 2007 PrestaShop SA and Contributors
|
||||
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
|
||||
* that is bundled with this package in the file LICENSE.md.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/licenses/AFL-3.0
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||
*
|
||||
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
|
||||
*}
|
||||
|
||||
{assign var='icon' value=$icon|default:'check_circle'}
|
||||
{assign var='modal_message' value=$modal_message|default:''}
|
||||
|
||||
<script type="text/javascript">
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
const alertModal = $('#{$modal_id}');
|
||||
alertModal.on('hidden.bs.modal', function () {
|
||||
alertModal.modal('hide');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<div id="{$modal_id}" class="modal fade product-comment-modal" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h2>
|
||||
<i class="material-icons {$icon}">{$icon}</i>
|
||||
{$modal_title}
|
||||
</h2>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-sm-12" id="{$modal_id}-message">
|
||||
{$modal_message}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-sm-12 post-comment-buttons">
|
||||
<button type="button" class="btn btn-comment btn-comment-huge" data-dismiss="modal" aria-label="{l s='OK' d='Modules.Productcomments.Shop'}">
|
||||
{l s='OK' d='Modules.Productcomments.Shop'}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,31 @@
|
||||
{**
|
||||
* Copyright since 2007 PrestaShop SA and Contributors
|
||||
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
|
||||
* that is bundled with this package in the file LICENSE.md.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/licenses/AFL-3.0
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||
*
|
||||
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
|
||||
*}
|
||||
|
||||
{if $nb_comments != 0}
|
||||
<div class="comments-note">
|
||||
<span>{l s='Grade' d='Modules.Productcomments.Shop'}</span>
|
||||
<div class="grade-stars" data-grade="{$grade}"></div>
|
||||
</div>
|
||||
{/if}
|
||||
@@ -0,0 +1,74 @@
|
||||
{**
|
||||
* Copyright since 2007 PrestaShop SA and Contributors
|
||||
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
|
||||
* that is bundled with this package in the file LICENSE.md.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/licenses/AFL-3.0
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||
*
|
||||
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
|
||||
*}
|
||||
|
||||
{assign var='icon' value=$icon|default:'check_circle'}
|
||||
{assign var='modal_message' value=$modal_message|default:''}
|
||||
|
||||
<script type="text/javascript">
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
const confirmModal = $('#{$modal_id}');
|
||||
confirmModal.on('hidden.bs.modal', function () {
|
||||
confirmModal.modal('hide');
|
||||
confirmModal.trigger('modal:confirm', false);
|
||||
});
|
||||
|
||||
$('.confirm-button', confirmModal).click(function() {
|
||||
confirmModal.trigger('modal:confirm', true);
|
||||
});
|
||||
$('.refuse-button', confirmModal).click(function() {
|
||||
confirmModal.trigger('modal:confirm', false);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<div id="{$modal_id}" class="modal fade product-comment-modal" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h2>
|
||||
<i class="material-icons {$icon}">{$icon}</i>
|
||||
{$modal_title}
|
||||
</h2>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-sm-12" id="{$modal_id}-message">
|
||||
{$modal_message}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-sm-12 post-comment-buttons">
|
||||
<button type="button" class="btn btn-comment-inverse btn-comment-huge refuse-button" data-dismiss="modal" aria-label="{l s='No' d='Modules.Productcomments.Shop'}">
|
||||
{l s='No' d='Modules.Productcomments.Shop'}
|
||||
</button>
|
||||
<button type="button" class="btn btn-comment btn-comment-huge confirm-button" data-dismiss="modal" aria-label="{l s='Yes' d='Modules.Productcomments.Shop'}">
|
||||
{l s='Yes' d='Modules.Productcomments.Shop'}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,35 @@
|
||||
{**
|
||||
* Copyright since 2007 PrestaShop SA and Contributors
|
||||
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
|
||||
* that is bundled with this package in the file LICENSE.md.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/licenses/AFL-3.0
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||
*
|
||||
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
|
||||
*}
|
||||
|
||||
<div id="empty-product-comment" class="product-comment-list-item">
|
||||
{if $post_allowed}
|
||||
<button class="btn btn-comment btn-comment-big post-product-comment">
|
||||
<i class="material-icons shopping-cart">edit</i>
|
||||
{l s='Be the first to write your review' d='Modules.Productcomments.Shop'}
|
||||
</button>
|
||||
{else}
|
||||
{l s='No customer reviews for the moment.' d='Modules.Productcomments.Shop'}
|
||||
{/if}
|
||||
</div>
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright since 2007 PrestaShop SA and Contributors
|
||||
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
|
||||
* that is bundled with this package in the file LICENSE.md.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/licenses/AFL-3.0
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||
*
|
||||
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
|
||||
*/
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../');
|
||||
exit;
|
||||
@@ -0,0 +1,154 @@
|
||||
{**
|
||||
* Copyright since 2007 PrestaShop SA and Contributors
|
||||
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
|
||||
* that is bundled with this package in the file LICENSE.md.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/licenses/AFL-3.0
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||
*
|
||||
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
|
||||
*}
|
||||
|
||||
<script type="text/javascript">
|
||||
var productCommentPostErrorMessage = '{l s='Sorry, your review cannot be posted.' d='Modules.Productcomments.Shop' js=1}';
|
||||
</script>
|
||||
|
||||
<div id="post-product-comment-modal" class="modal fade product-comment-modal" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h2>{l s='Write your review' d='Modules.Productcomments.Shop'}</h2>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form id="post-product-comment-form" action="{$post_comment_url nofilter}" method="POST">
|
||||
<div class="row">
|
||||
<div class="col-md-2 col-sm-2">
|
||||
{if isset($product) && $product}
|
||||
{block name='product_flags'}
|
||||
<ul class="product-flags">
|
||||
{foreach from=$product.flags item=flag}
|
||||
<li class="product-flag {$flag.type}">{$flag.label}</li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
{/block}
|
||||
|
||||
{block name='product_cover'}
|
||||
<div class="product-cover">
|
||||
{if $product.cover}
|
||||
<img class="js-qv-product-cover" src="{$product.cover.bySize.medium_default.url}" alt="{$product.cover.legend}" title="{$product.cover.legend}" style="width:100%;" itemprop="image">
|
||||
{else}
|
||||
<img src="{$urls.no_picture_image.bySize.large_default.url nofilter}" style="width:100%;">
|
||||
{/if}
|
||||
</div>
|
||||
{/block}
|
||||
{/if}
|
||||
</div>
|
||||
<div class="col-md-4 col-sm-4">
|
||||
<h3>{$product.name}</h3>
|
||||
{block name='product_description_short'}
|
||||
<div itemprop="description">{$product.description_short nofilter}</div>
|
||||
{/block}
|
||||
</div>
|
||||
<div class="col-md-6 col-sm-6">
|
||||
{if $criterions|@count > 0}
|
||||
<ul id="criterions_list">
|
||||
{foreach from=$criterions item='criterion'}
|
||||
<li>
|
||||
<div class="criterion-rating">
|
||||
<label>{$criterion.name|escape:'html':'UTF-8'}:</label>
|
||||
<div
|
||||
class="grade-stars"
|
||||
data-grade="3"
|
||||
data-input="criterion[{$criterion.id_product_comment_criterion}]">
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
{if !$logged}
|
||||
<div class="col-md-8 col-sm-8">
|
||||
<label class="form-label" for="comment_title">{l s='Title' d='Modules.Productcomments.Shop'}<sup class="required">*</sup></label>
|
||||
<input name="comment_title" type="text" value=""/>
|
||||
</div>
|
||||
<div class="col-md-4 col-sm-4">
|
||||
<label class="form-label" for="customer_name">{l s='Your name' d='Modules.Productcomments.Shop'}<sup class="required">*</sup></label>
|
||||
<input name="customer_name" type="text" value=""/>
|
||||
</div>
|
||||
{else}
|
||||
<div class="col-md-12 col-sm-12">
|
||||
<label class="form-label" for="comment_title">{l s='Title' d='Modules.Productcomments.Shop'}<sup class="required">*</sup></label>
|
||||
<input name="comment_title" type="text" value=""/>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-sm-12">
|
||||
<label class="form-label" for="comment_content">{l s='Review' d='Modules.Productcomments.Shop'}<sup class="required">*</sup></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-sm-12">
|
||||
<textarea name="comment_content"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6 col-sm-6">
|
||||
<p class="required"><sup>*</sup> {l s='Required fields' d='Modules.Productcomments.Shop'}</p>
|
||||
</div>
|
||||
<div class="col-md-6 col-sm-6 post-comment-buttons">
|
||||
<button type="button" class="btn btn-comment-inverse btn-comment-big" data-dismiss="modal" aria-label="{l s='Cancel' d='Modules.Productcomments.Shop'}">
|
||||
{l s='Cancel' d='Modules.Productcomments.Shop'}
|
||||
</button>
|
||||
<button type="submit" class="btn btn-comment btn-comment-big">
|
||||
{l s='Send' d='Modules.Productcomments.Shop'}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{* Comment posted modal *}
|
||||
{if $moderation_active}
|
||||
{assign var='comment_posted_message' value={l s='Your comment has been submitted and will be available once approved by a moderator.' d='Modules.Productcomments.Shop'}}
|
||||
{else}
|
||||
{assign var='comment_posted_message' value={l s='Your comment has been added!' d='Modules.Productcomments.Shop'}}
|
||||
{/if}
|
||||
{include file='module:productcomments/views/templates/hook/alert-modal.tpl'
|
||||
modal_id='product-comment-posted-modal'
|
||||
modal_title={l s='Review sent' d='Modules.Productcomments.Shop'}
|
||||
modal_message=$comment_posted_message
|
||||
}
|
||||
|
||||
{* Comment post error modal *}
|
||||
{include file='module:productcomments/views/templates/hook/alert-modal.tpl'
|
||||
modal_id='product-comment-post-error'
|
||||
modal_title={l s='Your review cannot be sent' d='Modules.Productcomments.Shop'}
|
||||
icon='error'
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
{**
|
||||
* Copyright since 2007 PrestaShop SA and Contributors
|
||||
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
|
||||
* that is bundled with this package in the file LICENSE.md.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/licenses/AFL-3.0
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||
*
|
||||
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
|
||||
*}
|
||||
|
||||
{if $nb_comments != 0}
|
||||
<script type="text/javascript">
|
||||
const $ = jQuery;
|
||||
$('#product-quickview-{$product.id}').insertAfter($('.quickview #product-description-short'));
|
||||
$('#product-quickview-{$product.id} .grade-stars').rating({ grade: {$average_grade} });
|
||||
$('#product-quickview-{$product.id} .comments-nb').html('({$nb_comments})');
|
||||
</script>
|
||||
|
||||
<div id="product-quickview-{$product.id}" class="product-quickview-review">
|
||||
<div class="grade-stars"></div>
|
||||
<div class="comments-nb"></div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
@@ -0,0 +1,41 @@
|
||||
{**
|
||||
* Copyright since 2007 PrestaShop SA and Contributors
|
||||
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
|
||||
* that is bundled with this package in the file LICENSE.md.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/licenses/AFL-3.0
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||
*
|
||||
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
|
||||
*}
|
||||
|
||||
{if $nb_comments != 0 || $post_allowed}
|
||||
<div class="product-comments-additional-info">
|
||||
|
||||
{include file='module:productcomments/views/templates/hook/average-grade-stars.tpl' grade=$average_grade}
|
||||
|
||||
<a class="nb-comments noeffect goreviews" href="#tabsection"><span itemprop="reviewCount">{$nb_comments}</span> {if isset($nb_comments) && $nb_comments == 1}{l s='Review'}{else}{l s='Reviews'}{/if}</a>
|
||||
|
||||
|
||||
{* Rich snippet rating*}
|
||||
<div itemprop="aggregateRating" itemtype="http://schema.org/AggregateRating" itemscope>
|
||||
<meta itemprop="reviewCount" content="{$nb_comments}" />
|
||||
<meta itemprop="ratingValue" content="{$average_grade}" />
|
||||
</div>
|
||||
|
||||
</div>
|
||||
{/if}
|
||||
@@ -0,0 +1,56 @@
|
||||
{**
|
||||
* Copyright since 2007 PrestaShop SA and Contributors
|
||||
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
|
||||
* that is bundled with this package in the file LICENSE.md.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/licenses/AFL-3.0
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||
*
|
||||
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
|
||||
*}
|
||||
|
||||
<div class="product-comment-list-item row" data-product-comment-id="@COMMENT_ID@" data-product-id="@PRODUCT_ID@">
|
||||
<div class="col-md-2 col-sm-2 comment-infos">
|
||||
<div class="grade-stars"></div>
|
||||
<div class="comment-author">
|
||||
{l s='%1$s' sprintf=['@CUSTOMER_NAME@'] d='Modules.Productcomments.Shop'}
|
||||
</div>
|
||||
<div class="comment-date">
|
||||
@COMMENT_DATE@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-10 col-sm-10 comment-content">
|
||||
<h4>@COMMENT_TITLE@</h4>
|
||||
<p>@COMMENT_COMMENT@</p>
|
||||
<div class="comment-buttons btn-group">
|
||||
{if $usefulness_enabled}
|
||||
<a class="useful-review">
|
||||
<i class="material-icons thumb_up">thumb_up</i>
|
||||
<span class="useful-review-value">@COMMENT_USEFUL_ADVICES@</span>
|
||||
</a>
|
||||
<a class="not-useful-review">
|
||||
<i class="material-icons thumb_down">thumb_down</i>
|
||||
<span class="not-useful-review-value">@COMMENT_NOT_USEFUL_ADVICES@</span>
|
||||
</a>
|
||||
{/if}
|
||||
<a class="report-abuse" title="{l s='Report abuse' d='Modules.Productcomments.Shop'}">
|
||||
<i class="material-icons outlined_flag">flag</i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,96 @@
|
||||
{**
|
||||
* Copyright since 2007 PrestaShop SA and Contributors
|
||||
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
|
||||
* that is bundled with this package in the file LICENSE.md.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/licenses/AFL-3.0
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||
*
|
||||
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
|
||||
*}
|
||||
<script type="text/javascript">
|
||||
var productCommentUpdatePostErrorMessage = '{l|escape:'javascript' s='Sorry, your review appreciation cannot be sent.' d='Modules.Productcomments.Shop'}';
|
||||
var productCommentAbuseReportErrorMessage = '{l|escape:'javascript' s='Sorry, your abuse report cannot be sent.' d='Modules.Productcomments.Shop'}';
|
||||
</script>
|
||||
|
||||
|
||||
<div class="reviews-list-title">
|
||||
<h3>{l s='Product Comments' d='Modules.Productcomments.Shop'}</h3>
|
||||
</div>
|
||||
{if $nb_comments != 0}
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-sm-12" id="product-comments-list-header">
|
||||
<div class="comments-nb">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-message-square"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"></path></svg>
|
||||
{l s='Comments' d='Modules.Productcomments.Shop'} ({$nb_comments})
|
||||
</div>
|
||||
{include file='module:productcomments/views/templates/hook/average-grade-stars.tpl' grade=$average_grade}
|
||||
</div>
|
||||
</div>
|
||||
{/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'}
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-sm-12"
|
||||
id="product-comments-list"
|
||||
data-list-comments-url="{$list_comments_url nofilter}"
|
||||
data-update-comment-usefulness-url="{$update_comment_usefulness_url nofilter}"
|
||||
data-report-comment-url="{$report_comment_url nofilter}"
|
||||
data-comment-item-prototype="{$comment_prototype|escape:'html_attr'}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-sm-12" id="product-comments-list-footer">
|
||||
<div id="product-comments-list-pagination"></div>
|
||||
{if $post_allowed && $nb_comments != 0}
|
||||
<button class="btn btn-comment btn-comment-big post-product-comment">
|
||||
<i class="material-icons shopping-cart">edit</i>
|
||||
{l s='Write your review' d='Modules.Productcomments.Shop'}
|
||||
</button>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{* Appreciation post error modal *}
|
||||
{include file='module:productcomments/views/templates/hook/alert-modal.tpl'
|
||||
modal_id='update-comment-usefulness-post-error'
|
||||
modal_title={l s='Your review appreciation cannot be sent' d='Modules.Productcomments.Shop'}
|
||||
icon='error'
|
||||
}
|
||||
|
||||
{* Confirm report modal *}
|
||||
{include file='module:productcomments/views/templates/hook/confirm-modal.tpl'
|
||||
modal_id='report-comment-confirmation'
|
||||
modal_title={l s='Report comment' d='Modules.Productcomments.Shop'}
|
||||
modal_message={l s='Are you sure that you want to report this comment?' d='Modules.Productcomments.Shop'}
|
||||
icon='feedback'
|
||||
}
|
||||
|
||||
{* Report comment posted modal *}
|
||||
{include file='module:productcomments/views/templates/hook/alert-modal.tpl'
|
||||
modal_id='report-comment-posted'
|
||||
modal_title={l s='Report sent' d='Modules.Productcomments.Shop'}
|
||||
modal_message={l s='Your report has been submitted and will be considered by a moderator.' d='Modules.Productcomments.Shop'}
|
||||
}
|
||||
|
||||
{* Report abuse error modal *}
|
||||
{include file='module:productcomments/views/templates/hook/alert-modal.tpl'
|
||||
modal_id='report-comment-post-error'
|
||||
modal_title={l s='Your report cannot be sent' d='Modules.Productcomments.Shop'}
|
||||
icon='error'
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
{**
|
||||
* Copyright since 2007 PrestaShop SA and Contributors
|
||||
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
|
||||
* that is bundled with this package in the file LICENSE.md.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/licenses/AFL-3.0
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||
*
|
||||
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
|
||||
*}
|
||||
|
||||
{* Javascript is used to display each product grade, this allows every rating to be udpated as soon as they change *}
|
||||
|
||||
|
||||
{if $nb_comments != 0}
|
||||
|
||||
<div class="product-list-reviews" data-id="{$product.id}" data-url="{$product_comment_grade_url nofilter}">
|
||||
<div class="grade-stars small-stars"></div>
|
||||
<div class="comments-nb"></div>
|
||||
</div>
|
||||
|
||||
{* Rich snippet rating is displayed via php/smarty meaning it will be cached (for example on homepage) *}
|
||||
<div itemprop="aggregateRating" itemtype="http://schema.org/AggregateRating" itemscope>
|
||||
<meta itemprop="reviewCount" content="{$nb_comments}" />
|
||||
<meta itemprop="ratingValue" content="{$average_grade}" />
|
||||
</div>
|
||||
{/if}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2016 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2016 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
|
||||
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
|
||||
|
||||
header("Cache-Control: no-store, no-cache, must-revalidate");
|
||||
header("Cache-Control: post-check=0, pre-check=0", false);
|
||||
header("Pragma: no-cache");
|
||||
|
||||
header("Location: ../");
|
||||
exit;
|
||||
Reference in New Issue
Block a user