From bbd4a1a838bf7bf3c42617cbdcfd7189dec771a4 Mon Sep 17 00:00:00 2001 From: "A.Avenel" Date: Tue, 20 Nov 2012 23:33:32 +0100 Subject: [PATCH] Cosmetic changes for "add a bill" panel --- budget/forms.py | 6 ++---- budget/static/js/ihatemoney.js | 21 +++++++++++---------- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/budget/forms.py b/budget/forms.py index 4a810de..5d7c18b 100644 --- a/budget/forms.py +++ b/budget/forms.py @@ -19,16 +19,14 @@ def select_multi_checkbox(field, ul_class='', **kwargs): 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)) + html.append(u'

    %s | %s

    '% (_("Select all"), _("Select none"))) 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) if checked: options['checked'] = 'checked' - html.append(u'
  • ' + html.append(u'

    ' % (choice_id, ' ' % html_params(**options), label)) html.append(u'') return u''.join(html) diff --git a/budget/static/js/ihatemoney.js b/budget/static/js/ihatemoney.js index 6a813b9..24e82b7 100644 --- a/budget/static/js/ihatemoney.js +++ b/budget/static/js/ihatemoney.js @@ -1,17 +1,18 @@ - // Add a script to select all or non of the checkboxes in the add_bill form - function toggle() + // Add scripts to select all or non of the checkboxes in the add_bill form +function selectall() { var els = document.getElementsByName('payed_for'); for(var i =0;i