{style} .owm_premoderation_high { background: #f9f6a9 none repeat scroll 0 0; } .owm_edit_photo_upload .owm_upload_photo_attach_wrap { padding:0px; } .owm_edit_photo_button { position: absolute; top: 9px; left: 10px; } .owm_edit_photo_button_label { padding-left: 63px; margin-right: 8px; min-width:53px; float:left; } .owm_edit_photo_button_img { min-width: 100px; float: left; } .owm_edit_photo_button_img #photo-file-preview { height: 44px; vertical-align: middle; } .owm_edit_photo_button_img #delete-avatar { padding-left: 10px; vertical-align: middle; } .owm_anno { margin-top: 20px; padding-right: 10px; padding-top: 10px; padding-bottom: 10px; } {/style} {script} var validImageExtensions = {$validImageExtensions}; var hiddenImg = $("#{$avatarId}"); var img = $('.edit_photo_upload #photo-file-preview'); var imgSpan = img.parents(".edit_photo_upload .owm_upload_img_name_label"); var imgChangeLabel = $('.edit_photo_upload .owm_upload_replace_label'); var imgUploadLabel = $('.edit_photo_upload .owm_upload_choose_label'); var icon = $('.edit_photo_upload .edit_photo_button a'); $("#delete-avatar").click(function(e) { e.preventDefault(); hiddenImg.val(''); imgSpan.hide(); }); $("input[name=userPhoto]").change(function() { if (!this.files || !this.files[0]) { return }; var extension = this.files[0].name.split('.').pop().toLowerCase(); if (validImageExtensions.indexOf(extension) == -1) { return; } var name = imgSpan.find("span"); name.text(""); imgSpan.hide(); if ( window.FileReader ) { var reader = new FileReader(); reader.onload = function (e) { showAvatar(e.target.result); } reader.readAsDataURL(this.files[0]); } else { name.text(this.files[0].name); } }); function showAvatar(url) { img.attr('src', url); imgSpan.css('display','table'); imgChangeLabel.css('display','table'); imgUploadLabel.hide(); icon.parents('div:eq(0)').addClass('owm_upload_photo_attach_wrap'); hiddenImg.val(url); } // show avatar {if $avatarPreview} showAvatar('{$avatarPreview}'); {/if} {/script} {form name=editForm} {if $displayAccountType}
{label name='accountType'}
{input name='accountType'}
{error name='accountType'}
{/if} {foreach from=$questionArray key='section' item='questions' name='question'} {if !empty($section) }
{text key="base+questions_section_`$section`_label"}
{/if} {foreach from=$questions item='question' name='question'}
{label name=$question.name}
{input name=$question.name}
{error name=$question.name}
{/foreach} {/foreach}
{label name='userPhoto'}{if $requiredPhotoUpload}*{/if} {label name='userPhoto'}{if $requiredPhotoUpload}*{/if}
{text key="base+delete"}
{error name='userPhoto'}
{if !$adminMode && !$isAdmin && $approveEnabled}
{text key="base+edit_profile_warning"}
{/if}
{if $adminMode} {if !$isUserApproved} {submit name='saveAndApprove'} {else} {submit name='editSubmit'} {/if} {else} {submit name='editSubmit'} {/if}
{/form}