This commit is contained in:
lalka2016 2023-08-12 16:49:23 +03:00
parent 331e1cb0d4
commit 22d49a1cb9
3 changed files with 10 additions and 8 deletions

View file

@ -82,20 +82,20 @@
</table>
<script n:if="$canReport ?? false">
function reportComment() {
uReportMsgTxt = "Вы собираетесь пожаловаться на данный комментарий.";
uReportMsgTxt += "<br/>Что именно вам кажется недопустимым в этом материале?";
uReportMsgTxt += "<br/><br/><b>Причина жалобы</b>: <input type='text' id='uReportMsgInput' placeholder='Причина' />"
uReportMsgTxt = tr("going_to_report_comment");
uReportMsgTxt += "<br/>"+tr("report_question_text");
uReportMsgTxt += "<br/><br/><b>"+tr("report_reason")+"</b>: <input type='text' id='uReportMsgInput' placeholder='" + tr("reason") + "' />"
MessageBox("Пожаловаться?", uReportMsgTxt, ["Подтвердить", "Отмена"], [
MessageBox(tr("report_question"), uReportMsgTxt, [tr("confirm_m"), tr("cancel")], [
(function() {
res = document.querySelector("#uReportMsgInput").value;
xhr = new XMLHttpRequest();
xhr.open("GET", "/report/" + {$comment->getId()} + "?reason=" + res + "&type=comment", true);
xhr.onload = (function() {
if(xhr.responseText.indexOf("reason") === -1)
MessageBox("Ошибка", "Не удалось подать жалобу...", ["OK"], [Function.noop]);
MessageBox(tr("error"), tr("error_sending_report"), ["OK"], [Function.noop]);
else
MessageBox("Операция успешна", "Скоро её рассмотрят модераторы", ["OK"], [Function.noop]);
MessageBox(tr("action_successfully"), tr("will_be_watched"), ["OK"], [Function.noop]);
});
xhr.send(null);
}),

View file

@ -939,6 +939,7 @@
"going_to_report_user" = "You are about to report this user.";
"going_to_report_video" = "You are about to report this video.";
"going_to_report_post" = "You are about to report this post.";
"going_to_report_comment" = "You are about to report this comment.";
"comment" = "Comment";
"sender" = "Sender";
@ -1789,4 +1790,4 @@
"time" = "Time";
"roll_back" = "rollback";
"roll_backed" = "rollbacked";
"roll_backed" = "rollbacked";

View file

@ -873,6 +873,7 @@
"going_to_report_user" = "Вы собираетесь пожаловаться на данного пользователя.";
"going_to_report_video" = "Вы собираетесь пожаловаться на данную видеозапись.";
"going_to_report_post" = "Вы собираетесь пожаловаться на данную запись.";
"going_to_report_comment" = "Вы собираетесь пожаловаться на данный комментарий.";
"comment" = "Комментарий";
"sender" = "Отправитель";
@ -1681,4 +1682,4 @@
"time" = "Время";
"roll_back" = "откатить";
"roll_backed" = "откачено";
"roll_backed" = "откачено";