From 11491f24cb6671fcc4962211e552815f460cb49d Mon Sep 17 00:00:00 2001 From: themohooks Date: Fri, 11 Feb 2022 18:12:44 +0300 Subject: [PATCH 01/54] Update SU strings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit да --- locales/su.strings | 123 +++++++++++++++++++++++++++++++++------------ 1 file changed, 92 insertions(+), 31 deletions(-) diff --git a/locales/su.strings b/locales/su.strings index e6d995d9..44e77443 100644 --- a/locales/su.strings +++ b/locales/su.strings @@ -53,7 +53,7 @@ "registration_date" = "Дата регистрации"; "hometown" = "Родной город"; "this_is_you" = "это Вы"; -"edit_page" = "Изменить информацию паспорта"; +"edit_page" = "Изменить информацию досье"; "edit_group" = "Изменить информацию клуба"; "change_status" = "изменить "; "name" = "Имя"; @@ -164,7 +164,7 @@ "no_comments" = "Отзывы отсутствуют"; "all_news" = "Все новостные газеты"; -"posts_per_page" = "Количество записей в паспорте"; +"posts_per_page" = "Количество записей в досье"; "attachment" = "Вложение"; "post_as_group" = "От имени клуба"; @@ -255,6 +255,7 @@ "hidden_yes" = "Скрыт: Да"; "hidden_no" = "Скрыт: Нет"; "group_allow_post_for_everyone" = "Разрешить публиковать записи всем"; +group_hide_from_global_feed" = "Не отображать записи в публичной доске"; "statistics" = "Статистика"; "group_administrators_list" = "Список админов"; "group_display_only_creator" = "Отображать только создателя группы"; @@ -296,7 +297,7 @@ "open_original" = "Посмотреть оригинал картинки"; -"avatar_album" = "Картинки с паспорта"; +"avatar_album" = "Картинки из досье"; "wall_album" = "Картинки с доски"; "albums_zero" = "Ни одного альбома с картинками"; @@ -322,22 +323,22 @@ /* Menus */ -"edit_button" = "ред."; -"my_page" = "Мой Паспорт"; +"edit_button" = "корр."; +"my_page" = "Мое Досье"; "my_friends" = "Мои Товарищи"; "my_photos" = "Мои Фотокартинки"; "my_videos" = "Мои Киноленты"; -"my_messages" = "Мои Письма"; -"my_notes" = "Мои Черновики"; +"my_messages" = "Мои Телеграмы"; +"my_notes" = "Мои Записки"; "my_groups" = "Мои Клубы"; -"my_feed" = "Мои Газеты"; -"my_feedback" = "Мои Ответы"; +"my_feed" = "Мое Информбюро"; +"my_feedback" = "Мои Сводки"; "my_settings" = "Мои Настройки"; "bug_tracker" = "Доска задач"; "menu_login" = "Вход"; "menu_registration" = "Регистрация"; -"menu_help" = "Помощь"; +"menu_help" = "Справка"; "menu_logout" = "Выйти"; "menu_support" = "Поддержка"; @@ -346,9 +347,9 @@ "header_groups" = "клубы"; "header_people" = "граждане"; "header_invite" = "пригласить"; -"header_help" = "помощь"; -"header_log_out" = "выйти"; -"header_search" = "Поиск"; +"header_help" = "справка"; +"header_log_out" = "эмиграция"; +"header_search" = "Розыск"; "header_login" = "вход"; "header_registration" = "регистрация"; @@ -359,14 +360,14 @@ "footer_help" = "помощь"; "footer_developers" = "госслужащим"; "footer_choose_language" = "выбрать язык"; -"footer_privacy" = "приватность"; +"footer_privacy" = "секретность"; /* Settings */ "main" = "Основное"; "contacts" = "Контакты"; -"avatar" = Картинка"; -"privacy" = "Приватность"; +"avatar" = "Картинка"; +"privacy" = "Секретность"; "interface" = "Внешний вид"; "profile_picture" = "Изображение страницы"; @@ -385,8 +386,8 @@ "cut" = "Обрезка"; "round_avatars" = "Круглая картинка"; -"search_for_groups" = "Поиск клубов"; -"search_for_people" = "Поиск гражданинов"; +"search_for_groups" = "Розыск клубов"; +"search_for_people" = "Розыск граждан"; "search_button" = "Найти"; "search_placeholder" = "Начните вводить любое имя, название или слово"; "results_zero" = "Ни одного результата"; @@ -395,7 +396,7 @@ "results_many" = "$1 результатов"; "results_other" = "$1 результатов"; -"privacy_setting_access_page" = "Кому из граждан виден мой паспорт"; +"privacy_setting_access_page" = "Кому из граждан видно мое досье"; "privacy_setting_read_info" = "Кому видно основную информацию моей страницы"; "privacy_setting_see_groups" = "Кому разрешено просматривать мои картинки и встречи"; "privacy_setting_see_photos" = "Кому разрешено просматривать мои картинки"; @@ -410,17 +411,17 @@ "privacy_value_users" = "Участникам органа OpenVK"; "privacy_value_friends" = "Товарищи"; "privacy_value_friends_dative" = "Товарищам"; -"privacy_value_only_me" = "Только я"; -"privacy_value_only_me_dative" = "Только мне"; +"privacy_value_only_me" = "Только я и КГБ"; +"privacy_value_only_me_dative" = "Только мне и КГБ"; "privacy_value_nobody" = "Никто"; "your_email_address" = "Адрес Вашего почтового ящика"; -"your_page_address" = "Адрес Вашего паспорта"; -"page_address" = "Адрес паспорта"; +"your_page_address" = "Адрес Вашего досье"; +"page_address" = "Адрес досье"; "current_email_address" = "Текущий адрес"; -"page_id" = "Номер паспорта"; +"page_id" = "Номер досье"; "you_can_also" = "Вы также можете"; -"delete_your_page" = "порвать свой паспорт"; +"delete_your_page" = "порвать свое досье"; "delete_album" = "выкинуть свой альбом с картинками"; "ui_settings_interface" = "Интерфейс"; @@ -430,7 +431,7 @@ "ui_settings_rating_hide" = "Скрывать"; "additional_links" = "Дополнительные ссылки"; - +"ad_poster" = "Рекламный плакат"; /* Two-factor authentication */ "two_factor_authentication" = "Двухфакторная аутентификация"; @@ -561,7 +562,7 @@ "transferred_to_you" = "передал вам"; -"receiver_address" = "Адрес паспорта получателя"; +"receiver_address" = "Адрес досье получателя"; "coins_count" = "Количество рублей"; "message" = "Сообщение"; @@ -609,6 +610,21 @@ /* Support */ +"increase_rating" = "Увеличить рейтинг"; +"increase_rating_button" = "Увеличить"; +"to_whom" = "Кому"; +"increase_by" = "Увеличить на"; +"price" = "Ценник"; + +"you_have_unused_votes" = "У Вас $1 неиспользованных рубля на кошельке."; +"apply_voucher" = "Применить купон"; + +"failed_to_increase_rating" = "Не удалось увеличить рейтинг"; +"rating_increase_successful" = "Вы успешно увеличили рейтинг $2 на $3%."; +"negative_rating_value" = "Орган не может украсть баллы рейтинга у другого гражданина, так не положено."; + +"increased_your_rating_by" = "увеличил ваш рейтинг на"; + "support_opened" = "Открытые"; "support_answered" = "С ответом"; "support_closed" = "Закрытые"; @@ -740,10 +756,10 @@ "forbidden_comment" = "Настройки приватности этого пользователя не разрешают вам смотреть на его страницу."; "changes_saved" = "Изменения сохранены"; -"changes_saved_comment" = "Товарищ, обоновлённые данные появятся на вашем паспорте."; +"changes_saved_comment" = "Товарищ, обоновлённые данные появятся на вашем досье."; "photo_saved" = "Картинка сохранена"; -"photo_saved_comment" = "Товарищ, орган одобрил новую картинку в вашем паспорте."; +"photo_saved_comment" = "Товарищ, орган одобрил новую картинку в вашем досье."; "shared_succ" = "Запись появится на вашей доске. Нажмите на уведомление, чтобы перейти к своей стене."; @@ -759,8 +775,8 @@ "token_manipulation_error" = "Ошибка манипулирования токеном"; "token_manipulation_error_comment" = "Токен недействителен или истёк"; -"profile_changed" = "Паспорт изменён"; -"profile_changed_comment" = Товарищ, орган одобрил изменение вашего паспорта."; +"profile_changed" = "Досье изменёно"; +"profile_changed_comment" = "Товарищ, орган одобрил изменение вашего досье."; "profile_not_found" = "Гражданин не найден."; "suspicious_registration_attempt" = "Подозрительная попытка регистрации в орган"; @@ -795,6 +811,36 @@ /* About */ "about_openvk" = "Об органе OpenVK"; +"footer_about_instance" = "о стране"; +"about_this_instance" = "Об этой стране"; +"rules" = "Правила"; +"most_popular_groups" = "Самые популярные клубы"; +"on_this_instance_are" = "На этой стране"; + +"about_users_one" = "1 гражданин"; +"about_users_few" = "$1 гражданина"; +"about_users_many" = "$1 гражданинов"; +"about_users_other" = "$1 гражданинов"; + +"about_online_users_one" = "1 пользователь в сети"; +"about_online_users_few" = "$1 пользователя в сети"; +"about_online_users_many" = "$1 гражданинов в сети"; +"about_online_users_other" = "$1 гражданинов в сети"; + +"about_active_users_one" = "1 активный пользователь"; +"about_active_users_few" = "$1 активных пользователя"; +"about_active_users_many" = "$1 активных гражданинов"; +"about_active_users_other" = "$1 активных гражданинов"; + +"about_groups_one" = "1 клуб"; +"about_groups_few" = "$1 клубы"; +"about_groups_many" = "$1 клубов"; +"about_groups_other" = "$1 клубов"; + +"about_wall_posts_one" = "1 заметка на досках"; +"about_wall_posts_few" = "$1 заметки на досках"; +"about_wall_posts_many" = "$1 заметки на досках"; +"about_wall_posts_other" = "$1 заметки на досках"; /* Dialogs */ @@ -810,5 +856,20 @@ "question_confirm" = "Товарищ, будьте внимательны с выбором. Вы согласны с вашим выбором? Отменить не представляется возможным."; /* User alerts */ +"apply_style_for_this_device" = "Применить стиль только для этой ЭВМ"; "user_alert_scam" = "Органу управления было дозволено, что данный гражданин обманывает товарищей на денежные средства. Будьте осторожны при разговоре с ним."; + + +"ec_header" = "Подтверждение регистрации прописки"; +"ec_title" = "Спасибо!"; +"ec_1" = "$1, на ваш почтовый ящик должно придти письмо с подтверждением регистрации."; +"ec_2" = "Если по каким-то причинам вам не пришло письмо, то проверьте мусорный бак. Если письма не окажется и там, то вы можете переотправить письмо."; +"ec_resend" = "Переотправить письмо"; + +"email_sent" = "Письмо было успешно отправлено."; +"email_sent_desc" = "Если ваш почтовый ящик существует, вы получите письмо."; +"email_error" = "Непредвиденная ошибка при отправке письма."; +"email_rate_limit_error" = "Нельзя делать это так часто, извините."; + +"email_verify_success" = "Ваша регистрация была подтверждена. Приятного времяпрепровождения!"; \ No newline at end of file From edccb34c5325af7c2aa2c40b292f872a77da8fed Mon Sep 17 00:00:00 2001 From: Celestora Date: Sun, 20 Mar 2022 21:54:09 +0200 Subject: [PATCH 02/54] Add phpStorm config --- .idea/.gitignore | 8 + .idea/intellij-latte/xmlSources/Latte.dtd | 46 +++ .idea/intellij-latte/xmlSources/Latte.xml | 290 ++++++++++++++++++ .../xmlSources/NetteApplication.xml | 59 ++++ .../intellij-latte/xmlSources/NetteForms.xml | 41 +++ .idea/misc.xml | 6 + .idea/modules.xml | 8 + .idea/openvk.iml | 35 +++ .idea/php.xml | 37 +++ .idea/runConfigurations.xml | 10 + .idea/vcs.xml | 6 + 11 files changed, 546 insertions(+) create mode 100644 .idea/.gitignore create mode 100644 .idea/intellij-latte/xmlSources/Latte.dtd create mode 100644 .idea/intellij-latte/xmlSources/Latte.xml create mode 100644 .idea/intellij-latte/xmlSources/NetteApplication.xml create mode 100644 .idea/intellij-latte/xmlSources/NetteForms.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/openvk.iml create mode 100644 .idea/php.xml create mode 100644 .idea/runConfigurations.xml create mode 100644 .idea/vcs.xml diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 00000000..13566b81 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/intellij-latte/xmlSources/Latte.dtd b/.idea/intellij-latte/xmlSources/Latte.dtd new file mode 100644 index 00000000..0cf3a95a --- /dev/null +++ b/.idea/intellij-latte/xmlSources/Latte.dtd @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.idea/intellij-latte/xmlSources/Latte.xml b/.idea/intellij-latte/xmlSources/Latte.xml new file mode 100644 index 00000000..0bfceaf8 --- /dev/null +++ b/.idea/intellij-latte/xmlSources/Latte.xml @@ -0,0 +1,290 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/intellij-latte/xmlSources/NetteApplication.xml b/.idea/intellij-latte/xmlSources/NetteApplication.xml new file mode 100644 index 00000000..aa4a4685 --- /dev/null +++ b/.idea/intellij-latte/xmlSources/NetteApplication.xml @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/intellij-latte/xmlSources/NetteForms.xml b/.idea/intellij-latte/xmlSources/NetteForms.xml new file mode 100644 index 00000000..036e07f6 --- /dev/null +++ b/.idea/intellij-latte/xmlSources/NetteForms.xml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 00000000..639900d1 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 00000000..de1f1bbf --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/openvk.iml b/.idea/openvk.iml new file mode 100644 index 00000000..b5f07aa6 --- /dev/null +++ b/.idea/openvk.iml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/php.xml b/.idea/php.xml new file mode 100644 index 00000000..22c50b95 --- /dev/null +++ b/.idea/php.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml new file mode 100644 index 00000000..797acea5 --- /dev/null +++ b/.idea/runConfigurations.xml @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 00000000..35eb1ddf --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file From b11c942c65f3fed37b4f382eae1493dac016c5ec Mon Sep 17 00:00:00 2001 From: Ilya Prokopenko Date: Thu, 24 Mar 2022 15:29:00 +0300 Subject: [PATCH 03/54] Global: Correct the components code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit НЛО прилетело и опубликовало эту надпись здесь --- .../templates/components/attachment.xml | 8 +- .../templates/components/comment.xml | 12 +-- .../templates/components/comments.xml | 4 +- .../templates/components/paginator.xml | 12 +-- Web/Presenters/templates/components/post.xml | 5 - .../components/post/microblogpost.xml | 91 +++++++----------- .../templates/components/post/oldpost.xml | 94 +++++++------------ .../templates/components/textArea.xml | 12 +-- Web/Presenters/templates/components/wall.xml | 6 +- 9 files changed, 88 insertions(+), 156 deletions(-) diff --git a/Web/Presenters/templates/components/attachment.xml b/Web/Presenters/templates/components/attachment.xml index 9e9271f2..4689723e 100644 --- a/Web/Presenters/templates/components/attachment.xml +++ b/Web/Presenters/templates/components/attachment.xml @@ -5,8 +5,8 @@ {$attachment->getDescription()} {else} - - {_ + + {_attach_no_longer_available} {/if} {elseif $attachment instanceof \openvk\Web\Models\Entities\Video} @@ -14,12 +14,12 @@ {elseif $attachment instanceof \openvk\Web\Models\Entities\Post} {php $GLOBALS["_nesAttGloCou"] = (isset($GLOBALS["_nesAttGloCou"]) ? $GLOBALS["_nesAttGloCou"] : 0) + 1} {if $GLOBALS["_nesAttGloCou"] > 2} - {_"open_post"} + {_open_post} {else} {include "post.xml", post => $attachment, compact => true} {/if} {else} - {_"version_incompatibility"} + {_version_incompatibility} {/if} {php $GLOBALS["_nesAttGloCou"] = NULL} diff --git a/Web/Presenters/templates/components/comment.xml b/Web/Presenters/templates/components/comment.xml index 5671ac54..65072458 100644 --- a/Web/Presenters/templates/components/comment.xml +++ b/Web/Presenters/templates/components/comment.xml @@ -8,10 +8,7 @@ - + @@ -19,7 +16,7 @@ {$author->getCanonicalName()} - {if $author->isVerified()}{/if}
+
@@ -34,9 +31,9 @@
{$comment->getPublicationTime()} | {if $comment->canBeDeletedBy($thisUser)} - {_"delete"} | + {_delete} | {/if} - {_"reply"} + {_reply}
- diff --git a/Web/Presenters/templates/components/comments.xml b/Web/Presenters/templates/components/comments.xml index 99400706..30009c59 100644 --- a/Web/Presenters/templates/components/comments.xml +++ b/Web/Presenters/templates/components/comments.xml @@ -1,4 +1,4 @@ -

