personalize_form のソース
個人設定画面で設定できる項目を増やした場合のソースコード。
サイズ 14.2 kB - File type text/htmlファイルのコンテンツ
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
lang="en"
metal:use-macro="here/prefs_main_template/macros/master"
i18n:domain="plone">
<metal:block fill-slot="top_slot"
tal:define="dummy python:request.set('disable_border',1)" />
<body>
<div metal:fill-slot="prefs_configlet_main"
tal:define="errors options/state/getErrors;">
<span tal:define="dummy python:request.response.setHeader('pragma','no-cache')" />
<h1 i18n:translate="heading_my_preferences">Personal Preferences</h1>
<a href=""
class="link-parent"
tal:attributes="href string: $portal_url/plone_memberprefs_panel"
i18n:translate="label_up_to_preferences">
Up to My Preferences
</a>
<p i18n:translate="description_my_preferences">
Your personal settings.
</p>
<form action="personalize"
method="post"
enctype="multipart/form-data"
tal:condition="member"
tal:attributes="action template/getId">
<fieldset>
<legend i18n:translate="legend_member_details">Member Details</legend>
<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"
tabindex=""
value="member.fullname html_quote"
tal:attributes="value fullname;
tabindex tabindex/next;"
/>
</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"
i18n:translate="label_required">(Required)</span>
<div tal:content="error">Validation error output</div>
<input type="text"
id="email"
name="email"
size="25"
tabindex=""
value="member.email html_quote"
tal:attributes="value email;
tabindex tabindex/next;"
/>
</div>
<div class="field"
tal:define="error errors/nickname | nothing;
nickname python:request.get('nickname', member.getProperty('nickname', ''));"
tal:attributes="class python:test(error, 'field error', 'field')">
<label for="nickname" i18n:translate="label_nick_name">Nick name</label>
<div tal:content="error">Validation error output</div>
<input type="text"
id="nickname"
name="nickname"
size="25"
tabindex=""
value="member.nickname html_quote"
tal:attributes="value nickname;
tabindex tabindex/next;"
/>
</div>
<div class="field"
tal:define="error errors/organization | nothing;
organization python:request.get('organization', member.getProperty('organization', ''));"
tal:attributes="class python:test(error, 'field error', 'field')">
<label for="organization" i18n:translate="label_organization">Organization</label>
<div tal:content="error">Validation error output</div>
<input type="text"
id="organization"
name="organization"
size="25"
tabindex=""
value="member.organization html_quote"
tal:attributes="value organization;
tabindex tabindex/next;"
/>
</div>
<div class="field"
tal:define="blood python:request.get('blood',
member.getProperty('blood',''))">
<label for="blood" i18n:translate="label_blood">Blood</label>
<div></div>
<select name="blood"
id="blood"
tabindex=""
tal:attributes="tabindex tabindex/next;">
<option value="">--</option>
<tal:block tal:repeat="val python:('A', 'B', 'O', 'AB')">
<option value="None"
tal:attributes="value val;
selected python:test(val==blood, 'selected', None);"
tal:content="val"
i18n:translate="">
Blood
</option>
</tal:block>
</select>
</div>
<div class="field"
tal:define="sex python:request.get('sex',
member.getProperty('sex',''))">
<label for="sex" i18n:translate="label_sex">Sex</label>
<div></div>
<select name="sex"
id="sex"
tabindex=""
tal:attributes="tabindex tabindex/next;">
<option value="">--</option>
<tal:block tal:repeat="val python:('Male', 'Female')">
<option value="None"
tal:attributes="value val;
selected python:test(val==sex, 'selected', None);"
tal:content="val"
i18n:translate="">
Sex
</option>
</tal:block>
</select>
</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"
tabindex=""
tal:attributes="tabindex tabindex/next;">
<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">
WYSIWYG-editor
</option>
<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="label_ordinary_content_editor">
Ordinary Form-based Editor (works in all browsers)
</option>
</tal:block>
</select>
</div>
<div class="field"
tal:define="listed python:request.get('listed', member.getProperty('listed',''));">
<input type="checkbox"
class="noborder"
name="listed"
id="cb_listed"
tal:attributes="tabindex tabindex/next;
checked python:test(listed, 'checked', None);"
/>
<label for="cb_listed" i18n:translate="label_listed_status">Listed in searches</label>
<div class="formHelp" i18n:translate="help_listed_search">
Determines if your user name is listed in member searches done on this site.
</div>
</div>
<div class="field"
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="tabindex tabindex/next;
checked python:test(visible_ids, 'checked', None);"
/>
<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="here/portal_skins/allow_any"
tal:define="skinvar python:request.get(here.portal_skins.getRequestVarname(), '');
skindefault here/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"
tabindex=""
tal:attributes="tabindex tabindex/next;"
>
<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 mtool/getPersonalPortrait;">
<label for="portrait" i18n:translate="label_portrait">Portrait</label>
<img src="" alt=""
height="192"
width="192"
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"
tabindex=""
tal:attributes="tabindex tabindex/next;"
/>
<br />
<input class="noborder"
tabindex=""
type="checkbox"
id="pdelete"
value="Delete Portrait"
name="delete_portrait"
tal:attributes="tabindex tabindex/next;"
/>
<label for="pdelete" i18n:translate="label_delete_portrait">Delete Portrait</label>
</div>
<div class="formControls">
<input class="context"
tabindex=""
type="submit"
value="Save"
name="form.button.Save"
i18n:attributes="value"
tal:attributes="tabindex tabindex/next;"
/>
<input class="standalone"
tabindex=""
type="submit"
value="Cancel"
name="form.button.Cancel"
i18n:attributes="value"
tal:attributes="tabindex tabindex/next;"
/>
</div>
<input type="hidden" name="form.submitted" value="1" />
</fieldset>
</form>
</div>
</body>
</html>
Click here to get the file