git pushMerge branch 'master' of github.com:openvk/openvk

This commit is contained in:
veselcraft 2022-02-05 17:50:42 +03:00
commit f668aad262
No known key found for this signature in database
GPG key ID: AED66BC1AC628A4E
9 changed files with 189 additions and 69 deletions

View file

@ -48,7 +48,7 @@ ln -s /path/to/chandler/extensions/available/commitcaptcha /path/to/chandler/ext
ln -s /path/to/chandler/extensions/available/openvk /path/to/chandler/extensions/enabled/ ln -s /path/to/chandler/extensions/available/openvk /path/to/chandler/extensions/enabled/
``` ```
4. Import `install/init-static-db.sql` to **same database** you installed Chandler to 4. Import `install/init-static-db.sql` to **same database** you installed Chandler to and import all sqls from `install/sqls` to **same database**
5. Import `install/init-event-db.sql` to **separate database** 5. Import `install/init-event-db.sql` to **separate database**
6. Copy `openvk-example.yml` to `openvk.yml` and change options 6. Copy `openvk-example.yml` to `openvk.yml` and change options
7. Run `composer install` in OpenVK directory 7. Run `composer install` in OpenVK directory
@ -75,7 +75,7 @@ You may reach out to us via:
* [Bug-tracker](https://github.com/openvk/openvk/projects/1) * [Bug-tracker](https://github.com/openvk/openvk/projects/1)
* [Ticketing system](https://openvk.su/support?act=new) * [Ticketing system](https://openvk.su/support?act=new)
* Telegram chat: Go to [our channel](https://t.me/openvkch) and open discussion in our channel menu. * Telegram chat: Go to [our channel](https://t.me/openvkenglish) and open discussion in our channel menu.
* [Reddit](https://www.reddit.com/r/openvk/) * [Reddit](https://www.reddit.com/r/openvk/)
* [Discussions](https://github.com/openvk/openvk/discussions) * [Discussions](https://github.com/openvk/openvk/discussions)

View file

@ -48,7 +48,7 @@ ln -s /path/to/chandler/extensions/available/commitcaptcha /path/to/chandler/ext
ln -s /path/to/chandler/extensions/available/openvk /path/to/chandler/extensions/enabled/ ln -s /path/to/chandler/extensions/available/openvk /path/to/chandler/extensions/enabled/
``` ```
4. Импортируйте `install/init-static-db.sql` в **ту же базу данных**, в которую вы установили Chandler 4. Импортируйте `install/init-static-db.sql` в **ту же базу данных**, в которую вы установили Chandler, и импортируйте все SQL файлы из папки `install/sqls` в **ту же базу данных**
5. Импортируйте `install/init-event-db.sql` в **отдельную базу данных** 5. Импортируйте `install/init-event-db.sql` в **отдельную базу данных**
6. Скопируйте `openvk-example.yml` в `openvk.yml` и измените параметры 6. Скопируйте `openvk-example.yml` в `openvk.yml` и измените параметры
7. Запустите `composer install` в директории OpenVK 7. Запустите `composer install` в директории OpenVK

View file

@ -2,13 +2,17 @@
{block wrap} {block wrap}
<div class="page_wrap"> <div class="page_wrap">
<div n:ifset="tabs" class="tabs"> <div n:ifset="tabs" n:ifcontent class="tabs">
{include tabs} {include tabs}
</div> </div>
{ifset size}
{include size, x => $dat}
{/ifset}
<div class="container_gray"> <div class="container_gray">
{var data = is_array($iterator) ? $iterator : iterator_to_array($iterator)} {var data = is_array($iterator) ? $iterator : iterator_to_array($iterator)}
{if sizeof($data) > 0} {if sizeof($data) > 0}
<div class="content" n:foreach="$data as $dat"> <div class="content" n:foreach="$data as $dat">
<table> <table>
@ -20,32 +24,32 @@
</a> </a>
</td> </td>
<td valign="top" style="width: 100%"> <td valign="top" style="width: 100%">
<a href="{include link, x => $dat}"> {ifset infoTable}
<b> {include infoTable, x => $dat}
{include name, x => $dat} {else}
</b> <a href="{include link, x => $dat}">
</a> <b>
<br/> {include name, x => $dat}
</b>
{include description, x => $dat} </a>
<br/>
{include description, x => $dat}
{/ifset}
</td> </td>
<td n:ifset="actions" valign="top" class="action_links" style="width: 150px"> <td n:ifset="actions" valign="top" class="action_links" style="width: 150px; text-transform: lowercase;">
{include actions, x => $dat} {include actions, x => $dat}
</td> </td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
</div> </div>
{include "components/paginator.xml", conf => (object) [
<div style="padding: 8px;"> "page" => $page,
{include "components/paginator.xml", conf => (object) [ "count" => $count,
"page" => $page, "amount" => sizeof($data),
"count" => $count, "perPage" => $perPage ?? OPENVK_DEFAULT_PER_PAGE,
"amount" => sizeof($data), "atBottom" => true,
"perPage" => $perPage ?? OPENVK_DEFAULT_PER_PAGE, ]}
"atBottom" => true,
]}
</div>
{else} {else}
{ifset customErrorMessage} {ifset customErrorMessage}
{include customErrorMessage} {include customErrorMessage}
@ -54,5 +58,9 @@
{/ifset} {/ifset}
{/if} {/if}
</div> </div>
{ifset bottom}
{include bottom}
{/ifset}
</div> </div>
{/block} {/block}

View file

@ -2,37 +2,45 @@
{var iterator = $user->getClubs($page, $admin)} {var iterator = $user->getClubs($page, $admin)}
{var count = $user->getClubCount($admin)} {var count = $user->getClubCount($admin)}
{block title}{_"groups"}{/block} {block title}
{_groups}
{/block}
{block header} {block header}
<a href="{$user->getURL()}">{$user->getCanonicalName()}</a> » {_"groups"} {if !is_null($thisUser) && $user->getId() === $thisUser->getId()}
{_my_groups}
<div n:if="!is_null($thisUser) && $user->getId() === $thisUser->getId()" style="float:right;"> {else}
<span> <a href="{$user->getURL()}">{$user->getCanonicalName()}</a> » {_groups}
<b> {/if}
<a href="/groups_create">
{_"create_group"}
</a>
</b>
</span>
</div>
{/block} {/block}
{* BEGIN ELEMENTS DESCRIPTION *} {* BEGIN ELEMENTS DESCRIPTION *}
{block tabs} {block tabs}
{if !is_null($thisUser) && $user->getId() === $thisUser->getId()} {if !is_null($thisUser) && $user->getId() === $thisUser->getId()}
<div {if !$admin}id="activetabs"{/if} class="tab"> <div n:attr='id => ($admin ? false : "activetabs")' class="tab">
<a {if !$admin}id="act_tab_a"{/if} href="/groups{$user->getId()}"> <a n:attr='id => ($admin ? false : "act_tab_a")' href="/groups{$user->getId()}">
{_groups} {_groups}
</a> </a>
</div> </div>
<div {if $admin}id="activetabs"{/if} class="tab"> <div n:attr='id => (!$admin ? false : "activetabs")' class="tab">
<a {if $admin}id="act_tab_a"{/if} href="/groups{$user->getId()}?act=managed"> <a n:attr='id => (!$admin ? false : "act_tab_a")' href="/groups{$user->getId()}?act=managed">
{_managed} {_managed}
</a> </a>
</div> </div>
{/if} {/if}
{/block}
{block size}
<div n:if="!is_null($thisUser) && $user->getId() === $thisUser->getId()" style="padding-bottom: 0px; border-bottom: 0;" class="summaryBar">
<div class="summary">
{if !is_null($thisUser) && $user->getId() === $thisUser->getId()}
{tr("groups_list", $thisUser->getClubCount())}
{else}
{tr("groups", $user->getClubCount())}
{/if}
</div>
</div>
{/block} {/block}
{block link|strip|stripHtml} {block link|strip|stripHtml}
@ -43,8 +51,19 @@
<img src="{$x->getAvatarUrl()}" width="75" alt="Фотография группы" /> <img src="{$x->getAvatarUrl()}" width="75" alt="Фотография группы" />
{/block} {/block}
{block name} {block infoTable}
{$x->getName()} <table id="basicInfo" class="ugc-table group_info" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td class="label"><span class="nobold">{_name}: </span></td>
<td class="data"><a href="{$x->getURL()}">{$x->getName()}</a></td>
</tr>
<tr>
<td class="label"><span class="nobold">{_size}:</span></td>
<td class="data"><a href="/club{$x->getId()}/followers">{tr("participants", $x->getFollowersCount())}</a></td>
</tr>
</tbody>
</table>
{/block} {/block}
{block description} {block description}
@ -54,12 +73,46 @@
{block actions} {block actions}
{var clubPinned = $thisUser->isClubPinned($x)} {var clubPinned = $thisUser->isClubPinned($x)}
{if $x->canBeModifiedBy($thisUser ?? NULL) && ($clubPinned || $thisUser->getPinnedClubCount() <= 10)} {if $x->canBeModifiedBy($thisUser ?? NULL) && ($clubPinned || $thisUser->getPinnedClubCount() <= 10)}
<a class="profile_link" href="/groups_pin?club={$x->getId()}&hash={rawurlencode($csrfToken)}" id="_pinGroup" data-group-name="{$x->getName()}" data-group-url="{$x->getUrl()}"> <a style="width: 140px;" class="profile_link" href="{$x->getURL()}">
{_check_community}
</a>
<a style="width: 140px;" class="profile_link" href="/groups_pin?club={$x->getId()}&hash={rawurlencode($csrfToken)}" id="_pinGroup" data-group-name="{$x->getName()}" data-group-url="{$x->getUrl()}">
{if $clubPinned} {if $clubPinned}
{_remove_from_left_menu} {_remove_from_left_menu}
{else} {else}
{_add_to_left_menu} {_add_to_left_menu}
{/if} {/if}
</a> </a>
<form action="/setSub/club" method="post">
<input type="hidden" name="act" value="rem" />
<input type="hidden" name="id" value="{$x->getId()}" />
<input type="hidden" name="hash" value="{$csrfToken}" />
<input style="width: 140px; text-transform: lowercase;" type="submit" id="profile_link" value="{_leave_community}" />
</form>
{/if}
{/block}
{block bottom}
{if !is_null($thisUser) && $user->getId() === $thisUser->getId()}
<div class="groups_options">
<div id="gp_container" style="width: 200px; margin-right: 40px;">
<h4>{_open_new_group}</h4>
<span>{_open_group_desc}</span>
<form action="/groups_create">
<button class="button">{_create_group}</button>
</form>
</div>
<div id="gp_container" style="width: 344px;">
<h4>{_search_group}</h4>
<span>{_search_group_desc}</span>
<form action="/search">
<input name="type" type="hidden" value="groups">
<input name="query" class="header_search_input" value="" style="background: none; width: 155px; padding-left: 3px;">
<button class="button">{_search_by_groups}</button>
</form>
</div>
</div>
{/if} {/if}
{/block} {/block}

View file

@ -1,7 +1,6 @@
<center> <center style="background: white;border: #DEDEDE solid 1px;">
<img src="/assets/packages/static/openvk/img/error.png" alt="Ошибка" /> <span style="color: #707070;margin: 60px 0;display: block;">
<h1>{$title}</h1> <b>{$title}</b><br><br>
<p>
{$description} {$description}
</p> </span>
</center> </center>

View file

@ -1,16 +1,18 @@
{var $space = 2} {var $space = 2}
{var $pageCount = ceil($conf->count / $conf->perPage)} {var $pageCount = ceil($conf->count / $conf->perPage)}
<div n:if="!($conf->page === 1 && $conf->count <= $conf->perPage)" n:class="paginator, ($conf->atBottom ?? false) ? paginator-at-bottom"> <div n:if="!($conf->page === 1 && $conf->count <= $conf->perPage)" style="padding: 8px;">
{if $conf->page > $space} <div n:class="paginator, ($conf->atBottom ?? false) ? paginator-at-bottom">
<a n:attr="class => ($conf->page === 1 ? 'active')" href="?{http_build_query(array_merge($_GET, ['p' => 1]), 'k', '&', PHP_QUERY_RFC3986)}">«</a> {if $conf->page > $space}
{/if} <a n:attr="class => ($conf->page === 1 ? 'active')" href="?{http_build_query(array_merge($_GET, ['p' => 1]), 'k', '&', PHP_QUERY_RFC3986)}">«</a>
{for $j = $conf->page - ($space-1); $j <= $conf->page + ($space-1); $j++}
{if $j > 0 && $j <= $pageCount}
<a n:attr="class => ($conf->page === $j ? 'active')" href="?{http_build_query(array_merge($_GET, ['p' => $j]), 'k', '&', PHP_QUERY_RFC3986)}">{$j}</a>
{/if} {/if}
{/for} {for $j = $conf->page - ($space-1); $j <= $conf->page + ($space-1); $j++}
{if $conf->page <= $pageCount-$space} {if $j > 0 && $j <= $pageCount}
<a n:attr="class => ($conf->page === $pageCount ? 'active')" href="?{http_build_query(array_merge($_GET, ['p' => $pageCount]), 'k', '&', PHP_QUERY_RFC3986)}">»</a> <a n:attr="class => ($conf->page === $j ? 'active')" href="?{http_build_query(array_merge($_GET, ['p' => $j]), 'k', '&', PHP_QUERY_RFC3986)}">{$j}</a>
{/if} {/if}
{/for}
{if $conf->page <= $pageCount-$space}
<a n:attr="class => ($conf->page === $pageCount ? 'active')" href="?{http_build_query(array_merge($_GET, ['p' => $pageCount]), 'k', '&', PHP_QUERY_RFC3986)}">»</a>
{/if}
</div>
</div> </div>

View file

@ -1832,6 +1832,40 @@ body.scrolled .toTop:hover {
padding: 5px 0px 0px 0px; padding: 5px 0px 0px 0px;
} }
.groups_options {
padding: 10px 20px 20px;
border-top: #DEDEDE solid 1px;
margin-top: 12px;
margin-left: -12px;
margin-right: -12px;
}
#gp_container {
display: inline-block;
}
#gp_container span {
display: block;
margin: 10px 0 15px;
}
#gp_container h4 {
font-size: 11px;
}
.container_gray .content:last-child {
margin-bottom: 0;
}
.group_info {
padding: 0 0 0 5px !important;
}
.group_info .label {
width: auto !important;
padding-right: 5px;
}
.border-block { .border-block {
box-shadow: inset 0px 0 0px 1px #b6bfca, inset 0px 0 0px 10px #d8dfe7; box-shadow: inset 0px 0 0px 1px #b6bfca, inset 0px 0 0px 10px #d8dfe7;
width: 300px; width: 300px;

View file

@ -223,6 +223,7 @@
"subscriptions" = "Subscriptions"; "subscriptions" = "Subscriptions";
"join_community" = "Join community"; "join_community" = "Join community";
"leave_community" = "Leave community"; "leave_community" = "Leave community";
"check_community" = "View community";
"min_6_community" = "Name of the group must have more that 6 characters"; "min_6_community" = "Name of the group must have more that 6 characters";
"participants" = "Participants"; "participants" = "Participants";
"groups" = "Groups"; "groups" = "Groups";
@ -240,6 +241,7 @@
"only_administrators" = "Only administrators"; "only_administrators" = "Only administrators";
"website" = "Website"; "website" = "Website";
"managed" = "Managed"; "managed" = "Managed";
"size" = "Size";
"administrators_one" = "$1 administrator"; "administrators_one" = "$1 administrator";
"administrators_other" = "$1 administrators"; "administrators_other" = "$1 administrators";
@ -272,10 +274,20 @@
"groups_one" = "$1 group"; "groups_one" = "$1 group";
"groups_other" = "$1 groups"; "groups_other" = "$1 groups";
"groups_list_zero" = "You are not a participant in any group";
"groups_list_one" = "You are participating in one group";
"groups_list_other" = "You are a participant of $1 groups";
"meetings_zero" = "No meetings"; "meetings_zero" = "No meetings";
"meetings_one" = "$1 meeting"; "meetings_one" = "$1 meeting";
"meetings_other" = "$1 meetings"; "meetings_other" = "$1 meetings";
"open_new_group" = "Open a new group";
"open_group_desc" = "Can't find the right group? Open your own...";
"search_group" = "Search group";
"search_by_groups" = "Search by groups";
"search_group_desc" = "Here you can browse through the existing groups and choose a group to suit your needs...";
/* Albums */ /* Albums */
"create" = "Create"; "create" = "Create";

View file

@ -232,6 +232,7 @@
"subscriptions" = "Подписки"; "subscriptions" = "Подписки";
"join_community" = "Вступить в группу"; "join_community" = "Вступить в группу";
"leave_community" = "Выйти из группы"; "leave_community" = "Выйти из группы";
"check_community" = "Просмотр группы";
"min_6_community" = "Название должно быть не менее 6 символов"; "min_6_community" = "Название должно быть не менее 6 символов";
"participants" = "Участники"; "participants" = "Участники";
"groups" = "Группы"; "groups" = "Группы";
@ -249,6 +250,7 @@
"only_administrators" = "Только администраторы"; "only_administrators" = "Только администраторы";
"website" = "Сайт"; "website" = "Сайт";
"managed" = "Управляемые"; "managed" = "Управляемые";
"size" = "Размер";
"administrators_one" = "$1 администратор"; "administrators_one" = "$1 администратор";
"administrators_few" = "$1 администратора"; "administrators_few" = "$1 администратора";
@ -286,12 +288,22 @@
"groups_many" = "$1 групп"; "groups_many" = "$1 групп";
"groups_other" = "$1 групп"; "groups_other" = "$1 групп";
"groups_list_zero" = "Вы не состоите ни в одной группе";
"groups_list_one" = "Вы состоите в одной группе";
"groups_list_other" = "Вы состоите в $1 группах";
"meetings_zero" = "Ни одной встречи"; "meetings_zero" = "Ни одной встречи";
"meetings_one" = "Одна встреча"; "meetings_one" = "Одна встреча";
"meetings_few" = "$1 встречи"; "meetings_few" = "$1 встречи";
"meetings_many" = "$1 встреч"; "meetings_many" = "$1 встреч";
"meetings_other" = "$1 встреч"; "meetings_other" = "$1 встреч";
"open_new_group" = "Открыть новую группу";
"open_group_desc" = "Не можете найти нужную группу? Откройте свою...";
"search_group" = "Поиск группы";
"search_by_groups" = "Поиск по группам";
"search_group_desc" = "Здесь Вы можете просмотреть существующие группы и выбрать группу себе по вкусу...";
/* Albums */ /* Albums */
"create" = "Создать"; "create" = "Создать";