diff options
| author | Alexis Metaireau <alexis@notmyidea.org> | 2011-11-28 00:22:10 +0100 |
|---|---|---|
| committer | Alexis Metaireau <alexis@notmyidea.org> | 2011-11-28 00:22:10 +0100 |
| commit | f75bf39307e81e833e2ef0182bed6727192c20c8 (patch) | |
| tree | 47ba6ad83b9a576f4f8a0ec4b947514503ff0d80 /budget/templates/list_bills.html | |
| parent | 8570e79170e28ad0437a6b663066e7d54b0c682d (diff) | |
| download | ihatemoney-mirror-f75bf39307e81e833e2ef0182bed6727192c20c8.zip ihatemoney-mirror-f75bf39307e81e833e2ef0182bed6727192c20c8.tar.gz ihatemoney-mirror-f75bf39307e81e833e2ef0182bed6727192c20c8.tar.bz2 | |
Transform the bill addition form, using a popup. See #53
Diffstat (limited to 'budget/templates/list_bills.html')
| -rw-r--r-- | budget/templates/list_bills.html | 47 |
1 files changed, 16 insertions, 31 deletions
diff --git a/budget/templates/list_bills.html b/budget/templates/list_bills.html index c6eeb02..59692d5 100644 --- a/budget/templates/list_bills.html +++ b/budget/templates/list_bills.html @@ -3,6 +3,7 @@ {% block title %}- {{ g.project.name }}{% endblock %} {% block head %} <script src="{{ url_for("static", filename="js/jquery-ui.js") }}"></script> + <script src="{{ url_for("static", filename="js/bootstrap-modal.js") }}"></script> {% if g.lang != "en" %} <script src="{{ url_for("static", filename="js/i18n/jquery.ui.datepicker-%s.js" % g.lang ) }}"></script> {% endif %} @@ -17,26 +18,9 @@ $("#table_overflow").height( $("#sidebar").height()-120 ); }); - // display the form when clicking on the "add bill" button - var show_form = function(){ - $('#bill-form').slideDown(100); - $("#hide-bill-form").show(); - $("#new-bill").hide(); - return false; - } - - // and provide a mechanism to hide it back - var hide_form = function(){ - $("#bill-form").slideUp(100); - $("#new-bill").show(); - $("#hide-bill-form").hide(); - return false; - } - - $('#new-bill').click(show_form); - $('#empty-new-bill').click(show_form); - $('#hide-bill-form').click(hide_form); - $('#cancel-form').click(hide_form); + $('#cancel-form').click(function(){ + $('#bill-form').modal('hide'); + }); // ask for confirmation before removing an user $('.action').each(function(){ @@ -111,12 +95,17 @@ {% block content %} <div class="identifier">{{ _("The project identifier is") }} <a href="{{ url_for(".list_bills") }}">{{ g.project.id }}</a>, {{ _("remember it!") }}</div> - <a id="new-bill" href="{{ url_for(".add_bill") }}" class="btn primary">{{ _("Add a new bill") }}</a> - - <form id="bill-form" action="{{ url_for(".add_bill") }}" method="post" style="display: none"> - <a class="btn primary" id="hide-bill-form" href="#">{{ _("hide this form") }}</a> - {{ forms.add_bill(bill_form) }} +<a id="new-bill" href="{{ url_for(".add_bill") }}" class="btn primary" data-controls-modal="bill-form" data-backdrop="true" data-keyboard="true">{{ _("Add a new bill") }}</a> + + <div id="bill-form" class="modal hide fade"> + <div class="modal-header"> + <a href="#" class="close">×</a> + <h3>{{ _('Add a bill') }}</h3> + </div> + <form action="{{ url_for(".add_bill") }}" method="post" > + {{ forms.add_bill(bill_form, title=False) }} </form> + </div> {% if bills.count() > 0 %} <table id="bill_table" class="list_bills common-table zebra-striped"> @@ -130,12 +119,8 @@ <td>{{ bill.owers|join(', ', 'name') }} </td> <td>{{ "%0.2f"|format(bill.amount) }} ({{ "%0.2f"|format(bill.pay_each()) }} {{ _("each") }})</td> <td class="bill-actions"> - <a class="edit" href="{{ url_for(".edit_bill", bill_id=bill.id) }}" title="{{ _("edit") }}"> - <img src="{{ url_for("static", filename="edit.png") }}" /> - </a> - <a class="delete" href="{{ url_for(".delete_bill", bill_id=bill.id) }}" title="{{ _("delete") }}"> - <img src="{{ url_for("static", filename="delete.png") }}" /> - </a> + <a class="edit" href="{{ url_for(".edit_bill", bill_id=bill.id) }}" title="{{ _("edit") }}">{{ _('edit') }}</a> + <a class="delete" href="{{ url_for(".delete_bill", bill_id=bill.id) }}" title="{{ _("delete") }}">{{ _('delete') }}</a> </td> </tr> {% endfor %} |
