-
Notifications
You must be signed in to change notification settings - Fork 274
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change settle endpoint to use POST instead of GET (#1303)
Co-authored-by: Baptiste Jonglez <[email protected]> Co-authored-by: Alexis Métaireau <[email protected]>
- Loading branch information
1 parent
0574234
commit 19ecdb5
Showing
6 changed files
with
204 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,49 @@ | ||
{% extends "sidebar_table_layout.html" %} | ||
|
||
{% block sidebar %} | ||
<div id="table_overflow"> | ||
{{ balance_table(show_weight=False) }} | ||
</div> | ||
{% endblock %} | ||
|
||
|
||
{% block content %} | ||
<table id="bill_table" class="split_bills table table-striped"> | ||
<thead><tr><th>{{ _("Who pays?") }}</th><th>{{ _("To whom?") }}</th><th>{{ _("How much?") }}</th><th>{{ _("Settled?") }}</th></tr></thead> | ||
<tbody> | ||
{% for bill in bills %} | ||
<tr receiver={{bill.receiver.id}}> | ||
<td>{{ bill.ower }}</td> | ||
<td>{{ bill.receiver }}</td> | ||
<td>{{ bill.amount|currency }}</td> | ||
<td> | ||
<span id="settle-bill" class="ml-auto pb-2"> | ||
<a href="{{ url_for('.settle', amount = bill.amount, ower_id = bill.ower.id, payer_id = bill.receiver.id) }}" class="btn btn-primary"> | ||
<div data-toggle="tooltip" title='{{ _("Click here to record that the money transfer has been done") }}'> | ||
{{ ("Settle") }} | ||
</div> | ||
</a> | ||
</span> | ||
</td> | ||
{% extends "sidebar_table_layout.html" %} {% block sidebar %} | ||
<div id="table_overflow">{{ balance_table(show_weight=False) }}</div> | ||
{% endblock %} {% block content %} | ||
<table id="bill_table" class="split_bills table table-striped"> | ||
<thead> | ||
<tr> | ||
<th>{{ _("Who pays?") }}</th> | ||
<th>{{ _("To whom?") }}</th> | ||
<th>{{ _("How much?") }}</th> | ||
<th>{{ _("Settled?") }}</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{% for transaction in transactions %} | ||
<tr receiver="{{transaction.receiver.id}}"> | ||
<td>{{ transaction.ower }}</td> | ||
<td>{{ transaction.receiver }}</td> | ||
<td>{{ transaction.amount|currency }}</td> | ||
<td> | ||
<span id="settle-bill" class="ml-auto pb-2"> | ||
<form class="" action="{{ url_for(".add_settlement_bill") }}" method="POST"> | ||
{{ settlement_form.csrf_token }} | ||
{{ settlement_form.amount(value=transaction.amount) }} | ||
{{ settlement_form.sender_id(value=transaction.ower.id) }} | ||
{{ settlement_form.receiver_id(value=transaction.receiver.id) }} | ||
<button class="btn btn-primary" type="submit" title="{{ _("Settle") }}"> | ||
<div | ||
data-toggle="tooltip" | ||
title='{{ _("Click here to record that the money transfer has been done") }}' | ||
> | ||
{{ _("Settle") }} | ||
</div> | ||
</button> | ||
</form> | ||
<a | ||
href="{{ url_for('.add_settlement_bill', amount = transaction.amount, sender_id = transaction.ower.id, receiver_id = transaction.receiver.id) }}" | ||
class="btn btn-primary" | ||
> | ||
{{ ("Settle") }} | ||
</div> | ||
</a> | ||
</span> | ||
</td> | ||
</tr> | ||
{% endfor %} | ||
</tbody> | ||
</table> | ||
</tbody> | ||
</table> | ||
|
||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters