changeset 2478:2ead05f02b24

fixes register view as per bootstrap
author sharky93 <rishabhr123@gmail.com>
date Sat, 14 Sep 2013 02:37:11 +0530
parents 7e05a3e8db96
children 2d84ec2d9de1
files MoinMoin/themes/basic/templates/register.html
diffstat 1 files changed, 35 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/themes/basic/templates/register.html	Sat Sep 14 02:00:50 2013 +0530
+++ b/MoinMoin/themes/basic/templates/register.html	Sat Sep 14 02:37:11 2013 +0530
@@ -2,19 +2,40 @@
 {% import "forms.html" as forms %}
 
 {% block content %}
-<h1>{{ _("Create Account") }}</h1>
-<div class="moin-form">
-{{ gen.form.open(form, method="post", action=url_for('frontend.register')) }}
-  {{ forms.render_errors(form) }}
-  <dl>
-    {{ forms.render(form['username']) }}
-    {{ forms.render(form['password1']) }}
-    {{ forms.render(form['password2']) }}
-    {{ forms.render(form['email']) }}
-    {{ forms.render(form['openid']) }}
-    {{ forms.render_textcha(gen, form) }}
-  </dl>
-  {{ forms.render_submit(form) }}
-{{ gen.form.close() }}
+<h2>{{ _('Create Account') }}</h2>
+<div class="row">
+  <div class="col-lg-4">
+    
+    {{ gen.form.open(form, method="post", action=url_for('frontend.register')) }}
+    
+    {% if form.errors %}
+      <div class="moin-flash moin-flash-error">
+      {% for error in form.errors %}
+        {{ error }}
+        <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
+      {% endfor %}
+      </div>
+    {% endif %}
+
+    {% for field, fieldtype in [
+        ('username', 'text'),
+        ('password1', 'password'),
+        ('password2', 'password'),
+        ('email', 'text'),
+        ('openid', 'text'),
+        ] %}
+          <div class="form-group">
+              {{ gen.label(form[field]) }}
+              {{ gen.input(form[field], type=fieldtype, class="form-control") }}
+          </div>
+      {% endfor %}
+      {{ forms.render_textcha(gen, form) }}
+
+    <div class="form-group">
+        {{ forms.render_submit(form, class='btn btn-primary') }}
+    </div>
+
+    {{ gen.form.close() }}
+  </div>
 </div>
 {% endblock %}