Users: Fix list of user groups a little bit

This commit is contained in:
Maxim Leshchenko 2022-05-23 20:24:32 +01:00
parent ce6c576ffb
commit 203b16b87c
No known key found for this signature in database
GPG key ID: BB9C44A8733FBEEE
3 changed files with 7 additions and 4 deletions

View file

@ -90,6 +90,9 @@ final class UserPresenter extends OpenVKPresenter
elseif (!$user->getPrivacyPermission('groups.read', $this->user->identity ?? NULL)) elseif (!$user->getPrivacyPermission('groups.read', $this->user->identity ?? NULL))
$this->flashFail("err", tr("forbidden"), tr("forbidden_comment")); $this->flashFail("err", tr("forbidden"), tr("forbidden_comment"));
else { else {
if($this->queryParam("act") === "managed" && $this->user->id !== $user->getId())
$this->flashFail("err", tr("forbidden"), tr("forbidden_comment"));
$this->template->user = $user; $this->template->user = $user;
$this->template->page = (int) ($this->queryParam("p") ?? 1); $this->template->page = (int) ($this->queryParam("p") ?? 1);
$this->template->admin = $this->queryParam("act") == "managed"; $this->template->admin = $this->queryParam("act") == "managed";

View file

@ -4,7 +4,7 @@
<div class="wrap2"> <div class="wrap2">
<div class="wrap1"> <div class="wrap1">
<div class="page_wrap padding_top"> <div class="page_wrap padding_top">
<div n:ifset="tabs" class="tabs"> <div n:ifset="tabs" n:ifcontent class="tabs">
{include tabs} {include tabs}
</div> </div>

View file

@ -32,7 +32,7 @@
{/block} {/block}
{block size} {block size}
<div style="padding-bottom: 0px;" class="summaryBar"> <div style="padding-bottom: 0px; {if is_null($thisUser) || $user->getId() !== $thisUser->getId()}padding-top: 0px;{/if}" class="summaryBar">
<div class="summary"> <div class="summary">
{if !is_null($thisUser) && $user->getId() === $thisUser->getId()} {if !is_null($thisUser) && $user->getId() === $thisUser->getId()}
{tr("groups_list", $thisUser->getClubCount())} {tr("groups_list", $thisUser->getClubCount())}
@ -90,7 +90,7 @@
{/if} {/if}
<form action="/setSub/club" method="post"> <form action="/setSub/club" method="post">
<input type="hidden" name="act" value="rem" /> <input type="hidden" name="act" value="rem" />
<input type="hidden" name="id" value="{$x->getId()}" /> <input type="hidden" name="id" value="{$x->getId()}" />
<input type="hidden" name="hash" value="{$csrfToken}" /> <input type="hidden" name="hash" value="{$csrfToken}" />
<input style="text-transform: lowercase; width: 100%;" class="link" type="submit" value="{_"leave_community"}" /> <input style="text-transform: lowercase; width: 100%;" class="link" type="submit" value="{_"leave_community"}" />
</form> </form>
@ -101,7 +101,7 @@
{block bottom} {block bottom}
{if !is_null($thisUser) && $user->getId() === $thisUser->getId()} {if !is_null($thisUser) && $user->getId() === $thisUser->getId()}
<div class="groups_options"> <div class="groups_options">
<div id="gp_container" style="width: 200px; margin-right: 40px;"> <div id="gp_container" style="width: 200px; margin-right: 39px;">
<h4>{_open_new_group}</h4> <h4>{_open_new_group}</h4>
<span>{_open_group_desc}</span> <span>{_open_group_desc}</span>
<form action="/groups_create"> <form action="/groups_create">