diff --git a/debianmemberportfolio/forms.py b/debianmemberportfolio/forms.py index 0155656..f35d02a 100644 --- a/debianmemberportfolio/forms.py +++ b/debianmemberportfolio/forms.py @@ -1,7 +1,8 @@ from __future__ import unicode_literals +from flask.ext.babel import gettext as _ from flask.ext.wtf import Form -from wtforms import IntegerField, StringField +from wtforms import IntegerField, StringField, RadioField from wtforms.validators import ( AnyOf, DataRequired, Email, Length, Optional, Regexp ) @@ -27,8 +28,10 @@ class DeveloperData(Form): username = StringField('username', validators=[PlainText()]) nonddemail = StringField('nonddemail', validators=[Email()]) aliothusername = StringField('aliothusername', validators=[PlainText()]) - mode = StringField( - 'mode', default='html',validators=[AnyOf(['json', 'html'])] + mode = RadioField( + 'mode', default='html', choices=[ + ('json', _('JSON')), ('html', _('HTML')) + ], validators=[AnyOf(['json', 'html'])] ) forumsid = IntegerField('forumsid', default=None, validators=[Optional()]) wikihomepage = StringField('wikihomepage', default=None, validators=[ diff --git a/debianmemberportfolio/templates/showform.html b/debianmemberportfolio/templates/showform.html index fac47d8..e0b40c0 100644 --- a/debianmemberportfolio/templates/showform.html +++ b/debianmemberportfolio/templates/showform.html @@ -35,6 +35,69 @@ with this program. If not, see .
{{ form.email }}
+ +
+
+ {{ form.name }} +
+
+
+ {{ form.gpgfp }} +
+
+
+ {{ form.username }} +
+
+
+ {{ form.nonddemail }} +
+
+
+ {{ form.aliothusername }} +
+
+
+ {{ form.wikihomepage }} +
+
+
+ {{ form.forumsid }} +
+
+
+ {% for subfield in form.mode %} + {{ subfield.label }} {{ subfield }} + {% endfor %}
+ +
{% endblock %} diff --git a/debianmemberportfolio/templates/showform.mako b/debianmemberportfolio/templates/showform.mako deleted file mode 100644 index 32a8233..0000000 --- a/debianmemberportfolio/templates/showform.mako +++ /dev/null @@ -1,164 +0,0 @@ -## -- coding: utf-8 -- \ -<%inherit file="base.mako" /> -<%doc> -Template for the data input form. - -Copyright © 2009-2014 Jan Dittberner - -This file is part of the Debian Member Portfolio service. - -Debian Member Portfolio service is free software: you can redistribute it -and/or modify it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -Debian Member Portfolio service is distributed in the hope that it will be -useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero -General Public License for more details. - -You should have received a copy of the GNU Affero General Public License along -with this program. If not, see . - -<%def name="titleaddon()"> - - ${_('Enter your personal information')} - -<%def name="extrahead()">${h.javascript_link('/javascript/jquery/jquery.js', -h.url(controller='showformscripts', action='index'))} -${h.form(h.url(action='urllist', controller='portfolio'), method='get')} -
- ${_('Debian Member Portfolio')} -
-
- ${h.text('email', - h.escape(request.params.get('email', None)), id='email')}
-
- -
-
- ${h.text('name', - h.escape(request.params.get('name', None)), id='name')}
-
-
-
- ${h.text('gpgfp', - h.escape(request.params.get('gpgfp', None)), - id='gpgfp')}
-
-
-
- ${h.text('username', - h.escape(request.params.get('username', None)), - id='username')}
-
-
-
- ${h.text('nonddemail', - h.escape(request.params.get('nonddemail', None)), - id='nonddemail')}
-
-
-
- ${h.text('aliothusername', - h.escape(request.params.get('username', None)), - id='aliothusername')}
-
-
-
- ${h.text('wikihomepage', - h.escape(request.params.get('wikihomepage', None)), - id='wikihomepage')}
-
-
-
- ${h.text('forumsid', - h.escape(request.params.get('forumsid', None)), - id='forumsid')}
-
-
-
- ${_('HTML')} ${h.radio('mode', 'html', - checked=(request.params.get('mode', - 'html') == 'html'))} ${_('JSON')} ${h.radio('mode', - 'json', checked=(request.params.get('mode', 'html') == 'json'))}
- ${h.submit('submit', value=_('Build Debian Member Portfolio URLs'))} -
-
-${h.end_form()}