1 | <metal:block define-macro="buttons"> |
---|
2 | <input type="submit" name="cpsdocument_edit_button" |
---|
3 | class="standalone" value="button_change" |
---|
4 | id="cpsdocument_edit_button" |
---|
5 | i18n:attributes="value" |
---|
6 | tal:condition="not:creation" /> |
---|
7 | <input type="submit" name="cpsdocument_edit_and_view_button" |
---|
8 | class="standalone" value="button_change_and_view" |
---|
9 | id="cpsdocument_edit_and_view_button" |
---|
10 | i18n:attributes="value" |
---|
11 | tal:condition="not:creation" /> |
---|
12 | <input type="submit" name="cpsdocument_create_button" |
---|
13 | class="standalone" value="button_create" |
---|
14 | i18n:attributes="value" |
---|
15 | id="cpsdocument_create_button" |
---|
16 | tal:condition="creation" /> |
---|
17 | <tal:block define=" |
---|
18 | use_ajax use_ajax|python:True; |
---|
19 | content_changed python:cpsmcat('psm_content_changed'); |
---|
20 | content_error python:cpsmcat('psm_content_error'); |
---|
21 | working python:cpsmcat('psm_ajax_working')" |
---|
22 | condition="python:edition and use_ajax"> |
---|
23 | <script type="text/javascript" |
---|
24 | tal:content="string: |
---|
25 | // unobtrusive form controller, that leaves the form accessible |
---|
26 | var editor = new CPSDocumentEditor( |
---|
27 | 'editForm', |
---|
28 | $$('editForm').action, |
---|
29 | 'editForm', |
---|
30 | new Array('cpsdocument_edit_button'), |
---|
31 | new Array('cpsdocument_edit_and_view_button'), |
---|
32 | 'page_title', |
---|
33 | {content_changed: '${content_changed}', |
---|
34 | working: '${working}', |
---|
35 | content_error: '${content_error}'}, |
---|
36 | null, |
---|
37 | new Array('addwidget_button'));"> |
---|
38 | </script> |
---|
39 | </tal:block> |
---|
40 | </metal:block> |
---|