diff options
author | Christopher Allan Webber <cwebber@dustycloud.org> | 2011-03-27 17:32:27 -0500 |
---|---|---|
committer | Christopher Allan Webber <cwebber@dustycloud.org> | 2011-03-27 17:32:27 -0500 |
commit | ef7cdac5b97374418ef94891981539ea07216fe4 (patch) | |
tree | 97fe572d5b5184b3b2f618d85ce267b0bf4df221 /mediagoblin/templates | |
parent | 6f86cfe95c9de40a1e0baaf2b19f3377a1db5f32 (diff) | |
download | mediagoblin-ef7cdac5b97374418ef94891981539ea07216fe4.tar.lz mediagoblin-ef7cdac5b97374418ef94891981539ea07216fe4.tar.xz mediagoblin-ef7cdac5b97374418ef94891981539ea07216fe4.zip |
A testing submit view that doesn't work but is getting closer to working.
Diffstat (limited to 'mediagoblin/templates')
-rw-r--r-- | mediagoblin/templates/mediagoblin/test_submit.html | 9 | ||||
-rw-r--r-- | mediagoblin/templates/mediagoblin/utils/wtforms.html | 18 |
2 files changed, 21 insertions, 6 deletions
diff --git a/mediagoblin/templates/mediagoblin/test_submit.html b/mediagoblin/templates/mediagoblin/test_submit.html index bf91d26b..2fae634c 100644 --- a/mediagoblin/templates/mediagoblin/test_submit.html +++ b/mediagoblin/templates/mediagoblin/test_submit.html @@ -1,14 +1,11 @@ +{% import "/mediagoblin/utils/wtforms.html" as wtforms_util %} + <html> <body> <form action="{{ request.urlgen('test_submit') }}" method="POST" enctype="multipart/form-data"> <table> - {% for field in image_form %} - <tr> - <td>{{ field.label }}</td> - <td>{{ field }}</td> - </tr> - {% endfor %} + {{ wtforms_util.render_table(image_form) }} <tr> <td></td> <td><input type="submit" value="submit" /></td> diff --git a/mediagoblin/templates/mediagoblin/utils/wtforms.html b/mediagoblin/templates/mediagoblin/utils/wtforms.html new file mode 100644 index 00000000..641f51d5 --- /dev/null +++ b/mediagoblin/templates/mediagoblin/utils/wtforms.html @@ -0,0 +1,18 @@ +{% macro render_table(form) -%} + {% for field in form %} + <tr> + <th>{{field.label}}</th> + <td> + {{field}} + {% if field.errors %} + <br /> + <ul class="errors"> + {% for error in field.errors %} + <li>{{error}}</li> + {% endfor %} + </ul> + {% endif %} + </td> + </tr> + {% endfor %} +{%- endmacro %} |