openvk/Web/Presenters/templates/Group/Followers.xml
Maxim Leshchenko 5556c88e44
Improvements related to group admins (#278)
Changes:
1. Add the ability to display only administrators on the page with a list of subscribers
2. Add the ability to hide the fact that the subscriber is an administrator
3. Fix display of large text in the block with the list of administrators
4. Fix display of the number of administrators
2021-11-12 15:31:23 +02:00

119 lines
5 KiB
XML

{extends "../@listView.xml"}
{var $Manager = openvk\Web\Models\Entities\Manager::class}
{var iterator = $onlyShowManagers ? $managers : $followers}
{var count = $paginatorConf->count}
{var page = $paginatorConf->page}
{var perPage = 6}
{block title}{_followers} {$club->getCanonicalName()}{/block}
{block header}
<a href="{$club->getURL()}">{$club->getCanonicalName()}</a>
» {_followers}
<a n:if="!$onlyShowManagers" href="/club{$club->getId()}/followers?onlyAdmins=1" style="float: right;">{_all_followers}</a>
<a n:if="$onlyShowManagers" href="/club{$club->getId()}/followers" style="float: right;">{_only_administrators}</a>
{/block}
{block actions}
{/block}
{* BEGIN ELEMENTS DESCRIPTION *}
{block tabs}
{if $club->canBeModifiedBy($thisUser)}
<div class="tab">
<a href="/club{$club->getId()}/edit">
{_main}
</a>
</div>
<div id="activetabs" class="tab">
<a id="act_tab_a" href="/club{$club->getId()}/followers">
{_followers}
</a>
</div>
<div class="tab">
<a href="/club{$club->getId()}/stats">
{_statistics}
</a>
</div>
{/if}
{/block}
{block link|strip|stripHtml}
/id{$x instanceof $Manager ? $x->getUserId() : $x->getId()}
{/block}
{block preview}
<img src="{$x instanceof $Manager ? $x->getUser()->getAvatarURL() : $x->getAvatarURL()}" alt="{$x instanceof $Manager ? $x->getUser()->getCanonicalName() : $x->getCanonicalName()}" width=75 />
{/block}
{block name}
{$x instanceof $Manager ? $x->getUser()->getCanonicalName() : $x->getCanonicalName()}
{/block}
{block description}
{var user = $x instanceof $Manager ? $x->getUser() : $x}
{var manager = $x instanceof $Manager ? $x : $club->getManager($user, !$club->canBeModifiedBy($thisUser))}
<table>
<tbody>
<tr>
<td width="120" valign="top"><span class="nobold">{_"gender"}: </span></td>
<td>{$user->isFemale() ? "женский" : "мужской"}</td>
</tr>
<tr>
<td width="120" valign="top"><span class="nobold">{_"registration_date"}: </span></td>
<td>{$user->getRegistrationTime()}</td>
</tr>
<tr>
<td width="120" valign="top"><span class="nobold">{_role}: </span></td>
<td>
{$club->getOwner()->getId() == $user->getId() ? !$club->isOwnerHidden() || $club->canBeModifiedBy($thisUser) : !is_null($manager) ? tr("administrator") : tr("follower")}
</td>
</tr>
<tr n:if="$manager && !empty($manager->getComment()) || $club->getOwner()->getId() === $user->getId() && !empty($club->getOwnerComment()) && (!$club->isOwnerHidden() || $club->canBeModifiedBy($thisUser))">
<td width="120" valign="top"><span class="nobold">{_comment}: </span></td>
<td>
{if $club->getOwner()->getId() === $user->getId()}
{$club->getOwnerComment()}
{else}
{$manager->getComment()}
{/if}
</td>
</tr>
<tr n:if="$club->canBeModifiedBy($thisUser ?? NULL)">
<td width="120" valign="top"><span class="nobold">{_actions}: </span></td>
<td>
<a href="/club{$club->getId()}/setAdmin.jsp?user={$user->getId()}&hash={rawurlencode($csrfToken)}" n:if="$club->getOwner()->getId() !== $user->getId()">
{if $manager}
{_devote}
{else}
{_promote_to_admin}
{/if}
</a>
{if $manager}
|
<a href="javascript:setClubAdminComment('{$club->getId()}', '{$manager->getUserId()}', '{rawurlencode($csrfToken)}')">
{_set_comment}
</a>
{/if}
<a n:if="$club->getOwner()->getId() === $user->getId()" href="javascript:setClubAdminComment('{$club->getId()}', '{$club->getOwner()->getId()}', '{rawurlencode($csrfToken)}')">
{_set_comment}
</a>
{if $manager}
|
<a href="/club{$club->getId()}/setAdmin.jsp?user={$user->getId()}&hidden={(int) !$manager->isHidden()}&hash={rawurlencode($csrfToken)}">
{if $manager->isHidden()}{_hidden_yes}{else}{_hidden_no}{/if}
</a>
{/if}
{if $club->getOwner()->getId() == $user->getId()}
|
<a href="/club{$club->getId()}/setAdmin.jsp?user={$user->getId()}&hidden={(int) !$club->isOwnerHidden()}&hash={rawurlencode($csrfToken)}">
{if $club->isOwnerHidden()}{_hidden_yes}{else}{_hidden_no}{/if}
</a>
{/if}
</td>
</tr>
</tbody>
</table>
{/block}