diff --git a/budget/forms.py b/budget/forms.py
index afa86cc7..d797d696 100644
--- a/budget/forms.py
+++ b/budget/forms.py
@@ -1,7 +1,24 @@
from flaskext.wtf import *
+from wtforms.widgets import html_params
from models import Project, Person, Bill
from datetime import datetime
+
+def select_multi_checkbox(field, ul_class='', **kwargs):
+ kwargs.setdefault('type', 'checkbox')
+ field_id = kwargs.pop('id', field.id)
+ html = [u'
')
+ return u''.join(html)
+
+
class ProjectForm(Form):
name = TextField("Project name", validators=[Required()])
id = TextField("Project identifier", validators=[Required()])
@@ -32,7 +49,7 @@ class BillForm(Form):
payer = SelectField("Payer", validators=[Required()])
amount = DecimalField("Amount payed", validators=[Required()])
payed_for = SelectMultipleField("Who has to pay for this?",
- validators=[Required()])
+ validators=[Required()], widget=select_multi_checkbox)
submit = SubmitField("Add the bill")
def save(self):
@@ -68,3 +85,4 @@ class InviteForm(Form):
for email in [email.strip() for email in form.emails.data.split(",")]:
if not validator.regex.match(email):
raise ValidationError("The email %s is not valid" % email)
+
diff --git a/budget/static/main.css b/budget/static/main.css
index bd59b2a7..f42a1fe3 100644
--- a/budget/static/main.css
+++ b/budget/static/main.css
@@ -11,6 +11,14 @@ a {
color: #a45900;
}
+.fright{
+ float: right;
+}
+
+.fleft{
+ float: left;
+}
+
#title{
margin-top: 10px;
}
diff --git a/budget/static/uniform/blue.uni-form.css b/budget/static/uniform/blue.uni-form.css
index c1f70ecd..2c67c828 100644
--- a/budget/static/uniform/blue.uni-form.css
+++ b/budget/static/uniform/blue.uni-form.css
@@ -151,3 +151,7 @@
/* Use .first and .last classes to control the layout/spacing of your columns */
.uniForm .col.first{ width: 49%; float: left; clear: none; }
.uniForm .col.last { width: 49%; float: right; clear: none; margin-right: 0; }
+
+.ctrlHolder ul{
+ float: right;
+}
diff --git a/budget/templates/forms.html b/budget/templates/forms.html
index d462a822..62ad4b89 100644
--- a/budget/templates/forms.html
+++ b/budget/templates/forms.html
@@ -44,7 +44,7 @@
{{ input(form.what) }}
{{ input(form.payer) }}
{{ input(form.amount) }}
- {{ input(form.payed_for, multiple=True) }}
+ {{ input(form.payed_for) }}
{{ input(form.submit) }}
{% endmacro %}