<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
      xmlns:tal="http://xml.zope.org/namespaces/tal"
      xmlns:metal="http://xml.zope.org/namespaces/metal"
      xmlns:i18n="http://xml.zope.org/namespaces/i18n"
      lang="en"
      metal:use-macro="context/main_template/macros/master"
      i18n:domain="plone">

<head>
    <metal:block fill-slot="top_slot"
                 tal:define="dummy python:request.set('disable_border',1);
                             disable_column_one python:request.set('disable_plone.leftcolumn',1);
                             disable_column_two python:request.set('disable_plone.rightcolumn',1);" />
</head>

<body>

<metal:main fill-slot="content"
            tal:define="errors options/state/getErrors;
                        portal_url context/@@plone_portal_state/navigation_root_url;
                        member context/@@plone_portal_state/member;">
<tal:main-macro metal:define-macro="main">

    <div class="documentEditable">
        <div id="edit-bar">
        <h5 class="hiddenStructure">Views</h5>
        <ul id="content-views" class="contentViews">
          <li>
            <a href=""
               tal:define="member_id python:member.getId();
                           member_url python:(member_id.startswith('http:') or member_id.startswith('https:')) and ('?author=%s' % member_id) or member_id"
               tal:attributes="href string:${portal_url}/author/${member_url}"
               i18n:translate="label_view">View</a>
          </li>
          <li class="selected">
            <a href=""
               tal:attributes="href string:${portal_url}/personalize_form"
               i18n:translate="label_edit">Edit</a>
          </li>
        </ul>
        <div class="contentActions">&nbsp;</div>
        </div>


            <div metal:use-macro="context/global_statusmessage/macros/portal_message">
               Portal status message
            </div>

            <div id="content">
                <h1 class="documentFirstHeading"
                    i18n:translate="heading_my_preferences">Personal Preferences</h1>

                <div class="documentDescription" i18n:translate="description_my_preferences">
                Your personal settings.
                </div>

                <div id="content-core">
                    <form action="personalize"
                          class="enableAutoFocus enableUnloadProtection"
                          method="post"
                          enctype="multipart/form-data"
                          tal:condition="member"
                          tal:attributes="action template/getId">

                        <metal:userdetails define-macro="user_form">
                        <fieldset tal:define="macros context/additional_memberdata/macros | nothing;
                                              top_macro macros/top | nothing;
                                              showTop python:top_macro;
                                              bottom_macro macros/bottom | nothing;
                                              showBottom python:bottom_macro;
                                              after_primary macros/after_primary| nothing;
                                              showAfterPrimary python:after_primary;
                                              site_properties context/portal_properties/site_properties;">

                            <legend i18n:translate="legend_personal_details">Personal Details</legend>

                            <tal:macro condition="showTop">
                                <div metal:use-macro="top_macro"/>
                            </tal:macro>

                            <div class="field"
                                 tal:define="error errors/fullname | nothing;
                                             fullname python:request.get('fullname', member.getProperty('fullname', ''));"
                                 tal:attributes="class python:test(error, 'field error', 'field')">

                                <label for="fullname" i18n:translate="label_full_name">Full Name</label>

                                <div tal:content="error">Validation error output</div>

                                <input type="text"
                                       id="fullname"
                                       name="fullname"
                                       size="25"
                                       value="member.fullname html_quote"
                                       tal:attributes="value fullname;
                                                       disabled python:member.canWriteProperty('fullname') and default or 'disabled'"
                                       />

                            </div>

                            <div class="field"
                                 tal:define="error errors/email | nothing;
                                             email python:request.get('email', member.getProperty('email',''));"
                                 tal:attributes="class python:test(error, 'field error', 'field')">

                                <label for="email" i18n:translate="label_email">E-mail</label>

                                <span class="fieldRequired" title="Required"
                                      i18n:attributes="title title_required;"
                                      i18n:translate="label_required">(Required)</span>

                                <div tal:content="error">Validation error output</div>

                                <input type="text"
                                       id="email"
                                       name="email"
                                       size="25"
                                       value="member.email html_quote"
                                       tal:attributes="value email;
                                                        readonly python:member.canWriteProperty('email') and default or 'readonly'"
                                       />

                            </div>

                            <tal:macro condition="showAfterPrimary">
                                <div metal:use-macro="after_primary"/>
                            </tal:macro>

                            <div class="field"
                                 tal:define="error errors/location | nothing;
                                             location python:request.get('location', member.getProperty('location', ''));"
                                 tal:attributes="class python:test(error, 'field error', 'field')">

                                <label for="location" i18n:translate="label_location">Location</label>

                                <div class="formHelp" i18n:translate="help_location">
                                Your location - either city and country - or in a company setting,
                                where your office is located.
                                </div>

                                <div tal:content="error">Validation error output</div>

                                <input type="text"
                                       id="location"
                                       name="location"
                                       size="25"
                                       value="member.location html_quote"
                                       tal:attributes="value location;
                                                       disabled python:member.canWriteProperty('location') and default or 'disabled'"
                                       />

                            </div>

                            <div class="field"
                                 tal:define="error errors/language | nothing;
                                             language python:request.get('language', member.getProperty('language', ''));"
                                 tal:attributes="class python:test(error, 'field error', 'field')">

                                <label for="language" i18n:translate="label_language">Language</label>

                                <div class="formHelp" i18n:translate="help_preferred_language">
                                Your preferred language.
                                </div>

                                <div tal:content="error">Validation error output</div>


                                <select name="language"
                                        id="language"
                                        tal:attributes="disabled python:member.canWriteProperty('language') and default or 'disabled'">
                                    <tal:block tal:repeat="lang context/availableLanguages">
                                        <option value="None"
                                            tal:content="python:lang[1]"
                                            tal:attributes="value python:lang[0];
                                                            selected python:test(language==lang[0], 'selected', None);">
                                        </option>
                                    </tal:block>
                                 </select>

                            </div>

                            <div class="field"
                                 tal:define="error errors/description | nothing;
                                             description python:request.get('description', member.getProperty('description', ''));"
                                 tal:attributes="class python:test(error, 'field error', 'field')">

                                <label for="description" i18n:translate="label_biography">Biography</label>

                                <div class="formHelp" i18n:translate="help_biography">
                                A short overview of who you are and what you do. Will be displayed
                                on your author page, linked from the items you create.
                                </div>

                                <div tal:content="error">Validation error output</div>

                                <textarea
                                       id="description"
                                       name="description"
                                       tal:content="description"
                                       rows="5"
                                       cols="40"
                                       tal:attributes="disabled python:member.canWriteProperty('description') and default or 'disabled'"
                                       />

                            </div>

                            <div class="field"
                                 tal:define="error errors/home_page | nothing;
                                             home_page python:request.get('home_page', member.getProperty('home_page', ''));"
                                 tal:attributes="class python:test(error, 'field error', 'field')">

                                <label for="home_page" i18n:translate="label_homepage">Home page</label>

                                <div class="formHelp" i18n:translate="help_homepage">
                                The URL for your external home page, if you have one.
                                </div>

                                <div tal:content="error">Validation error output</div>

                                <input type="text"
                                       id="home_page"
                                       name="home_page"
                                       size="25"
                                       value="member.home_page html_quote"
                                       tal:attributes="value home_page;
                                                       disabled python:member.canWriteProperty('home_page') and default or 'disabled'"
                                       />

                            </div>

                            <div class="field"
                                     tal:define="wysiwyg_editor python:request.get('wysiwyg_editor',
                                                                member.getProperty('wysiwyg_editor',''))">
                                <label for="wysiwyg_editor" i18n:translate="label_content_editor">Content editor</label>

                                <div class="formHelp" i18n:translate="help_content_editor">
                                Select the content editor that you would like to use.
                                Note that content editors often have specific browser
                                requirements.
                                </div>

                                <select name="wysiwyg_editor"
                                        id="wysiwyg_editor"
                                        tal:attributes="disabled python:member.canWriteProperty('wysiwyg_editor') and default or 'disabled'">
                                    <option value=""
                                            tal:attributes="selected python:test(wysiwyg_editor=='', 'selected', None);"
                                            i18n:translate="label_default_content_editor">
                                    Use site default
                                    </option>
                                    <tal:block tal:repeat="editor site_properties/available_editors">
                                    <option tal:condition="python:editor != 'None'"
                                            value="None"
                                            tal:attributes="value editor;
                                                            selected python:test(editor==wysiwyg_editor, 'selected', None);"
                                            tal:content="editor"
                                            i18n:translate="">
                                    WYSIWYG-editor
                                    </option>
                                    <option tal:condition="python:editor == 'None'"
                                            value="None"
                                            tal:attributes="value editor;
                                                            selected python:test(editor==wysiwyg_editor, 'selected', None);"
                                            i18n:translate="label_ordinary_content_editor">
                                    Basic HTML textarea editor (works in all browsers)
                                    </option>

                                    </tal:block>
                                 </select>
                             </div>

                             <div class="field"
                                      tal:define="ext_editor python:request.get('ext_editor',
                                                                 member.getProperty('ext_editor',''))">
                                <input type="checkbox"
                                       class="noborder"
                                       name="ext_editor"
                                       id="cb_ext_editor"
                                       tal:attributes="checked python:test(ext_editor, 'checked', None);
                                                       disabled python:member.canWriteProperty('ext_editor') and default or 'disabled'"
                                       />

                                <label for="cb_ext_editor" i18n:translate="label_ext_editor">Enable external editing</label>

                                <div class="formHelp" i18n:translate="help_content_ext_editor">
                                    When checked, an option will be made visible on each page which allows
                                    you to edit content with your favorite editor instead of using
                                    browser-based editors. This requires an additional application,
                                    most often ExternalEditor or ZopeEditManager, installed client-side.
                                    Ask your administrator for more information if needed.
                                </div>
                            </div>

                            <div class="field"
                                     tal:condition="site_properties/visible_ids|nothing"
                                     tal:define="visible_ids python:request.get('visible_ids', member.getProperty('visible_ids',''));">

                                <input type="checkbox"
                                       class="noborder"
                                       name="visible_ids"
                                       id="cb_invisible_ids"
                                       tal:attributes="checked python:test(visible_ids, 'checked', None);
                                                       disabled python:member.canWriteProperty('visible_ids') and default or 'disabled'"
                                       />

                                <label for="cb_invisible_ids"
                                       i18n:translate="label_edit_short_names">Allow editing of Short Names</label>

                                <div class="formHelp" i18n:translate="help_display_names">
                                Determines if Short Names (also known as IDs) are
                                changable when editing items. If Short Names
                                are not displayed, they will be generated automatically.
                                </div>

                            </div>

                            <div class="field"
                                    tal:condition="context/portal_skins/allow_any"
                                    tal:define="skinvar python:request.get(context.portal_skins.getRequestVarname(), '');
                                    skindefault context/portal_skins/getDefaultSkin;
                                    skincurrent python:test(skinvar, skinvar, skindefault);">

                                <label for="portal_skin" i18n:translate="label_look">Look</label>

                                <div i18n:translate="help_look"
                                     class="formHelp">
                                Appearance of the site.
                                </div>

                                <select name="portal_skin"
                                        id="portal_skin"
                                        tal:attributes="disabled python:member.canWriteProperty('portal_skin') and default or 'disabled'"
                                        >
                                <option value="#"
                                        i18n:translate=""
                                        tal:repeat="skin container/portal_skins/getSkinSelections"
                                        tal:attributes="value skin;
                                                        selected python:test(skincurrent==skin, 'selected', None);"
                                        tal:content="skin"
                                        >dummy skin</option>
                                </select>
                            </div>

                            <div class="field"
                                 tal:define="portrait python:context.portal_membership.getPersonalPortrait(member.getId());">

                                <label for="portrait" i18n:translate="label_portrait">Portrait</label>

                                <img src="" alt=""
                                     height="100"
                                     width="75"
                                     class="portraitPhoto"
                                     style="float: right;"
                                     tal:condition="portrait"
                                     tal:attributes="src portrait/absolute_url"
                                     />

                                <div class="formHelp" i18n:translate="help_portrait">
                                To add or change the portrait: click the "Browse" button;
                                select a picture of yourself. Recommended image size is 75
                                pixels wide by 100 pixels tall.
                                </div>


                                <input type="file"
                                       name="portrait"
                                       id="portrait"
                                       size="20"
                                       />

                                <br />

                                <input class="noborder"
                                    type="checkbox"
                                    id="pdelete"
                                    value="Delete Portrait"
                                    name="delete_portrait"
                                    />
                                <label for="pdelete" i18n:translate="label_delete_portrait">Delete Portrait</label>

                            </div>

                            <tal:macro condition="showBottom">
                                <div metal:use-macro="bottom_macro" />
                            </tal:macro>

                            <div class="formControls">
                                <input class="context"
                                       type="submit"
                                       value="Save"
                                       name="form.button.Save"
                                       i18n:attributes="value label_save;"
                                       />
                                <input class="standalone"
                                       type="submit"
                                       value="Cancel"
                                       name="form.button.Cancel"
                                       i18n:attributes="value label_cancel;"
                                       />
                            </div>

                            <input type="hidden" name="form.submitted" value="1" />

                            <input tal:replace="structure context/@@authenticator/authenticator" />

                        </fieldset>
                        </metal:userdetails>
                    </form>
                </div>
            </div>

    </div>
</tal:main-macro>

</metal:main>

</body>
</html>
