{script}
  {literal}
    $("#avatar_change_btn").click(function(){
        $(this).hide();
        $("#cancel_change").show();
        $("#avatar_input").show();
    });
    
    $("#big_avatar_change_btn").click(function(){
        $(this).hide();
        $("#cancel_big_change").show();
        $("#big_avatar_input").show();
    });
    
    $("#cancel_change").click(function(){
        $(this).hide();
        $("#avatar_change_btn").show();
        $("#avatar_input").html('<input type="file" name="avatar" />');
        $("#avatar_input").hide();
    });
    
    $("#cancel_big_change").click(function(){
        $(this).hide();
        $("#big_avatar_change_btn").show();
        $("#big_avatar_input").html('<input type="file" name="bigAvatar" />');
        $("#big_avatar_input").hide();
    });
    
    $("#avatar_delete_btn").click(function(){
        if ( confirm(OW.getLanguageText('admin', 'confirm_avatar_delete')) ) 
        {
            window.location.href = "{/literal}{url_for_route for='admin_settings_user'}?del-avatar=1{literal}";
        }
    });
    
    $("#big_avatar_delete_btn").click(function(){
        if ( confirm(OW.getLanguageText('admin', 'confirm_avatar_delete')) ) 
        {
            window.location.href = "{/literal}{url_for_route for='admin_settings_user'}?del-avatar=2{literal}";
        }
    });
  {/literal}
{/script}

{form name='userSettingsForm'}

<table class="ow_table_1 ow_form">
    <tr class="ow_tr_first">
        <th class="ow_name ow_txtleft" colspan="3">
            <span class="ow_section_icon ow_ic_monitor">{text key='admin+user_display_settings'}</span>
        </th>
    </tr>
   <tr class="ow_alt1 ow_tr_last">
        <td class="ow_label">{label name='displayName'}</td>
        <td class="ow_value">{input name='displayName'} {error name='displayName'}</td>
        <td class="ow_desc ow_small">
            {text key='admin+user_settings_display_name_desc'}
        </td>
    </tr>
    <tr class="ow_tr_delimiter"><td></td></tr>
    {if $displayConfirmEmail}
    <tr class="ow_tr_first">
        <th class="ow_name ow_txtleft" colspan="3">
            <span class="ow_section_icon ow_ic_mail">{text key='admin+user_settings_email'}</span>
        </th>
    </tr>
    <tr class="ow_alt1 ow_tr_last">
        <td class="ow_label">{label name='confirmEmail'}</td>
        <td class="ow_value">{input name='confirmEmail'} {error name='confirmEmail'}</td>
        <td class="ow_desc ow_small">
            {text key='admin+user_settings_confirm_email_desc'}
        </td>
    </tr>
    <tr class="ow_tr_delimiter"><td></td></tr>
    {/if}
    <tr class="ow_tr_first">
        <th class="ow_name ow_txtleft" colspan="3">
            <span class="ow_section_icon ow_ic_picture">{text key='admin+user_avatar_settings'}</span>
        </th>
    </tr>
    <tr class="ow_alt1">
        <td class="ow_label">{label name='avatarSize'}</td>
        <td class="ow_value">{input name='avatarSize' class='ow_settings_input'} px<br />{error name='avatarSize'}</td>
        <td class="ow_desc ow_small">{text key='admin+user_settings_avatar_size_desc'}</td>
    </tr>
    <tr class="ow_alt2">
        <td class="ow_label">{label name='bigAvatarSize'}</td>
        <td class="ow_value">{input name='bigAvatarSize' class='ow_settings_input'} px<br />{error name='bigAvatarSize'}</td>
        <td class="ow_desc ow_small">{text key='admin+user_settings_big_avatar_size_desc'}</td>
    </tr>        
        <tr class="ow_alt1">
            <td class="ow_label">{label name='avatar_max_upload_size'}</td>
            <td class="ow_value">{input name='avatar_max_upload_size' style="width:30px;"} MB  <span class="ow_small">{text key='base+max_upload_filesize' value=$maxUploadMaxFilesize}</span><br />{error name='avatar_max_upload_size'}</td>
            <td class="ow_desc"></td>
        </tr>
    </tr>
    <tr class="ow_alt2 ow_tr_last ow_default_avatar_section">
        <td class="ow_label">{text key='admin+user_settings_avatar_image'}</td>
        <td class="ow_value">
            <div class="ow_smallmargin">
                <img src="{$avatar}" /><br />
                {if !empty($customAvatar.1)}<span class="ow_lbutton ow_mild_red" id="avatar_delete_btn">{text key='base+delete'}</span>{/if}
                <span class="ow_lbutton" id="avatar_change_btn">{text key='base+change'}</span>
                <span class="ow_lbutton" id="cancel_change" style="display: none;">{text key='base+cancel'}</span>
	            <div id="avatar_input" style="display: none">{input name='avatar'}</div>
            </div>
            <div>
                <img src="{$avatarBig}" /><br />
                {if !empty($customAvatar.2)}<span class="ow_lbutton ow_mild_red" id="big_avatar_delete_btn">{text key='base+delete'}</span>{/if}
                <span class="ow_lbutton" id="big_avatar_change_btn">{text key='base+change'}</span>
                <span class="ow_lbutton" id="cancel_big_change" style="display: none;">{text key='base+cancel'}</span>
                <div id="big_avatar_input" style="display: none">{input name='bigAvatar'}</div>
            </div>
        </td>
        <td class="ow_desc ow_small">{text key='admin+user_settings_avatar_image_desc'}</td>
    </tr>
    <tr class="ow_tr_delimiter"><td></td></tr>

    <tr class="ow_tr_first">
        <th class="ow_name ow_txtleft" colspan="3">
            <span class="ow_section_icon ow_ic_user">{text key='admin+user_settings_profile_questions'}</span>
        </th>
    </tr>
    <tr class="{cycle values='ow_alt2,alt1'}">
        <td class="ow_label" >{label name=user_view_presentation}</td>
        <td class="ow_value" style="text-align:left;padding-left:40px;">{input name=user_view_presentation}<br/>{error name=user_view_presentation}</td>
        <td class="ow_desc ow_small" style="text-align:left">{desc name=user_view_presentation}</td>
    </tr>
    <tr class="ow_tr_delimiter"><td></td></tr>
 
    <tr class="ow_tr_first">
        <th class="ow_name ow_txtleft" colspan="3">
            <span class="ow_section_icon ow_ic_script">{text key='admin+join_page'}</span>
        </th>
    </tr>
    <tr class="{cycle name="install" values="ow_alt1,ow_alt2"}">
        <td class="ow_label">{text key='admin+join_display_photo_upload'}</td>
        <td class="ow_value">{input name='join_display_photo_upload'} {error name='join_display_photo_upload'}</td>
        <td class="ow_desc">{text key='admin+join_display_photo_upload_desc'}</td>
    </tr>
    <tr class="{cycle name="install" values="ow_alt1,ow_alt2"} ow_tr_last">
        <td class="ow_label">{text key='admin+join_display_terms_of_use'}</td>
        <td class="ow_value">{input name='join_display_terms_of_use'} {error name='join_display_terms_of_use'}</td>
        <td class="ow_desc">{text key='admin+join_display_terms_of_use_desc'}</td>
    </tr>
