source: WAeUP_SRP/trunk/skins/waeup_default/waeup_edit_form.pt @ 2020

Last change on this file since 2020 was 2020, checked in by joachim, 17 years ago

ajaxifying finished works for personal_edit

  • Property svn:keywords set to Id
File size: 5.7 KB
Line 
1<metal:defineblock tal:define="rendered_main python:context.getContent().render(layout_mode='edit',
2           cluster=None,
3           request=request,
4           use_session=True,
5           no_form=True);
6           form_action string:waeup_edit;
7           form_type string:waeup;
8           creation python:False;
9           is_allowed context/isSectionOfficer;
10           metadata metadata|nothing;
11           template here/main_template/macros/master;
12           ">
13<metal:block define-macro="edit_form">
14  <metal:block use-macro=template>
15      <metal:block fill-slot="style_slot">
16      <script type="text/javascript" src="prototype.js"
17              tal:attributes="src string:${base_url}prototype.js"></script>
18      <script type="text/javascript" src="effects.js"
19              tal:attributes="src string:${base_url}effects.js"></script>
20      <script type="text/javascript" src="controls.js"
21              tal:attributes="src string:${base_url}controls.js"></script>
22      <script type="text/javascript" src="cpsdocument.js"
23              tal:attributes="src string:${base_url}cpsdocument.js"></script>
24      <script type="text/javascript" src="cpsschemas.js"
25              tal:attributes="src string:${base_url}cpsschemas.js"></script>
26
27    </metal:block>
28  <metal:block fill-slot="header">
29    <span tal:condition="not: is_allowed">
30        <span tal:content="here/illegal_view" />
31    </span>
32    <span tal:condition="is_allowed">
33    <h3 tal:condition="creation" i18n:translate="">
34      Create a document of type
35      <tal:block i18n:name="type_name" i18n:translate=""
36            tal:define="type_name request/type_name;
37                        type_info python:here.portal_types[type_name]"
38            tal:content="type_info/Title">Type Title</tal:block>
39    </h3>
40    <span tal:condition="python: not creation">
41     <a href="" tal:condition="python: form_type in ('waeup',)"
42       tal:attributes="href string:${here/academicsParent}">
43      <img tal:attributes="src string:${here/portal_url}/arrow_up.gif"/>
44      Up one level
45    </a>
46    <h3>
47      <tal:block condition="not: metadata"
48        i18n:translate="">Edit <span id="page_title" i18n:name="title"
49        tal:content="here/title_or_id">Page Title</span>
50      </tal:block>
51      <tal:block tal:condition="metadata"
52        i18n:translate="">Metadata of <span i18n:name="title" tal:content="here/title_or_id">Page Title</span>
53      </tal:block>
54    </h3>
55    <br />       
56    </span>
57    </span>
58  </metal:block>
59 
60 
61  <metal:block fill-slot="main" tal:condition="is_allowed">
62    <form id=editForm action="waeup_edit" method="post" id="editForm"
63          enctype="multipart/form-data" class="workflow"
64          tal:attributes="action string:${context/absolute_url}/waeup_edit"
65          >
66        <input type="hidden" id="came_from" name="came_from" value=""
67               tal:attributes="value string:${form_action}_form"/>
68      <div class="group">
69        <div class="documentFields">
70          <tal:block define="getFormUidHtml nocall:modules/Products.CPSDocument.utils/getFormUidHtml"
71                     replace="structure python:getFormUidHtml(request)"/>
72          <input type="hidden" name="type_name" value="VALUE"
73                 tal:condition="creation"
74                 tal:attributes="value request/type_name" />
75          <div id="rendered_main" tal:content="structure rendered_main">
76            CONTENT
77          </div>
78        </div>
79
80        <tal:block condition="python: 0 and not creation">
81          <div class="tooltipArea" style="visibility: hidden;"
82               id="transition_comments_help"
83               onclick="showElement(false, 'transition_comments_help')"
84               i18n:translate="help_transition_comments_modification">
85            In this field you can give the reason for the modification
86            on this document. Your comments may be used to notify other users.
87          </div>
88          <dl>
89            <dt><label for="comments"
90                       i18n:translate="transition_comments_modification"
91                       >Reason of the modification</label>
92              <button type="button" class="tooltipControl"
93                      onclick="toggleElementVisibility('transition_comments_help')"> ? </button>
94            </dt>
95            <dd>
96              <textarea name="comments" id="comments" cols="60" rows="3"
97                        tal:content="nothing">
98              </textarea>
99            </dd>
100          </dl>         
101        </tal:block>
102        <metal:block use-macro="python:path('context/%s_edit_buttons/macros/buttons' % form_type)"/>
103
104          <tal:block define="
105          use_ajax use_ajax|python:True;
106          content_changed python:cpsmcat('psm_content_changed');
107          content_error python:cpsmcat('psm_content_error');
108          working python:cpsmcat('psm_ajax_working')"
109          condition="python:use_ajax">
110            <script type="text/javascript"
111                    tal:content="string:
112                    // unobtrusive form controller, that leaves the form accessible
113                    var editor = new CPSDocumentEditor(
114                    'editForm',
115                    $$('editForm').action,
116                    'editForm',
117                    new Array('cpsdocument_edit_button'),
118                    new Array('cpsdocument_edit_and_view_button'),
119                    'page_title',
120                    {content_changed: '${content_changed}',
121                    working: '${working}',
122                    content_error: '${content_error}'},
123                    null,
124                    new Array('addwidget_button'));"
125                    >
126            </script>
127          </tal:block>
128        </div>
129      </form>
130      <div id="ajax_psm" style="display:none">
131        ajax feedback
132      </div>
133  </metal:block>
134
135</metal:block>
136</metal:block>
137</metal:defineblock>
Note: See TracBrowser for help on using the repository browser.