-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Standardized transaction templates and added transaction forms to all…
… of them. Touches on #26, but still need support for locking created transactions to a certain party/category on that page.
- Loading branch information
Showing
7 changed files
with
129 additions
and
195 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 |
---|---|---|
@@ -0,0 +1,74 @@ | ||
{% extends "argus/__group.html" %} | ||
|
||
{% load floppyforms %} | ||
|
||
{% block main %} | ||
<h2>Record a New Expense</h2> | ||
|
||
<!-- Nav tabs --> | ||
<ul class="nav nav-tabs nav-justified"> | ||
<li class="active"><a href="#simple" data-toggle="tab">Simple transaction</a></li> | ||
<li><a href="#even" data-toggle="tab">Even split</a></li> | ||
<li><a href="#manual" data-toggle="tab">Manual split</a></li> | ||
</ul> | ||
|
||
<!-- Tab panes --> | ||
<div class="tab-content"> | ||
<div class="tab-pane active" id="simple"> | ||
<form action="" method="post"> | ||
{% csrf_token %} | ||
{% form forms.simple_form %} | ||
<button type='submit'>Create transaction</button> | ||
</form> | ||
</div> | ||
<div class="tab-pane" id="even"> | ||
<form action="" method="post"> | ||
{% csrf_token %} | ||
{% form forms.even_form %} | ||
<button type='submit'>Create transaction</button> | ||
</form> | ||
</div> | ||
<div class="tab-pane" id="manual"> | ||
<form action="" method="post"> | ||
{% csrf_token %} | ||
{% form forms.manual_form %} | ||
<button type='submit'>Create transaction</button> | ||
</form> | ||
</div> | ||
</div> | ||
|
||
<table class="table"> | ||
<thead> | ||
<tr> | ||
<th>Paid at</th> | ||
<th>Paid by</th> | ||
<th>Paid to</th> | ||
<th>Memo</th> | ||
<th>Amount ({{ group.currency }})</th> | ||
{% if not category %}<th>Category</th>{% endif %} | ||
<th>Sharers</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{% for transaction in recent_transactions|slice:":10" %} | ||
<tr> | ||
<td>{{ transaction.paid_at|date:"Y-m-d H:i:s" }}</td> | ||
<td><a href="{{ transaction.paid_by.get_absolute_url }}">{{ transaction.paid_by.name }}</a></td> | ||
<td><a href="{{ transaction.paid_to.get_absolute_url }}">{{ transaction.paid_to.name }}</a></td> | ||
<td>{{ transaction.memo }}</td> | ||
<td>{{ transaction.amount }}</td> | ||
{% if not category %}<td><a href="{{ transaction.category.get_absolute_url }}">{{ transaction.category.name }}</a></td>{% endif %} | ||
<td> | ||
{% for party in group.parties.all %} | ||
{% for share in transaction.shares.all %} | ||
{% if share.party_id == party.pk %} | ||
<a href="{{ party.get_absolute_url }}" title="{{ share.amount }} ({{ share.percentage }}%)">{{ party.name }}</a> | ||
{% endif %} | ||
{% endfor %} | ||
{% endfor %} | ||
</td> | ||
</tr> | ||
{% endfor %} | ||
</tbody> | ||
</table> | ||
{% endblock main %} |
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,44 +1,11 @@ | ||
{% extends "argus/__group.html" %} | ||
{% extends "argus/__transaction_list.html" %} | ||
|
||
{% block title %}{{ category.name }} – {{ group.name }} – {{block.super }}{% endblock %} | ||
|
||
{% block navbar-collapse %} | ||
<ul class="nav navbar-nav"> | ||
<li><a href="{{ group.get_absolute_url }}">{{ group.name|default:group.slug }}</a></li> | ||
</ul> | ||
<ul class="nav navbar-nav navbar-right"> | ||
<li><a href="{% url 'argus_group_update' slug=group.slug %}"><span class="glyphicon glyphicon-cog"></span></a></li> | ||
</ul> | ||
{% endblock navbar-collapse %} | ||
{% load argus %} | ||
|
||
{% block title %}{{ category.name }} – {{block.super }}{% endblock %} | ||
|
||
{% block main %} | ||
<pre>Name: {{ category.name }}</pre> | ||
<pre>Group: <a href="{{ group.get_absolute_url }}">{{ group }}</a></pre> | ||
<pre>Total transaction: {{ total_transaction }}</pre> | ||
|
||
<p><a href="{% url 'argus_category_update' group_slug=group.slug pk=category.pk %}">Edit category</a></p> | ||
<h1>{{ category.name }} <small>${{ balance|abs }}</small> <small><a href="{% url 'argus_category_update' group_slug=group.slug pk=category.pk %}">Edit category</a></small></h1> | ||
|
||
<table class="table"> | ||
<thead> | ||
<tr> | ||
<th>Paid at</th> | ||
<th>Paid by</th> | ||
<th>Paid to</th> | ||
<th>Memo</th> | ||
<th>Cost ({{ group.currency }})</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{% for transaction in recent_transactions|slice:":10" %} | ||
<tr> | ||
<td>{{ transaction.paid_at|date:"Y-m-d H:i:s" }}</td> | ||
<td><a href="{{ transaction.paid_by.get_absolute_url }}">{{ transaction.paid_by.name }}</a></td> | ||
<td><a href="{{ transaction.paid_to.get_absolute_url }}">{{ transaction.paid_to.name }}</a></td> | ||
<td>{{ transaction.memo }}</td> | ||
<td>{{ transaction.amount }}</td> | ||
</tr> | ||
{% endfor %} | ||
</tbody> | ||
</table> | ||
{{ block.super }} | ||
{% endblock main %} |
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,106 +1 @@ | ||
{% extends "argus/__group.html" %} | ||
|
||
{% load floppyforms %} | ||
|
||
{% block side %} | ||
<div class="panel panel-default"> | ||
<div class="panel-heading"> | ||
{% if group.password %} | ||
<div class="pull-right"><a href="{% url 'argus_group_logout' %}">Logout</a></div> | ||
{% endif %} | ||
<h3 class="panel-title">{{ group.name|default:group.slug }}</h3> | ||
</div> | ||
<div class="panel-body"> | ||
|
||
|
||
{% if not group.password %} | ||
<div class="alert alert-warning"> | ||
This group doesn’t have a password yet! Maybe you just created it. To keep your group’s information safe from snoopers and saboteurs, <a href="{% url 'argus_group_change_password' group.slug %}">protect it with a password</a>. | ||
</div> | ||
{% endif %} | ||
|
||
<h4>Members</h4> | ||
<ul> | ||
{% for member in members %} | ||
<li><a href="{{ member.get_absolute_url }}">{{ member.name }}: {{ member.balance }}</a></li> | ||
{% endfor %} | ||
<li><a href="{% url 'argus_party_create' group_slug=group.slug %}"><span class="glyphicon glyphicon-plus"></span> Add Member</a></li> | ||
</ul> | ||
|
||
{% with categories=group.categories.all %} | ||
<h4>Categories</h4> | ||
<ul> | ||
{% for category in categories %} | ||
<li><a href="{{ category.get_absolute_url }}">{{ category.name }}</a></li> | ||
{% endfor %} | ||
<li><a href="{% url 'argus_category_create' group_slug=group.slug %}"><span class="glyphicon glyphicon-plus"></span> New Category</a></li> | ||
</ul> | ||
{% endwith %} | ||
</div>{# /.panel-body #} | ||
</div>{# /.panel #} | ||
{% endblock side %} | ||
|
||
{% block main %} | ||
<h2>Record a New Expense</h2> | ||
|
||
<div> | ||
<h3>Simple transaction (payment)</h3> | ||
<form action="" method="post"> | ||
{% csrf_token %} | ||
{% form forms.simple_form %} | ||
<button type='submit'>Create transaction</button> | ||
</form> | ||
</div> | ||
<div> | ||
<h3>Even split transaction</h3> | ||
<form action="" method="post"> | ||
{% csrf_token %} | ||
{% form forms.even_form %} | ||
<button type='submit'>Create transaction</button> | ||
</form> | ||
</div> | ||
<div> | ||
<h3>Manual split transaction</h3> | ||
<form action="" method="post"> | ||
{% csrf_token %} | ||
{% form forms.manual_form %} | ||
<button type='submit'>Create transaction</button> | ||
</form> | ||
</div> | ||
|
||
|
||
<table class="table"> | ||
<thead> | ||
<tr> | ||
<th>Paid at</th> | ||
<th>Paid by</th> | ||
<th>Paid to</th> | ||
<th>Memo</th> | ||
<th>Amount ({{ group.currency }})</th> | ||
<th>Category</th> | ||
<th>Sharers</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{% for transaction in recent_transactions|slice:":10" %} | ||
<tr> | ||
<td>{{ transaction.paid_at|date:"Y-m-d H:i:s" }}</td> | ||
<td><a href="{{ transaction.paid_by.get_absolute_url }}">{{ transaction.paid_by.name }}</a></td> | ||
<td><a href="{{ transaction.paid_to.get_absolute_url }}">{{ transaction.paid_to.name }}</a></td> | ||
<td>{{ transaction.memo }}</td> | ||
<td>{{ transaction.amount }}</td> | ||
<td><a href="{{ transaction.category.get_absolute_url }}">{{ transaction.category.name }}</a></td> | ||
<td> | ||
{% for party in group.parties.all %} | ||
{% for share in transaction.shares.all %} | ||
{% if share.party_id == party.pk %} | ||
<a href="{{ party.get_absolute_url }}">{{ party.name }}</a> | ||
{% endif %} | ||
{% endfor %} | ||
{% endfor %} | ||
</td> | ||
</tr> | ||
{% endfor %} | ||
</tbody> | ||
</table> | ||
{% endblock main %} | ||
{% extends "argus/__transaction_list.html" %} |
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,58 +1,12 @@ | ||
{% extends "argus/__group.html" %} | ||
{% extends "argus/__transaction_list.html" %} | ||
|
||
{% load argus %} | ||
|
||
{% block title %}{{ party.name }} – {{ group.name }} – {{block.super }}{% endblock %} | ||
|
||
{% block navbar-collapse %} | ||
<ul class="nav navbar-nav"> | ||
<li><a href="{{ group.get_absolute_url }}">{{ group.name|default:group.slug }}</a></li> | ||
</ul> | ||
<ul class="nav navbar-nav navbar-right"> | ||
<li><a href="{% url 'argus_group_update' slug=group.slug %}"><span class="glyphicon glyphicon-cog"></span></a></li> | ||
</ul> | ||
{% endblock navbar-collapse %} | ||
{% block title %}{{ party.name }} – {{block.super }}{% endblock %} | ||
|
||
|
||
{% block main %} | ||
<pre>Name: {{ party.name }}</pre> | ||
<pre>Group: <a href="{{ group.get_absolute_url }}">{{ group }}</a></pre> | ||
<pre>Balance: {{ balance }} or {{ party.balance }}</pre> | ||
|
||
<h1>{{ party.name }}</h1> | ||
<h3>{% if party.balance < 0 %}Owed{% else %}Owes{% endif %} ${{ party.balance|abs }}</h3> | ||
<p><a href="{% url 'argus_party_update' group_slug=group.slug pk=party.pk %}">Edit party</a></p> | ||
<h1>{{ party.name }} <small>{% if balance < 0 %}Owed{% else %}Owes{% endif %} ${{ balance|abs }}</small> <small><a href="{% url 'argus_party_update' group_slug=group.slug pk=party.pk %}">Edit party</a></small></h1> | ||
|
||
<table class="table"> | ||
<thead> | ||
<tr> | ||
<th>Paid at</th> | ||
<th>Paid by</th> | ||
<th>Paid to</th> | ||
<th>Memo</th> | ||
<th>Total cost ({{ group.currency }})</th> | ||
<th>Category</th> | ||
<th>Share of cost</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{% for transaction in recent_transactions|slice:":10" %} | ||
<tr> | ||
<td>{{ transaction.paid_at|date:"Y-m-d H:i:s" }}</td> | ||
<td><a href="{{ transaction.paid_by.get_absolute_url }}">{{ transaction.paid_by.name }}</a></td> | ||
<td><a href="{{ transaction.paid_to.get_absolute_url }}">{{ transaction.paid_to.name }}</a></td> | ||
<td>{{ transaction.memo }}</td> | ||
<td>{{ transaction.amount }}</td> | ||
<td><a href="{{ transaction.category.get_absolute_url }}">{{ transaction.category }}</a></td> | ||
<td> | ||
{% for share in transaction.shares.all %} | ||
{% if share.party == party %} | ||
{{ share.amount }} ({{ share.percentage }}) | ||
{% endif %} | ||
{% endfor %} | ||
</td> | ||
</tr> | ||
{% endfor %} | ||
</tbody> | ||
</table> | ||
{{ block.super }} | ||
{% endblock main %} |
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