</table>

<table class="ow_table_1 ow_form">
    <tr class="ow_tr_first">
        <th colspan="3" class="ow_name ow_txtleft">
            <span class="ow_section_icon ow_ic_lock">{text key='admin+user_settings_permissions'}</span>
        </th>
    </tr>
    <tr class="{cycle values='ow_alt2,ow_alt1'}">
		<td class="ow_label">{label name='user_approve'}</td>
		<td class="ow_value">{input name='user_approve'}</td>
		<td class="ow_desc"></td>
	</tr>
	<tr class="{cycle values='ow_alt2,ow_alt1'}">
		<td class="ow_label">{label name='who_can_join'}</td>
		<td class="ow_value">{input name='who_can_join'}</td>
		<td class="ow_desc"></td>
	</tr>
    <tr class="{cycle values='ow_alt2,ow_alt1'}" style="display:none;">
		<td class="ow_label">{label name='who_can_invite'}</td>
		<td class="ow_value">{input name='who_can_invite'}</td>
		<td class="ow_desc"></td>
	</tr>
	<tr class="{cycle values='ow_alt2,ow_alt1'} ow_tr_last">
		<td class="ow_label">{label name='guests_can_view'}</td>
        <td class="ow_value">
            <div class="clearfix">
                <div style="float: left;width: 50%;">{input name='guests_can_view'}</div>
                <div style="float: left;width: 50%;padding-top: 35px;">{input name='password'}</div>
            </div>
        </td>
		<td class="ow_desc ow_small">{desc name='guests_can_view'}</td>
	</tr>
</table>
<div class="clearfix ow_stdmargin"><div class="ow_right">
{submit name='save' class='ow_ic_save'}
</div></div>

{/form}