annotate MoinMoin/templates/modify_applet.html @ 242:e93157b8b0bd

refactor modify views to use flatland, see details below code is more OO now, the Item instance now handles modify view AND post handling in do_modify() - moving this was needed so a flatland Form subclass could be used that depends on the Item type. moved item_modified event triggering to _save(). templates: use flatland generator to generate most form fields
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 29 May 2011 19:57:17 +0200
parents 7099a64c00ad
children a11656ba1eab
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 %}
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
2 {% extends theme("layout.html") %}
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 {% block content %}
7099a64c00ad remove TABs, remove CRLF lineendings - please use spaces and LF only
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 0
diff changeset
4 <h1>{{ _("Modifying %(item_name)s", item_name=item_name) }}</h1>
7099a64c00ad remove TABs, remove CRLF lineendings - please use spaces and LF only
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 0
diff changeset
5 <div class="moin-form">
242
e93157b8b0bd refactor modify views to use flatland, see details below
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 227
diff changeset
6 {{ gen.form.open(form, method='post', action='', enctype='multipart/form-data') }}
e93157b8b0bd refactor modify views to use flatland, see details below
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 227
diff changeset
7 {{ forms.render_errors(form) }}
e93157b8b0bd refactor modify views to use flatland, see details below
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 227
diff changeset
8 {{ gen.input(form['rev'], type='hidden') }}
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
9 {% block extra_form %}{% endblock %}
7099a64c00ad remove TABs, remove CRLF lineendings - please use spaces and LF only
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 0
diff changeset
10 {% block data_editor %}{% endblock %}
7099a64c00ad remove TABs, remove CRLF lineendings - please use spaces and LF only
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 0
diff changeset
11 <dl>
7099a64c00ad remove TABs, remove CRLF lineendings - please use spaces and LF only
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 0
diff changeset
12 <dt>
7099a64c00ad remove TABs, remove CRLF lineendings - please use spaces and LF only
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 0
diff changeset
13 <label for="data_file">{{ _("Upload file:") }}</label>
7099a64c00ad remove TABs, remove CRLF lineendings - please use spaces and LF only
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 0
diff changeset
14 </dt>
7099a64c00ad remove TABs, remove CRLF lineendings - please use spaces and LF only
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 0
diff changeset
15 <dd>
7099a64c00ad remove TABs, remove CRLF lineendings - please use spaces and LF only
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 0
diff changeset
16 <input type="file" id="data_file" name="data_file" />
7099a64c00ad remove TABs, remove CRLF lineendings - please use spaces and LF only
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 0
diff changeset
17 </dd>
7099a64c00ad remove TABs, remove CRLF lineendings - please use spaces and LF only
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 0
diff changeset
18 </dl>
7099a64c00ad remove TABs, remove CRLF lineendings - please use spaces and LF only
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 0
diff changeset
19 <pre>{{ help }}</pre>
242
e93157b8b0bd refactor modify views to use flatland, see details below
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 227
diff changeset
20 {{ gen.textarea(form['meta_text'], lang='en', dir='ltr', rows=rows_meta, cols=cols) }}
e93157b8b0bd refactor modify views to use flatland, see details below
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 227
diff changeset
21 <br />
e93157b8b0bd refactor modify views to use flatland, see details below
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 227
diff changeset
22 {{ forms.render_errors(form['meta_text']) }}
e93157b8b0bd refactor modify views to use flatland, see details below
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 227
diff changeset
23 {{ 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
24 </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
25 {% endblock %}