mirror of
https://github.com/openclassify/openclassify.git
synced 2026-04-17 20:52:12 -05:00
4.0-mostafa
This commit is contained in:
parent
ceb907312c
commit
4eac3243b8
1
.gitignore
vendored
1
.gitignore
vendored
@ -11,7 +11,6 @@
|
||||
composer.lock
|
||||
package-lock.json
|
||||
|
||||
|
||||
* text=auto
|
||||
|
||||
*.txt text eol=lf
|
||||
|
||||
@ -1 +0,0 @@
|
||||
Subproject commit b40188d9be235e30859fc341e48aa3775d7860d9
|
||||
@ -1 +1 @@
|
||||
Subproject commit ee8c36d5613aae65e0edbcf8b5678077076c5e78
|
||||
Subproject commit 19802f55e0c553aab0ac197d0935fd898dcac67f
|
||||
10
addons/default/visiosoft/comments-module/.gitignore
vendored
Normal file
10
addons/default/visiosoft/comments-module/.gitignore
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
.coverage
|
||||
composer.lock
|
||||
npm-debug.log
|
||||
mix-manifest.json
|
||||
package-lock.json
|
||||
/bin
|
||||
/build
|
||||
/vendor
|
||||
/coverage
|
||||
/node_modules
|
||||
10
addons/default/visiosoft/comments-module/composer.json
Normal file
10
addons/default/visiosoft/comments-module/composer.json
Normal file
@ -0,0 +1,10 @@
|
||||
{
|
||||
"name": "visiosoft/comments-module",
|
||||
"type": "streams-addon",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Visiosoft\\CommentsModule\\": "src/"
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
3
addons/default/visiosoft/comments-module/crowdin.yml
Normal file
3
addons/default/visiosoft/comments-module/crowdin.yml
Normal file
@ -0,0 +1,3 @@
|
||||
files:
|
||||
- source: /resources/lang/en/*.php
|
||||
translation: /resources/lang/%two_letters_code%/%original_file_name%
|
||||
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
use Anomaly\Streams\Platform\Database\Migration\Migration;
|
||||
use Visiosoft\AdvsModule\Adv\AdvModel;
|
||||
|
||||
class VisiosoftModuleCommentsCreateCommentsFields extends Migration
|
||||
{
|
||||
|
||||
/**
|
||||
* The addon fields.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $fields = [
|
||||
'entry' => 'anomaly.field_type.polymorphic',
|
||||
'username' => 'anomaly.field_type.text',
|
||||
'title' => 'anomaly.field_type.text',
|
||||
'rating' => 'anomaly.field_type.integer',
|
||||
'detail' => [
|
||||
"type" => "anomaly.field_type.textarea",
|
||||
"config" => [
|
||||
"rows" => 6
|
||||
]
|
||||
],
|
||||
'status' => [
|
||||
'type' => 'anomaly.field_type.boolean',
|
||||
'config' => [
|
||||
'default_value' => 0,
|
||||
]
|
||||
]
|
||||
];
|
||||
|
||||
}
|
||||
@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
use Anomaly\Streams\Platform\Database\Migration\Migration;
|
||||
|
||||
class VisiosoftModuleCommentsCreateCommentsStream extends Migration
|
||||
{
|
||||
|
||||
/**
|
||||
* This migration creates the stream.
|
||||
* It should be deleted on rollback.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $delete = true;
|
||||
|
||||
/**
|
||||
* The stream definition.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $stream = [
|
||||
'slug' => 'comments',
|
||||
'title_column' => 'username',
|
||||
'translatable' => false,
|
||||
'versionable' => false,
|
||||
'trashable' => false,
|
||||
'searchable' => false,
|
||||
'sortable' => false,
|
||||
];
|
||||
|
||||
/**
|
||||
* The stream assignments.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $assignments = [
|
||||
'entry',
|
||||
'username',
|
||||
'title',
|
||||
'detail',
|
||||
'rating',
|
||||
'status'
|
||||
];
|
||||
|
||||
}
|
||||
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'comments' => [
|
||||
'read',
|
||||
'write',
|
||||
'delete',
|
||||
],
|
||||
];
|
||||
@ -0,0 +1 @@
|
||||
.jq-ry-container{position:relative;padding:0 5px;line-height:0;display:block;cursor:pointer;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;direction:ltr}.jq-ry-container[readonly=readonly]{cursor:default}.jq-ry-container>.jq-ry-group-wrapper{position:relative;width:100%}.jq-ry-container>.jq-ry-group-wrapper>.jq-ry-group{position:relative;line-height:0;z-index:10;white-space:nowrap}.jq-ry-container>.jq-ry-group-wrapper>.jq-ry-group>svg{display:inline-block}.jq-ry-container>.jq-ry-group-wrapper>.jq-ry-group.jq-ry-normal-group{width:100%}.jq-ry-container>.jq-ry-group-wrapper>.jq-ry-group.jq-ry-rated-group{width:0;z-index:11;position:absolute;top:0;left:0;overflow:hidden}
|
||||
@ -0,0 +1,2 @@
|
||||
<?xml version="1.0"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svgjs="http://svgjs.com/svgjs" version="1.1" width="21" height="21" x="0" y="0" viewBox="0 0 511.096 511.096" style="enable-background:new 0 0 512 512" xml:space="preserve" class=""><g><g xmlns="http://www.w3.org/2000/svg" id="Speech_Bubble_48_"><g><path d="m74.414 480.548h-36.214l25.607-25.607c13.807-13.807 22.429-31.765 24.747-51.246-59.127-38.802-88.554-95.014-88.554-153.944 0-108.719 99.923-219.203 256.414-219.203 165.785 0 254.682 101.666 254.682 209.678 0 108.724-89.836 210.322-254.682 210.322-28.877 0-59.01-3.855-85.913-10.928-25.467 26.121-59.973 40.928-96.087 40.928z" fill="#5c6c76" data-original="#000000" style="" class=""/></g></g></g></svg>
|
||||
|
After Width: | Height: | Size: 772 B |
@ -0,0 +1,39 @@
|
||||
$(document).ready( function () {
|
||||
$('#topProductReport').DataTable({
|
||||
ajax: {
|
||||
url: '/admin/api/comments/report/product',
|
||||
dataSrc( json ) {
|
||||
json.recordsTotal = json.total;
|
||||
json.recordsFiltered = json.total;
|
||||
|
||||
return json.data;
|
||||
}
|
||||
},
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
order: [[ 1, "desc" ]],
|
||||
columns: [
|
||||
{ data: 'name', defaultContent: topProductReportTrans.unspecified_product },
|
||||
{ data: 'rate' },
|
||||
],
|
||||
});
|
||||
|
||||
$('#mostCommentReport').DataTable({
|
||||
ajax: {
|
||||
url: '/admin/api/comments/report/comment',
|
||||
dataSrc( json ) {
|
||||
json.recordsTotal = json.total;
|
||||
json.recordsFiltered = json.total;
|
||||
|
||||
return json.data;
|
||||
}
|
||||
},
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
order: [[ 1, "desc" ]],
|
||||
columns: [
|
||||
{ data: 'name', defaultContent: topProductReportTrans.unspecified_product },
|
||||
{ data: 'count' },
|
||||
],
|
||||
});
|
||||
} );
|
||||
@ -0,0 +1,22 @@
|
||||
$(function () {
|
||||
$('form.commentformajax').on('submit', function (e) {
|
||||
e.preventDefault();
|
||||
$.post($(this).attr('action'), $(this).serializeArray(), function (data) {
|
||||
|
||||
if (!data.status) {
|
||||
$('.comment-messages')
|
||||
.addClass('alert-danger')
|
||||
.removeClass('hidden')
|
||||
.find('.error')
|
||||
.removeClass('hidden');
|
||||
} else {
|
||||
$('.comment-messages')
|
||||
.addClass('alert-success')
|
||||
.removeClass('hidden')
|
||||
.find('.success')
|
||||
.removeClass('hidden');
|
||||
}
|
||||
$('.commentformajax').trigger("reset");
|
||||
});
|
||||
});
|
||||
})
|
||||
4
addons/default/visiosoft/comments-module/resources/js/rateyo.min.js
vendored
Normal file
4
addons/default/visiosoft/comments-module/resources/js/rateyo.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
@ -0,0 +1,37 @@
|
||||
var rate = $('input[name="showRate"]');
|
||||
|
||||
$("#rating").rateYo({
|
||||
numStars: 5,
|
||||
starWidth: "12px",
|
||||
precision: 0,
|
||||
rating: "100%",
|
||||
spacing: "3px",
|
||||
|
||||
onSet: function (rating) {
|
||||
$('input[name="rating"]').val(rating)
|
||||
}
|
||||
});
|
||||
|
||||
rate.each((key, val)=>{
|
||||
let item = $('#' + val.id)
|
||||
|
||||
$(".showRate-" + item.data('id')).rateYo({
|
||||
numStars: 5,
|
||||
starWidth: "12px",
|
||||
precision: 0,
|
||||
rating: item.val() + '%',
|
||||
spacing: "3px",
|
||||
readOnly: true,
|
||||
})
|
||||
});
|
||||
|
||||
$(".rating-ads").each(function () {
|
||||
$(this).rateYo({
|
||||
numStars: 5,
|
||||
starWidth: "12px",
|
||||
precision: 0,
|
||||
readOnly: true,
|
||||
rating: $(this).attr('data-ratingVal'),
|
||||
spacing: "3px",
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'title' => 'تعليقات',
|
||||
'name' => 'وحدة التعليقات',
|
||||
'description' => ''
|
||||
];
|
||||
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'new_comment' => 'تعليق جديد',
|
||||
'send_comment' => 'إرسال تعليق',
|
||||
'reset' => 'إعادة ضبط',
|
||||
'revert' => 'يرجع',
|
||||
'approve' => 'يعتمد',
|
||||
];
|
||||
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'comment' => 'تعليقات',
|
||||
'username' => [
|
||||
'name' => 'اسم',
|
||||
],
|
||||
'title' => [
|
||||
'name' => 'عنوان التعليق',
|
||||
],
|
||||
'rating' => [
|
||||
'name' => 'تقييم',
|
||||
],
|
||||
'detail' => [
|
||||
'name' => 'تعليق',
|
||||
],
|
||||
'adv' => [
|
||||
'name' => 'إعلان',
|
||||
],
|
||||
'status' => [
|
||||
'name' => 'حالة',
|
||||
],
|
||||
'ads_review' => 'تقييم المنتج',
|
||||
'ads_comments' => 'تعليقات المنتج',
|
||||
'show_more' => 'أظهر المزيد',
|
||||
'show_less' => 'عرض أقل',
|
||||
'reviewing_comments' => 'تعليقات المستخدم حول المنتج الذي تقوم بمراجعته',
|
||||
'user_rating' => ': عدد المستخدمين <span class="text-secondary">الاستعراضات</span>',
|
||||
'write_comment' => 'اكتب تعليق على الإعلان',
|
||||
|
||||
// Report
|
||||
'top_rated_products_report' => 'تقرير المنتجات الأعلى تقييما',
|
||||
'product' => 'منتج',
|
||||
'rate' => 'معدل',
|
||||
'most_commented_products_report' => 'تقرير المنتجات الأكثر تعليقًا',
|
||||
'comments_count' => 'عدد التعليقات',
|
||||
'unspecified_product' => 'منتج غير محدد',
|
||||
];
|
||||
@ -0,0 +1,6 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'comment_success' => 'تم إرسال تعليقك بنجاح. وهي في طور الموافقة عليها من قبل المحرر.',
|
||||
'comment_error' => 'لم نتمكن من نشر تعليقك بسبب مشكلة فنية. الرجاء معاودة المحاولة في وقت لاحق.',
|
||||
];
|
||||
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'comments' => [
|
||||
'name' => 'تعليقات',
|
||||
'option' => [
|
||||
'read' => 'هل تستطيع قراءة التعليقات؟',
|
||||
'write' => 'هل يمكن إنشاء / تعديل التعليقات؟',
|
||||
'delete' => 'هل يمكن حذف التعليقات؟',
|
||||
],
|
||||
],
|
||||
];
|
||||
@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'comments' => [
|
||||
'title' => 'تعليقات',
|
||||
],
|
||||
];
|
||||
@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'comments' => [
|
||||
'name' => 'تعليقات',
|
||||
],
|
||||
];
|
||||
@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'title' => 'Comments',
|
||||
'name' => 'Comments Module',
|
||||
'description' => ''
|
||||
];
|
||||
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'new_comment' => 'New Comment',
|
||||
'send_comment' => 'Send Comment',
|
||||
'reset' => 'Reset',
|
||||
'revert' => 'Revert',
|
||||
'approve' => 'Approve',
|
||||
];
|
||||
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'comment' => 'Comments',
|
||||
'username' => [
|
||||
'name' => 'Name',
|
||||
],
|
||||
'title' => [
|
||||
'name' => 'Comment Title',
|
||||
],
|
||||
'rating' => [
|
||||
'name' => 'Rating',
|
||||
],
|
||||
'detail' => [
|
||||
'name' => 'Comment',
|
||||
],
|
||||
'adv' => [
|
||||
'name' => 'Ad',
|
||||
],
|
||||
'status' => [
|
||||
'name' => 'Status',
|
||||
],
|
||||
'ads_review' => 'Product Review',
|
||||
'ads_comments' => 'Product Comments',
|
||||
'show_more' => 'Show more',
|
||||
'show_less' => 'Show less',
|
||||
'reviewing_comments' => 'User comments about the product you are reviewing',
|
||||
'user_rating' => ':count user <span class="text-secondary">reviews</span>',
|
||||
'write_comment' => 'Write a comment on the ad',
|
||||
|
||||
// Report
|
||||
'top_rated_products_report' => 'Top Rated Products Report',
|
||||
'product' => 'Product',
|
||||
'rate' => 'Rate',
|
||||
'most_commented_products_report' => 'Most Commented Products Report',
|
||||
'comments_count' => 'Comments Count',
|
||||
'unspecified_product' => 'Unspecified Product',
|
||||
];
|
||||
@ -0,0 +1,6 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'comment_success' => 'Your comment has been successfully sent. It is in the process of approval by the editor.',
|
||||
'comment_error' => 'We were unable to post your comment due to a technical problem. Please try again later.',
|
||||
];
|
||||
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'comments' => [
|
||||
'name' => 'Comments',
|
||||
'option' => [
|
||||
'read' => 'Can read comments?',
|
||||
'write' => 'Can create/edit comments?',
|
||||
'delete' => 'Can delete comments?',
|
||||
],
|
||||
],
|
||||
];
|
||||
@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'comments' => [
|
||||
'title' => 'Comments',
|
||||
],
|
||||
];
|
||||
@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'comments' => [
|
||||
'name' => 'Comments',
|
||||
],
|
||||
];
|
||||
@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'title' => 'Komentari',
|
||||
'name' => 'Modul komentara',
|
||||
'description' => ''
|
||||
];
|
||||
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'new_comment' => 'Novi komentar',
|
||||
'send_comment' => 'Pošaljite komentar',
|
||||
'reset' => 'Resetiraj',
|
||||
'revert' => 'Vrati',
|
||||
'approve' => 'Odobriti',
|
||||
];
|
||||
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'comment' => 'Komentari',
|
||||
'username' => [
|
||||
'name' => 'Ime',
|
||||
],
|
||||
'title' => [
|
||||
'name' => 'Naslov komentara',
|
||||
],
|
||||
'rating' => [
|
||||
'name' => 'Ocjena',
|
||||
],
|
||||
'detail' => [
|
||||
'name' => 'Komentar',
|
||||
],
|
||||
'adv' => [
|
||||
'name' => 'Oglas',
|
||||
],
|
||||
'status' => [
|
||||
'name' => 'Status',
|
||||
],
|
||||
'ads_review' => 'Pregled proizvoda',
|
||||
'ads_comments' => 'Komentari proizvoda',
|
||||
'show_more' => 'Prikaži više',
|
||||
'show_less' => 'Prikaži manje',
|
||||
'reviewing_comments' => 'Komentari korisnika o proizvodu koji recenzirate',
|
||||
'user_rating' => ':count user <span class="text-secondary">recenzija</span>',
|
||||
'write_comment' => 'Napišite komentar na oglas',
|
||||
|
||||
// Report
|
||||
'top_rated_products_report' => 'Izvješće o najbolje ocijenjenim proizvodima',
|
||||
'product' => 'Proizvod',
|
||||
'rate' => 'Stopa',
|
||||
'most_commented_products_report' => 'Izvješće o proizvodima s najviše komentara',
|
||||
'comments_count' => 'Komentari se broje',
|
||||
'unspecified_product' => 'Nespecificirani proizvod',
|
||||
];
|
||||
@ -0,0 +1,6 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'comment_success' => 'Vaš komentar je uspješno poslan. U postupku je odobrenja urednika.',
|
||||
'comment_error' => 'Nismo uspjeli objaviti vaš komentar zbog tehničkog problema. Molimo pokušajte ponovo kasnije.',
|
||||
];
|
||||
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'comments' => [
|
||||
'name' => 'Komentari',
|
||||
'option' => [
|
||||
'read' => 'Zna li čitati komentare?',
|
||||
'write' => 'Može li stvarati/uređivati komentare?',
|
||||
'delete' => 'Mogu li brisati komentare?',
|
||||
],
|
||||
],
|
||||
];
|
||||
@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'comments' => [
|
||||
'title' => 'Komentari',
|
||||
],
|
||||
];
|
||||
@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'comments' => [
|
||||
'name' => 'Komentari',
|
||||
],
|
||||
];
|
||||
@ -0,0 +1,6 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'title' => 'komentāri',
|
||||
'name' => 'Komentāru modulis',
|
||||
];
|
||||
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'new_comment' => 'Jauns komentārs',
|
||||
'send_comment' => 'Nosūtīt komentāru',
|
||||
'reset' => 'Atiestatīt',
|
||||
'revert' => 'Atgriezties',
|
||||
'approve' => 'Apstiprināt',
|
||||
];
|
||||
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'comment' => 'komentāri',
|
||||
'username' => [
|
||||
'name' => 'Vārds',
|
||||
],
|
||||
'title' => [
|
||||
'name' => 'Komentāra virsraksts',
|
||||
],
|
||||
'rating' => [
|
||||
'name' => 'Vērtējums',
|
||||
],
|
||||
'detail' => [
|
||||
'name' => 'komentēt',
|
||||
],
|
||||
'adv' => [
|
||||
'name' => 'Reklāma',
|
||||
],
|
||||
'status' => [
|
||||
'name' => 'Statuss',
|
||||
],
|
||||
'ads_review' => 'Produkta apskats',
|
||||
'ads_comments' => 'Produktu komentāri',
|
||||
'show_more' => 'Parādīt vairāk',
|
||||
'show_less' => 'Rādīt mazāk',
|
||||
'reviewing_comments' => 'Lietotāju komentāri par produktu, kuru apskatāt',
|
||||
'user_rating' => ':skaitiet lietotāju <span class="text-secondary">atsauksmes</span>',
|
||||
'write_comment' => 'Rakstiet komentāru par sludinājumu',
|
||||
'top_rated_products_report' => 'Pārskats par visaugstāk novērtētajiem produktiem',
|
||||
'product' => 'Produkts',
|
||||
'rate' => 'Likme',
|
||||
'most_commented_products_report' => 'Pārskats par visvairāk komentētajiem produktiem',
|
||||
'comments_count' => 'Komentāri Skaits',
|
||||
'unspecified_product' => 'Nenoteikts produkts',
|
||||
];
|
||||
@ -0,0 +1,6 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'comment_success' => 'Jūsu komentārs ir veiksmīgi nosūtīts. To apstiprina redaktors.',
|
||||
'comment_error' => 'Mēs nevarējām publicēt jūsu komentāru tehniskas problēmas dēļ. Lūdzu, pamēģiniet vēlreiz vēlāk.',
|
||||
];
|
||||
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'comments' => [
|
||||
'name' => 'komentāri',
|
||||
'option' => [
|
||||
'read' => 'Vai varat lasīt komentārus?',
|
||||
'write' => 'Vai var izveidot/rediģēt komentārus?',
|
||||
'delete' => 'Vai var izdzēst komentārus?',
|
||||
],
|
||||
],
|
||||
];
|
||||
@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'comments' => [
|
||||
'title' => 'komentāri',
|
||||
],
|
||||
];
|
||||
@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'comments' => [
|
||||
'name' => 'komentāri',
|
||||
],
|
||||
];
|
||||
@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'title' => 'Comments',
|
||||
'name' => 'Comments Module',
|
||||
'description' => ''
|
||||
];
|
||||
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'new_comment' => 'New Comment',
|
||||
'send_comment' => 'Send Comment',
|
||||
'reset' => 'Reset',
|
||||
'revert' => 'Revert',
|
||||
'approve' => 'Approve',
|
||||
];
|
||||
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'comment' => 'Comments',
|
||||
'username' => [
|
||||
'name' => 'Name',
|
||||
],
|
||||
'title' => [
|
||||
'name' => 'Comment Title',
|
||||
],
|
||||
'rating' => [
|
||||
'name' => 'Rating',
|
||||
],
|
||||
'detail' => [
|
||||
'name' => 'Comment',
|
||||
],
|
||||
'adv' => [
|
||||
'name' => 'Ad',
|
||||
],
|
||||
'status' => [
|
||||
'name' => 'Status',
|
||||
],
|
||||
'ads_review' => 'Product Review',
|
||||
'ads_comments' => 'Product Comments',
|
||||
'show_more' => 'Show more',
|
||||
'show_less' => 'Show less',
|
||||
'reviewing_comments' => 'User comments about the product you are reviewing',
|
||||
'user_rating' => ':count user <span class="text-secondary">reviews</span>',
|
||||
'write_comment' => 'Write a comment on the ad',
|
||||
|
||||
// Report
|
||||
'top_rated_products_report' => 'Top Rated Products Report',
|
||||
'product' => 'Product',
|
||||
'rate' => 'Rate',
|
||||
'most_commented_products_report' => 'Most Commented Products Report',
|
||||
'comments_count' => 'Comments Count',
|
||||
'unspecified_product' => 'Unspecified Product',
|
||||
];
|
||||
@ -0,0 +1,6 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'comment_success' => 'Your comment has been successfully sent. It is in the process of approval by the editor.',
|
||||
'comment_error' => 'We were unable to post your comment due to a technical problem. Please try again later.',
|
||||
];
|
||||
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'comments' => [
|
||||
'name' => 'Comments',
|
||||
'option' => [
|
||||
'read' => 'Can read comments?',
|
||||
'write' => 'Can create/edit comments?',
|
||||
'delete' => 'Can delete comments?',
|
||||
],
|
||||
],
|
||||
];
|
||||
@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'comments' => [
|
||||
'title' => 'Comments',
|
||||
],
|
||||
];
|
||||
@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'comments' => [
|
||||
'name' => 'Comments',
|
||||
],
|
||||
];
|
||||
@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'title' => 'Комментарии',
|
||||
'name' => 'Модуль комментариев',
|
||||
'description' => ''
|
||||
];
|
||||
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'new_comment' => 'Новый комментарий',
|
||||
'send_comment' => 'Отправить комментарий',
|
||||
'reset' => 'Перезагрузить',
|
||||
'revert' => 'Возвращаться',
|
||||
'approve' => 'Утвердить',
|
||||
];
|
||||
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'comment' => 'Комментарии',
|
||||
'username' => [
|
||||
'name' => 'Имя',
|
||||
],
|
||||
'title' => [
|
||||
'name' => 'Название комментария',
|
||||
],
|
||||
'rating' => [
|
||||
'name' => 'Рейтинг',
|
||||
],
|
||||
'detail' => [
|
||||
'name' => 'Комментарий',
|
||||
],
|
||||
'adv' => [
|
||||
'name' => 'Объявление',
|
||||
],
|
||||
'status' => [
|
||||
'name' => 'Положение дел',
|
||||
],
|
||||
'ads_review' => 'Обзор продукта',
|
||||
'ads_comments' => 'Комментарии к продукту',
|
||||
'show_more' => 'Показать больше',
|
||||
'show_less' => 'Показывай меньше',
|
||||
'reviewing_comments' => 'Комментарии пользователей о продукте, который вы просматриваете',
|
||||
'user_rating' => ':count пользователей <span class="text-secondary">отзывов</span>',
|
||||
'write_comment' => 'Напишите комментарий к объявлению',
|
||||
|
||||
// Report
|
||||
'top_rated_products_report' => 'Отчет о продуктах с самым высоким рейтингом',
|
||||
'product' => 'Продукт',
|
||||
'rate' => 'Ставка',
|
||||
'most_commented_products_report' => 'Отчет о продуктах с наибольшим количеством комментариев',
|
||||
'comments_count' => 'Количество комментариев',
|
||||
'unspecified_product' => 'Неуказанный продукт',
|
||||
];
|
||||
@ -0,0 +1,6 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'comment_success' => 'Ваш комментарий успешно отправлен. Он находится на согласовании с редактором.',
|
||||
'comment_error' => 'Мы не смогли опубликовать ваш комментарий по техническим причинам. Пожалуйста, повторите попытку позже.',
|
||||
];
|
||||
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'comments' => [
|
||||
'name' => 'Комментарии',
|
||||
'option' => [
|
||||
'read' => 'Может читать комментарии?',
|
||||
'write' => 'Может создавать/редактировать комментарии?',
|
||||
'delete' => 'Может удалять комментарии?',
|
||||
],
|
||||
],
|
||||
];
|
||||
@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'comments' => [
|
||||
'title' => 'Комментарии',
|
||||
],
|
||||
];
|
||||
@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'comments' => [
|
||||
'name' => 'Комментарии',
|
||||
],
|
||||
];
|
||||
@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'title' => 'Comments',
|
||||
'name' => 'Comments Module',
|
||||
'description' => ''
|
||||
];
|
||||
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'new_comment' => 'New Comment',
|
||||
'send_comment' => 'Send Comment',
|
||||
'reset' => 'Reset',
|
||||
'revert' => 'Revert',
|
||||
'approve' => 'Approve',
|
||||
];
|
||||
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'comment' => 'Comments',
|
||||
'username' => [
|
||||
'name' => 'Name',
|
||||
],
|
||||
'title' => [
|
||||
'name' => 'Comment Title',
|
||||
],
|
||||
'rating' => [
|
||||
'name' => 'Rating',
|
||||
],
|
||||
'detail' => [
|
||||
'name' => 'Comment',
|
||||
],
|
||||
'adv' => [
|
||||
'name' => 'Ad',
|
||||
],
|
||||
'status' => [
|
||||
'name' => 'Status',
|
||||
],
|
||||
'ads_review' => 'Product Review',
|
||||
'ads_comments' => 'Product Comments',
|
||||
'show_more' => 'Show more',
|
||||
'show_less' => 'Show less',
|
||||
'reviewing_comments' => 'User comments about the product you are reviewing',
|
||||
'user_rating' => ':count user <span class="text-secondary">reviews</span>',
|
||||
'write_comment' => 'Write a comment on the ad',
|
||||
|
||||
// Report
|
||||
'top_rated_products_report' => 'Top Rated Products Report',
|
||||
'product' => 'Product',
|
||||
'rate' => 'Rate',
|
||||
'most_commented_products_report' => 'Most Commented Products Report',
|
||||
'comments_count' => 'Comments Count',
|
||||
'unspecified_product' => 'Unspecified Product',
|
||||
];
|
||||
@ -0,0 +1,6 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'comment_success' => 'Your comment has been successfully sent. It is in the process of approval by the editor.',
|
||||
'comment_error' => 'We were unable to post your comment due to a technical problem. Please try again later.',
|
||||
];
|
||||
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'comments' => [
|
||||
'name' => 'Comments',
|
||||
'option' => [
|
||||
'read' => 'Can read comments?',
|
||||
'write' => 'Can create/edit comments?',
|
||||
'delete' => 'Can delete comments?',
|
||||
],
|
||||
],
|
||||
];
|
||||
@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'comments' => [
|
||||
'title' => 'Comments',
|
||||
],
|
||||
];
|
||||
@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'comments' => [
|
||||
'name' => 'Comments',
|
||||
],
|
||||
];
|
||||
@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'title' => 'Comments',
|
||||
'name' => 'Comments Module',
|
||||
'description' => ''
|
||||
];
|
||||
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'new_comment' => 'New Comment',
|
||||
'send_comment' => 'Send Comment',
|
||||
'reset' => 'Reset',
|
||||
'revert' => 'Revert',
|
||||
'approve' => 'Approve',
|
||||
];
|
||||
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'comment' => 'Comments',
|
||||
'username' => [
|
||||
'name' => 'Name',
|
||||
],
|
||||
'title' => [
|
||||
'name' => 'Comment Title',
|
||||
],
|
||||
'rating' => [
|
||||
'name' => 'Rating',
|
||||
],
|
||||
'detail' => [
|
||||
'name' => 'Comment',
|
||||
],
|
||||
'adv' => [
|
||||
'name' => 'Ad',
|
||||
],
|
||||
'status' => [
|
||||
'name' => 'Status',
|
||||
],
|
||||
'ads_review' => 'Product Review',
|
||||
'ads_comments' => 'Product Comments',
|
||||
'show_more' => 'Show more',
|
||||
'show_less' => 'Show less',
|
||||
'reviewing_comments' => 'User comments about the product you are reviewing',
|
||||
'user_rating' => ':count user <span class="text-secondary">reviews</span>',
|
||||
'write_comment' => 'Write a comment on the ad',
|
||||
|
||||
// Report
|
||||
'top_rated_products_report' => 'Top Rated Products Report',
|
||||
'product' => 'Product',
|
||||
'rate' => 'Rate',
|
||||
'most_commented_products_report' => 'Most Commented Products Report',
|
||||
'comments_count' => 'Comments Count',
|
||||
'unspecified_product' => 'Unspecified Product',
|
||||
];
|
||||
@ -0,0 +1,6 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'comment_success' => 'Your comment has been successfully sent. It is in the process of approval by the editor.',
|
||||
'comment_error' => 'We were unable to post your comment due to a technical problem. Please try again later.',
|
||||
];
|
||||
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'comments' => [
|
||||
'name' => 'Comments',
|
||||
'option' => [
|
||||
'read' => 'Can read comments?',
|
||||
'write' => 'Can create/edit comments?',
|
||||
'delete' => 'Can delete comments?',
|
||||
],
|
||||
],
|
||||
];
|
||||
@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'comments' => [
|
||||
'title' => 'Comments',
|
||||
],
|
||||
];
|
||||
@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'comments' => [
|
||||
'name' => 'Comments',
|
||||
],
|
||||
];
|
||||
@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'title' => 'Yorumlar',
|
||||
'name' => 'Yorumlar Modülü',
|
||||
'description' => ''
|
||||
];
|
||||
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'new_comment' => 'Yeni yorum',
|
||||
'send_comment' => 'Yorumu Gönder',
|
||||
'reset' => 'Sıfırla',
|
||||
'revert' => 'geri al',
|
||||
'approve' => 'onayla',
|
||||
];
|
||||
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'comment' => 'Yorumlar',
|
||||
'username' => [
|
||||
'name' => 'Adınız',
|
||||
],
|
||||
'title' => [
|
||||
'name' => 'Yorum Başlığınız',
|
||||
],
|
||||
'rating' => [
|
||||
'name' => 'Sizin dereceniz',
|
||||
],
|
||||
'detail' => [
|
||||
'name' => 'Yorum Yap',
|
||||
],
|
||||
'adv' => [
|
||||
'name' => 'İlan',
|
||||
],
|
||||
'status' => [
|
||||
'name' => 'Durum',
|
||||
],
|
||||
'ads_review' => 'İlan incelemeleri',
|
||||
'ads_comments' => 'İlan Yorumları',
|
||||
'show_more' => 'Daha fazla göster',
|
||||
'show_less' => 'Daha az göster',
|
||||
'reviewing_comments' => 'İncelediğiniz ürünle ilgili kullanıcı yorumları',
|
||||
'user_rating' => ':count kişi <span class="text-secondary">inceleme yaptı</span>',
|
||||
'write_comment' => 'Yorum yazabilirsiniz',
|
||||
];
|
||||
@ -0,0 +1,6 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'comment_success' => 'Yorumunuz başarıyla gönderildi.Editör tarafından onaylama sürecindedir.',
|
||||
'comment_error' => 'Teknik bir problemden dolayı yorumunuzu gönderemedik.Lütfen daha sonra tekrar deneyiniz.',
|
||||
];
|
||||
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'comments' => [
|
||||
'name' => 'Yorumlar',
|
||||
'option' => [
|
||||
'read' => 'Yorum okuyabilir mi? ',
|
||||
'write' => 'Yorumlar oluşturabilir / düzenleyebilir mi? ',
|
||||
'delete' => 'Yorumları silebilir miyim?',
|
||||
],
|
||||
],
|
||||
];
|
||||
@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'comments' => [
|
||||
'title' => 'Yorumlar',
|
||||
],
|
||||
];
|
||||
@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'comments' => [
|
||||
'name' => 'Yorumlar',
|
||||
],
|
||||
];
|
||||
@ -0,0 +1,6 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'title' => 'Коментарі',
|
||||
'name' => 'Модуль коментарів',
|
||||
];
|
||||
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'new_comment' => 'Новий коментар',
|
||||
'send_comment' => 'Надіслати коментар',
|
||||
'reset' => 'Скинути',
|
||||
'revert' => 'Повернути',
|
||||
'approve' => 'Затвердити',
|
||||
];
|
||||
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'comment' => 'Коментарі',
|
||||
'username' => [
|
||||
'name' => 'Ім\'я',
|
||||
],
|
||||
'title' => [
|
||||
'name' => 'Назва коментаря',
|
||||
],
|
||||
'rating' => [
|
||||
'name' => 'Рейтинг',
|
||||
],
|
||||
'detail' => [
|
||||
'name' => 'Коментар',
|
||||
],
|
||||
'adv' => [
|
||||
'name' => 'Реклама',
|
||||
],
|
||||
'status' => [
|
||||
'name' => 'Статус',
|
||||
],
|
||||
'ads_review' => 'Огляд продукту',
|
||||
'ads_comments' => 'Коментарі до продукту',
|
||||
'show_more' => 'Показати більше',
|
||||
'show_less' => 'Показати менше',
|
||||
'reviewing_comments' => 'Коментарі користувачів про продукт, який ви переглядаєте',
|
||||
'user_rating' => ':count <span class="text-secondary">відгуки</span> користувачів',
|
||||
'write_comment' => 'Напишіть коментар до оголошення',
|
||||
'top_rated_products_report' => 'Звіт про найкращі продукти',
|
||||
'product' => 'Продукт',
|
||||
'rate' => 'Оцінити',
|
||||
'most_commented_products_report' => 'Звіт про найбільш коментовані продукти',
|
||||
'comments_count' => 'Кількість коментарів',
|
||||
'unspecified_product' => 'Невизначений продукт',
|
||||
];
|
||||
@ -0,0 +1,6 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'comment_success' => 'Ваш коментар успішно надіслано. Він знаходиться на стадії затвердження редактором.',
|
||||
'comment_error' => 'Ми не змогли опублікувати ваш коментар через технічну проблему. Будь-ласка спробуйте пізніше.',
|
||||
];
|
||||
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'comments' => [
|
||||
'name' => 'Коментарі',
|
||||
'option' => [
|
||||
'read' => 'Можна читати коментарі?',
|
||||
'write' => 'Чи можна створювати/редагувати коментарі?',
|
||||
'delete' => 'Чи можна видалити коментарі?',
|
||||
],
|
||||
],
|
||||
];
|
||||
@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'comments' => [
|
||||
'title' => 'Коментарі',
|
||||
],
|
||||
];
|
||||
@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'comments' => [
|
||||
'name' => 'Коментарі',
|
||||
],
|
||||
];
|
||||
@ -0,0 +1,4 @@
|
||||
<a class="nav-item nav-link bg-secondary text-white" id="nav-comments-tab"
|
||||
data-toggle="tab" href="#nav-comments" role="tab"
|
||||
aria-controls="nav-comments"
|
||||
aria-selected="true">{{ trans('visiosoft.module.comments::addon.title') }}</a>
|
||||
@ -0,0 +1,4 @@
|
||||
<div id="nav-comments" class="tab-pane fade in">
|
||||
{% include "visiosoft.module.comments::comments" %}
|
||||
</div>
|
||||
|
||||
@ -0,0 +1,5 @@
|
||||
{% set comment = getRating(params.entry_type, params.entry.id) %}
|
||||
|
||||
<input type="text" name="showRate" value="{{ comment.rating|length ? comment.rating : 0 }}" hidden>
|
||||
|
||||
<div id="showRate"></div>
|
||||
@ -0,0 +1,13 @@
|
||||
{% set entry_type = get_class(params.adv.getObject()) %}
|
||||
{% set comment = fn('getRating', entry_type, params.adv.id) %}
|
||||
|
||||
<span class="d-flex align-items-center">
|
||||
<input type="text" data-id="{{ params.adv.id }}" id="rate-{{ params.adv.id }}" name="showRate"
|
||||
value="{{ comment.rating|length ? comment.rating : 0 }}" hidden>
|
||||
<div id="showRate-{{ params.adv.id }}" class="showRate p-0"></div>
|
||||
<span class="review-count">({{ comment.count }} {{ trans('visiosoft.module.comments::field.ads_review') }})</span>
|
||||
</span>
|
||||
|
||||
{{ asset_add("scripts.js", "visiosoft.module.comments::js/rateyo.min.js") }}
|
||||
{{ asset_add("scripts.js", "visiosoft.module.comments::js/rateyoVisiosoft.js") }}
|
||||
{{ asset_add("styles.css", "visiosoft.module.comments::css/rateyo.css") }}
|
||||
@ -0,0 +1,48 @@
|
||||
{% set reports = [
|
||||
{
|
||||
'title': trans('visiosoft.module.comments::field.top_rated_products_report'),
|
||||
'id': 'topProductReport',
|
||||
'columns': [
|
||||
trans('visiosoft.module.comments::field.product'),
|
||||
trans('visiosoft.module.comments::field.rate'),
|
||||
],
|
||||
},
|
||||
{
|
||||
'title': trans('visiosoft.module.comments::field.most_commented_products_report'),
|
||||
'id': 'mostCommentReport',
|
||||
'columns': [
|
||||
trans('visiosoft.module.comments::field.product'),
|
||||
trans('visiosoft.module.comments::field.comments_count'),
|
||||
],
|
||||
},
|
||||
] %}
|
||||
|
||||
{% for report in reports %}
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-header bg-success">
|
||||
<h5 class="card-title text-white">{{ report.title }}</h5>
|
||||
</div>
|
||||
|
||||
<div class="card-block">
|
||||
<table id="{{ report.id }}" class="display">
|
||||
<thead>
|
||||
<tr>
|
||||
{% for column in report.columns %}
|
||||
<th>{{ column }}</th>
|
||||
{% endfor %}
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
||||
<script>
|
||||
const topProductReportTrans = {
|
||||
unspecified_product: `{{ trans('visiosoft.module.comments::field.unspecified_product') }}`,
|
||||
};
|
||||
</script>
|
||||
|
||||
{{ asset_add('scripts.js', 'visiosoft.module.comments::js/admin/dashboard/report.js') }}
|
||||
@ -0,0 +1,75 @@
|
||||
<div class="comments text-left">
|
||||
|
||||
<div class="comment-messages alert alert-dismissible hidden">
|
||||
<button type="button" class="close" data-dismiss="alert">
|
||||
<span>×</span>
|
||||
</button>
|
||||
|
||||
<span class="error hidden">{{ trans('visiosoft.module.comments::message.comment_error') }}</span>
|
||||
<span class="success hidden">{{ trans('visiosoft.module.comments::message.comment_success') }}</span>
|
||||
</div>
|
||||
|
||||
|
||||
{% set entry = adv %}
|
||||
{% set entry_type = get_class(entry.getObject()) %}
|
||||
|
||||
{% if app.auth.id %}
|
||||
{% set form = form('comments', 'comments').actions({'save':{}}).url(url_route('comments::save_comment')).get() %}
|
||||
{{ form.open({ 'class': 'commentformajax mb-4'})|raw }}
|
||||
<input type="hidden" name="entry" value="{{ entry.id }}">
|
||||
<input type="hidden" name="entry_type" value="{{ entry_type }}">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<input type="text" name="rating" value="100" hidden>
|
||||
{{ form.fields.rating.label|raw }}
|
||||
|
||||
<div id="rating"></div>
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
{% if auth_check() %}
|
||||
{{ form.fields.username.setValue(auth_user().name()).setAttributes({'required' :true, 'readonly': true})|raw }}
|
||||
{% else %}
|
||||
{{ form.fields.username.setAttributes({'required' :true,})|raw }}
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
{{ form.fields.title.setAttributes({'required' :true,})|raw }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
{{ form.fields.detail.setAttributes({'required' :true,})|raw }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button type="submit" class="btn btn-primary">
|
||||
<i class="fas fa-paper-plane"></i>
|
||||
{{ trans('visiosoft.module.comments::button.send_comment') }}
|
||||
</button>
|
||||
|
||||
{{ form.close|raw }}
|
||||
{% endif %}
|
||||
{% for comment in getComments(entry_type, entry.id) %}
|
||||
<div class="row commentlist my-2 py-2 border bg-white">
|
||||
<div class="col-12 col-sm-3 row m-0 p-0">
|
||||
<div class="col-12">
|
||||
<h6 class="fas fa-hashtag m-0 comment-owner"> {{ comment.created_by.name() }}</h6>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<div class="rating-ads" data-ratingVal="{{ comment.rating }}%"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 col-sm-9 comments speech-bubble">
|
||||
<p class="m-0 comment-title"><b>{{ comment.title }}</b></p>
|
||||
<p class="comment-message">{{ comment.detail }}</p>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
{{ asset_add("scripts.js", "visiosoft.module.comments::js/rateyo.min.js") }}
|
||||
{{ asset_add("scripts.js", "visiosoft.module.comments::js/ajaxcomment.js") }}
|
||||
{{ asset_add("scripts.js", "visiosoft.module.comments::js/rateyoVisiosoft.js") }}
|
||||
{{ asset_add("styles.css", "visiosoft.module.comments::css/rateyo.css") }}
|
||||
{{ asset_add("styles.css", "visiosoft.module.comments::css/style.css") }}
|
||||
@ -0,0 +1,5 @@
|
||||
<div class="nav-item nav-link bg-secondary text-white comment-header card mt-4 mb-5">
|
||||
{{ trans('visiosoft.module.comments::addon.title') }}
|
||||
</div>
|
||||
|
||||
{% include 'visiosoft.module.comments::comments' %}
|
||||
@ -0,0 +1 @@
|
||||
{% include 'visiosoft.module.comments::showrate' %}
|
||||
@ -0,0 +1,8 @@
|
||||
{% set entry_type = get_class(params.adv.getObject()) %}
|
||||
{% set comment = getRating(entry_type, params.adv.id) %}
|
||||
<input type="text" data-id="{{ params.adv.id }}" id="rate-{{ params.adv.id }}" name="showRate" value="{{ comment.rating|length ? comment.rating : 0 }}" hidden>
|
||||
<div id="showRate-{{ params.adv.id }}" class="showRate-{{ params.adv.id }} p-0 {{ params.class }}"></div>
|
||||
|
||||
{{ asset_add("scripts.js", "visiosoft.module.comments::js/rateyo.min.js") }}
|
||||
{{ asset_add("scripts.js", "visiosoft.module.comments::js/rateyoVisiosoft.js") }}
|
||||
{{ asset_add("styles.css", "visiosoft.module.comments::css/rateyo.css") }}
|
||||
@ -0,0 +1,8 @@
|
||||
<div class="store-desc-wrapper mb-5">
|
||||
<div class="store-desc-header d-flex px-4 py-2 border rounded">
|
||||
<img src="{{ img('visiosoft.module.comments::images/comment.svg').path }}"
|
||||
alt="store icon">
|
||||
<p class="ml-2 mb-0">{{ trans('visiosoft.module.comments::field.comment') }}</p>
|
||||
</div>
|
||||
{% include 'visiosoft.module.comments::comments' %}
|
||||
</div>
|
||||
@ -0,0 +1 @@
|
||||
{% include 'visiosoft.module.comments::showrate' %}
|
||||
@ -0,0 +1,26 @@
|
||||
<?php namespace Visiosoft\CommentsModule\Comment\Command;
|
||||
|
||||
use Visiosoft\CommentsModule\Comment\Contract\CommentRepositoryInterface;
|
||||
|
||||
class getComments
|
||||
{
|
||||
|
||||
protected $id;
|
||||
|
||||
protected $entry_type;
|
||||
|
||||
|
||||
public function __construct($entry_type, $id)
|
||||
{
|
||||
$this->id = $id;
|
||||
$this->entry_type = $entry_type;
|
||||
}
|
||||
|
||||
public function handle(CommentRepositoryInterface $groups)
|
||||
{
|
||||
return $groups->newQuery()->where('entry_id', $this->id)
|
||||
->where('status', 1)
|
||||
->where('entry_type', $this->entry_type)
|
||||
->orderByDesc('created_at')->get();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,38 @@
|
||||
<?php namespace Visiosoft\CommentsModule\Comment\Command;
|
||||
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class getEntries
|
||||
{
|
||||
protected $entryType;
|
||||
protected $limit;
|
||||
|
||||
public function __construct($entryType, $limit = 5)
|
||||
{
|
||||
$this->entryType = $entryType;
|
||||
$this->limit = $limit;
|
||||
}
|
||||
|
||||
public function handle()
|
||||
{
|
||||
$entryModel = app($this->entryType);
|
||||
|
||||
$entryType = Str::replace("\\", "\\\\", $this->entryType);
|
||||
$entryTable = "default_{$entryModel->getTable()}";
|
||||
|
||||
$entries = $entryModel
|
||||
->selectRaw("$entryTable.*, (
|
||||
SELECT AVG(rating)
|
||||
FROM default_comments_comments AS comments
|
||||
WHERE comments.entry_id = $entryTable.id
|
||||
AND comments.status = 1
|
||||
AND comments.entry_type = '$entryType'
|
||||
) AS rating")
|
||||
->orderByDesc('rating')
|
||||
->where('status', 'approved')
|
||||
->limit($this->limit)
|
||||
->get();
|
||||
|
||||
return $entries;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,38 @@
|
||||
<?php namespace Visiosoft\CommentsModule\Comment\Command;
|
||||
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Visiosoft\CommentsModule\Comment\Contract\CommentRepositoryInterface;
|
||||
|
||||
class getStoreRateFiltered
|
||||
{
|
||||
protected $query;
|
||||
protected $rate;
|
||||
|
||||
public function __construct($query, $rate)
|
||||
{
|
||||
$this->query = $query;
|
||||
$this->rate = $rate;
|
||||
}
|
||||
|
||||
public function handle(CommentRepositoryInterface $repository)
|
||||
{
|
||||
$star = [
|
||||
1 => [0, 20],
|
||||
2 => [20, 40],
|
||||
3 => [40, 60],
|
||||
4 => [60, 80],
|
||||
5 => [80, 100]
|
||||
];
|
||||
|
||||
$rates = $this->rate;
|
||||
|
||||
$stores = $repository->newQuery()
|
||||
->where('entry_type', 'Visiosoft\StoreModule\Store\StoreModel')
|
||||
->groupBy('entry_id')
|
||||
->select('entry_id', DB::raw('AVG(rating) as rate'))
|
||||
->havingRaw('rate >= ? and rate <= ?', [$star[$rates]])
|
||||
->pluck('entry_id');
|
||||
|
||||
return $this->query->whereIn('store_store.id', $stores);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,8 @@
|
||||
<?php namespace Visiosoft\CommentsModule\Comment;
|
||||
|
||||
use Anomaly\Streams\Platform\Entry\EntryCollection;
|
||||
|
||||
class CommentCollection extends EntryCollection
|
||||
{
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user