Groups: Update layot

New counter, info and actions blocks and some stye fixes
This commit is contained in:
kosfurler 2022-01-31 15:15:51 +03:00
parent 42f862eaec
commit a2b13116e6
5 changed files with 71 additions and 22 deletions

View file

@ -24,24 +24,25 @@
</a> </a>
</td> </td>
<td valign="top" style="width: 100%"> <td valign="top" style="width: 100%">
{ifset infotable}
{include infotable, x => $dat}
{else}
<a href="{include link, x => $dat}"> <a href="{include link, x => $dat}">
<b> <b>
{include name, x => $dat} {include name, x => $dat}
</b> </b>
</a> </a>
<br/> <br/>
{include description, x => $dat}
{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>
<div style="padding: 8px;">
{include "components/paginator.xml", conf => (object) [ {include "components/paginator.xml", conf => (object) [
"page" => $page, "page" => $page,
"count" => $count, "count" => $count,
@ -49,7 +50,6 @@
"perPage" => $perPage ?? OPENVK_DEFAULT_PER_PAGE, "perPage" => $perPage ?? OPENVK_DEFAULT_PER_PAGE,
"atBottom" => true, "atBottom" => true,
]} ]}
</div>
{else} {else}
{ifset customErrorMessage} {ifset customErrorMessage}
{include customErrorMessage} {include customErrorMessage}

View file

@ -33,7 +33,13 @@
{block size} {block size}
<div style="padding-bottom: 0px;border-bottom: 0;" class="summaryBar"> <div style="padding-bottom: 0px;border-bottom: 0;" class="summaryBar">
<div class="summary">Найдено групп ({$thisUser->getClubCount()})</div> <div class="summary">
{if !is_null($thisUser) && $user->getId() === $thisUser->getId()}
{tr("groups_list", $thisUser->getClubCount())}
{else}
{tr("groups", $user->getClubCount())}
{/if}
</div>
</div> </div>
{/block} {/block}
@ -45,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}
@ -56,13 +73,25 @@
{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} {/if}
{/block} {/block}
@ -87,4 +116,4 @@
</div> </div>
</div> </div>
{/if} {/if}
{/block} {/block}

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

@ -1852,3 +1852,16 @@ body.scrolled .toTop:hover {
#gp_container h4 { #gp_container h4 {
font-size: 11px; 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;
}

View file

@ -225,6 +225,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" = "Группы";
@ -279,6 +280,10 @@
"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 встречи";