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

344 lines
17 KiB
XML

{extends "../@layout.xml"}
{block title}{_edit_page}{/block}
{block header}
{_edit_page}
{/block}
{block content}
{var $isMain = $mode === 'main'}
{var $isContacts = $mode === 'contacts'}
{var $isInterests = $mode === 'interests'}
{var $isAvatar = $mode === 'avatar'}
<div n:if="$user->hasPendingNumberChange()" class="msg">
<b>Подтверждение номера телефона</b><br/>
Введите код для подтверждения смены номера: <a href="/edit/verify_phone">ввести код</a>.
</div>
<div class="tabs">
<div n:attr="id => ($isMain ? 'activetabs' : 'ki')" class="tab">
<a n:attr="id => ($isMain ? 'act_tab_a' : 'ki')" href="/edit">{_main}</a>
</div>
<div n:attr="id => ($isContacts ? 'activetabs' : 'ki')" class="tab">
<a n:attr="id => ($isContacts ? 'act_tab_a' : 'ki')" href="/edit?act=contacts">{_contacts}</a>
</div>
<div n:attr="id => ($isInterests ? 'activetabs' : 'ki')" class="tab">
<a n:attr="id => ($isInterests ? 'act_tab_a' : 'ki')" href="/edit?act=interests">{_interests}</a>
</div>
<div n:attr="id => ($isAvatar ? 'activetabs' : 'ki')" class="tab">
<a n:attr="id => ($isAvatar ? 'act_tab_a' : 'ki')" href="/edit?act=avatar">{_avatar}</a>
</div>
</div>
<div class="container_gray">
{if $isMain}
<h4>{_main_information}</h4>
<form action="/edit?act=main" method="POST" enctype="multipart/form-data">
<table cellspacing="7" cellpadding="0" width="60%" border="0" align="center">
<tbody>
<tr>
<td width="120" valign="top">
<span class="nobold">{_name}: </span>
</td>
<td>
<input type="text" name="first_name" value="{$user->getFirstName(true)}" />
</td>
</tr>
<tr>
<td width="120" valign="top">
<span class="nobold">{_surname}: </span>
</td>
<td>
<input type="text" name="last_name" value="{$user->getLastName(true)}" />
</td>
</tr>
<tr>
<td width="120" valign="top">
<span class="nobold">{_nickname}: </span>
</td>
<td>
<input type="text" name="pseudo" value="{$user->getPseudo()}" />
</td>
</tr>
{if OPENVK_ROOT_CONF['openvk']['credentials']['zadarma']['enable']}
<tr>
<td width="120" valign="top">
<span class="nobold">{_phone}: </span>
</td>
<td>
<input type="phone" name="phone" value="{$user->getPhone()}" />
</td>
</tr>
{/if}
<tr>
<td width="120" valign="top">
<span class="nobold">{_status}: </span>
</td>
<td>
<input type="text" name="status" value="{$user->getStatus()}" />
</td>
</tr>
<tr>
<td width="120" valign="top">
<span class="nobold">{_hometown}: </span>
</td>
<td>
<input type="text" name="hometown" value="{$user->getHometown()}" />
</td>
</tr>
<tr>
<td width="120" valign="top">
<span class="nobold">{_relationship}: </span>
</td>
<td>
<select name="marialstatus">
<option n:foreach="range(0, 8) as $i" n:attr="selected: ($user->getMaritalStatus() == $i)" value="{$i}">
{if $user->isFemale()}
{var $str = "relationship_$i"}
{if tr($str . "_fem") == ("@$str" . "_fem")}
{_$str}
{else}
{tr($str . "_fem")}
{/if}
{else}
{_"relationship_$i"}
{/if}
</option>
</select>
</td>
</tr>
<tr>
<td width="120" valign="top">
<span class="nobold">{_politViews}: </span>
</td>
<td>
<select name="politViews">
<option value="0" {if $user->getPoliticalViews() == 0}selected{/if}>{_politViews_0}</option>
<option value="1" {if $user->getPoliticalViews() == 1}selected{/if}>{_politViews_1}</option>
<option value="2" {if $user->getPoliticalViews() == 2}selected{/if}>{_politViews_2}</option>
<option value="3" {if $user->getPoliticalViews() == 3}selected{/if}>{_politViews_3}</option>
<option value="4" {if $user->getPoliticalViews() == 4}selected{/if}>{_politViews_4}</option>
<option value="5" {if $user->getPoliticalViews() == 5}selected{/if}>{_politViews_5}</option>
<option value="6" {if $user->getPoliticalViews() == 6}selected{/if}>{_politViews_6}</option>
<option value="7" {if $user->getPoliticalViews() == 7}selected{/if}>{_politViews_7}</option>
<option value="8" {if $user->getPoliticalViews() == 8}selected{/if}>{_politViews_8}</option>
<option value="9" {if $user->getPoliticalViews() == 9}selected{/if}>{_politViews_9}</option>
</select>
</td>
</tr>
<tr>
<td width="120" valign="top">
<span class="nobold">{_gender}: </span>
</td>
<script>
function genderChanged(e) {
if(e.target.value == "other")
$('#other-gender-input').show('slide', 0, 1000)
else
$('#other-gender-input').hide('slide', 0, 1000);
}
</script>
<td>
<select name="gender" onchange="genderChanged(event)">
<option value="hide" n:attr="selected => $user->getRawGender() == NULL">{_hidden}</option>
<option value="female" n:attr="selected => $user->getRawGender() == 'female'">{_female}</option>
<option value="male" n:attr="selected => $user->getRawGender() == 'male'">{_male}</option>
<option value="non-binary" n:attr="selected => $user->getRawGender() == 'non-binary'">{_non-binary}</option>
<option value="other" n:attr="selected => $user->hasOtherGenderString()">{_other}</option>
</select>
<input id="other-gender-input" type="text" name="other-gender-string" placeholder="{_other_gender_placeholder}" style="display: {$user->hasOtherGenderString() ? 'inline' : 'none'};" n:attr="value => $user->hasOtherGenderString() ? $user->getGender() : ''" />
</td>
</tr>
<tr>
<td width="120" valign="top">
<span class="nobold">{_birth_date}: </span>
</td>
<td>
<input max={date('Y-m-d')} name="birthday" value={is_null($user->getBirthday()) ? NULL : $user->getBirthday()->format('%Y-%m-%d')} type="date" style="margin-bottom: 7px;" />
<select name="birthday_privacy">
<option value="0" {if $user->getBirthdayPrivacy() == 0}selected{/if}>{_show_my_birthday}</option>
<option value="1" {if $user->getBirthdayPrivacy() == 1}selected{/if}>{_show_only_month_and_day}</option>
</select>
</td>
</tr>
<tr>
<td>
</td>
<td>
<input type="hidden" name="hash" value="{$csrfToken}" />
<input type="submit" value="{_save}" class="button" />
</td>
</tr>
</tbody>
</table>
</form>
{elseif $isContacts}
<h4>{_contact_information}</h4>
<form action="/edit?act=contacts" method="POST" enctype="multipart/form-data">
<table cellspacing="7" cellpadding="0" width="60%" border="0" align="center">
<tbody>
<tr>
<td width="120" valign="top">
<span class="nobold">{_email}: </span>
</td>
<td>
<input type="email" name="email_contact" value="{$user->getContactEmail()}" />
</td>
</tr>
<tr>
<td width="120" valign="top">
<span class="nobold">{_telegram}: </span>
</td>
<td>
<input type="text" name="telegram" value="{$user->getTelegram()}" />
</td>
</tr>
<tr>
<td width="120" valign="top">
<span class="nobold">{_personal_website}: </span>
</td>
<td>
<input type="text" name="website" value="{$user->getWebsite()}" />
</td>
</tr>
<tr>
<td width="120" valign="top">
<span class="nobold">{_city}: </span>
</td>
<td>
<input type="text" name="city" value="{$user->getCity()}" />
</td>
</tr>
<tr>
<td width="120" valign="top">
<span class="nobold">{_address}: </span>
</td>
<td>
<input type="text" name="address" value="{$user->getPhysicalAddress()}" />
</td>
</tr>
<tr>
<td>
</td>
<td>
<input type="hidden" name="hash" value="{$csrfToken}" />
<input type="submit" value="{_save}" class="button" />
</td>
</tr>
</tbody>
</table>
</form>
{elseif $isInterests}
<h4>{_personal_information}</h4>
<form action="/edit?act=interests" method="POST" enctype="multipart/form-data">
<table cellspacing="7" cellpadding="0" width="60%" border="0" align="center">
<tbody>
<tr>
<td width="120" valign="top">
<span class="nobold">{_interests}: </span>
</td>
<td>
<textarea type="text" name="interests">{$user->getInterests()}</textarea>
</td>
</tr>
<tr>
<td width="120" valign="top">
<span class="nobold">{_favorite_music}: </span>
</td>
<td>
<textarea type="text" name="fav_music">{$user->getFavoriteMusic()}</textarea>
</td>
</tr>
<tr>
<td width="120" valign="top">
<span class="nobold">{_favorite_films}: </span>
</td>
<td>
<textarea type="text" name="fav_films">{$user->getFavoriteFilms()}</textarea>
</td>
</tr>
<tr>
<td width="120" valign="top">
<span class="nobold">{_favorite_shows}: </span>
</td>
<td>
<textarea type="text" name="fav_shows">{$user->getFavoriteShows()}</textarea>
</td>
</tr>
<tr>
<td width="120" valign="top">
<span class="nobold">{_favorite_books}: </span>
</td>
<td>
<textarea type="text" name="fav_books">{$user->getFavoriteBooks()}</textarea>
</td>
</tr>
<tr>
<td width="120" valign="top">
<span class="nobold">{_favorite_quotes}: </span>
</td>
<td>
<textarea type="text" name="fav_quote">{$user->getFavoriteQuote()}</textarea>
</td>
</tr>
<tr>
<td width="120" valign="top">
<span class="nobold">{_information_about}: </span>
</td>
<td>
<textarea type="text" name="about">{$user->getDescription()}</textarea>
</td>
</tr>
<tr>
<td>
</td>
<td>
<input type="hidden" name="hash" value="{$csrfToken}" />
<input type="submit" value="{_save}" class="button" />
</td>
</tr>
</tbody>
</table>
</form>
{elseif $isAvatar}
<h4>{_profile_picture}</h4>
<form action="/al_avatars" method="POST" enctype="multipart/form-data">
<table cellspacing="7" cellpadding="0" width="60%" border="0" align="center">
<tbody>
<tr>
<td width="120" valign="top">
<span class="nobold">{_picture}: </span>
</td>
<td>
<input type="file" name="blob" accept="image/*" />
</td>
</tr>
<tr>
<td>
</td>
<td>
<input type="hidden" name="hash" value="{$csrfToken}" />
<input type="submit" value="{_save}" class="button" />
</td>
</tr>
</tbody>
</table>
</form>
{/if}
</div>
{/block}