[1] | 1 | <tal:block metal:define-macro="master" |
---|
| 2 | define="errors options/state/getErrors | nothing; |
---|
| 3 | Iterator python:modules['Products.Archetypes'].IndexIterator; |
---|
| 4 | schematas here/Schemata; |
---|
| 5 | fieldsets python:[key for key in schematas.keys() if (key != 'metadata') and (schematas[key].editableFields(here, visible_only=True))]; |
---|
| 6 | default_fieldset python:(not schematas or schematas.has_key('default')) and 'default' or fieldsets[0]; |
---|
| 7 | fieldset request/fieldset|options/fieldset|default_fieldset; |
---|
| 8 | fields python:schematas[fieldset].editableFields(here); |
---|
| 9 | dummy python:here.at_isEditable(fields); |
---|
| 10 | portal_type python:here.getPortalTypeName().lower().replace(' ', '_'); |
---|
| 11 | type_name here/getPortalTypeName|here/archetype_name; |
---|
| 12 | base_macros here/edit_macros/macros; |
---|
| 13 | edit_template python:'%s_edit' % portal_type; |
---|
| 14 | edit_macros python:path('here/%s/macros | nothing' % edit_template); |
---|
| 15 | header_macro edit_macros/header | header_macro | base_macros/header; |
---|
| 16 | typedescription_macro edit_macros/typedescription | typedescription_macro | base_macros/typedescription; |
---|
| 17 | body_macro edit_macros/body | body_macro | base_macros/body; |
---|
| 18 | footer_macro edit_macros/footer | footer_macro | base_macros/footer; |
---|
| 19 | lockable python:hasattr(here, 'wl_isLocked'); |
---|
| 20 | isLocked python:lockable and here.wl_isLocked(); |
---|
| 21 | tabindex tabindex|python:Iterator(pos=7000); |
---|
| 22 | css python:here.getUniqueWidgetAttr(fields, 'helper_css'); |
---|
| 23 | js python:here.getUniqueWidgetAttr(fields, 'helper_js');"> |
---|
| 24 | |
---|
| 25 | <html xmlns="http://www.w3.org/1999/xhtml" |
---|
| 26 | xml:lang="en" |
---|
| 27 | lang="en" |
---|
| 28 | xmlns:tal="http://xml.zope.org/namespaces/tal" |
---|
| 29 | xmlns:metal="http://xml.zope.org/namespaces/metal" |
---|
| 30 | xmlns:i18n="http://xml.zope.org/namespaces/i18n" |
---|
| 31 | metal:use-macro="here/main_template/macros/master" |
---|
| 32 | i18n:domain="plone"> |
---|
| 33 | |
---|
| 34 | <metal:head fill-slot="top_slot"> |
---|
| 35 | <tal:block define="macro edit_macros/topslot | nothing" |
---|
| 36 | condition="macro"> |
---|
| 37 | <metal:block use-macro="macro" /> |
---|
| 38 | </tal:block> |
---|
| 39 | </metal:head> |
---|
| 40 | |
---|
| 41 | <metal:javascript_head fill-slot="javascript_head_slot"> |
---|
| 42 | <tal:block define="macro here/archetypes_custom_js/macros/javascript_head | nothing" |
---|
| 43 | condition="macro"> |
---|
| 44 | <metal:block use-macro="macro" /> |
---|
| 45 | </tal:block> |
---|
| 46 | <tal:js condition="js" |
---|
| 47 | repeat="item js"> |
---|
| 48 | <script type="text/javascript" |
---|
| 49 | charset="iso-8859-1" |
---|
| 50 | tal:condition="python:exists('portal/%s' % item)" |
---|
| 51 | tal:attributes="src string:$portal_url/$item"> |
---|
| 52 | </script> |
---|
| 53 | </tal:js> |
---|
| 54 | <tal:block define="macro edit_macros/javascript_head | nothing" |
---|
| 55 | condition="macro"> |
---|
| 56 | <metal:block use-macro="macro" /> |
---|
| 57 | </tal:block> |
---|
| 58 | </metal:javascript_head> |
---|
| 59 | |
---|
| 60 | <metal:css fill-slot="css_slot"> |
---|
| 61 | <tal:css condition="css" |
---|
| 62 | repeat="item css"> |
---|
| 63 | <style type="text/css" |
---|
| 64 | media="all" |
---|
| 65 | tal:condition="python:exists('portal/%s' % item)" |
---|
| 66 | tal:content="string:@import url($portal_url/$item);"> |
---|
| 67 | </style> |
---|
| 68 | </tal:css> |
---|
| 69 | <tal:block define="macro edit_macros/css | nothing" |
---|
| 70 | condition="macro"> |
---|
| 71 | <metal:block use-macro="macro" /> |
---|
| 72 | </tal:block> |
---|
| 73 | </metal:css> |
---|
| 74 | |
---|
| 75 | <body> |
---|
| 76 | |
---|
| 77 | <metal:fill fill-slot="main"> |
---|
| 78 | <metal:main define-macro="main"> |
---|
| 79 | <metal:use_header use-macro="header_macro" /> |
---|
| 80 | <metal:use_typedescription use-macro="typedescription_macro" /> |
---|
| 81 | |
---|
| 82 | <div> |
---|
| 83 | <form name="edit_form" |
---|
| 84 | method="post" |
---|
| 85 | enctype="multipart/form-data" |
---|
| 86 | class="enableUnloadProtection" |
---|
| 87 | action="" |
---|
| 88 | tal:attributes="action python:here.absolute_url()+'/'+template.id"> |
---|
| 89 | |
---|
| 90 | <metal:block define-slot="extra_top" /> |
---|
| 91 | |
---|
| 92 | <metal:block define-slot="widgets"> |
---|
| 93 | <tal:fields repeat="field fields"> |
---|
| 94 | <metal:fieldMacro use-macro="python:here.widget(field.getName(), mode='edit')" /> |
---|
| 95 | <div id="autozoom" tal:condition="python:field.getName() == 'location'"> |
---|
| 96 | <span tal:replace="structure here/getCenterZoom" /> |
---|
| 97 | </div> |
---|
| 98 | </tal:fields> |
---|
| 99 | </metal:block> |
---|
| 100 | |
---|
| 101 | <metal:block define-slot="extra_bottom" /> |
---|
| 102 | |
---|
| 103 | <div class="formControls"> |
---|
| 104 | |
---|
| 105 | <input type="hidden" |
---|
| 106 | name="fieldset" |
---|
| 107 | value="default" |
---|
| 108 | tal:attributes="value fieldset" |
---|
| 109 | /> |
---|
| 110 | <input type="hidden" |
---|
| 111 | name="form.submitted" |
---|
| 112 | value="1" |
---|
| 113 | /> |
---|
| 114 | <input type="hidden" |
---|
| 115 | name="add_reference.field:record" |
---|
| 116 | value="" |
---|
| 117 | /> |
---|
| 118 | <input type="hidden" |
---|
| 119 | name="add_reference.type:record" |
---|
| 120 | value="" |
---|
| 121 | /> |
---|
| 122 | <input type="hidden" |
---|
| 123 | name="add_reference.destination:record" |
---|
| 124 | value="" |
---|
| 125 | /> |
---|
| 126 | |
---|
| 127 | <tal:env define="env request/controller_state/kwargs"> |
---|
| 128 | <tal:loop repeat="varname python:('reference_source_url', 'reference_source_field', 'reference_source_fieldset')"> |
---|
| 129 | <tal:reference define="items python:env.get(varname, request.get(varname))" |
---|
| 130 | condition="items"> |
---|
| 131 | <input tal:repeat="item items" |
---|
| 132 | type="hidden" |
---|
| 133 | name="form_env.reference_source_url:list:record" |
---|
| 134 | value="value" |
---|
| 135 | tal:attributes="value item; |
---|
| 136 | name string:form_env.${varname}:list:record" |
---|
| 137 | /> |
---|
| 138 | </tal:reference> |
---|
| 139 | </tal:loop> |
---|
| 140 | </tal:env> |
---|
| 141 | |
---|
| 142 | <tal:comment replace="nothing"> |
---|
| 143 | Turn 'persistent_' variables from controller_state persistent |
---|
| 144 | </tal:comment> |
---|
| 145 | <tal:env repeat="env request/controller_state/kwargs/items"> |
---|
| 146 | <input type="hidden" |
---|
| 147 | name="key" |
---|
| 148 | value="value" |
---|
| 149 | tal:define="key python:env[0]; |
---|
| 150 | value python:env[1]" |
---|
| 151 | tal:condition="python:key.startswith('persistent_')" |
---|
| 152 | tal:attributes="name string:form_env.${key}:record; |
---|
| 153 | value value" |
---|
| 154 | /> |
---|
| 155 | </tal:env> |
---|
| 156 | |
---|
| 157 | <tal:comment replace="nothing"> |
---|
| 158 | Turn 'persistent_' variables from forms (GET/POST) persistent |
---|
| 159 | </tal:comment> |
---|
| 160 | <tal:env repeat="env request/form"> |
---|
| 161 | <input type="hidden" |
---|
| 162 | name="key" |
---|
| 163 | value="value" |
---|
| 164 | tal:define="key env; |
---|
| 165 | value request/?env" |
---|
| 166 | tal:condition="python:key.startswith('persistent_')" |
---|
| 167 | tal:attributes="name string:form_env.${key}:record; |
---|
| 168 | value value" |
---|
| 169 | /> |
---|
| 170 | </tal:env> |
---|
| 171 | |
---|
| 172 | <tal:comment replace="nothing"> |
---|
| 173 | Store referrer to remember where to go back |
---|
| 174 | </tal:comment> |
---|
| 175 | <input type="hidden" |
---|
| 176 | name="last_referer" |
---|
| 177 | tal:define="last_referer python:here.session_restore_value('HTTP_REFERER', request.form.get('last_referer', request.get('HTTP_REFERER')))" |
---|
| 178 | tal:attributes="value python:(last_referer and '%s/%s' % (here.absolute_url(), template.id) not in last_referer) and last_referer or (here.getParentNode() and here.getParentNode().absolute_url())" |
---|
| 179 | /> |
---|
| 180 | |
---|
| 181 | <metal:block define-slot="buttons" |
---|
| 182 | tal:define="fieldset_index python:fieldsets.index(fieldset); |
---|
| 183 | n_fieldsets python:len(fieldsets)"> |
---|
| 184 | |
---|
| 185 | <input tal:condition="python:fieldset_index > 0" |
---|
| 186 | class="context" |
---|
| 187 | tabindex="" |
---|
| 188 | type="submit" |
---|
| 189 | name="form_previous" |
---|
| 190 | value="Previous" |
---|
| 191 | i18n:attributes="value label_previous;" |
---|
| 192 | tal:attributes="tabindex tabindex/next; |
---|
| 193 | disabled python:test(isLocked, 'disabled', None);" |
---|
| 194 | /> |
---|
| 195 | <input tal:condition="python:fieldset_index < n_fieldsets - 1" |
---|
| 196 | class="context" |
---|
| 197 | tabindex="" |
---|
| 198 | type="submit" |
---|
| 199 | name="form_next" |
---|
| 200 | value="Next" |
---|
| 201 | i18n:attributes="value label_next;" |
---|
| 202 | tal:attributes="tabindex tabindex/next; |
---|
| 203 | disabled python:test(isLocked, 'disabled', None);" |
---|
| 204 | /> |
---|
| 205 | <input class="context" |
---|
| 206 | tabindex="" |
---|
| 207 | type="submit" |
---|
| 208 | name="form_submit" |
---|
| 209 | value="Save" |
---|
| 210 | i18n:attributes="value label_save;" |
---|
| 211 | tal:attributes="tabindex tabindex/next; |
---|
| 212 | disabled python:test(isLocked, 'disabled', None);" |
---|
| 213 | /> |
---|
| 214 | <input class="standalone" |
---|
| 215 | tabindex="" |
---|
| 216 | type="submit" |
---|
| 217 | name="form.button.cancel" |
---|
| 218 | value="Cancel" |
---|
| 219 | i18n:attributes="value label_cancel;" |
---|
| 220 | tal:attributes="tabindex tabindex/next" |
---|
| 221 | /> |
---|
| 222 | </metal:block> |
---|
| 223 | |
---|
| 224 | <metal:block define-slot="extra_buttons" /> |
---|
| 225 | |
---|
| 226 | </div> |
---|
| 227 | |
---|
| 228 | </form> |
---|
| 229 | </div> |
---|
| 230 | |
---|
| 231 | <metal:use_footer use-macro="footer_macro" /> |
---|
| 232 | </metal:main> |
---|
| 233 | </metal:fill> |
---|
| 234 | |
---|
| 235 | </body> |
---|
| 236 | |
---|
| 237 | </html> |
---|
| 238 | |
---|
| 239 | </tal:block> |
---|