Groups: Update groups layout (#444)

* Groups: Update groups layot

* We don't use crowdin anymore, why it's still there?

* Locales: Delete unnecessary LICENSE

We already have COPYING in the root directory :/

* Locales: Localize strings for updated group layout

Localized strings: open_new_group, open_group_desc, search_group, search_by_groups, search_group_desc
(we already have search_for_groups but idk, I'll leave it for now)

* Global: Fix tabs

* Groups: Fix tabs and div block

I have SO many questions...

* Groups: Update layot

New counter, info and actions blocks and some stye fixes

* Global: Fix tabs

* Locales: Localize strings for updated group layout

Localized strings: check_community, groups_list

* Update Groups.xml

* Update Groups.xml

Co-authored-by: veselcraft <veselcraft@icloud.com>
Co-authored-by: Ilya Prokopenko <dsrev@protonmail.com>
Co-authored-by: celestora <kitsuruko@gmail.com>
This commit is contained in:
KosFurler 2022-02-01 14:20:14 +03:00 committed by GitHub
parent 4d6af6d28e
commit b1407ba823
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 184 additions and 65 deletions

View file

@ -5,10 +5,14 @@
<div n:ifset="tabs" class="tabs"> <div n:ifset="tabs" 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 {if $admin}id="activetabs"{/if} class="tab">
<a {if $admin}id="act_tab_a"{/if} href="/groups{$user->getId()}?act=managed"> <a {if $admin}id="act_tab_a"{/if} href="/groups{$user->getId()}?act=managed">
{_managed} {_managed}
</a> </a>
</div> </div>
{/if} {/if}
{/block}
{block size}
<div 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">Название: </span></td>
<td class="data"><a href="{$x->getURL()}">{$x->getName()}</a></td>
</tr>
<tr>
<td class="label"><span class="nobold">Размер:</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,47 @@
{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="border-bottom: none; width: 140px;" class="profile_link" href="{$x->getURL()}">
{_check_community}
</a>
<a style="border-bottom: none; width: 140px;" class="profile_link" href="/groups_pin?club={$x->getId()}&hash={rawurlencode($csrfToken)}" 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="text-transform: lowercase; border-bottom: none; width: 140px;" 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";
@ -272,10 +273,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" = "Группы";
@ -286,12 +287,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" = "Создать";