mirror of
https://github.com/openvk/openvk
synced 2024-11-11 01:19:53 +03:00
Discussions: Add ability to turn on the display of a list of topics above the wall
This commit is contained in:
parent
d2814bef01
commit
c77fbebd22
7 changed files with 53 additions and 25 deletions
|
@ -135,6 +135,11 @@ class Club extends RowModel
|
|||
return (bool) $this->getRecord()->everyone_can_create_topics;
|
||||
}
|
||||
|
||||
function isDisplayTopicsAboveWallEnabled(): bool
|
||||
{
|
||||
return (bool) $this->getRecord()->display_topics_above_wall;
|
||||
}
|
||||
|
||||
function getType(): int
|
||||
{
|
||||
return $this->getRecord()->type;
|
||||
|
|
|
@ -208,6 +208,7 @@ final class GroupPresenter extends OpenVKPresenter
|
|||
$club->setWall(empty($this->postParam("wall")) ? 0 : 1);
|
||||
$club->setAdministrators_List_Display(empty($this->postParam("administrators_list_display")) ? 0 : $this->postParam("administrators_list_display"));
|
||||
$club->setEveryone_Can_Create_Topics(empty($this->postParam("everyone_can_create_topics")) ? 0 : 1);
|
||||
$club->setDisplay_Topics_Above_Wall(empty($this->postParam("display_topics_above_wall")) ? 0 : 1);;
|
||||
|
||||
$website = $this->postParam("website") ?? "";
|
||||
if(empty($website))
|
||||
|
|
|
@ -82,7 +82,8 @@
|
|||
<span class="nobold">{_discussions}: </span>
|
||||
</td>
|
||||
<td>
|
||||
<input type="checkbox" name="everyone_can_create_topics" value="1" n:attr="checked => $club->isEveryoneCanCreateTopics()" /> {_everyone_can_create_topics}
|
||||
<input type="checkbox" name="everyone_can_create_topics" value="1" n:attr="checked => $club->isEveryoneCanCreateTopics()" /> {_everyone_can_create_topics}<br>
|
||||
<input type="checkbox" name="display_topics_above_wall" value="1" n:attr="checked => $club->isDisplayTopicsAboveWallEnabled()" /> {_display_list_of_topics_above_wall}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
|
|
@ -68,9 +68,27 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div n:if="($topicsCount > 0 || $club->isEveryoneCanCreateTopics() || ($thisUser && $club->canBeModifiedBy($thisUser))) && $club->isDisplayTopicsAboveWallEnabled()">
|
||||
<div class="content_title_expanded" onclick="hidePanel(this, {$topicsCount});">
|
||||
{_discussions}
|
||||
</div>
|
||||
<div>
|
||||
<div class="content_subtitle">
|
||||
{tr("topics", $topicsCount)}
|
||||
<div style="float: right;">
|
||||
<a href="/board{$club->getId()}">{_"all_title"}</a>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div n:foreach="$topics as $topic" class="topic-list-item" style="padding: 8px;">
|
||||
<b><a href="/topic{$topic->getPrettyId()}">{$topic->getTitle()}</a></b><br>
|
||||
<span class="nobold">{tr("updated_at", $topic->getUpdateTime())}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{presenter "openvk!Wall->wallEmbedded", -$club->getId()}
|
||||
|
||||
</div>
|
||||
<div class="right_small_block">
|
||||
<a href="{$club->getAvatarLink()|nocheck}">
|
||||
|
@ -194,7 +212,7 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div n:if="$topicsCount > 0 || $club->isEveryoneCanCreateTopics() || ($thisUser && $club->canBeModifiedBy($thisUser))">
|
||||
<div n:if="($topicsCount > 0 || $club->isEveryoneCanCreateTopics() || ($thisUser && $club->canBeModifiedBy($thisUser))) && !$club->isDisplayTopicsAboveWallEnabled()">
|
||||
<div class="content_title_expanded" onclick="hidePanel(this, {$topicsCount});">
|
||||
{_discussions}
|
||||
</div>
|
||||
|
|
1
install/sqls/00016-place-oftopic-list-setting.sql
Normal file
1
install/sqls/00016-place-oftopic-list-setting.sql
Normal file
|
@ -0,0 +1 @@
|
|||
ALTER TABLE `groups` ADD COLUMN `display_topics_above_wall` BOOLEAN NOT NULL DEFAULT FALSE AFTER `everyone_can_create_topics`;
|
|
@ -668,6 +668,7 @@
|
|||
"created" = "Created";
|
||||
|
||||
"everyone_can_create_topics" = "Everyone can create topics";
|
||||
"display_list_of_topics_above_wall" = "Display a list of topics above the wall";
|
||||
|
||||
"topic_changes_saved_comment" = "The updated title and settings will appear on the topic page.";
|
||||
|
||||
|
|
|
@ -703,6 +703,7 @@
|
|||
"created" = "Создано";
|
||||
|
||||
"everyone_can_create_topics" = "Все могут создавать темы";
|
||||
"display_list_of_topics_above_wall" = "Отображать список тем над стеной";
|
||||
|
||||
"topic_changes_saved_comment" = "Обновлённый заголовок и настройки появятся на странице с темой.";
|
||||
|
||||
|
|
Loading…
Reference in a new issue