From 7d60bee0ef5a38e6765b9bb51ae7e200157591a0 Mon Sep 17 00:00:00 2001 From: Alexis Metaireau Date: Sun, 21 Aug 2011 01:42:10 +0200 Subject: Re-design (Fixes #19) --- budget/templates/list_bills.html | 97 +++++++++++++++++++++------------------- 1 file changed, 50 insertions(+), 47 deletions(-) (limited to 'budget/templates/list_bills.html') diff --git a/budget/templates/list_bills.html b/budget/templates/list_bills.html index 94b0f8f..d73a95f 100644 --- a/budget/templates/list_bills.html +++ b/budget/templates/list_bills.html @@ -1,68 +1,71 @@ {% extends "layout.html" %} {% block js %} -// display the form when clicking on the "add bill" button -$('#add_bill_button').click(function(){ - $('#add_bill').show(200); - $(this).hide(); - $('#hide_bill_form').show(); - return false; -}); + // display the form when clicking on the "add bill" button + var show_form = function(){ + $('#bill-form').show(70); + $("#new-bill").hide(); + return false; + } + + // and provide a mechanism to hide it back + var hide_form = function(){ + $("#bill-form").hide(70); + $("#new-bill").show(); + return false; + } -// and provide a mechanism to hide it back -$('#hide_bill_form').click(function(){ - $('#add_bill').hide(200); - $(this).hide(); - $('#add_bill_button').show(); - return false; -}); + $('#new-bill').click(show_form); + $('#empty-new-bill').click(show_form); + $('#hide-bill-form').click(hide_form); + $('#cancel-form').click(hide_form); -// ask for confirmation before removing an user -$('a.remove').each(function(){ - $(this).hide(); - $(this).click(function(){ - return confirm("are you sure?"); + // ask for confirmation before removing an user + $('a.remove').each(function(){ + $(this).hide(); + $(this).click(function(){ + return confirm("are you sure?"); + }); }); -}); -// display the remove button on mouse over (and hide them per default) -$('.members li').hover(function(){ - $(this).children('a.remove').show(); -}, function(){ - $(this).children('a.remove').hide(); -}); + // display the remove button on mouse over (and hide them per default) + $('.balance tr').hover(function(){ + $(this).find('.remove').show(); + }, function(){ + $(this).find('.remove').hide(); + }); {% endblock %} -{% block top_menu %} - -{% endblock %} +{% block sidebar %} +

Balance

-{% block content %} -
-
-
- Add a bill - - +{% endblock %} - +{% block content %} + Add a new bill + {% if bills.count() > 0 %} - +
{% for bill in bills %} @@ -80,7 +83,7 @@ $('.members li').hover(function(){
When?Who paid?For what?OwersHow much?Actions
{% else %} -

Nothing to list yet. You probably want to add a bill ?

+

Nothing to list yet. You probably want to add a bill ?

{% endif %}
{% endblock %} -- cgit v1.1