{_"comments"} ({$count})

+

{_comments} ({$count})

{var commentsURL = "/al_comments/create/$model/" . $parent->getId()} @@ -27,7 +27,7 @@ {else}

Будьте первым кто оставит комментарий к этой дичи!

{/if} --> - {_"comments_tip"} + {_comments_tip} {/if} {script "js/al_comments.js"} diff --git a/Web/Presenters/templates/components/paginator.xml b/Web/Presenters/templates/components/paginator.xml index 7c14e7e4..206c7fb3 100644 --- a/Web/Presenters/templates/components/paginator.xml +++ b/Web/Presenters/templates/components/paginator.xml @@ -3,16 +3,10 @@
- {if $conf->page > $space} - « - {/if} + « {for $j = $conf->page - ($space-1); $j <= $conf->page + ($space-1); $j++} - {if $j > 0 && $j <= $pageCount} - {$j} - {/if} + {$j} {/for} - {if $conf->page <= $pageCount-$space} - » - {/if} + »
diff --git a/Web/Presenters/templates/components/post.xml b/Web/Presenters/templates/components/post.xml index 5c1bebe0..96ec60b1 100644 --- a/Web/Presenters/templates/components/post.xml +++ b/Web/Presenters/templates/components/post.xml @@ -1,9 +1,4 @@ {var microblogEnabled = isset($thisUser) ? $thisUser->hasMicroblogEnabled() : false} -{if !$post->isPostedOnBehalfOfGroup()} - {var then = date_create("@" . $post->getOwner()->getOnline()->timestamp())} - {var now = date_create()} - {var diff = date_diff($now, $then)} -{/if} {if $microblogEnabled} {include "post/microblogpost.xml", post => $post, diff => $diff, commentSection => $commentSection} diff --git a/Web/Presenters/templates/components/post/microblogpost.xml b/Web/Presenters/templates/components/post/microblogpost.xml index d50d9b02..5755e865 100644 --- a/Web/Presenters/templates/components/post/microblogpost.xml +++ b/Web/Presenters/templates/components/post/microblogpost.xml @@ -9,25 +9,14 @@ - - {if !$post->isPostedOnBehalfOfGroup() && !$compact} - - {_online} - - {/if} + + {_online}
- {var acutalAuthor = $post->getOwner(false)} + {var actualAuthor = $post->getOwner(false)} - Автор: - - {$acutalAuthor->getCanonicalName()} + {_author}: + + {$actualAuthor->getCanonicalName()}
@@ -94,26 +82,17 @@ {if isset($thisUser)}   - {if !($forceNoCommentsLink ?? false)} - - {_"comment"} - - {/if} + {_comment} {/if}
- {if !($forceNoCommentsLink ?? false)} -
- {if $commentsCount > 3} - {_view_other_comments} - {/if} - {foreach $comments as $comment} - {include "../comment.xml", comment => $comment, $compact => true} - {/foreach} -
- {var commentsURL = "/al_comments/create/posts/" . $post->getId()} - {var club = is_null($club) ? ($post->getTargetWall() < 0 ? (new openvk\Web\Models\Repositories\Clubs)->get(abs($post->getTargetWall())) : NULL) : $club} - {include "../textArea.xml", route => $commentsURL, postOpts => false, graffiti => (bool) ovkGetQuirk("comments.allow-graffiti"), post => $post, club => $club} -
+
+ {_view_other_comments} + {foreach $comments as $comment} + {include "../comment.xml", comment => $comment, $compact => true} + {/foreach} +
+ {var commentsURL = "/al_comments/create/posts/" . $post->getId()} + {var club = is_null($club) ? ($post->getTargetWall() < 0 ? (new openvk\Web\Models\Repositories\Clubs)->get(abs($post->getTargetWall())) : NULL) : $club} + {include "../textArea.xml", route => $commentsURL, postOpts => false, graffiti => (bool) ovkGetQuirk("comments.allow-graffiti"), post => $post, club => $club}
- {/if} +
diff --git a/Web/Presenters/templates/components/post/oldpost.xml b/Web/Presenters/templates/components/post/oldpost.xml index 6c2958e7..1a3c4c84 100644 --- a/Web/Presenters/templates/components/post/oldpost.xml +++ b/Web/Presenters/templates/components/post/oldpost.xml @@ -5,26 +5,15 @@ - + + {_online} - {if !$post->isPostedOnBehalfOfGroup() && !($compact ?? false)} - - {_online} - - {/if} -
@@ -64,68 +50,54 @@  ! Этот пост был размещён за взятку.
- {var acutalAuthor = $post->getOwner(false)} + {var actualAuthor = $post->getOwner(false)} - Автор: - - {$acutalAuthor->getCanonicalName()} + {_author}: + + {$actualAuthor->getCanonicalName()}
{if $post->canBeDeletedBy($thisUser) && !($forceNoDeleteLink ?? false)} - {_"delete"} |  + {_delete}  |  {/if} {if $post->canBePinnedBy($thisUser) && !($forceNoPinLink ?? false)} {if $post->isPinned()} - {_unpin} |  + {_unpin} {else} - {_pin} |  + {_pin} {/if} +  |  {/if} - {if !($forceNoCommentsLink ?? false)} - - {if $post->getCommentsCount() > 0} - {_"comments"} ({$post->getCommentsCount()}) - {else} - {_"comments"} - {/if} - - {/if} + + {_comments} + {if $post->getCommentsCount() > 0} + ({$post->getCommentsCount()}) + {/if} + {if !($forceNoCommentsLink ?? false) && !($forceNoShareLink ?? false)}  |  {/if} - {if !($forceNoShareLink ?? false)} - - {if $post->getRepostCount() > 0} - {_"share"} - ({$post->getRepostCount()}) - {else} - {_"share"} - {/if} - - {/if} + + {_share} + {if $post->getRepostCount() > 0} + ({$post->getRepostCount()}) + {/if} + - {if !($forceNoLike ?? false)} - - {/if} -
-
- +
diff --git a/Web/Presenters/templates/components/textArea.xml b/Web/Presenters/templates/components/textArea.xml index c27d0506..c14b652a 100644 --- a/Web/Presenters/templates/components/textArea.xml +++ b/Web/Presenters/templates/components/textArea.xml @@ -27,25 +27,25 @@ {/if} {/if}
@@ -53,7 +53,7 @@
- +
{_attach} diff --git a/Web/Presenters/templates/components/wall.xml b/Web/Presenters/templates/components/wall.xml index f8be0067..feb688bc 100644 --- a/Web/Presenters/templates/components/wall.xml +++ b/Web/Presenters/templates/components/wall.xml @@ -1,9 +1,9 @@
From 13dab88c9eb447e288f5273af844d091fd556a7f Mon Sep 17 00:00:00 2001 From: Celestora Date: Thu, 24 Mar 2022 17:03:43 +0200 Subject: [PATCH 04/54] Auto-resize coins count Coins count will still break lines if the value can be fit in multiple lines (for accessibility), but it won't escape it's box and damage page design. --- Web/Presenters/templates/User/Settings.xml | 20 +++++++++++++------- Web/static/js/package.json | 1 + Web/static/js/yarn.lock | 5 +++++ 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/Web/Presenters/templates/User/Settings.xml b/Web/Presenters/templates/User/Settings.xml index f8078d87..d844bcca 100644 --- a/Web/Presenters/templates/User/Settings.xml +++ b/Web/Presenters/templates/User/Settings.xml @@ -347,16 +347,22 @@
{tr("also_you_can_transfer_points", $thisUser->getCoins(), rawurlencode($csrfToken))|noescape}
-

