From 0fcc2c72ec30b0ca10867f48a49c246f96387cc7 Mon Sep 17 00:00:00 2001 From: "A.Avenel" Date: Mon, 3 Sep 2012 23:11:32 +0200 Subject: [PATCH 1/4] Some love for the dashboard view --- budget/templates/dashboard.html | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/budget/templates/dashboard.html b/budget/templates/dashboard.html index e9c92dd..3f50915 100644 --- a/budget/templates/dashboard.html +++ b/budget/templates/dashboard.html @@ -1,20 +1,21 @@ {% extends "layout.html" %} {% block content %} - +
- {% for project in projects %} - - -{% if project.has_bills() %} - - -{% else %} - - -{% endif %} - - {% endfor %} + {% for project in projects|sort(attribute='name') %} + + + {% if project.has_bills() %} + + + {% else %} + + + {% endif %} + + {% endfor %} +
{{ _("Project") }}{{ _("Number of members") }}{{ _("Number of bills") }}{{_("Newest bill")}}{{_("Oldest bill")}}
{{ project.name }}{{ project.members | count }}{{ project.get_bills().count() }}{{ project.get_bills().all()[0].date }}{{ project.get_bills().all()[-1].date }}
{{ project.name }}{{ project.members | count }}{{ project.get_bills().count() }}{{ project.get_bills().all()[0].date }}{{ project.get_bills().all()[-1].date }}
{% endblock %} From bbd4a1a838bf7bf3c42617cbdcfd7189dec771a4 Mon Sep 17 00:00:00 2001 From: "A.Avenel" Date: Tue, 20 Nov 2012 23:33:32 +0100 Subject: [PATCH 2/4] 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 Date: Sun, 25 Nov 2012 14:01:47 +0100 Subject: [PATCH 3/4] Increase max-height for modal so we can display more members without using scrollbars --- budget/static/css/main.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/budget/static/css/main.css b/budget/static/css/main.css index c3c8ed9..3274241 100644 --- a/budget/static/css/main.css +++ b/budget/static/css/main.css @@ -189,6 +189,10 @@ tr.payer_line .balance-name{ position: absolute; } +.modal-body { + max-height:455px; +} + /* Fluid Offsets for Boostrap */ .row-fluid > [class*="span"]:not([class*="offset"]):first-child{margin-left:0;} From 8b114c5718e332553a3bb9718c707365f7ab5a0a Mon Sep 17 00:00:00 2001 From: "A.Avenel" Date: Mon, 26 Nov 2012 21:52:25 +0100 Subject: [PATCH 4/4] update for "create archive" interface --- budget/forms.py | 6 +++--- budget/templates/forms.html | 1 + budget/web.py | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/budget/forms.py b/budget/forms.py index 5d7c18b..f243c39 100644 --- a/budget/forms.py +++ b/budget/forms.py @@ -187,6 +187,6 @@ class InviteForm(Form): class CreateArchiveForm(Form): - start_date = DateField(_("Start date"), validators=[Required(), ]) - end_date = DateField(_("End date"), validators=[Required(), ]) - name = TextField(_("Name for this archive (optional)")) + name = TextField(_("Name for this archive (optional)"), validators=[]) + start_date = DateField(_("Start date"), validators=[Required()]) + end_date = DateField(_("End date"), validators=[Required()], default=datetime.now) diff --git a/budget/templates/forms.html b/budget/templates/forms.html index 8d15cb8..2904e0d 100644 --- a/budget/templates/forms.html +++ b/budget/templates/forms.html @@ -108,6 +108,7 @@
    {{ _("Create an archive") }} {{ form.hidden_tag() }} + {{ input(form.name) }} {{ input(form.start_date) }} {{ input(form.end_date) }}
    diff --git a/budget/web.py b/budget/web.py index 489874c..af0a933 100644 --- a/budget/web.py +++ b/budget/web.py @@ -389,7 +389,7 @@ def compute_bills(): return render_template("compute_bills.html") -@main.route("//archives/create") +@main.route("//archives/create", methods=["GET", "POST"]) def create_archive(): form = CreateArchiveForm() if request.method == "POST":