annotate MoinMoin/templates/modify.html @ 2263:6dd5af01d54d

Sub-items pannel now has fqname support.
author Ashutosh Singla <ashu1461@gmail.com>
date Wed, 11 Sep 2013 14:48:02 +0530
parents a90551dc4b75
children 6938dad629da
rev   line source
242
e93157b8b0bd refactor modify views to use flatland, see details below
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 227
diff changeset
1 {% import "forms.html" as forms %}
1451
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
2 {% import "utils.html" as utils %}
1654
5acaea38f1a2 Duplicate templates removed from foobar
Jaiditya Mathur <jaiditya.mathur@gmail.com>
parents: 1629
diff changeset
3 {% extends theme("show.html") %}
1241
95abf895be4f Refactor title code, fixes #147
Sam Toyer <samATqxcvDOTnet>
parents: 892
diff changeset
4
1624
c6974ba2e2b2 Widget-based metadata editor.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1451
diff changeset
5 {% from form.meta_template import meta_editor %}
1451
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
6 {# Import macros data_editor and extra_head from content_form's template.
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
7 extra_head is optional, so instead of a simple "import from" we need to do
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
8 this manually #}
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
9 {% import form['content_form'].template as content_template %}
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
10 {% set extra_head = content_template.extra_head %}
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
11 {% set data_editor = content_template.data_editor %}
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
12
2261
a90551dc4b75 Updated fqname support to modify view.
Ashutosh Singla <ashu1461@gmail.com>
parents: 2121
diff changeset
13 {% set title = _("Modifying '%(item_name)s'", item_name=fqname.value) %}
1241
95abf895be4f Refactor title code, fixes #147
Sam Toyer <samATqxcvDOTnet>
parents: 892
diff changeset
14
1451
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
15 {% block head %}
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
16 {{ super() }}
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
17 {% if extra_head %}
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
18 {{ extra_head() }}
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
19 {% endif %}
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
20 {% endblock %}
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
21
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
22 {% block subitem_navigation %}
2263
6dd5af01d54d Sub-items pannel now has fqname support.
Ashutosh Singla <ashu1461@gmail.com>
parents: 2261
diff changeset
23 {% call(fullname, shortname, contenttype, has_children) utils.render_subitem_navigation(fqname, True) %}
1451
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
24 {% set shortname = shortname|json_dumps %}
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
25 {% set fullname = fullname|json_dumps %}
2084
d366d1af5e1e fixes : Transcluding and Linking subitems bug, changed transcluding and linking buttons to only one InsertName
Ashutosh Singla <ashu1461@gmail.com>
parents: 1988
diff changeset
26 <button class="moin-insertname-action" onclick='InsertName({{ fullname }})'
d366d1af5e1e fixes : Transcluding and Linking subitems bug, changed transcluding and linking buttons to only one InsertName
Ashutosh Singla <ashu1461@gmail.com>
parents: 1988
diff changeset
27 title="{{ _('Insert Name') }}">{{ _('Insert Name') }}</button>
1451
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
28 {% endcall %}
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
29 {% endblock %}
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
30
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
31
227
7099a64c00ad remove TABs, remove CRLF lineendings - please use spaces and LF only
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 0
diff changeset
32 {% block content %}
1241
95abf895be4f Refactor title code, fixes #147
Sam Toyer <samATqxcvDOTnet>
parents: 892
diff changeset
33 <h1>{{ title }}</h1>
1588
48bcafd8f5ec Modernized theme modify form styling
Jaiditya Mathur <jaiditya.mathur@gmail.com>
parents: 1451
diff changeset
34 <div id="moin-modify" class="moin-form">
1330
cae27a401354 fix issue #165 +modify fails html5 validation
Roger Haase <crosseyedpenguin@yahoo.com>
parents: 1317
diff changeset
35 {{ gen.form.open(form, method='post', enctype='multipart/form-data') }}
1317
ce5454f5edaa CSS cleanup, remove unused selectors, fixes #172 align columns of integers to right, partial fix for #165 html errors on +modify
Roger Haase <crosseyedpenguin@yahoo.com>
parents: 1241
diff changeset
36 {{ forms.render_errors(form) }}
1451
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
37 {#
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
38 Workaround:
1988
490c13d072f2 remove Submit widget
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1854
diff changeset
39 For *Draw content, hide submit button and form['comment'], since *Draw
1451
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
40 POSTs originate from their respective applets.
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
41 #}
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
42 {% if not form['content_form'].is_draw %}
2121
5c4b0703c62a fix for broken scroll-after-edit
Roger Haase <crosseyedpenguin@yahoo.com>
parents: 2084
diff changeset
43 {{ forms.render_submit(form, id='moin-save-text-button') }}
1451
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
44 <dl>
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
45 {{ forms.render_textcha(gen, form) }}
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
46 {{ forms.render(form['comment']) }}
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
47 </dl>
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
48 {% endif %}
1773
7841aa4065a7 macro data_editor needs item_name as parameter so we can use it in all kind of contentypes
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1745
diff changeset
49 {{ data_editor(form['content_form'], item_name) }}
1451
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
50 {% if form['content_form'].help %}
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
51 <pre id="moin-editor-help">{{ form['content_form'].help }}</pre>
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
52 {% endif %}
1624
c6974ba2e2b2 Widget-based metadata editor.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1451
diff changeset
53 {{ meta_editor(form['meta_form']) }}
1317
ce5454f5edaa CSS cleanup, remove unused selectors, fixes #172 align columns of integers to right, partial fix for #165 html errors on +modify
Roger Haase <crosseyedpenguin@yahoo.com>
parents: 1241
diff changeset
54 <dl>
1624
c6974ba2e2b2 Widget-based metadata editor.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1451
diff changeset
55 {{ forms.render(form['extra_meta_text']) }}
1317
ce5454f5edaa CSS cleanup, remove unused selectors, fixes #172 align columns of integers to right, partial fix for #165 html errors on +modify
Roger Haase <crosseyedpenguin@yahoo.com>
parents: 1241
diff changeset
56 </dl>
1451
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
57 {#
1317
ce5454f5edaa CSS cleanup, remove unused selectors, fixes #172 align columns of integers to right, partial fix for #165 html errors on +modify
Roger Haase <crosseyedpenguin@yahoo.com>
parents: 1241
diff changeset
58 {{ gen.textarea(form['meta_text'], lang='en', dir='ltr', rows=rows_meta, cols=cols) }}
ce5454f5edaa CSS cleanup, remove unused selectors, fixes #172 align columns of integers to right, partial fix for #165 html errors on +modify
Roger Haase <crosseyedpenguin@yahoo.com>
parents: 1241
diff changeset
59 <br />
ce5454f5edaa CSS cleanup, remove unused selectors, fixes #172 align columns of integers to right, partial fix for #165 html errors on +modify
Roger Haase <crosseyedpenguin@yahoo.com>
parents: 1241
diff changeset
60 {{ forms.render_errors(form['meta_text']) }}
1451
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
61 #}
1317
ce5454f5edaa CSS cleanup, remove unused selectors, fixes #172 align columns of integers to right, partial fix for #165 html errors on +modify
Roger Haase <crosseyedpenguin@yahoo.com>
parents: 1241
diff changeset
62 {{ gen.form.close() }}
227
7099a64c00ad remove TABs, remove CRLF lineendings - please use spaces and LF only
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 0
diff changeset
63 </div>
7099a64c00ad remove TABs, remove CRLF lineendings - please use spaces and LF only
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 0
diff changeset
64 {% endblock %}
1781
90eb2ea82c32 add auto-scroll edit textarea after doubleclick; auto-scroll show page after edit
Roger Haase <crosseyedpenguin@yahoo.com>
parents: 1773
diff changeset
65
90eb2ea82c32 add auto-scroll edit textarea after doubleclick; auto-scroll show page after edit
Roger Haase <crosseyedpenguin@yahoo.com>
parents: 1773
diff changeset
66 {% block options_for_javascript %}
1854
c177197b065b fix scroll_page_after_edit option so it is saved when checked in user settings
Roger Haase <crosseyedpenguin@yahoo.com>
parents: 1781
diff changeset
67 {%- if user.scroll_page_after_edit -%}
1781
90eb2ea82c32 add auto-scroll edit textarea after doubleclick; auto-scroll show page after edit
Roger Haase <crosseyedpenguin@yahoo.com>
parents: 1773
diff changeset
68 <br id="moin-scroll-page-after-edit" />
90eb2ea82c32 add auto-scroll edit textarea after doubleclick; auto-scroll show page after edit
Roger Haase <crosseyedpenguin@yahoo.com>
parents: 1773
diff changeset
69 {%- endif %}
90eb2ea82c32 add auto-scroll edit textarea after doubleclick; auto-scroll show page after edit
Roger Haase <crosseyedpenguin@yahoo.com>
parents: 1773
diff changeset
70 {% endblock %}