openvk/Web/Presenters/templates/User/View.xml

686 lines
38 KiB
XML
Raw Normal View History

2020-06-07 19:04:43 +03:00
{extends "../@layout.xml"}
{block title}{$user->getCanonicalName()}{/block}
{block headIncludes}
{if $user->getPrivacyPermission('page.read', $thisUser ?? NULL)}
2020-06-07 19:04:43 +03:00
<!-- openGraph -->
<meta property="og:title" content="{$user->getCanonicalName()}" />
<meta property="og:url" content="http://{$_SERVER['HTTP_HOST']}{$user->getURL()}" />
<meta property="og:image" content="{$user->getAvatarUrl('normal')}" />
2020-06-07 19:04:43 +03:00
<meta property="og:type" content="profile" />
<meta property="og:first_name" content="{$user->getFirstName()}" />
<meta property="og:last_name" content="{$user->getLastName()}" />
<meta n:if="!is_null($user->getShortcode())" property="og:username" content="{$user->getShortcode()}" />
<meta property="og:gender" content="{($user->isFemale() ? 'fe' : '')}male" />
<!-- json-ld -->
<script type="application/ld+json">
{
"@context": "http://schema.org/",
"type": "Person",
"name": {$user->getCanonicalName()},
"url": {('http://') . $_SERVER['HTTP_HOST'] . $user->getURL()}
}
</script>
{else}
<meta name="robots" content="noindex, noarchive">
{/if}
2020-06-07 19:04:43 +03:00
{/block}
{block header}
{$user->getCanonicalName()}
<img n:if="$user->isVerified()"
class="name-checkmark"
src="/assets/packages/static/openvk/img/checkmark.png"
/>
2022-08-09 09:37:08 +03:00
<span n:if="isset($thisUser) && $user->getId() == $thisUser->getId()"><b>({_this_is_you})</b></span>
2020-06-07 19:04:43 +03:00
<!-- DEBUG: ONLINE REPORT: static {$user->getOnline()->timestamp()}s adjusted {$user->getOnline()->timestamp() + 2505600}s real {time()}s -->
<div n:if="$user->getOnline()->timestamp() + 2505600 > time()" style="float:right;">
2021-11-04 14:45:30 +03:00
{if $user->isOnline()}
<span><b>{_online}</b></span>
2020-06-07 19:04:43 +03:00
{else}
<span>{$user->isFemale() ? tr("was_online_f") : tr("was_online_m")} {$user->getOnline()}</span>
2020-06-07 19:04:43 +03:00
{/if}
</div>
<div n:if="$user->onlineStatus() == 2" style="float:right;">
<span><b>{_deceased_person}</b></span>
</div>
2020-06-07 19:04:43 +03:00
{/block}
{block content}
{if !$user->isBanned()}
{if !$user->getPrivacyPermission('page.read', $thisUser ?? NULL)}
<div class="msg msg_err">
2020-08-20 17:05:00 +03:00
<b>{_forbidden}</b><br/>
{_forbidden_comment}
2020-06-07 19:04:43 +03:00
</div>
{else}
<div class="left_small_block">
<div>
<a href="{$user->getAvatarLink()|nocheck}">
<img src="{$user->getAvatarUrl('normal')}"
2020-08-20 17:05:00 +03:00
alt="{$user->getCanonicalName()}"
2020-06-07 19:04:43 +03:00
style="width: 100%; image-rendering: -webkit-optimize-contrast;" />
</a>
</div>
<div n:ifset="$thisUser" id="profile_links">
{if $user->getId() == $thisUser->getId()}
<div id="profile_link" style="width: 194px;">
2022-08-09 09:37:08 +03:00
<a href="/edit" class="link">{_edit_page}</a>
2020-06-07 19:04:43 +03:00
</div>
<div n:if="OPENVK_ROOT_CONF['openvk']['preferences']['commerce'] && !$thisUser->prefersNotToSeeRating()" id="profile_link" style="width: 194px;">
<a onClick="showIncreaseRatingDialog({$thisUser->getCoins()}, {ltrim($thisUser->getUrl(), '/')}, {$csrfToken})" class="link">{_increase_rating}</a>
</div>
2020-06-07 19:04:43 +03:00
{else}
{if $thisUser->getChandlerUser()->can("substitute")->model('openvk\Web\Models\Entities\User')->whichBelongsTo(0)}
<a href="/setSID/{$user->getChandlerUser()->getId()}?hash={rawurlencode($csrfToken)}" class="profile_link">
2020-08-20 17:05:00 +03:00
{tr("login_as", $user->getFirstName())}
2020-06-07 19:04:43 +03:00
</a>
{/if}
2020-07-17 19:26:59 +03:00
{if $thisUser->getChandlerUser()->can("access")->model("admin")->whichBelongsTo(NULL)}
<a href="/admin/users/id{$user->getId()}" class="profile_link">
{_manage_user_action}
</a>
2020-07-17 19:26:59 +03:00
<a href="javascript:banUser()" class="profile_link">
2020-08-20 17:05:00 +03:00
{_ban_user_action}
2020-07-17 19:26:59 +03:00
</a>
2020-07-17 19:39:34 +03:00
<a href="javascript:warnUser()" class="profile_link">
2020-08-20 17:05:00 +03:00
{_warn_user_action}
2020-07-17 19:39:34 +03:00
</a>
2020-07-17 19:26:59 +03:00
{/if}
{if $thisUser->getChandlerUser()->can('write')->model('openvk\Web\Models\Entities\TicketReply')->whichBelongsTo(0)}
<a href="javascript:toggleBanInSupport()" class="profile_link">
{if $user->isBannedInSupport()}
{_unban_in_support_user_action}
{else}
{_ban_in_support_user_action}
{/if}
</a>
{/if}
2020-07-17 19:26:59 +03:00
<a n:if="OPENVK_ROOT_CONF['openvk']['preferences']['commerce'] && $user->getGiftCount() == 0" href="/gifts?act=pick&user={$user->getId()}" class="profile_link">{_send_gift}</a>
2022-08-09 09:37:08 +03:00
<a n:if="$user->getPrivacyPermission('messages.write', $thisUser)" href="/im?sel={$user->getId()}" class="profile_link">{_send_message}</a>
2022-04-24 08:06:45 +03:00
{var $subStatus = $user->getSubscriptionStatus($thisUser)}
2020-06-07 19:04:43 +03:00
{if $subStatus === 0}
<form action="/setSub/user" method="post" class="profile_link_form">
2020-06-07 19:04:43 +03:00
<input type="hidden" name="act" value="add" />
<input type="hidden" name="id" value="{$user->getId()}" />
<input type="hidden" name="hash" value="{$csrfToken}" />
2022-08-09 09:37:08 +03:00
<input type="submit" class="profile_link" value="{_friends_add}" />
2020-06-07 19:04:43 +03:00
</form>
{elseif $subStatus === 1}
<form action="/setSub/user" method="post" class="profile_link_form">
2020-06-07 19:04:43 +03:00
<input type="hidden" name="act" value="add" />
<input type="hidden" name="id" value="{$user->getId()}" />
<input type="hidden" name="hash" value="{$csrfToken}" />
2022-08-09 09:37:08 +03:00
<input type="submit" class="profile_link" value="{_friends_accept}" />
2020-06-07 19:04:43 +03:00
</form>
{elseif $subStatus === 2}
<form action="/setSub/user" method="post" class="profile_link_form">
2020-06-07 19:04:43 +03:00
<input type="hidden" name="act" value="rem" />
<input type="hidden" name="id" value="{$user->getId()}" />
<input type="hidden" name="hash" value="{$csrfToken}" />
2022-08-09 09:37:08 +03:00
<input type="submit" class="profile_link" value="{_friends_reject}" />
2020-06-07 19:04:43 +03:00
</form>
{elseif $subStatus === 3}
<form action="/setSub/user" method="post" class="profile_link_form">
2020-06-07 19:04:43 +03:00
<input type="hidden" name="act" value="rem" />
<input type="hidden" name="id" value="{$user->getId()}" />
<input type="hidden" name="hash" value="{$csrfToken}" />
2022-08-09 09:37:08 +03:00
<input type="submit" class="profile_link" value="{_friends_delete}" />
2020-06-07 19:04:43 +03:00
</form>
{/if}
{/if}
<a n:if="$user->getFollowersCount() > 0" href="/friends{$user->getId()}?act=incoming" class="profile_link">{tr("followers", $user->getFollowersCount())}</a>
2020-06-07 19:04:43 +03:00
</div>
2020-08-17 17:02:42 +03:00
<div n:if="isset($thisUser) && !$thisUser->prefersNotToSeeRating()" class="profile-hints">
2022-04-24 08:06:45 +03:00
{var $completeness = $user->getProfileCompletenessReport()}
2020-06-07 19:04:43 +03:00
2021-10-09 22:42:20 +03:00
<div n:class="completeness-gauge, $completeness->total >= 100 ? completeness-gauge-gold">
<div style="width: {$completeness->percent}%"></div>
2020-06-07 19:04:43 +03:00
<span>{$completeness->total}%</span>
</div>
2020-08-17 17:02:42 +03:00
{if isset($thisUser) && $user->getId() === $thisUser->getId() && sizeof($completeness->unfilled) > 0}
2020-06-07 19:04:43 +03:00
<br/>
<a n:if="in_array('interests', $completeness->unfilled)" href="/edit">
2020-08-20 15:22:32 +03:00
<img src="/assets/packages/static/openvk/img/icon1.gif" />
{_interests} (+20%)
2020-06-07 19:04:43 +03:00
</a>
<a n:if="in_array('email', $completeness->unfilled)" href="/edit?act=contacts">
2020-08-20 15:22:32 +03:00
<img src="/assets/packages/static/openvk/img/icon2.gif" />
Email (+20%)
2020-06-07 19:04:43 +03:00
</a>
<a n:if="in_array('phone', $completeness->unfilled)" href="/edit?act=contacts">
2020-08-20 15:22:32 +03:00
<img src="/assets/packages/static/openvk/img/icon2.gif" />
{_phone} (+20%)
2020-06-07 19:04:43 +03:00
</a>
<a n:if="in_array('telegram', $completeness->unfilled)" href="/edit?act=contacts">
2020-08-20 15:22:32 +03:00
<img src="/assets/packages/static/openvk/img/icon2.gif" />
Telegram (+15%)
2020-06-07 19:04:43 +03:00
</a>
<a n:if="in_array('status', $completeness->unfilled)" href="/edit">
2020-08-20 15:22:32 +03:00
<img src="/assets/packages/static/openvk/img/icon3.gif" />
{_status} (+15%)
2020-06-07 19:04:43 +03:00
</a>
{/if}
</div>
<br />
<div n:if="$user->getFriendsCount() > 0 && $user->getPrivacyPermission('friends.read', $thisUser ?? NULL)">
2022-04-24 08:06:45 +03:00
{var $friendCount = $user->getFriendsCount()}
2020-06-07 19:04:43 +03:00
<div class="content_title_expanded" onclick="hidePanel(this, {$friendCount});">
2022-08-09 09:37:08 +03:00
{_friends}
2020-06-07 19:04:43 +03:00
</div>
<div>
<div class="content_subtitle">
{tr("friends", $friendCount)}
<div style="float:right;">
2022-08-09 09:37:08 +03:00
<a href="/friends{$user->getId()}">{_all_title}</a>
2020-06-07 19:04:43 +03:00
</div>
</div>
<div class="content_list">
<div class="cl_element" n:foreach="$user->getFriends(1) as $friend">
<div class="cl_avatar">
<a href="{$friend->getURL()}">
<img class="ava" src="{$friend->getAvatarUrl('miniscule')}" />
</a>
</div>
<a href="{$friend->getURL()}" class="cl_name">
<text class="cl_fname">{$friend->getFirstName()}</text>
<text class="cl_lname">{$friend->getLastName()}</text>
</a>
2020-06-07 19:04:43 +03:00
</div>
</div>
</div>
</div>
<div n:if="$thisUser != NULL && $thisUser->getId() == $user->getId() && $user->getFriendsOnlineCount() > 0">
2022-07-31 14:33:23 +03:00
{var $friendOnlineCount = $user->getFriendsOnlineCount()}
<div class="content_title_expanded" onclick="hidePanel(this, {$friendOnlineCount});">
2022-08-09 09:37:08 +03:00
{_friends_online}
2022-07-31 14:33:23 +03:00
</div>
<div>
<div class="content_subtitle">
{tr("friends_online", $friendOnlineCount)}
<div style="float:right;">
2022-08-09 09:37:08 +03:00
<a href="/friends{$user->getId()}?act=online">{_all_title}</a>
2022-07-31 14:33:23 +03:00
</div>
</div>
<div class="content_list">
<div class="cl_element" n:foreach="$user->getFriendsOnline(1) as $friend">
<div class="cl_avatar">
<a href="{$friend->getURL()}">
<img class="ava" src="{$friend->getAvatarUrl('miniscule')}" />
</a>
</div>
<a href="{$friend->getURL()}" class="cl_name">
<text class="cl_fname">{$friend->getFirstName()}</text>
<text class="cl_lname">{$friend->getLastName()}</text>
</a>
</div>
</div>
</div>
</div>
2020-06-07 19:04:43 +03:00
<div n:if="$albumsCount > 0 && $user->getPrivacyPermission('photos.read', $thisUser ?? NULL)">
<div class="content_title_expanded" onclick="hidePanel(this, {$albumsCount});">
2022-08-09 09:37:08 +03:00
{_albums}
2020-06-07 19:04:43 +03:00
</div>
<div>
<div class="content_subtitle">
{tr("albums", $albumsCount)}
<div style="float:right;">
2022-08-09 09:37:08 +03:00
<a href="/albums{$user->getId()}">{_all_title}</a>
2020-06-07 19:04:43 +03:00
</div>
</div>
<div style="padding: 5px;">
<div class="ovk-album" style="display: inline-block;" n:foreach="$albums as $album">
<div style="text-align: center;float: left;height: 54pt;width: 100px;">
2022-04-24 08:06:45 +03:00
{var $cover = $album->getCoverPhoto()}
2020-06-07 19:04:43 +03:00
<img
src="{is_null($cover)?'/assets/packages/static/openvk/img/camera_200.png':$cover->getURLBySizeId('small')}"
2020-06-07 19:04:43 +03:00
style="max-width: 80px; max-height: 54pt;" />
</div>
2021-09-14 02:35:46 +03:00
<div style="overflow: hidden; overflow-wrap: break-word;">
2020-06-07 19:04:43 +03:00
<b><a href="/album{$album->getPrettyId()}">{$album->getName()}</a></b><br>
2020-08-20 17:05:00 +03:00
<span class="nobold">{tr("updated_at", $album->getEditTime() ?? $album->getPublicationTime())}</span>
2020-06-07 19:04:43 +03:00
</div>
</div>
</div>
</div>
</div>
<div n:if="$videosCount > 0 && $user->getPrivacyPermission('videos.read', $thisUser ?? NULL)">
<div class="content_title_expanded" onclick="hidePanel(this, {$videosCount});">
2020-06-07 19:04:43 +03:00
{_videos}
</div>
<div>
<div class="content_subtitle">
{tr("videos", $videosCount)}
<div style="float:right;">
2022-08-09 09:37:08 +03:00
<a href="/videos{$user->getId()}">{_all_title}</a>
2020-06-07 19:04:43 +03:00
</div>
</div>
<div style="padding: 5px;">
2021-10-08 01:10:07 +03:00
<div class="ovk-video" n:foreach="$videos as $video">
<a href="/video{$video->getPrettyId()}" class="preview" align="center">
2020-06-07 19:04:43 +03:00
<img
src="{$video->getThumbnailURL()}"
2021-10-08 01:10:07 +03:00
style="max-width: 170px; max-height: 127px; margin: auto;" />
</a>
2020-06-07 19:04:43 +03:00
<div>
<b><a href="/video{$video->getPrettyId()}">{ovk_proc_strtr($video->getName(), 30)}</a></b><br>
2021-10-08 01:10:07 +03:00
<span style="font-size: 10px;">{$video->getPublicationTime()} | {_comments} ({$video->getCommentsCount()})</span>
2020-06-07 19:04:43 +03:00
</div>
</div>
</div>
</div>
</div>
<div n:if="$notesCount > 0 && $user->getPrivacyPermission('notes.read', $thisUser ?? NULL)">
<div class="content_title_expanded" onclick="hidePanel(this, {$notesCount});">
2020-06-07 19:04:43 +03:00
{_notes}
</div>
<div>
<div class="content_subtitle">
{tr("notes", $notesCount)}
<div style="float:right;">
2022-08-09 09:37:08 +03:00
<a href="/notes{$user->getId()}">{_all_title}</a>
2020-06-07 19:04:43 +03:00
</div>
</div>
<div style="padding: 5px 8px 15px 8px;">
<ul class="notes_titles" n:foreach="$notes as $note">
<li class="written">
2021-11-15 14:00:49 +03:00
<a href="/note{$note->getPrettyId()}">
{$note->getName()}
</a>
<small>
{$note->getPublicationTime()}
<span class="divide">|</span>
2021-11-15 14:00:49 +03:00
<a href="/note{$note->getPrettyId()}">{_comments}</a>
</small>
</li>
</ul>
2020-06-07 19:04:43 +03:00
</div>
</div>
</div>
<div n:if="$user->getClubCount() > 0 && $user->getPrivacyPermission('groups.read', $thisUser ?? NULL)">
2022-04-24 08:06:45 +03:00
{var $clubsCount = $user->getClubCount()}
2020-06-07 19:04:43 +03:00
<div class="content_title_expanded" onclick="hidePanel(this, {$clubsCount})">
2022-08-09 09:37:08 +03:00
{_groups}
2020-06-07 19:04:43 +03:00
</div>
<div>
<div class="content_subtitle">
{tr("groups", $clubsCount)}
<div style="float:right;">
2022-08-09 09:37:08 +03:00
<a href="/groups{$user->getId()}">{_all_title}</a>
2020-06-07 19:04:43 +03:00
</div>
</div>
<div style="padding-left: 5px;">
<div style="display: inline;" n:foreach="$user->getClubs(1) as $club">
<a href="club{$club->getId()}">{$club->getName()}</a> {if !$iterator->last}•{/if}
</div>
</div>
</div>
</div>
<div n:if="$user->getMeetingCount() > 0 && $user->getPrivacyPermission('groups.read', $thisUser ?? NULL)">
2022-04-24 08:06:45 +03:00
{var $meetingCount = $user->getMeetingCount()}
2020-06-07 19:04:43 +03:00
<div class="content_title_expanded" onclick="hidePanel(this, {$meetingCount})">
{_meetings}
</div>
<div>
<div class="content_subtitle">
{tr("meetings", $meetingCount)}
<div style="float:right;">
2022-08-09 09:37:08 +03:00
<a href="/groups{$user->getId()}?act=meetings">{_all_title}</a>
2020-06-07 19:04:43 +03:00
</div>
</div>
<div style="padding-left: 5px;">
<div style="display: inline;" n:foreach="$user->getMeetings(1) as $meeting">
<a href="/event{$meeting->getId()}">{$meeting->getName()}</a> {if !$iterator->last}•{/if}
</div>
</div>
</div>
</div>
</div>
<div class="right_big_block">
<div class="page_info">
<div n:if="!is_null($alert = $user->getAlert())" class="user-alert">{strpos($alert, "@") === 0 ? tr(substr($alert, 1)) : $alert}</div>
2022-04-24 08:06:45 +03:00
{var $thatIsThisUser = isset($thisUser) && $user->getId() == $thisUser->getId()}
<div n:if="$thatIsThisUser" class="page_status_popup" id="status_editor" style="display: none;">
<form name="status_popup_form" onsubmit="changeStatus(); return false;">
<div style="margin-bottom: 10px;">
<input type="text" name="status" size="50" value="{$user->getStatus()}" />
</div>
<input type="hidden" name="hash" value="{$csrfToken}" />
<button type="submit" name="submit" class="button" style="height: 22px;">{_send}</button>
</form>
</div>
<div class="accountInfo clearFix">
2021-11-24 19:14:13 +03:00
<div class="profileName">
<h2>{$user->getFullName()}</h2>
{if !is_null($user->getStatus())}
<div n:class="page_status, $thatIsThisUser ? page_status_edit_button" n:attr="id => $thatIsThisUser ? page_status_text : NULL">{$user->getStatus()}</div>
{elseif $thatIsThisUser}
2021-11-24 19:14:13 +03:00
<div class="page_status">
2022-08-09 09:37:08 +03:00
<div n:class="edit_link, $thatIsThisUser ? page_status_edit_button" id="page_status_text">[ {_change_status} ]</div>
2021-11-24 19:14:13 +03:00
</div>
2021-09-13 21:13:52 +03:00
{/if}
2021-11-24 19:14:13 +03:00
</div>
</div>
<div>
<table id="basicInfo" class="ugc-table" border="0" cellspacing="0" cellpadding="0" border="0" cellspacing="0" cellpadding="0" n:if=" $user->getPrivacyPermission('page.info.read', $thisUser ?? NULL)">
<tbody>
<tr>
2022-08-09 09:37:08 +03:00
<td class="label"><span class="nobold">{_gender}: </span></td>
2021-11-24 19:14:13 +03:00
<td class="data">{$user->isFemale() ? tr("female") : tr("male")}</td>
</tr>
<tr>
2022-08-09 09:37:08 +03:00
<td class="label"><span class="nobold">{_relationship}:</span></td>
<td class="data">{$user->getLocalizedMaritalStatus()}</td>
2021-11-24 19:14:13 +03:00
</tr>
<tr>
2022-08-09 09:37:08 +03:00
<td class="label"><span class="nobold">{_registration_date}: </span></td>
2021-11-24 19:14:13 +03:00
<td class="data">{$user->getRegistrationTime()}</td>
</tr>
<tr n:if="!is_null($user->getHometown())">
2022-08-09 09:37:08 +03:00
<td class="label"><span class="nobold">{_hometown}:</span></td>
2021-11-24 19:14:13 +03:00
<td class="data">{$user->getHometown()}</td>
</tr>
<tr>
2022-08-09 09:37:08 +03:00
<td class="label"><span class="nobold">{_politViews}:</span></td>
2021-11-24 19:14:13 +03:00
<td class="data">{var $pviews = $user->getPoliticalViews()}{_"politViews_$pviews"}</td>
</tr>
<tr n:if="!is_null($user->getBirthday())">
2022-08-09 09:37:08 +03:00
<td class="label"><span class="nobold">{_birth_date}:</span></td>
<td n:if="$user->getBirthdayPrivacy() == 0" class="data">{$user->getBirthday()->format('%e %B %Y')},
{tr("years", $user->getAge())}</td>
<td n:if="$user->getBirthdayPrivacy() == 1" class="data">{$user->getBirthday()->format('%e %B')}</td>
</tr>
2021-11-24 19:14:13 +03:00
</tbody>
</table>
</div>
2020-06-07 19:04:43 +03:00
</div>
2021-11-20 14:30:18 +03:00
<div n:if="$user->getPrivacyPermission('page.info.read', $thisUser ?? NULL)">
2020-06-07 19:04:43 +03:00
<div class="content_title_expanded" onclick="hidePanel(this);">
2022-08-09 09:37:08 +03:00
{_information}
2020-06-07 19:04:43 +03:00
</div>
{capture $contactInfo_Tmp}
<table class="ugc-table" border="0" cellspacing="0" cellpadding="0" border="0" cellspacing="0" cellpadding="0" n:ifcontent>
2020-06-07 19:04:43 +03:00
<tbody n:ifcontent>
<tr n:if="!is_null($user->getContactEmail())">
2022-08-09 09:37:08 +03:00
<td class="label"><span class="nobold">{_email}: </span></td>
2020-06-07 19:04:43 +03:00
<td>
<a href="mailto:{$user->getContactEmail()}" rel="ugc">
{$user->getContactEmail()}
</a>
</td>
</tr>
<tr n:if="!is_null($user->getTelegram())">
2022-08-09 09:37:08 +03:00
<td class="label"><span class="nobold">{_telegram}: </span></td>
2020-06-07 19:04:43 +03:00
<td>
<a href="https://t.me/{$user->getTelegram()}" rel="ugc" target="_blank">
@{$user->getTelegram()}
</a>
</td>
</tr>
<tr n:if="!is_null($user->getWebsite())">
2022-08-09 09:37:08 +03:00
<td class="label"><span class="nobold">{_personal_website}: </span></td>
<td>
<a href="{$user->getWebsite()}" rel="ugc" target="_blank">
{$user->getWebsite()}
</a>
</td>
</tr>
2020-06-07 19:04:43 +03:00
<tr n:if="!is_null($user->getCity())">
2022-08-09 09:37:08 +03:00
<td class="label"><span class="nobold">{_city}:</span></td>
<td class="data">{$user->getCity()}</td>
2020-06-07 19:04:43 +03:00
</tr>
<tr n:if="!is_null($user->getPhysicalAddress())">
2022-08-09 09:37:08 +03:00
<td class="label"><span class="nobold">{_address}:</span></td>
<td class="data">{$user->getPhysicalAddress()}</td>
2020-06-07 19:04:43 +03:00
</tr>
</tbody>
</table>
{/capture}
{capture $uInfo_Tmp}
<table class="ugc-table" border="0" cellspacing="0" cellpadding="0" border="0" cellspacing="0" cellpadding="0" n:ifcontent>
2020-06-07 19:04:43 +03:00
<tbody n:ifcontent>
<tr n:if="!is_null($user->getInterests())">
2022-08-09 09:37:08 +03:00
<td class="label"><span class="nobold">{_interests}: </span></td>
<td class="data">{$user->getInterests()}</td>
2020-06-07 19:04:43 +03:00
</tr>
<tr n:if="!is_null($user->getFavoriteMusic())">
2022-08-09 09:37:08 +03:00
<td class="label"><span class="nobold">{_favorite_music}: </span></td>
<td class="data">{$user->getFavoriteMusic()}</td>
2020-06-07 19:04:43 +03:00
</tr>
<tr n:if="!is_null($user->getFavoriteFilms())">
2022-08-09 09:37:08 +03:00
<td class="label"><span class="nobold">{_favorite_films}: </span></td>
<td class="data">{$user->getFavoriteFilms()}</td>
2020-06-07 19:04:43 +03:00
</tr>
<tr n:if="!is_null($user->getFavoriteShows())">
2022-08-09 09:37:08 +03:00
<td class="label"><span class="nobold">{_favorite_shows}: </span></td>
<td class="data">{$user->getFavoriteShows()}</td>
2020-06-07 19:04:43 +03:00
</tr>
<tr n:if="!is_null($user->getFavoriteBooks())">
2022-08-09 09:37:08 +03:00
<td class="label"><span class="nobold">{_favorite_books}: </span></td>
<td class="data">{$user->getFavoriteBooks()}</td>
2020-06-07 19:04:43 +03:00
</tr>
<tr n:if="!is_null($user->getFavoriteQuote())">
2022-08-09 09:37:08 +03:00
<td class="label"><span class="nobold">{_favorite_quotes}: </span></td>
<td class="data">{$user->getFavoriteQuote()}</td>
2020-06-07 19:04:43 +03:00
</tr>
<tr n:if="!is_null($user->getDescription())">
<td class="label"><span class="nobold">О себе: </span></td>
<td class="data">{$user->getDescription()}</td>
2020-06-07 19:04:43 +03:00
</tr>
</tbody>
</table>
{/capture}
<div>
<div style="padding: 10px 8px 15px 8px;" n:ifcontent>
2022-08-09 09:37:08 +03:00
<h4 style="border-bottom: none; font-size: 11px; padding: 0; display: inline-block;">{_contact_information} {ifset $thisUser}{if $thisUser->getId() == $user->getId()}<a href="/edit?act=contacts" class="edit_link">[ {_edit} ]</a>{/if}{/ifset}</h4>
2020-06-07 19:04:43 +03:00
{if !empty($contactInfo_Tmp)}
2021-11-20 14:30:18 +03:00
{$contactInfo_Tmp|noescape}
{else}
<div style="padding: 15px;color:gray;text-align: center;">{_no_information_provided}</div>
{/if}
<br>
2022-08-09 09:37:08 +03:00
<h4 style="border-bottom: none; font-size: 11px; padding: 0; display: inline-block;">{_personal_information} {ifset $thisUser}{if $thisUser->getId() == $user->getId()}<a href="/edit?act=interests" class="edit_link">[ {_edit} ]</a>{/if}{/ifset}</h4>
2021-11-20 14:30:18 +03:00
{if !empty($uInfo_Tmp)}
{$uInfo_Tmp|noescape}
{else}
<div style="padding-top: 15px;color:gray;text-align: center;">{_no_information_provided}</div>
2020-06-07 19:04:43 +03:00
{/if}
</div>
</div>
2020-06-07 19:04:43 +03:00
</div>
<div n:if="OPENVK_ROOT_CONF['openvk']['preferences']['commerce'] && ($giftCount = $user->getGiftCount()) > 0">
<div class="content_title_expanded" onclick="hidePanel(this, {$giftCount});">
{_gifts}
</div>
<div>
<div class="content_subtitle">
{tr("gifts", $giftCount)}
<div style="float:right;">
{if OPENVK_ROOT_CONF['openvk']['preferences']['commerce'] && !is_null($thisUser)}
<a href="/gifts?act=pick&user={$user->getId()}">{_send_gift}</a> |
{/if}
<a href="/gifts{$user->getId()}">{_all_title}</a>
</div>
</div>
<div class="content_list long">
<div class="cl_element" style="width: 25%;" n:foreach="$user->getGifts(1, 4) as $giftDescriptor">
2022-04-24 08:06:45 +03:00
{var $hideInfo = !is_null($thisUser) ? ($giftDescriptor->anon ? $thisUser->getId() !== $user->getId() : false) : false}
<div class="cl_avatar">
<a href="{$hideInfo ? 'javascript:false' : $giftDescriptor->sender->getURL()}">
<img style="width: 70px; max-height: 70px;"
src="{$giftDescriptor->gift->getImage(2)}"
alt="{$hideInfo ? tr('gift') : ($giftDescriptor->caption ?? tr('gift'))}"
title="{$hideInfo ? tr('gift') : ($giftDescriptor->caption ?? tr('gift'))}" />
</a>
</div>
</div>
</div>
</div>
</div>
2020-06-07 19:04:43 +03:00
{presenter "openvk!Wall->wallEmbedded", $user->getId()}
2020-07-17 19:26:59 +03:00
<script n:if="isset($thisUser) && $thisUser->getChandlerUser()->can('access')->model('admin')->whichBelongsTo(NULL)">
function banUser() {
uBanMsgTxt = "Вы собираетесь забанить пользователя " + {$user->getCanonicalName()} + ".";
uBanMsgTxt += "<br/><b>Предупреждение</b>: Это действие удалит все подписки пользователя и отпишет всех от него.";
2020-07-17 19:39:34 +03:00
uBanMsgTxt += "<br/><br/><b>Причина бана</b>: <input type='text' id='uBanMsgInput' placeholder='придумайте что-нибудь крутое' />"
2020-07-17 19:26:59 +03:00
MessageBox("Забанить " + {$user->getFirstName()}, uBanMsgTxt, ["Подтвердить", "Отмена"], [
(function() {
res = document.querySelector("#uBanMsgInput").value;
xhr = new XMLHttpRequest();
xhr.open("GET", "/admin/ban/" + {$user->getId()} + "?reason=" + res + "&hash=" + {rawurlencode($csrfToken)}, true);
2020-07-17 19:26:59 +03:00
xhr.onload = (function() {
if(xhr.responseText.indexOf("success") === -1)
2020-07-17 19:26:59 +03:00
MessageBox("Ошибка", "Не удалось забанить пользователя...", ["OK"], [Function.noop]);
else
MessageBox("Операция успешна", "Пользователь заблокирован", ["OK"], [Function.noop]);
});
xhr.send(null);
}),
Function.noop
2020-07-17 19:39:34 +03:00
]);
}
function warnUser() {
uBanMsgTxt = "Вы собираетесь предупредить пользователя " + {$user->getCanonicalName()} + ".";
uBanMsgTxt += "<br/>Мы отправим уведомление пользователю в личные сообщения от имени аккаунта администратора.";
uBanMsgTxt += "<br/><br/><b>Текст предупреждения</b>: <input type='text' id='uWarnMsgInput' placeholder='придумайте что-нибудь крутое' />";
2020-07-17 19:39:34 +03:00
MessageBox("Выдать предупреждение " + {$user->getFirstName()}, uBanMsgTxt, ["Подтвердить", "Отмена"], [
(function() {
res = document.querySelector("#uWarnMsgInput").value;
xhr = new XMLHttpRequest();
xhr.open("GET", "/admin/warn/" + {$user->getId()} + "?message=" + res + "&hash=" + {rawurlencode($csrfToken)}, true);
2020-07-17 19:39:34 +03:00
xhr.onload = (function() {
if(xhr.responseText.indexOf("message") === -1)
MessageBox("Ошибка", "Не удалось отправить предупреждение...", ["OK"], [Function.noop]);
else
MessageBox("Операция успешна", "Предупреждение отправлено", ["OK"], [Function.noop]);
});
xhr.send(null);
}),
Function.noop
]);
2020-07-17 19:26:59 +03:00
}
</script>
<script n:if="isset($thisUser) && $thisUser->getChandlerUser()->can('write')->model('openvk\Web\Models\Entities\TicketReply')->whichBelongsTo(0)">
{if $user->isBannedInSupport()}
function toggleBanInSupport() {
uBanMsgTxt = "Вы собираетесь разблокировать в поддержке пользователя " + {$user->getCanonicalName()} + ".";
uBanMsgTxt += "<br/>Сейчас он заблокирован по причине <strong>" + {$user->getBanInSupportReason()} + "</strong>.";
MessageBox("Разблокировать в поддержке " + {$user->getFirstName()}, uBanMsgTxt, ["Подтвердить", "Отмена"], [
(function() {
xhr = new XMLHttpRequest();
xhr.open("GET", "/admin/support/unban/" + {$user->getId()} + "?hash=" + {rawurlencode($csrfToken)}, true);
xhr.onload = (function() {
if(xhr.responseText.indexOf("success") === -1)
MessageBox("Ошибка", "Не удалось разблокировать пользователя в поддержке...", ["OK"], [Function.noop]);
else
MessageBox("Операция успешна", "Пользователь разблокирован в поддержке", ["OK"], [Function.noop]);
});
xhr.send(null);
}),
Function.noop
]);
}
{else}
function toggleBanInSupport() {
uBanMsgTxt = "Вы собираетесь заблокировать в поддержке пользователя " + {$user->getCanonicalName()} + ".";
uBanMsgTxt += "<br/><br/><b>Причина бана</b>: <input type='text' id='uBanMsgInput' placeholder='придумайте что-нибудь крутое' />";
uBanMsgTxt += "<br/><br/><input type='checkbox' id='uBanClsTicketsInput' /><label for='uBanClsTicketsInput'>Закрыть все обращения пользователя</label>";
MessageBox("Заблокировать в поддержке " + {$user->getFirstName()}, uBanMsgTxt, ["Подтвердить", "Отмена"], [
(function() {
res = document.querySelector("#uBanMsgInput").value;
cls = document.querySelector("#uBanClsTicketsInput").value;
xhr = new XMLHttpRequest();
xhr.open("GET", "/admin/support/ban/" + {$user->getId()} + "?reason=" + res + "&close_tickets=" + cls + "&hash=" + {rawurlencode($csrfToken)}, true);
xhr.onload = (function() {
if(xhr.responseText.indexOf("success") === -1)
MessageBox("Ошибка", "Не удалось заблокировать пользователя в поддержке...", ["OK"], [Function.noop]);
else
MessageBox("Операция успешна", "Пользователь заблокирован в поддержке", ["OK"], [Function.noop]);
});
xhr.send(null);
}),
Function.noop
]);
}
{/if}
</script>
<script n:if="isset($thisUser) && $user->getId() == $thisUser->getId()" n:syntax="off">
function setStatusEditorShown(shown) {
document.getElementById("status_editor").style.display = shown ? "block" : "none";
if(!document.status_popup_form.submit.style.width)
document.status_popup_form.submit.style.width = document.status_popup_form.submit.offsetWidth + 4 + "px"
}
document.addEventListener("click", event => {
if(!event.target.closest("#status_editor") && !event.target.closest("#page_status_text"))
setStatusEditorShown(false);
});
document.getElementById("page_status_text").onclick = setStatusEditorShown.bind(this, true);
async function changeStatus() {
const status = document.status_popup_form.status.value;
document.status_popup_form.submit.innerHTML = "<div class=\"button-loading\"></div>";
document.status_popup_form.submit.disabled = true;
const formData = new FormData();
formData.append("status", status);
formData.append("hash", document.status_popup_form.hash.value);
const response = await ky.post("/edit?act=status", {body: formData});
if(!parseAjaxResponse(await response.text())) {
document.status_popup_form.submit.innerHTML = tr("send");
document.status_popup_form.submit.disabled = false;
return;
}
2021-12-26 01:02:07 +03:00
if(document.status_popup_form.status.value === "") {
document.querySelector("#page_status_text").innerHTML = `[ ${tr("change_status")} ]`;
document.querySelector("#page_status_text").className = "edit_link page_status_edit_button";
} else {
document.querySelector("#page_status_text").innerHTML = status;
document.querySelector("#page_status_text").className = "page_status page_status_edit_button";
}
setStatusEditorShown(false);
document.status_popup_form.submit.innerHTML = tr("send");
document.status_popup_form.submit.disabled = false;
}
2020-07-17 19:26:59 +03:00
</script>
2020-06-07 19:04:43 +03:00
</div>
{/if}
{else} {* isBanned() *}
{include "banned.xml"}
{/if}
{/block}