Merge remote-tracking branch 'gitorious/master'

This commit is contained in:
Jef van Schendel 2011-05-28 17:44:15 +02:00
commit ead3ebd6b7
2 changed files with 32 additions and 7 deletions

View File

@ -20,14 +20,15 @@
{% import "/mediagoblin/utils/wtforms.html" as wtforms_util %}
{% block mediagoblin_content %}
<h2>Create an account!</h2>
<form action="{{ request.urlgen('mediagoblin.auth.register') }}"
method="POST" enctype="multipart/form-data">
<table>
{{ wtforms_util.render_table(register_form) }}
<tr>
<td></td>
<td><input type="submit" value="submit" class="button" /></td>
</tr>
</table>
<div class="register_box form_box">
{{ wtforms_util.render_divs(register_form) }}
<div class="form_submit_buttons">
<input type="submit" value="submit" class="button" />
</div>
</div>
</form>
{% endblock %}

View File

@ -15,6 +15,30 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#}
{# Auto-render a form as a series of divs #}
{% macro render_divs(form) -%}
{% for field in form %}
<div class="form_field_box">
<div class="form_field_label">{{ field.label }}</div>
{% if field.description -%}
<div class="form_field_description">{{ field.description }}</div>
{%- endif %}
<div class="form_field_input">{{ field }}</div>
{%- if field.errors -%}
<div class="form_field_errors">
<ul>
{% for error in field.errors %}
<li>{{ error }}</li>
{% endfor %}
</ul>
</div>
{%- endif %}
</div>
{% endfor %}
{%- endmacro %}
{# Auto-render a form as a table #}
{% macro render_table(form) -%}
{% for field in form %}
<tr>