diff 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
line wrap: on
line diff
--- a/MoinMoin/templates/modify_applet.html	Sun May 29 19:39:54 2011 +0200
+++ b/MoinMoin/templates/modify_applet.html	Sun May 29 19:57:17 2011 +0200
@@ -1,10 +1,11 @@
+{% import "forms.html" as forms %}
 {% extends theme("layout.html") %}
 {% block content %}
 <h1>{{ _("Modifying %(item_name)s", item_name=item_name) }}</h1>
 <div class="moin-form">
-<form action="" method="POST" enctype="multipart/form-data">
-<input type="hidden" name="action" value="modify" />
-<input type="hidden" name="rev" value="{{ revno }}" />
+{{ gen.form.open(form, method='post', action='', enctype='multipart/form-data') }}
+{{ forms.render_errors(form) }}
+{{ gen.input(form['rev'], type='hidden') }}
 {% block extra_form %}{% endblock %}
 {% block data_editor %}{% endblock %}
     <dl>
@@ -16,7 +17,9 @@
         </dd>
     </dl>
 <pre>{{ help }}</pre>
-<textarea name="meta_text" lang="en" dir="ltr" rows="{{ rows_meta }}" cols="{{ cols }}">{{ meta_text }}</textarea>
-</form>
+{{ gen.textarea(form['meta_text'], lang='en', dir='ltr', rows=rows_meta, cols=cols) }}
+<br />
+{{ forms.render_errors(form['meta_text']) }}
+{{ gen.form.close() }}
 </div>
 {% endblock %}