diff --git a/budget/forms.py b/budget/forms.py
index d0a60ca..1fa8133 100644
--- a/budget/forms.py
+++ b/budget/forms.py
@@ -13,6 +13,13 @@ def select_multi_checkbox(field, ul_class='', **kwargs):
kwargs.setdefault('type', 'checkbox')
field_id = kwargs.pop('id', field.id)
html = [u'
' % html_params(id=field_id, class_="inputs-list")]
+
+ choice_id = u'toggleField'
+ js_function = u'toggle();'
+ options = dict(kwargs, id=choice_id, onclick=js_function)
+ label = _("Select All/None")
+ html.append(u'' % (choice_id, ' ' % html_params(**options), label))
+
for value, label, checked in field.iter_choices():
choice_id = u'%s-%s' % (field_id, value)
options = dict(kwargs, name=field.name, value=value, id=choice_id)
@@ -96,7 +103,7 @@ class BillForm(Form):
what = TextField(_("What?"), validators=[Required()])
payer = SelectField(_("Payer"), validators=[Required()], coerce=int)
amount = DecimalField(_("Amount payed"), validators=[Required()])
- payed_for = SelectMultipleField(_("Who has to pay for this?"),
+ payed_for = SelectMultipleField(_("For whom?"),
validators=[Required()], widget=select_multi_checkbox, coerce=int)
submit = SubmitField(_("Send the bill"))
diff --git a/budget/messages.pot b/budget/messages.pot
index ef1fe23..ca6bd29 100644
--- a/budget/messages.pot
+++ b/budget/messages.pot
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
-"POT-Creation-Date: 2011-10-15 00:42+0200\n"
+"POT-Creation-Date: 2011-10-20 02:32+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME \n"
"Language-Team: LANGUAGE \n"
@@ -17,31 +17,35 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 0.9.6\n"
-#: forms.py:44
+#: forms.py:20
+msgid "Select All/None"
+msgstr ""
+
+#: forms.py:51
msgid "Project name"
msgstr ""
-#: forms.py:45 forms.py:70 forms.py:81
+#: forms.py:52 forms.py:77 forms.py:88
msgid "Private code"
msgstr ""
-#: forms.py:46
+#: forms.py:53
msgid "Email"
msgstr ""
-#: forms.py:47
+#: forms.py:54
msgid "Edit the project"
msgstr ""
-#: forms.py:69 forms.py:80 forms.py:86
+#: forms.py:76 forms.py:87 forms.py:93
msgid "Project identifier"
msgstr ""
-#: forms.py:71 templates/send_invites.html:5
+#: forms.py:78 templates/send_invites.html:5
msgid "Create the project"
msgstr ""
-#: forms.py:76
+#: forms.py:83
msgid ""
"The project identifier is used to log in and for the URL of the project. "
"We tried to generate an identifier for you but a project with this "
@@ -49,143 +53,147 @@ msgid ""
"able to remember."
msgstr ""
-#: forms.py:82
+#: forms.py:89
msgid "Get in"
msgstr ""
-#: forms.py:87
+#: forms.py:94
msgid "Send me the code by email"
msgstr ""
-#: forms.py:91
+#: forms.py:98
msgid "This project does not exists"
msgstr ""
-#: forms.py:95
+#: forms.py:102
msgid "Date"
msgstr ""
-#: forms.py:96
+#: forms.py:103
msgid "What?"
msgstr ""
-#: forms.py:97
+#: forms.py:104
msgid "Payer"
msgstr ""
-#: forms.py:98
+#: forms.py:105
msgid "Amount payed"
msgstr ""
-#: forms.py:99
-msgid "Who has to pay for this?"
+#: forms.py:106 templates/list_bills.html:89
+msgid "For whom?"
msgstr ""
-#: forms.py:101
+#: forms.py:108
msgid "Send the bill"
msgstr ""
-#: forms.py:126
-msgid "Name"
-msgstr ""
-
-#: forms.py:127
-msgid "Add a member"
+#: forms.py:132
+msgid "Bills can't be negative"
msgstr ""
#: forms.py:137
-msgid "This project already have this member"
+msgid "Name"
msgstr ""
-#: forms.py:147
-msgid "People to notify"
+#: forms.py:138
+msgid "Add a member"
msgstr ""
#: forms.py:148
-msgid "Send invites"
-msgstr ""
-
-#: forms.py:154
-#, python-format
-msgid "The email %s is not valid"
+msgid "This project already have this member"
msgstr ""
#: forms.py:158
-msgid "Start date"
+msgid "People to notify"
msgstr ""
#: forms.py:159
+msgid "Send invites"
+msgstr ""
+
+#: forms.py:165
+#, python-format
+msgid "The email %(email)s is not valid"
+msgstr ""
+
+#: forms.py:170
+msgid "Start date"
+msgstr ""
+
+#: forms.py:171
msgid "End date"
msgstr ""
-#: forms.py:160
+#: forms.py:172
msgid "Name for this archive (optional)"
msgstr ""
-#: web.py:91
+#: web.py:89
msgid "This private code is not the right one"
msgstr ""
-#: web.py:139
+#: web.py:137
#, python-format
-msgid "You have just created '%(projec)s' to share your expenses"
+msgid "You have just created '%(project)s' to share your expenses"
msgstr ""
-#: web.py:150
+#: web.py:148
#, python-format
msgid "The project identifier is %(project)s"
msgstr ""
-#: web.py:167
+#: web.py:166
msgid "a mail has been sent to you with the password"
msgstr ""
-#: web.py:225
+#: web.py:224
#, python-format
msgid "You have been invited to share your expenses for %(project)s"
msgstr ""
-#: web.py:232
+#: web.py:231
msgid "Your invitations have been sent"
msgstr ""
-#: web.py:253
+#: web.py:252
#, python-format
msgid "%(member)s had been added"
msgstr ""
-#: web.py:265
+#: web.py:264
#, python-format
msgid "%(name)s is part of this project again"
msgstr ""
-#: web.py:273
+#: web.py:272
#, python-format
msgid "User '%(name)s' has been deactivated"
msgstr ""
-#: web.py:275
+#: web.py:274
#, python-format
msgid "User '%(name)s' has been removed"
msgstr ""
-#: web.py:288
+#: web.py:287
msgid "The bill has been added"
msgstr ""
-#: web.py:303
+#: web.py:302
msgid "The bill has been deleted"
msgstr ""
-#: web.py:321
+#: web.py:320
msgid "The bill has been modified"
msgstr ""
-#: web.py:338
+#: web.py:344
msgid "The data from XX to XX has been archived"
msgstr ""
-#: templates/add_bill.html:4 templates/edit_bill.html:4
+#: templates/add_bill.html:23 templates/edit_bill.html:23
msgid "Back to the list"
msgstr ""
@@ -207,7 +215,7 @@ msgstr ""
msgid "Create a new project"
msgstr ""
-#: templates/edit_bill.html:8
+#: templates/edit_bill.html:27
msgid "Edit a bill"
msgstr ""
@@ -299,107 +307,103 @@ msgstr ""
msgid "Account manager"
msgstr ""
-#: templates/layout.html:48
+#: templates/layout.html:52
msgid "Bills"
msgstr ""
-#: templates/layout.html:49
-msgid "Archives"
-msgstr ""
-
-#: templates/layout.html:53
+#: templates/layout.html:56
msgid "options"
msgstr ""
-#: templates/layout.html:55
+#: templates/layout.html:58
msgid "Project settings"
msgstr ""
-#: templates/layout.html:59
+#: templates/layout.html:62
msgid "switch to"
msgstr ""
-#: templates/layout.html:62
+#: templates/layout.html:65
msgid "Start a new project"
msgstr ""
-#: templates/layout.html:64
+#: templates/layout.html:67
msgid "Logout"
msgstr ""
-#: templates/layout.html:85
+#: templates/layout.html:93
msgid "This is a free software"
msgstr ""
-#: templates/layout.html:85
+#: templates/layout.html:93
msgid "you can contribute and improve it!"
msgstr ""
-#: templates/list_bills.html:30
+#: templates/list_bills.html:37
msgid "you sure?"
msgstr ""
-#: templates/list_bills.html:45
+#: templates/list_bills.html:56
msgid "Balance"
msgstr ""
-#: templates/list_bills.html:56 templates/list_bills.html:88
+#: templates/list_bills.html:67 templates/list_bills.html:99
msgid "delete"
msgstr ""
-#: templates/list_bills.html:56
+#: templates/list_bills.html:67
msgid "reactivate"
msgstr ""
-#: templates/list_bills.html:68
+#: templates/list_bills.html:80
msgid "The project identifier is"
msgstr ""
-#: templates/list_bills.html:68
-msgid "remember it or add this page to you bookmarks!"
+#: templates/list_bills.html:80
+msgid "remember it!"
msgstr ""
-#: templates/list_bills.html:70
+#: templates/list_bills.html:81
msgid "Add a new bill"
msgstr ""
-#: templates/list_bills.html:72
+#: templates/list_bills.html:83
msgid "hide this form"
msgstr ""
-#: templates/list_bills.html:78
+#: templates/list_bills.html:89
msgid "When?"
msgstr ""
-#: templates/list_bills.html:78
+#: templates/list_bills.html:89
msgid "Who paid?"
msgstr ""
-#: templates/list_bills.html:78
+#: templates/list_bills.html:89
msgid "For what?"
msgstr ""
-#: templates/list_bills.html:78
-msgid "Owers"
-msgstr ""
-
-#: templates/list_bills.html:78
+#: templates/list_bills.html:89
msgid "How much?"
msgstr ""
-#: templates/list_bills.html:78
+#: templates/list_bills.html:89
msgid "Actions"
msgstr ""
-#: templates/list_bills.html:87
+#: templates/list_bills.html:97
+msgid "each"
+msgstr ""
+
+#: templates/list_bills.html:98
msgid "edit"
msgstr ""
-#: templates/list_bills.html:95
+#: templates/list_bills.html:106
msgid "Nothing to list yet. You probably want to"
msgstr ""
-#: templates/list_bills.html:95
+#: templates/list_bills.html:106
msgid "add a bill"
msgstr ""
@@ -443,8 +447,3 @@ msgstr ""
msgid "and notify them yourself"
msgstr ""
-msgid "each"
-msgstr ""
-
-msgid "Bills can't be negative"
-msgstr ""
diff --git a/budget/static/ihatemoney/custom.js b/budget/static/ihatemoney/custom.js
new file mode 100644
index 0000000..6a813b9
--- /dev/null
+++ b/budget/static/ihatemoney/custom.js
@@ -0,0 +1,17 @@
+ // Add a script to select all or non of the checkboxes in the add_bill form
+ function toggle()
+ {
+ var els = document.getElementsByName('payed_for');
+ for(var i =0;i
{% endif %}
+
{% endblock %}
{% block js %}
// display the form when clicking on the "add bill" button
@@ -77,7 +78,7 @@
{% endblock %}
{% block content %}
-{{ _("The project identifier is") }}
{{ g.project.id }}, {{ _("remember it or add this page to you bookmarks!") }}
+
{{ _("Add a new bill") }}