Merge remote-tracking branch 'gitorious/master'
This commit is contained in:
commit
ead3ebd6b7
@ -20,14 +20,15 @@
|
|||||||
{% import "/mediagoblin/utils/wtforms.html" as wtforms_util %}
|
{% import "/mediagoblin/utils/wtforms.html" as wtforms_util %}
|
||||||
|
|
||||||
{% block mediagoblin_content %}
|
{% block mediagoblin_content %}
|
||||||
|
<h2>Create an account!</h2>
|
||||||
|
|
||||||
<form action="{{ request.urlgen('mediagoblin.auth.register') }}"
|
<form action="{{ request.urlgen('mediagoblin.auth.register') }}"
|
||||||
method="POST" enctype="multipart/form-data">
|
method="POST" enctype="multipart/form-data">
|
||||||
<table>
|
<div class="register_box form_box">
|
||||||
{{ wtforms_util.render_table(register_form) }}
|
{{ wtforms_util.render_divs(register_form) }}
|
||||||
<tr>
|
<div class="form_submit_buttons">
|
||||||
<td></td>
|
<input type="submit" value="submit" class="button" />
|
||||||
<td><input type="submit" value="submit" class="button" /></td>
|
</div>
|
||||||
</tr>
|
</div>
|
||||||
</table>
|
|
||||||
</form>
|
</form>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -15,6 +15,30 @@
|
|||||||
# You should have received a copy of the GNU Affero General Public License
|
# 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/>.
|
# 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) -%}
|
{% macro render_table(form) -%}
|
||||||
{% for field in form %}
|
{% for field in form %}
|
||||||
<tr>
|
<tr>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user