comparison 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
comparison
equal deleted inserted replaced
241:f464adcc3a51 242:e93157b8b0bd
1 {% import "forms.html" as forms %}
1 {% extends theme("layout.html") %} 2 {% extends theme("layout.html") %}
2 {% block content %} 3 {% block content %}
3 <h1>{{ _("Modifying %(item_name)s", item_name=item_name) }}</h1> 4 <h1>{{ _("Modifying %(item_name)s", item_name=item_name) }}</h1>
4 <div class="moin-form"> 5 <div class="moin-form">
5 <form action="" method="POST" enctype="multipart/form-data"> 6 {{ gen.form.open(form, method='post', action='', enctype='multipart/form-data') }}
6 <input type="hidden" name="action" value="modify" /> 7 {{ forms.render_errors(form) }}
7 <input type="hidden" name="rev" value="{{ revno }}" /> 8 {{ gen.input(form['rev'], type='hidden') }}
8 {% block extra_form %}{% endblock %} 9 {% block extra_form %}{% endblock %}
9 {% block data_editor %}{% endblock %} 10 {% block data_editor %}{% endblock %}
10 <dl> 11 <dl>
11 <dt> 12 <dt>
12 <label for="data_file">{{ _("Upload file:") }}</label> 13 <label for="data_file">{{ _("Upload file:") }}</label>
14 <dd> 15 <dd>
15 <input type="file" id="data_file" name="data_file" /> 16 <input type="file" id="data_file" name="data_file" />
16 </dd> 17 </dd>
17 </dl> 18 </dl>
18 <pre>{{ help }}</pre> 19 <pre>{{ help }}</pre>
19 <textarea name="meta_text" lang="en" dir="ltr" rows="{{ rows_meta }}" cols="{{ cols }}">{{ meta_text }}</textarea> 20 {{ gen.textarea(form['meta_text'], lang='en', dir='ltr', rows=rows_meta, cols=cols) }}
20 </form> 21 <br />
22 {{ forms.render_errors(form['meta_text']) }}
23 {{ gen.form.close() }}
21 </div> 24 </div>
22 {% endblock %} 25 {% endblock %}