annotate MoinMoin/templates/modify.html @ 1624:c6974ba2e2b2

Widget-based metadata editor.
author Cheer Xiao <xiaqqaix@gmail.com>
date Wed, 01 Aug 2012 23:31:14 +0800
parents c32ff2e07e7a
children 8b7a85055643
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 %}
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
3 {% extends theme("layout.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
1241
95abf895be4f Refactor title code, fixes #147
Sam Toyer <samATqxcvDOTnet>
parents: 892
diff changeset
13 {% set title = _("Modifying %(item_name)s", item_name=item_name) %}
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 %}
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
23 {% call(fullname, shortname, contenttype, has_children) utils.render_subitem_navigation(item_name, True) %}
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 %}
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
26 <button class="link-action" onclick='linkSubitem({{ shortname }}, {{ fullname }})'
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
27 title="{{ _('Link to Subitem') }}">{{ _('Link') }}</button>
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
28 <button class="transclude-action"
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
29 onclick='transcludeSubitem({{ shortname }}, {{ fullname }})'
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
30 title="{{ _('Transclude Subitem') }}">{{ _('Transclude') }}</button>
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
31 {% endcall %}
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
32 {% endblock %}
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
33
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
34
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
35 {% block content %}
1241
95abf895be4f Refactor title code, fixes #147
Sam Toyer <samATqxcvDOTnet>
parents: 892
diff changeset
36 <h1>{{ title }}</h1>
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
37 <div class="moin-form">
1330
cae27a401354 fix issue #165 +modify fails html5 validation
Roger Haase <crosseyedpenguin@yahoo.com>
parents: 1317
diff changeset
38 {{ 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
39 {{ forms.render_errors(form) }}
1451
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
40 {#
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
41 Workaround:
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
42 For *Draw content, hide form['submit'] and form['comment'], since *Draw
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
43 POSTs originate from their respective applets.
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
44 #}
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
45 {% if not form['content_form'].is_draw %}
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
46 {{ forms.render(form['submit']) }}
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 {{ forms.render_textcha(gen, form) }}
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
49 {{ forms.render(form['comment']) }}
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
50 </dl>
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
51 {% endif %}
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
52 {{ data_editor(form['content_form']) }}
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
53 {% if form['content_form'].help %}
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
54 <pre id="moin-editor-help">{{ form['content_form'].help }}</pre>
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
55 {% endif %}
1624
c6974ba2e2b2 Widget-based metadata editor.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1451
diff changeset
56 {{ 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
57 <dl>
1624
c6974ba2e2b2 Widget-based metadata editor.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1451
diff changeset
58 {{ 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
59 </dl>
1451
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
60 {#
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
61 {{ 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
62 <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
63 {{ forms.render_errors(form['meta_text']) }}
1451
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
64 #}
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
65 {{ 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
66 </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
67 {% endblock %}