- - {_on_your_account}
- {$thisUser->getCoins()}
- {_points_count}

- [{_have_voucher}?] -
+

+ {_on_your_account} +
{$thisUser->getCoins()}
+ {_points_count}
+ [{_have_voucher}?]

+ {script "js/node_modules/textfit/textFit.min.js"} + + {elseif $isFinanceTU}

{_voucher_explanation} {_voucher_explanation_ex}

diff --git a/Web/static/js/package.json b/Web/static/js/package.json index d3b0c088..e29efb2e 100644 --- a/Web/static/js/package.json +++ b/Web/static/js/package.json @@ -14,6 +14,7 @@ "react-dom-factories": "^1.0.2", "requirejs": "^2.3.6", "soundjs": "^1.0.1", + "textfit": "^2.4.0", "umbrellajs": "^3.1.0" } } diff --git a/Web/static/js/yarn.lock b/Web/static/js/yarn.lock index 78235893..41341d82 100644 --- a/Web/static/js/yarn.lock +++ b/Web/static/js/yarn.lock @@ -271,6 +271,11 @@ soundjs@^1.0.1: resolved "https://registry.yarnpkg.com/soundjs/-/soundjs-1.0.1.tgz#99970542d28d0df2a1ebd061ae75c961a98c8180" integrity sha512-MgFPvmKYfpcNiE3X5XybNvScie3DMQlZgmNzUn4puBcpw64f4LqjH/fhM8Sb/eTJ8hK57Crr7mWy0bfJOqPj6Q== +textfit@^2.4.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/textfit/-/textfit-2.4.0.tgz#80cba8006bfb9c3d9d552739257957bdda95c79c" + integrity sha512-/x4aoY5+/tJmu+iwpBH1yw75TFp86M6X15SvaaY/Eep7YySQYtqdOifEtfvVyMwzl7SZ+G4RQw00FD9g5R6i1Q== + trim-extra-html-whitespace@1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/trim-extra-html-whitespace/-/trim-extra-html-whitespace-1.3.0.tgz#b47efb0d1a5f2a56a85cc45cea525651e93404cf" From 1472801874817ce8b259ec6e885470100830cc62 Mon Sep 17 00:00:00 2001 From: veselcraft Date: Fri, 25 Mar 2022 14:05:44 +0300 Subject: [PATCH 05/54] VKAPI: Add attachments support for Wall methods MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit TODO Refactor: Перенести вывод в отдельную функцию, чтоб не дублировать код --- VKAPI/Handlers/Wall.php | 53 ++++++++++++++++++++++++++++++ Web/Models/Entities/Photo.php | 14 ++++++++ Web/Models/Repositories/Albums.php | 8 +++++ 3 files changed, 75 insertions(+) diff --git a/VKAPI/Handlers/Wall.php b/VKAPI/Handlers/Wall.php index ec153695..5b0035de 100644 --- a/VKAPI/Handlers/Wall.php +++ b/VKAPI/Handlers/Wall.php @@ -22,6 +22,32 @@ final class Wall extends VKAPIRequestHandler foreach ($posts->getPostsFromUsersWall((int)$owner_id, 1, $count, $offset) as $post) { $from_id = get_class($post->getOwner()) == "openvk\Web\Models\Entities\Club" ? $post->getOwner()->getId() * (-1) : $post->getOwner()->getId(); + + $attachments; + foreach($post->getChildren() as $attachment) + { + if($attachment instanceof \openvk\Web\Models\Entities\Photo) + { + $attachments[] = [ + "type" => "photo", + "photo" => [ + "album_id" => $attachment->getAlbum()->getId(), + "date" => $attachment->getPublicationTime()->timestamp(), + "id" => $attachment->getVirtualId(), + "owner_id" => $attachment->getOwner()->getId(), + "sizes" => array([ + "height" => $attachment->getDimentions()[1], + "url" => $attachment->getURL(), + "type" => "m", + "width" => $attachment->getDimentions()[0], + ]), + "text" => "", + "has_tags" => false + ] + ]; + } + } + $items[] = (object)[ "id" => $post->getVirtualId(), "from_id" => $from_id, @@ -35,6 +61,7 @@ final class Wall extends VKAPIRequestHandler "can_archive" => false, // TODO MAYBE "is_archived" => false, "is_pinned" => $post->isPinned(), + "attachments" => $attachments, "post_source" => (object)["type" => "vk"], "comments" => (object)[ "count" => $post->getCommentsCount(), @@ -127,6 +154,31 @@ final class Wall extends VKAPIRequestHandler $post = (new PostsRepo)->getPostById(intval($id[0]), intval($id[1])); if($post) { $from_id = get_class($post->getOwner()) == "openvk\Web\Models\Entities\Club" ? $post->getOwner()->getId() * (-1) : $post->getOwner()->getId(); + $attachments; + foreach($post->getChildren() as $attachment) + { + if($attachment instanceof \openvk\Web\Models\Entities\Photo) + { + $attachments[] = [ + "type" => "photo", + "photo" => [ + "album_id" => $attachment->getAlbum()->getId(), + "date" => $attachment->getPublicationTime()->timestamp(), + "id" => $attachment->getVirtualId(), + "owner_id" => $attachment->getOwner()->getId(), + "sizes" => array([ + "height" => $attachment->getDimentions()[1], + "url" => $attachment->getURL(), + "type" => "m", + "width" => $attachment->getDimentions()[0], + ]), + "text" => "", + "has_tags" => false + ] + ]; + } + } + $items[] = (object)[ "id" => $post->getVirtualId(), "from_id" => $from_id, @@ -141,6 +193,7 @@ final class Wall extends VKAPIRequestHandler "is_archived" => false, "is_pinned" => $post->isPinned(), "post_source" => (object)["type" => "vk"], + "attachments" => $attachments, "comments" => (object)[ "count" => $post->getCommentsCount(), "can_post" => 1 diff --git a/Web/Models/Entities/Photo.php b/Web/Models/Entities/Photo.php index ecda93f6..0c0e8941 100644 --- a/Web/Models/Entities/Photo.php +++ b/Web/Models/Entities/Photo.php @@ -1,5 +1,7 @@ getRecord()->hash; + + return getimagesize($this->pathFromHash($hash)); + } + + function getAlbum(): ?Album + { + return (new Albums)->getAlbumByPhotoId($this); + } } diff --git a/Web/Models/Repositories/Albums.php b/Web/Models/Repositories/Albums.php index e1bcc671..0da26ff0 100644 --- a/Web/Models/Repositories/Albums.php +++ b/Web/Models/Repositories/Albums.php @@ -1,6 +1,7 @@ getContext()->table("album_relations")->where(["media" => $photo->getId()])->fetch(); + + return $this->get($dbalbum->collection); + } } From 4bf6fce260ee5e83ac901dc443530168346c3f04 Mon Sep 17 00:00:00 2001 From: veselcraft Date: Fri, 25 Mar 2022 14:44:10 +0300 Subject: [PATCH 06/54] VKAPI: Fix 500 error if the post is published as anon --- VKAPI/Handlers/Wall.php | 2 +- Web/Models/Repositories/Albums.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/VKAPI/Handlers/Wall.php b/VKAPI/Handlers/Wall.php index 5b0035de..a87b1e63 100644 --- a/VKAPI/Handlers/Wall.php +++ b/VKAPI/Handlers/Wall.php @@ -31,7 +31,7 @@ final class Wall extends VKAPIRequestHandler $attachments[] = [ "type" => "photo", "photo" => [ - "album_id" => $attachment->getAlbum()->getId(), + "album_id" => $attachment->getAlbum() ? $attachment->getAlbum()->getId() : null, "date" => $attachment->getPublicationTime()->timestamp(), "id" => $attachment->getVirtualId(), "owner_id" => $attachment->getOwner()->getId(), diff --git a/Web/Models/Repositories/Albums.php b/Web/Models/Repositories/Albums.php index 0da26ff0..0995a073 100644 --- a/Web/Models/Repositories/Albums.php +++ b/Web/Models/Repositories/Albums.php @@ -121,6 +121,6 @@ class Albums { $dbalbum = DatabaseConnection::i()->getContext()->table("album_relations")->where(["media" => $photo->getId()])->fetch(); - return $this->get($dbalbum->collection); + return $dbalbum->collection ? $this->get($dbalbum->collection) : null; } } From 4cf50790b132ef0ccf58abb01f7b0896ea0f630b Mon Sep 17 00:00:00 2001 From: veselcraft Date: Fri, 25 Mar 2022 14:46:40 +0300 Subject: [PATCH 07/54] that's why i need to refactor this --- VKAPI/Handlers/Wall.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VKAPI/Handlers/Wall.php b/VKAPI/Handlers/Wall.php index a87b1e63..9aa8ad37 100644 --- a/VKAPI/Handlers/Wall.php +++ b/VKAPI/Handlers/Wall.php @@ -162,7 +162,7 @@ final class Wall extends VKAPIRequestHandler $attachments[] = [ "type" => "photo", "photo" => [ - "album_id" => $attachment->getAlbum()->getId(), + "album_id" => $attachment->getAlbum() ? $attachment->getAlbum()->getId() : null, "date" => $attachment->getPublicationTime()->timestamp(), "id" => $attachment->getVirtualId(), "owner_id" => $attachment->getOwner()->getId(), From e6759f089f3745a2b1cdf5109a887b95fd1dc6d2 Mon Sep 17 00:00:00 2001 From: veselcraft Date: Fri, 25 Mar 2022 16:36:38 +0300 Subject: [PATCH 08/54] Albums: fix getAlbumByPhotoId performance issue --- Web/Models/Repositories/Albums.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Web/Models/Repositories/Albums.php b/Web/Models/Repositories/Albums.php index 0995a073..99c6c732 100644 --- a/Web/Models/Repositories/Albums.php +++ b/Web/Models/Repositories/Albums.php @@ -119,7 +119,7 @@ class Albums function getAlbumByPhotoId(Photo $photo): ?Album { - $dbalbum = DatabaseConnection::i()->getContext()->table("album_relations")->where(["media" => $photo->getId()])->fetch(); + $dbalbum = $this->context->table("album_relations")->where(["media" => $photo->getId()])->fetch(); return $dbalbum->collection ? $this->get($dbalbum->collection) : null; } From c4a0d5ed9868877521aa4405879fd8f773564150 Mon Sep 17 00:00:00 2001 From: veselcraft Date: Fri, 25 Mar 2022 22:29:29 +0300 Subject: [PATCH 09/54] VKAPI: Fix stupid error when attachments duplicated over and over --- VKAPI/Handlers/Wall.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/VKAPI/Handlers/Wall.php b/VKAPI/Handlers/Wall.php index 9aa8ad37..747991d1 100644 --- a/VKAPI/Handlers/Wall.php +++ b/VKAPI/Handlers/Wall.php @@ -83,6 +83,8 @@ final class Wall extends VKAPIRequestHandler $profiles[] = $from_id; else $groups[] = $from_id * -1; + + $attachments = null; // free attachments so it will not clone everythingg } if($extended == 1) @@ -214,6 +216,8 @@ final class Wall extends VKAPIRequestHandler $profiles[] = $from_id; else $groups[] = $from_id * -1; + + $attachments = null; // free attachments so it will not clone everythingg } } From 6966cbb8c54cef917613be4eb34003e0ecef6a7c Mon Sep 17 00:00:00 2001 From: Celestora Date: Sat, 26 Mar 2022 12:24:57 +0200 Subject: [PATCH 10/54] Check name validity before creating ChandlerUser Fixes #498 --- Web/Presenters/AuthPresenter.php | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/Web/Presenters/AuthPresenter.php b/Web/Presenters/AuthPresenter.php index a80bbc68..8d15d3e2 100644 --- a/Web/Presenters/AuthPresenter.php +++ b/Web/Presenters/AuthPresenter.php @@ -4,6 +4,7 @@ use openvk\Web\Models\Entities\IP; use openvk\Web\Models\Entities\User; use openvk\Web\Models\Entities\PasswordReset; use openvk\Web\Models\Entities\EmailVerification; +use openvk\Web\Models\Exceptions\InvalidUserNameException; use openvk\Web\Models\Repositories\IPs; use openvk\Web\Models\Repositories\Users; use openvk\Web\Models\Repositories\Restores; @@ -88,20 +89,25 @@ final class AuthPresenter extends OpenVKPresenter if (strtotime($this->postParam("birthday")) > time()) $this->flashFail("err", tr("invalid_birth_date"), tr("invalid_birth_date_comment")); + try { + $user = new User; + $user->setFirst_Name($this->postParam("first_name")); + $user->setLast_Name($this->postParam("last_name")); + $user->setSex((int)($this->postParam("sex") === "female")); + $user->setEmail($this->postParam("email")); + $user->setSince(date("Y-m-d H:i:s")); + $user->setRegistering_Ip(CONNECTING_IP); + $user->setBirthday(strtotime($this->postParam("birthday"))); + $user->setActivated((int)!OPENVK_ROOT_CONF['openvk']['preferences']['security']['requireEmail']); + } catch(InvalidUserNameException $ex) { + $this->flashFail("err", tr("error"), tr("invalid_real_name")); + } + $chUser = ChandlerUser::create($this->postParam("email"), $this->postParam("password")); if(!$chUser) $this->flashFail("err", tr("failed_to_register"), tr("user_already_exists")); - - $user = new User; + $user->setUser($chUser->getId()); - $user->setFirst_Name($this->postParam("first_name")); - $user->setLast_Name($this->postParam("last_name")); - $user->setSex((int) ($this->postParam("sex") === "female")); - $user->setEmail($this->postParam("email")); - $user->setSince(date("Y-m-d H:i:s")); - $user->setRegistering_Ip(CONNECTING_IP); - $user->setBirthday(strtotime($this->postParam("birthday"))); - $user->setActivated((int) !OPENVK_ROOT_CONF['openvk']['preferences']['security']['requireEmail']); $user->save(); if(!is_null($referer)) { From da26c82531305f88095d1ebb6782b671ace68900 Mon Sep 17 00:00:00 2001 From: Maxim Leshchenko <50026114+maksalees@users.noreply.github.com> Date: Sat, 26 Mar 2022 15:11:13 +0100 Subject: [PATCH 11/54] L10n (Kazakh): Add missing semicolon --- locales/kk.strings | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/locales/kk.strings b/locales/kk.strings index 72665ff6..c20ef194 100644 --- a/locales/kk.strings +++ b/locales/kk.strings @@ -398,7 +398,7 @@ "default" = "әдепкі"; -"arbitrary_avatars" = "Ерікті" +"arbitrary_avatars" = "Ерікті"; "cut" = "Шаршы"; "round_avatars" = "Дөңгелек"; From f505887d7f35c6a70e8063e25ee6facbee0cd9b2 Mon Sep 17 00:00:00 2001 From: veselcraft Date: Sat, 26 Mar 2022 19:53:39 +0300 Subject: [PATCH 12/54] VKAPI: Fix wall performance issue MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit А пока никто не видет, пусть тут повисит текст одной песенки: Дай мені почути відверту мовчання тишу Ще раз зазирнути, утнути якусь дурницю Ти доповнила хором у соло останню нішу Відпустила і тягне-несе мене залізниця Дай докайфувати, допити останні ноти Вони і мене розвивають-крають, їх чути мушу Струмом віддавали торканння, погляди, фото Сканували і милом заслали ми наші душі Засмага зійде В купе купувати, в п'ятій піти Спрагою стане наступний день Але я залишаюсь там, як і ти Засмага зійде В купе купувати, в п'ятій піти Спрагою стане наступний день Але я залишаюсь там, як і ти Потяги в полиці штовхали у різні боки Телефони стискали, чекали картки ввімкнутись Залишили по собі ціньми в камінні мокрім Незабаром побачитись з вами, або почутись Не потрібні тіла нам ваші анітрохи Просто ближче підходьте й вгору здіймайте руки Сумувати, гаяти час, плести неспокій Так буває, що спогади народжують звуки Засмага зійде В купе купувати, в п'ятій піти Спрагою стане наступний день Але я залишаюсь там, як і ти --- VKAPI/Handlers/Wall.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/VKAPI/Handlers/Wall.php b/VKAPI/Handlers/Wall.php index 747991d1..59f8c751 100644 --- a/VKAPI/Handlers/Wall.php +++ b/VKAPI/Handlers/Wall.php @@ -36,10 +36,10 @@ final class Wall extends VKAPIRequestHandler "id" => $attachment->getVirtualId(), "owner_id" => $attachment->getOwner()->getId(), "sizes" => array([ - "height" => $attachment->getDimentions()[1], + "height" => 500, // Для временного компросима оставляю статическое число. Если каждый раз обращаться к файлу за количеством пикселов, то наступает пuпuська полная с производительностью, так что пока так "url" => $attachment->getURL(), "type" => "m", - "width" => $attachment->getDimentions()[0], + "width" => 500, ]), "text" => "", "has_tags" => false @@ -169,10 +169,10 @@ final class Wall extends VKAPIRequestHandler "id" => $attachment->getVirtualId(), "owner_id" => $attachment->getOwner()->getId(), "sizes" => array([ - "height" => $attachment->getDimentions()[1], + "height" => 500, // я ещё я заебался вставлять одинаковый код в два разных места "url" => $attachment->getURL(), "type" => "m", - "width" => $attachment->getDimentions()[0], + "width" => 500, ]), "text" => "", "has_tags" => false From 6588734caae0bbeecd583afa2870b320e19e1454 Mon Sep 17 00:00:00 2001 From: Maxim Leshchenko Date: Sat, 26 Mar 2022 21:48:42 +0100 Subject: [PATCH 13/54] Support: Allow agents to prevent users from creating tickets --- Web/Models/Entities/User.php | 10 ++++ Web/Presenters/SupportPresenter.php | 38 ++++++++++++++- Web/Presenters/templates/Support/Index.xml | 30 ++++++++---- Web/Presenters/templates/User/View.xml | 57 +++++++++++++++++++++- Web/routes.yml | 4 ++ install/sqls/00019-block-in-support.sql | 1 + locales/en.strings | 5 ++ locales/ru.strings | 5 ++ 8 files changed, 137 insertions(+), 13 deletions(-) create mode 100644 install/sqls/00019-block-in-support.sql diff --git a/Web/Models/Entities/User.php b/Web/Models/Entities/User.php index 64b689e4..c4888d75 100644 --- a/Web/Models/Entities/User.php +++ b/Web/Models/Entities/User.php @@ -214,6 +214,11 @@ class User extends RowModel { return $this->getRecord()->block_reason; } + + function getBanInSupportReason(): ?string + { + return $this->getRecord()->block_in_support_reason; + } function getType(): int { @@ -673,6 +678,11 @@ class User extends RowModel { return !is_null($this->getBanReason()); } + + function isBannedInSupport(): bool + { + return !is_null($this->getBanInSupportReason()); + } function isOnline(): bool { diff --git a/Web/Presenters/SupportPresenter.php b/Web/Presenters/SupportPresenter.php index a96ac465..9c2bcc8e 100644 --- a/Web/Presenters/SupportPresenter.php +++ b/Web/Presenters/SupportPresenter.php @@ -1,7 +1,7 @@ template->tickets = $this->tickets->getTicketsByUserId($this->user->id, $this->template->page); } + if($this->template->mode === "new") + $this->template->banReason = $this->user->identity->getBanInSupportReason(); + if($_SERVER["REQUEST_METHOD"] === "POST") { + if($this->user->identity->isBannedInSupport()) + $this->flashFail("err", tr("not_enough_permissions"), tr("not_enough_permissions_comment")); + if(!empty($this->postParam("name")) && !empty($this->postParam("text"))) { $this->willExecuteWriteAction(); @@ -268,4 +274,32 @@ final class SupportPresenter extends OpenVKPresenter exit(header("HTTP/1.1 200 OK")); } -} \ No newline at end of file + + function renderQuickBanInSupport(int $id): void + { + $this->assertPermission("openvk\Web\Models\Entities\TicketReply", "write", 0); + $this->assertNoCSRF(); + + $user = (new Users)->get($id); + if(!$user) + exit(json_encode([ "error" => "User does not exist" ])); + + $user->setBlock_In_Support_Reason($this->queryParam("reason")); + $user->save(); + $this->returnJson([ "success" => true, "reason" => $this->queryParam("reason") ]); + } + + function renderQuickUnbanInSupport(int $id): void + { + $this->assertPermission("openvk\Web\Models\Entities\TicketReply", "write", 0); + $this->assertNoCSRF(); + + $user = (new Users)->get($id); + if(!$user) + exit(json_encode([ "error" => "User does not exist" ])); + + $user->setBlock_In_Support_Reason(null); + $user->save(); + $this->returnJson([ "success" => true ]); + } +} diff --git a/Web/Presenters/templates/Support/Index.xml b/Web/Presenters/templates/Support/Index.xml index 8f0f8737..133cf073 100644 --- a/Web/Presenters/templates/Support/Index.xml +++ b/Web/Presenters/templates/Support/Index.xml @@ -26,16 +26,26 @@
{if $isNew} -
-
-
-

