annotate MoinMoin/templates/modify.html @ 1588:48bcafd8f5ec

Modernized theme modify form styling
author Jaiditya Mathur <jaiditya.mathur@gmail.com>
date Wed, 01 Aug 2012 02:48:05 +0530
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
1451
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
5 {# Import macros data_editor and extra_head from content_form's template.
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
6 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
7 this manually #}
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
8 {% import form['content_form'].template as content_template %}
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
9 {% set extra_head = content_template.extra_head %}
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
10 {% set data_editor = content_template.data_editor %}
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
11
1241
95abf895be4f Refactor title code, fixes #147
Sam Toyer <samATqxcvDOTnet>
parents: 892
diff changeset
12 {% set title = _("Modifying %(item_name)s", item_name=item_name) %}
95abf895be4f Refactor title code, fixes #147
Sam Toyer <samATqxcvDOTnet>
parents: 892
diff changeset
13
1451
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
14 {% block head %}
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
15 {{ super() }}
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
16 {% if extra_head %}
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
17 {{ extra_head() }}
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
18 {% endif %}
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
19 {% endblock %}
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
20
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
21 {% block subitem_navigation %}
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
22 {% 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
23 {% set shortname = shortname|json_dumps %}
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
24 {% set fullname = fullname|json_dumps %}
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
25 <button class="link-action" onclick='linkSubitem({{ shortname }}, {{ fullname }})'
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
26 title="{{ _('Link to Subitem') }}">{{ _('Link') }}</button>
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
27 <button class="transclude-action"
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
28 onclick='transcludeSubitem({{ shortname }}, {{ fullname }})'
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
29 title="{{ _('Transclude Subitem') }}">{{ _('Transclude') }}</button>
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
30 {% endcall %}
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
31 {% endblock %}
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
32
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
33
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
34 {% block content %}
1241
95abf895be4f Refactor title code, fixes #147
Sam Toyer <samATqxcvDOTnet>
parents: 892
diff changeset
35 <h1>{{ title }}</h1>
1588
48bcafd8f5ec Modernized theme modify form styling
Jaiditya Mathur <jaiditya.mathur@gmail.com>
parents: 1451
diff changeset
36 <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
37 {{ 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
38 {{ forms.render_errors(form) }}
1451
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
39 {#
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
40 Workaround:
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
41 For *Draw content, hide form['submit'] and form['comment'], since *Draw
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
42 POSTs originate from their respective applets.
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
43 #}
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
44 {% if not form['content_form'].is_draw %}
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
45 {{ forms.render(form['submit']) }}
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
46 <dl>
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
47 {{ forms.render_textcha(gen, form) }}
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
48 {{ forms.render(form['comment']) }}
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
49 </dl>
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
50 {% endif %}
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
51 {{ data_editor(form['content_form']) }}
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
52 {% if form['content_form'].help %}
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
53 <pre id="moin-editor-help">{{ form['content_form'].help }}</pre>
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
54 {% endif %}
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
55 <dl>
1451
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
56 {{ forms.render(form['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
57 </dl>
1451
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
58 {#
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 {{ 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
60 <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
61 {{ forms.render_errors(form['meta_text']) }}
1451
c32ff2e07e7a Introduce itemtype.
Cheer Xiao <xiaqqaix@gmail.com>
parents: 1420
diff changeset
62 #}
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
63 {{ 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
64 </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
65 {% endblock %}