diff --git a/VKAPI/Handlers/Notes.php b/VKAPI/Handlers/Notes.php
index 9e07454ec..0dcc6be85 100644
--- a/VKAPI/Handlers/Notes.php
+++ b/VKAPI/Handlers/Notes.php
@@ -9,7 +9,7 @@
use openvk\Web\Models\Repositories\Comments as CommentsRepo;
use openvk\Web\Models\Repositories\Photos as PhotosRepo;
use openvk\Web\Models\Repositories\Videos as VideosRepo;
-use openvk\Web\Models\Entities\{Note, Comment};
+use openvk\Web\Models\Entities\{User, Note, Comment};
final class Notes extends VKAPIRequestHandler
{
@@ -62,7 +62,7 @@ public function createComment(int $note_id, int $owner_id, string $message, stri
$this->fail(15, "Access denied");
}
- if (!$note->getOwner()->getPrivacyPermission('notes.read', $this->getUser())) {
+ if ($note->getOwner() instanceof User && !$note->getOwner()->getPrivacyPermission('notes.read', $this->getUser())) {
$this->fail(15, "Access denied");
}
@@ -92,7 +92,9 @@ public function edit(string $note_id, string $title = "", string $text = "", int
$this->fail(15, "Access denied");
}
- if (!$note->canBeModifiedBy($this->getUser())) {
+ if ($note->getOwner() instanceof User && !$note->canBeModifiedBy($this->getUser())) {
+ $this->fail(15, "Access denied");
+ } elseif (!$note->getOwner()->canBeModifiedBy($this->getUser()) || $note->getOwner()->isWikiPagesDisabledEnforced()) {
$this->fail(15, "Access denied");
}
@@ -174,7 +176,8 @@ public function getById(int $note_id, int $owner_id, bool $need_wiki = false)
$this->fail(15, "Access denied");
}
- if (!$note->getOwner()->getPrivacyPermission('notes.read', $this->getUser())) {
+
+ if ($note->getOwner() instanceof User && !$note->getOwner()->getPrivacyPermission('notes.read', $this->getUser())) {
$this->fail(15, "Access denied");
}
@@ -203,7 +206,7 @@ public function getComments(int $note_id, int $owner_id, int $sort = 1, int $off
$this->fail(15, "Access denied");
}
- if (!$note->getOwner()->getPrivacyPermission('notes.read', $this->getUser())) {
+ if ($note->getOwner() instanceof User && !$note->getOwner()->getPrivacyPermission('notes.read', $this->getUser())) {
$this->fail(15, "Access denied");
}
diff --git a/Web/Models/Entities/Club.php b/Web/Models/Entities/Club.php
index 6c8a03720..21bcbddab 100644
--- a/Web/Models/Entities/Club.php
+++ b/Web/Models/Entities/Club.php
@@ -7,7 +7,7 @@
use openvk\Web\Util\DateTime;
use openvk\Web\Models\RowModel;
use openvk\Web\Models\Entities\{User, Manager};
-use openvk\Web\Models\Repositories\{Users, Clubs, Albums, Managers, Posts};
+use openvk\Web\Models\Repositories\{Users, Clubs, Albums, Managers, Notes, Posts};
use Nette\Database\Table\{ActiveRow, GroupedSelection};
use Chandler\Database\DatabaseConnection as DB;
use Chandler\Security\User as ChandlerUser;
@@ -538,4 +538,38 @@ public function toVkApiStruct(?User $user = null, string $fields = ''): object
return $res;
}
+
+ public function canCreateNote(?User $user): bool
+ {
+ return $this->canBeModifiedBy($user);
+ }
+
+ public function getMainNoteId(): ?int
+ {
+ if ($this->isWikiPagesDisabledEnforced()) {
+ return null;
+ }
+
+ return $this->getRecord()->main_note_id;
+ }
+
+ public function getMainNote(): ?Note
+ {
+ return (new Notes())->get($this->getMainNoteId() ?? 0);
+ }
+
+ public function isMainNoteExpanded(): bool
+ {
+ return (bool) $this->getRecord()->is_main_note_expanded;
+ }
+
+ public function isMainNoteExpandedEnforced(): bool
+ {
+ return (bool) $this->getRecord()->enforce_main_note_expanded;
+ }
+
+ public function isWikiPagesDisabledEnforced(): bool
+ {
+ return (bool) $this->getRecord()->enforce_wiki_pages_disabled;
+ }
}
diff --git a/Web/Models/Entities/Note.php b/Web/Models/Entities/Note.php
index b9829822d..d0b39f6e3 100644
--- a/Web/Models/Entities/Note.php
+++ b/Web/Models/Entities/Note.php
@@ -7,6 +7,10 @@
use HTMLPurifier_Config;
use HTMLPurifier;
use HTMLPurifier_Filter;
+use openvk\Web\Models\RowModel;
+use openvk\Web\Models\Entities\User;
+use openvk\Web\Models\Repositories\Users;
+use openvk\Web\Models\Repositories\Clubs;
class SecurityFilter extends HTMLPurifier_Filter
{
@@ -160,11 +164,19 @@ public function getSource(): string
public function canBeViewedBy(?User $user = null): bool
{
- if ($this->isDeleted() || $this->getOwner()->isDeleted()) {
+ if ($this->isDeleted()) {
return false;
}
- return $this->getOwner()->getPrivacyPermission('notes.read', $user) && $this->getOwner()->canBeViewedBy($user);
+ if ($this->getOwner() instanceof User) {
+ if ($this->getOwner()->isDeleted()) {
+ return false;
+ }
+
+ return $this->getOwner()->getPrivacyPermission('notes.read', $user) && $this->getOwner()->canBeViewedBy($user);
+ }
+
+ return $this->getOwner()->canBeViewedBy($user);
}
public function toVkApiStruct(): object
@@ -181,4 +193,18 @@ public function toVkApiStruct(): object
return $res;
}
+
+ public function getOwner(bool $real = false): RowModel
+ {
+ $oid = (int) $this->getRecord()->owner;
+ if (!$real && $this->isAnonymous()) {
+ $oid = (int) OPENVK_ROOT_CONF["openvk"]["preferences"]["wall"]["anonymousPosting"]["account"];
+ }
+
+ if ($oid > 0) {
+ return (new Users())->get($oid);
+ } else {
+ return (new Clubs())->get($oid * -1);
+ }
+ }
}
diff --git a/Web/Models/Repositories/Notes.php b/Web/Models/Repositories/Notes.php
index 62bc3d33e..71edaf2d6 100644
--- a/Web/Models/Repositories/Notes.php
+++ b/Web/Models/Repositories/Notes.php
@@ -7,6 +7,7 @@
use Chandler\Database\DatabaseConnection;
use openvk\Web\Models\Entities\Note;
use openvk\Web\Models\Entities\User;
+use openvk\Web\Models\Entities\Club;
use Nette\Database\Table\ActiveRow;
class Notes
@@ -38,6 +39,21 @@ public function getUserNotes(User $user, int $page = 1, ?int $perPage = null, st
}
}
+ public function getClubNotes(Club $club, int $page = 1, ?int $perPage = null, string $sort = "DESC"): \Traversable
+ {
+ $perPage ??= OPENVK_DEFAULT_PER_PAGE;
+ foreach ($this->notes->where("owner", $club->getId() * -1)->where("deleted", 0)->order("created $sort")->page($page, $perPage) as $album) {
+ yield new Note($album);
+ }
+ }
+
+ public function getAllClubNotes(Club $club, string $sort = "DESC"): \Traversable
+ {
+ foreach ($this->notes->where("owner", $club->getId() * -1)->where("deleted", 0)->order("created $sort") as $album) {
+ yield new Note($album);
+ }
+ }
+
public function getNoteById(int $owner, int $note): ?Note
{
$note = $this->notes->where(['owner' => $owner, 'virtual_id' => $note])->fetch();
@@ -52,4 +68,9 @@ public function getUserNotesCount(User $user): int
{
return sizeof($this->notes->where("owner", $user->getId())->where("deleted", 0));
}
+
+ public function getClubNotesCount(Club $club): int
+ {
+ return $this->notes->where("owner", $club->getId() * -1)->where("deleted", 0)->count('*');
+ }
}
diff --git a/Web/Presenters/AdminPresenter.php b/Web/Presenters/AdminPresenter.php
index cc38b74e5..a6d89b6ed 100644
--- a/Web/Presenters/AdminPresenter.php
+++ b/Web/Presenters/AdminPresenter.php
@@ -258,6 +258,8 @@ public function renderClub(int $id): void
$club->setVerified(empty($this->postParam("verify") ? 0 : 1));
$club->setHide_From_Global_Feed(empty($this->postParam("hide_from_global_feed") ? 0 : 1));
$club->setEnforce_Hiding_From_Global_Feed(empty($this->postParam("enforce_hiding_from_global_feed") ? 0 : 1));
+ $club->setEnforce_Main_Note_Expanded(empty($this->postParam("enforce_main_note_expanded") ? 0 : 1));
+ $club->setEnforce_Wiki_Pages_Disabled(empty($this->postParam("enforce_wiki_pages_disabled") ? 0 : 1));
$club->save();
break;
case "ban":
diff --git a/Web/Presenters/CommentPresenter.php b/Web/Presenters/CommentPresenter.php
index 3dd2b5460..0ae6d70e3 100644
--- a/Web/Presenters/CommentPresenter.php
+++ b/Web/Presenters/CommentPresenter.php
@@ -4,7 +4,7 @@
namespace openvk\Web\Presenters;
-use openvk\Web\Models\Entities\{Comment, Notifications\MentionNotification, Photo, Video, User, Topic, Post};
+use openvk\Web\Models\Entities\{Comment, Club, Notifications\MentionNotification, Note, Photo, Video, User, Topic, Post};
use openvk\Web\Models\Entities\Notifications\CommentNotification;
use openvk\Web\Models\Repositories\{Comments, Clubs, Videos, Photos, Audios};
use Nette\InvalidStateException as ISE;
@@ -84,6 +84,10 @@ public function renderMakeComment(string $repo, int $eId): void
$this->flashFail("err", tr("error"), tr("forbidden"));
}
+ if ($entity instanceof Note && $entity->getOwner() instanceof Club) {
+ $this->flashFail("err", tr("error"), tr("forbidden"));
+ }
+
$flags = 0;
if ($this->postParam("as_group") === "on" && !is_null($club) && $club->canBeModifiedBy($this->user->identity)) {
$flags |= 0b10000000;
diff --git a/Web/Presenters/GroupPresenter.php b/Web/Presenters/GroupPresenter.php
index 99d5fa332..502d5b77d 100644
--- a/Web/Presenters/GroupPresenter.php
+++ b/Web/Presenters/GroupPresenter.php
@@ -7,7 +7,7 @@
use openvk\Web\Models\Entities\{Club, Photo, Post};
use Nette\InvalidStateException;
use openvk\Web\Models\Entities\Notifications\ClubModeratorNotification;
-use openvk\Web\Models\Repositories\{Clubs, Users, Albums, Managers, Topics, Audios, Posts, Documents};
+use openvk\Web\Models\Repositories\{Clubs, Users, Albums, Managers, Notes, Topics, Audios, Posts, Documents};
use Chandler\Security\Authenticator;
use Nette\InvalidStateException as ISE;
@@ -571,4 +571,46 @@ public function renderSuggested(int $id): void
$this->template->page = (int) ($this->queryParam("p") ?? 1);
}
+
+ public function renderNotes(int $id): void
+ {
+ $this->assertUserLoggedIn();
+
+ $club = $this->clubs->get($id);
+ if (!$club || $club->isBanned() || !$club->canBeModifiedBy($this->user->identity)) {
+ $this->notFound();
+ }
+
+ if ($club->isWikiPagesDisabledEnforced()) {
+ $this->flashFail("err", tr("forbidden"), tr("wiki_pages_banned_by_instance_admins"));
+ }
+
+ $this->template->club = $club;
+
+ if ($_SERVER["REQUEST_METHOD"] === "POST") {
+ if (!$club->isMainNoteExpandedEnforced()) {
+ $club->setIs_Main_Note_Expanded((bool) $this->postParam("expanded"));
+ }
+
+ $nid = (int) $this->postParam("nid");
+ if ($nid === 0) {
+ $club->setMain_Note_Id(null);
+ } else {
+ $note = (new Notes())->get($nid);
+
+ if (!$note || $note->isDeleted() || !($note->getOwner() instanceof Club && $note->getOwner()->getId() === $club->getId())) {
+ $this->flashFail("err", tr("error"), tr("forbidden"));
+ }
+
+ $club->setMain_Note_Id($nid);
+ }
+
+ $club->save();
+
+ $this->flash("succ", tr("changes_saved"), tr("new_changes_desc"));
+ }
+
+ $this->template->notes = iterator_to_array((new Notes())->getAllClubNotes($club));
+ $this->template->count = (new Notes())->getClubNotesCount($club);
+ }
}
diff --git a/Web/Presenters/NotesPresenter.php b/Web/Presenters/NotesPresenter.php
index ec51f238c..dd282e45e 100644
--- a/Web/Presenters/NotesPresenter.php
+++ b/Web/Presenters/NotesPresenter.php
@@ -4,8 +4,8 @@
namespace openvk\Web\Presenters;
-use openvk\Web\Models\Repositories\{Users, Notes};
-use openvk\Web\Models\Entities\Note;
+use openvk\Web\Models\Repositories\{Clubs, Users, Notes};
+use openvk\Web\Models\Entities\{User, Note};
final class NotesPresenter extends OpenVKPresenter
{
@@ -21,31 +21,54 @@ public function __construct(Notes $notes)
public function renderList(int $owner): void
{
- $user = (new Users())->get($owner);
- if (!$user) {
- $this->notFound();
- }
- if (!$user->getPrivacyPermission('notes.read', $this->user->identity ?? null)) {
- $this->flashFail("err", tr("forbidden"), tr("forbidden_comment"));
- }
-
$this->template->page = (int) ($this->queryParam("p") ?? 1);
- $this->template->notes = $this->notes->getUserNotes($user, $this->template->page);
- $this->template->count = $this->notes->getUserNotesCount($user);
- $this->template->owner = $user;
+
+ if ($owner > 0) {
+ $user = (new Users())->get($owner);
+
+ if (!$user) {
+ $this->notFound();
+ }
+ if (!$user->getPrivacyPermission('notes.read', $this->user->identity ?? null)) {
+ $this->flashFail("err", tr("forbidden"), tr("forbidden_comment"));
+ }
+
+ $this->template->notes = $this->notes->getUserNotes($user, $this->template->page);
+ $this->template->count = $this->notes->getUserNotesCount($user);
+ $this->template->owner = $user;
+ } else {
+ $club = (new Clubs())->get($owner * -1);
+
+ if (!$club || $club->isBanned() || is_null($this->user) || !$club->canBeModifiedBy($this->user->identity) || $club->isWikiPagesDisabledEnforced()) {
+ $this->notFound();
+ }
+
+ $this->template->notes = $this->notes->getClubNotes($club, $this->template->page);
+ $this->template->count = $this->notes->getClubNotesCount($club);
+ $this->template->owner = $club;
+ $this->template->canCreateNotesInThisGroup = $club->canCreateNote($this->user->identity);
+ }
}
public function renderView(int $owner, int $note_id): void
{
$note = $this->notes->getNoteById($owner, $note_id);
- if (!$note || $note->getOwner()->getId() !== $owner || $note->isDeleted()) {
+ if (!$note || $note->isDeleted()) {
$this->notFound();
}
- if (!$note->getOwner()->getPrivacyPermission('notes.read', $this->user->identity ?? null)) {
- $this->flashFail("err", tr("forbidden"), tr("forbidden_comment"));
- }
- if (!$note->canBeViewedBy($this->user->identity)) {
- $this->flashFail("err", tr("forbidden"), tr("forbidden_comment"));
+
+ if ($note->getOwner() instanceof User) {
+ if ($note->getOwner()->getId() !== $owner) {
+ $this->notFound();
+ }
+ if (!$note->getOwner()->getPrivacyPermission('notes.read', $this->user->identity ?? null)) {
+ $this->flashFail("err", tr("forbidden"), tr("forbidden_comment"));
+ }
+ if (!$note->canBeViewedBy($this->user->identity)) {
+ $this->flashFail("err", tr("forbidden"), tr("forbidden_comment"));
+ }
+ } elseif ($note->getOwner()->isBanned() || $note->getOwner()->isWikiPagesDisabledEnforced()) {
+ $this->flashFail("err", tr("error"), tr("forbidden"));
}
$this->template->cCount = $note->getCommentsCount();
@@ -88,20 +111,38 @@ public function renderCreate(): void
$this->notFound();
}
+ $owner = $id;
+
+ $group_id = (int) $this->queryParam("gid");
+
+ if ($group_id) {
+ $group = (new Clubs())->get($group_id);
+ if (!$group || $group->isBanned()) {
+ $this->notFound();
+ }
+
+ if (!$group->canCreateNote($this->user->identity) || $group->isWikiPagesDisabledEnforced()) {
+ $this->flashFail("err", tr("error"), tr("forbidden"));
+ }
+
+ $owner = $group->getId() * -1;
+ $this->template->club = $group;
+ }
+
if ($_SERVER["REQUEST_METHOD"] === "POST") {
if (empty($this->postParam("name"))) {
$this->flashFail("err", tr("error"), tr("error_segmentation"));
}
$note = new Note();
- $note->setOwner($this->user->id);
+ $note->setOwner($owner);
$note->setCreated(time());
$note->setName($this->postParam("name"));
$note->setSource($this->postParam("html"));
$note->setEdited(time());
$note->save();
- $this->redirect("/note" . $this->user->id . "_" . $note->getVirtualId());
+ $this->redirect("/note" . $owner . "_" . $note->getVirtualId());
}
}
@@ -112,12 +153,22 @@ public function renderEdit(int $owner, int $note_id): void
$note = $this->notes->getNoteById($owner, $note_id);
- if (!$note || $note->getOwner()->getId() !== $owner || $note->isDeleted()) {
+ if (!$note || $note->isDeleted()) {
$this->notFound();
}
- if (is_null($this->user) || !$note->canBeModifiedBy($this->user->identity)) {
+
+ if ($note->getOwner() instanceof User) {
+ if ($note->getOwner()->getId() !== $owner) {
+ $this->notFound();
+ }
+
+ if (is_null($this->user) || !$note->canBeModifiedBy($this->user->identity)) {
+ $this->flashFail("err", tr("error_access_denied_short"), tr("error_access_denied"));
+ }
+ } elseif (is_null($this->user) || !$note->getOwner()->canBeModifiedBy($this->user->identity) || $note->getOwner()->isWikiPagesDisabledEnforced()) {
$this->flashFail("err", tr("error_access_denied_short"), tr("error_access_denied"));
}
+
$this->template->note = $note;
if ($_SERVER["REQUEST_METHOD"] === "POST") {
@@ -131,7 +182,7 @@ public function renderEdit(int $owner, int $note_id): void
$note->setEdited(time());
$note->save();
- $this->redirect("/note" . $this->user->id . "_" . $note->getVirtualId());
+ $this->redirect("/note" . $note->getOwner()->getId() * ($note->getOwner() instanceof User ? 1 : -1) . "_" . $note->getVirtualId());
}
}
@@ -141,20 +192,33 @@ public function renderDelete(int $owner, int $id): void
$this->willExecuteWriteAction();
$this->assertNoCSRF();
- $note = $this->notes->get($id);
- if (!$note) {
+ $note = $this->notes->getNoteById($owner, $id);
+ if (!$note || $note->isDeleted()) {
$this->notFound();
}
- if ($note->getOwner()->getId() . "_" . $note->getId() !== $owner . "_" . $id || $note->isDeleted()) {
- $this->notFound();
- }
- if (is_null($this->user) || !$note->canBeModifiedBy($this->user->identity)) {
- $this->flashFail("err", tr("error_access_denied_short"), tr("error_access_denied"));
+
+ $oid = $note->getOwner()->getId() * ($note->getOwner() instanceof User ? 1 : -1);
+
+ if ($oid > 0) {
+ if ($note->getOwner()->getId() . "_" . $note->getId() !== $owner . "_" . $id) {
+ $this->notFound();
+ }
+ if (is_null($this->user) || !$note->canBeModifiedBy($this->user->identity)) {
+ $this->flashFail("err", tr("error_access_denied_short"), tr("error_access_denied"));
+ }
+ } else {
+ if (is_null($this->user) || !$note->getOwner()->canBeModifiedBy($this->user->identity) || $note->getOwner()->isWikiPagesDisabledEnforced()) {
+ $this->flashFail("err", tr("error_access_denied_short"), tr("error_access_denied"));
+ }
+
+ if ($note->getId() === $note->getOwner()->getMainNoteId()) {
+ $this->flashFail("err", tr("error_access_denied_short"), tr("wiki_pages_cant_remove_main", "/club" . $note->getOwner()->getId() . "/notes"));
+ }
}
$name = $note->getName();
$note->delete();
$this->flash("succ", tr("note_is_deleted"), tr("note_x_is_now_deleted", $name));
- $this->redirect("/notes" . $this->user->id);
+ $this->redirect("/notes" . $oid);
}
}
diff --git a/Web/Presenters/templates/Admin/Club.xml b/Web/Presenters/templates/Admin/Club.xml
index 2837da578..f9d1bc774 100644
--- a/Web/Presenters/templates/Admin/Club.xml
+++ b/Web/Presenters/templates/Admin/Club.xml
@@ -69,6 +69,14 @@
+
+
+
+
+
+
+
+
diff --git a/Web/Presenters/templates/Group/EditBackdrop.xml b/Web/Presenters/templates/Group/EditBackdrop.xml
index 1e53fa03a..d385365ad 100644
--- a/Web/Presenters/templates/Group/EditBackdrop.xml
+++ b/Web/Presenters/templates/Group/EditBackdrop.xml
@@ -24,6 +24,11 @@
{_followers}
+
diff --git a/Web/Presenters/templates/Group/Followers.xml b/Web/Presenters/templates/Group/Followers.xml
index 0042add13..256756b0b 100644
--- a/Web/Presenters/templates/Group/Followers.xml
+++ b/Web/Presenters/templates/Group/Followers.xml
@@ -33,6 +33,11 @@
{_followers}
+
{/if}
{/block}
diff --git a/Web/Presenters/templates/Group/Notes.xml b/Web/Presenters/templates/Group/Notes.xml
new file mode 100644
index 000000000..af7ac7458
--- /dev/null
+++ b/Web/Presenters/templates/Group/Notes.xml
@@ -0,0 +1,112 @@
+{extends "../@layout.xml"}
+{var $backdrops = $club->getBackDropPictureURLs()}
+
+{block title}{$club->getName()} | {_wiki_pages}{/block}
+
+{block header}
+{$club->getName()} » {_wiki_pages}
+{/block}
+
+{block content}
+
+
+
+
{_menu_settings}
+
+
+ {if $count > 10}
+
+
{tr("wiki_pages_show_all", $count)} »
+ {elseif $count == 0}
+
+ {include ../components/nothing.xml}
+ {/if}
+
+
+
+
+
+
+
+
+ |
+
+
+
+
+ {$note->getPublicationTime()}
+ ({_edited} {$note->getEditTime()})
+
+
+ |
+
+
+
+
+{/block}
diff --git a/Web/Presenters/templates/Group/View.xml b/Web/Presenters/templates/Group/View.xml
index 0a4944769..f831ff995 100644
--- a/Web/Presenters/templates/Group/View.xml
+++ b/Web/Presenters/templates/Group/View.xml
@@ -43,6 +43,43 @@
+
+ {if !(!$club->getMainNote() || $club->getMainNote()->isDeleted() || $club->isWikiPagesDisabledEnforced())}
+
+ {_materials}
+
+
+
+ {$club->getMainNote()->getText()|noescape}
+
+
+
+ {/if}
+
{var $followersCount = $club->getFollowersCount()}
diff --git a/Web/Presenters/templates/Notes/Create.xml b/Web/Presenters/templates/Notes/Create.xml
index 21e952479..c698550aa 100644
--- a/Web/Presenters/templates/Notes/Create.xml
+++ b/Web/Presenters/templates/Notes/Create.xml
@@ -3,6 +3,10 @@
{block title}{_create_note}{/block}
{block header}
+ {if isset($club)}
+
{$club->getCanonicalName()}
+ »
+ {/if}
{_create_note}
{/block}
diff --git a/Web/Presenters/templates/Notes/Edit.xml b/Web/Presenters/templates/Notes/Edit.xml
index ad8b9c803..95520163b 100644
--- a/Web/Presenters/templates/Notes/Edit.xml
+++ b/Web/Presenters/templates/Notes/Edit.xml
@@ -6,9 +6,9 @@
{var $author = $note->getOwner()}
{$author->getCanonicalName()}
»
-
{_notes}
+
{_notes}
»
-
{$note->getName()}
+
{$note->getName()}
{/block}
{block content}
@@ -23,7 +23,7 @@
-
{_cancel}
+
{_cancel}
{script "js/node_modules/monaco-editor/min/vs/loader.js"}
diff --git a/Web/Presenters/templates/Notes/List.xml b/Web/Presenters/templates/Notes/List.xml
index 7896c1d5a..0c2ed3714 100644
--- a/Web/Presenters/templates/Notes/List.xml
+++ b/Web/Presenters/templates/Notes/List.xml
@@ -18,9 +18,9 @@
@@ -87,19 +87,20 @@
diff --git a/Web/Presenters/templates/Notes/View.xml b/Web/Presenters/templates/Notes/View.xml
index 4aa0627be..fc9b4623e 100644
--- a/Web/Presenters/templates/Notes/View.xml
+++ b/Web/Presenters/templates/Notes/View.xml
@@ -4,15 +4,18 @@
{block header}
{var $author = $note->getOwner()}
- {$author->getCanonicalName()}
- »
- {_notes}
- »
+ {if $author instanceof openvk\Web\Models\Entities\User || (isset($thisUser) && $author->canBeModifiedBy($thisUser))}
+ {$author->getCanonicalName()}
+ »
+ {_notes}
+ »
+ {/if}
{$note->getName()}
{/block}
{block content}
{var $author = $note->getOwner()}
+ {var $isAuthorClub = $author instanceof openvk\Web\Models\Entities\Club}
-