-

- -

-
-
-
+ {if !is_null($banReason)} +
+ {_'banned_alt'} +
+

+ {tr("banned_in_support_1", htmlentities($thisUser->getCanonicalName()))|noescape}
+ {tr("banned_in_support_2", htmlentities($banReason))|noescape} +

+ {else} +
+
+
+

+

+ +

+
+
+
+ {/if} {/if} {/if} diff --git a/Web/Presenters/templates/User/View.xml b/Web/Presenters/templates/User/View.xml index f421925c..c9457cba 100644 --- a/Web/Presenters/templates/User/View.xml +++ b/Web/Presenters/templates/User/View.xml @@ -93,6 +93,16 @@ {_warn_user_action} {/if} + + {if $thisUser->getChandlerUser()->can('write')->model('openvk\Web\Models\Entities\TicketReply')->whichBelongsTo(0)} + + {if $user->isBannedInSupport()} + {_unban_in_support_user_action} + {else} + {_ban_in_support_user_action} + {/if} + + {/if} {_send_gift} {_"send_message"} @@ -526,7 +536,7 @@ function warnUser() { uBanMsgTxt = "Вы собираетесь предупредить пользователя " + {$user->getCanonicalName()} + "."; uBanMsgTxt += "
Мы отправим уведомление пользователю в личные сообщения от имени аккаунта администратора."; - uBanMsgTxt += "

Текст предупреждения: " + uBanMsgTxt += "

Текст предупреждения: "; MessageBox("Выдать предупреждение " + {$user->getFirstName()}, uBanMsgTxt, ["Подтвердить", "Отмена"], [ (function() { @@ -546,6 +556,51 @@ } + + diff --git a/Web/routes.yml b/Web/routes.yml index 2c22687f..a31bffad 100644 --- a/Web/routes.yml +++ b/Web/routes.yml @@ -271,6 +271,8 @@ routes: handler: "Admin->gifts" - url: "/admin/ban/{num}" handler: "Admin->quickBan" + - url: "/admin/unban/{num}" + handler: "Admin->quickUnban" - url: "/admin/warn/{num}" handler: "Admin->quickWarn" - url: "/admin/support/ban/{num}" diff --git a/locales/en.strings b/locales/en.strings index 5d138899..a305cbdd 100644 --- a/locales/en.strings +++ b/locales/en.strings @@ -834,6 +834,7 @@ "manage_user_action" = "Manage user"; "manage_group_action" = "Manage group"; "ban_user_action" = "Ban user"; +"unban_user_action" = "Unban user"; "warn_user_action" = "Warn user"; "ban_in_support_user_action" = "Ban in support"; "unban_in_support_user_action" = "Unban in support"; diff --git a/locales/ru.strings b/locales/ru.strings index cc98e2d8..0c71d919 100644 --- a/locales/ru.strings +++ b/locales/ru.strings @@ -877,6 +877,7 @@ "manage_user_action" = "Управление пользователем"; "manage_group_action" = "Управление группой"; "ban_user_action" = "Заблокировать пользователя"; +"unban_user_action" = "Разблокировать пользователя"; "warn_user_action" = "Предупредить пользователя"; "ban_in_support_user_action" = "Заблокировать в поддержке"; "unban_in_support_user_action" = "Разблокировать в поддержке"; From f1d923f5806455b067d407c93e137b07d1c51def Mon Sep 17 00:00:00 2001 From: Maxim Leshchenko Date: Sun, 27 Mar 2022 11:58:29 +0200 Subject: [PATCH 15/54] Support: Allow agents to prevent banned users from creating tickets --- Web/Presenters/templates/User/banned.xml | 59 ++++++++++++++++++++++-- 1 file changed, 56 insertions(+), 3 deletions(-) diff --git a/Web/Presenters/templates/User/banned.xml b/Web/Presenters/templates/User/banned.xml index f1e6f8c1..f0e7e661 100644 --- a/Web/Presenters/templates/User/banned.xml +++ b/Web/Presenters/templates/User/banned.xml @@ -4,13 +4,21 @@ {tr("user_banned", htmlentities($user->getFirstName()))|noescape}
{_"user_banned_comment"} {$user->getBanReason()}.

-

-
{_unban_user_action} +

+
+ {_unban_user_action} + + {if $user->isBannedInSupport()} + {_unban_in_support_user_action} + {else} + {_ban_in_support_user_action} + {/if} +

+ + From c55bb779ccfe36d47f5927d4f72c5fef1a955568 Mon Sep 17 00:00:00 2001 From: Maxim Leshchenko Date: Sun, 27 Mar 2022 12:11:29 +0200 Subject: [PATCH 16/54] Users: Hide button to increase rating if display of rating is disabled in settings Closes #504 --- Web/Presenters/templates/User/View.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Web/Presenters/templates/User/View.xml b/Web/Presenters/templates/User/View.xml index 7af04225..aaac140c 100644 --- a/Web/Presenters/templates/User/View.xml +++ b/Web/Presenters/templates/User/View.xml @@ -72,7 +72,7 @@ - @@ -155,7 +155,7 @@ - {$follower->getCanonicalName()} + {$follower->getCanonicalName()} @@ -188,4 +188,4 @@
{/if} -{/block} \ No newline at end of file +{/block} diff --git a/Web/Presenters/templates/Admin/Clubs.xml b/Web/Presenters/templates/Admin/Clubs.xml index 4e9de1cb..33093fa5 100644 --- a/Web/Presenters/templates/Admin/Clubs.xml +++ b/Web/Presenters/templates/Admin/Clubs.xml @@ -32,7 +32,7 @@ - {$club->getCanonicalName()} + {$club->getCanonicalName()} @@ -43,7 +43,7 @@ - {$user->getCanonicalName()} + {$user->getCanonicalName()} diff --git a/Web/Presenters/templates/Admin/User.xml b/Web/Presenters/templates/Admin/User.xml index ae4e1dc1..205add63 100644 --- a/Web/Presenters/templates/Admin/User.xml +++ b/Web/Presenters/templates/Admin/User.xml @@ -17,7 +17,7 @@ - +
diff --git a/Web/Presenters/templates/Admin/Users.xml b/Web/Presenters/templates/Admin/Users.xml index d0e1ece3..e50ed795 100644 --- a/Web/Presenters/templates/Admin/Users.xml +++ b/Web/Presenters/templates/Admin/Users.xml @@ -32,7 +32,7 @@ - {$user->getCanonicalName()} + {$user->getCanonicalName()} diff --git a/Web/Presenters/templates/Admin/Voucher.xml b/Web/Presenters/templates/Admin/Voucher.xml index 163f6111..1de53fe0 100644 --- a/Web/Presenters/templates/Admin/Voucher.xml +++ b/Web/Presenters/templates/Admin/Voucher.xml @@ -74,7 +74,7 @@ - {$user->getCanonicalName()} + {$user->getCanonicalName()} diff --git a/Web/Presenters/templates/Group/Followers.xml b/Web/Presenters/templates/Group/Followers.xml index f8980f7f..d451daff 100644 --- a/Web/Presenters/templates/Group/Followers.xml +++ b/Web/Presenters/templates/Group/Followers.xml @@ -41,7 +41,7 @@ {/block} {block preview} - {$x instanceof $Manager ? $x->getUser()->getCanonicalName() : $x->getCanonicalName()} + {$x instanceof $Manager ? $x->getUser()->getCanonicalName() : $x->getCanonicalName()} {/block} {block name} @@ -140,4 +140,4 @@ {/if} {/if} -{/block} \ No newline at end of file +{/block} diff --git a/Web/Presenters/templates/Group/View.xml b/Web/Presenters/templates/Group/View.xml index a37a5a1b..6ab0c055 100644 --- a/Web/Presenters/templates/Group/View.xml +++ b/Web/Presenters/templates/Group/View.xml @@ -57,7 +57,7 @@
@@ -94,7 +94,7 @@ {var avatarPhoto = $club->getAvatarPhoto()} {var avatarLink = ((is_null($avatarPhoto) ? FALSE : $avatarPhoto->isAnonymous()) ? "/photo" . ("s/" . base_convert((string) $avatarPhoto->getId(), 10, 32)) : $club->getAvatarLink())} - +
{if $correspondent->getId() === $thisUser->getId() || $correspondent->getPrivacyPermission('messages.write', $thisUser)} - {$thisUser->getCanonicalName()} + {$thisUser->getCanonicalName()}
- {$correspondent->getCanonicalName()} + {$correspondent->getCanonicalName()} {else}
{/if} diff --git a/Web/Presenters/templates/Messenger/Index.xml b/Web/Presenters/templates/Messenger/Index.xml index 63461d92..f0a12371 100644 --- a/Web/Presenters/templates/Messenger/Index.xml +++ b/Web/Presenters/templates/Messenger/Index.xml @@ -25,7 +25,7 @@ {var lastMsg = $coresp->getPreviewMessage()}
- Фотография пользователя