diff --git a/argus/templates/argus/__base.html b/argus/templates/argus/__base.html index c6d119b..76376d7 100644 --- a/argus/templates/argus/__base.html +++ b/argus/templates/argus/__base.html @@ -68,6 +68,7 @@ + {% endblock %} diff --git a/argus/templates/argus/__group.html b/argus/templates/argus/__group.html index 7549f6b..1f7c27c 100644 --- a/argus/templates/argus/__group.html +++ b/argus/templates/argus/__group.html @@ -1,5 +1,7 @@ {% extends "argus/layouts/75_25.html" %} +{% block title %}{{ group.name }} – {{block.super }}{% endblock %} + {% block navbar-collapse %} {% endblock navbar-collapse %} + +{% block side %} +
+
+ {% if group.password %} + + {% endif %} +

{{ group.name|default:group.slug }}

+
+
+ + + {% if not group.password %} +
+ This group doesn’t have a password yet! Maybe you just created it. To keep your group’s information safe from snoopers and saboteurs, protect it with a password. +
+ {% endif %} + +

Members

+ + + {% with categories=group.categories.all %} +

Categories

+ + {% endwith %} +
{# /.panel-body #} +
{# /.panel #} +{% endblock side %} + diff --git a/argus/templates/argus/__transaction_list.html b/argus/templates/argus/__transaction_list.html new file mode 100644 index 0000000..ad0de37 --- /dev/null +++ b/argus/templates/argus/__transaction_list.html @@ -0,0 +1,74 @@ +{% extends "argus/__group.html" %} + +{% load floppyforms %} + +{% block main %} +

Record a New Expense

+ + + + + +
+
+
+ {% csrf_token %} + {% form forms.simple_form %} + +
+
+
+
+ {% csrf_token %} + {% form forms.even_form %} + +
+
+
+
+ {% csrf_token %} + {% form forms.manual_form %} + +
+
+
+ + + + + + + + + + {% if not category %}{% endif %} + + + + + {% for transaction in recent_transactions|slice:":10" %} + + + + + + + {% if not category %}{% endif %} + + + {% endfor %} + +
Paid atPaid byPaid toMemoAmount ({{ group.currency }})CategorySharers
{{ transaction.paid_at|date:"Y-m-d H:i:s" }}{{ transaction.paid_by.name }}{{ transaction.paid_to.name }}{{ transaction.memo }}{{ transaction.amount }}{{ transaction.category.name }} + {% for party in group.parties.all %} + {% for share in transaction.shares.all %} + {% if share.party_id == party.pk %} + {{ party.name }} + {% endif %} + {% endfor %} + {% endfor %} +
+{% endblock main %} diff --git a/argus/templates/argus/category_detail.html b/argus/templates/argus/category_detail.html index e2d7af9..8223df9 100644 --- a/argus/templates/argus/category_detail.html +++ b/argus/templates/argus/category_detail.html @@ -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 %} - - -{% endblock navbar-collapse %} +{% load argus %} +{% block title %}{{ category.name }} – {{block.super }}{% endblock %} {% block main %} -
Name: {{ category.name }}
-
Group: {{ group }}
-
Total transaction: {{ total_transaction }}
- -

Edit category

+

{{ category.name }} ${{ balance|abs }} Edit category

- - - - - - - - - - - - {% for transaction in recent_transactions|slice:":10" %} - - - - - - - - {% endfor %} - -
Paid atPaid byPaid toMemoCost ({{ group.currency }})
{{ transaction.paid_at|date:"Y-m-d H:i:s" }}{{ transaction.paid_by.name }}{{ transaction.paid_to.name }}{{ transaction.memo }}{{ transaction.amount }}
+ {{ block.super }} {% endblock main %} diff --git a/argus/templates/argus/group_detail.html b/argus/templates/argus/group_detail.html index ec3b5b0..74186c2 100644 --- a/argus/templates/argus/group_detail.html +++ b/argus/templates/argus/group_detail.html @@ -1,106 +1 @@ -{% extends "argus/__group.html" %} - -{% load floppyforms %} - -{% block side %} -
-
- {% if group.password %} - - {% endif %} -

{{ group.name|default:group.slug }}

-
-
- - - {% if not group.password %} -
- This group doesn’t have a password yet! Maybe you just created it. To keep your group’s information safe from snoopers and saboteurs, protect it with a password. -
- {% endif %} - -

Members

- - - {% with categories=group.categories.all %} -

Categories

- - {% endwith %} -
{# /.panel-body #} -
{# /.panel #} -{% endblock side %} - -{% block main %} -

Record a New Expense

- -
-

Simple transaction (payment)

-
- {% csrf_token %} - {% form forms.simple_form %} - -
-
-
-

Even split transaction

-
- {% csrf_token %} - {% form forms.even_form %} - -
-
-
-

Manual split transaction

-
- {% csrf_token %} - {% form forms.manual_form %} - -
-
- - - - - - - - - - - - - - - - {% for transaction in recent_transactions|slice:":10" %} - - - - - - - - - - {% endfor %} - -
Paid atPaid byPaid toMemoAmount ({{ group.currency }})CategorySharers
{{ transaction.paid_at|date:"Y-m-d H:i:s" }}{{ transaction.paid_by.name }}{{ transaction.paid_to.name }}{{ transaction.memo }}{{ transaction.amount }}{{ transaction.category.name }} - {% for party in group.parties.all %} - {% for share in transaction.shares.all %} - {% if share.party_id == party.pk %} - {{ party.name }} - {% endif %} - {% endfor %} - {% endfor %} -
-{% endblock main %} +{% extends "argus/__transaction_list.html" %} diff --git a/argus/templates/argus/party_detail.html b/argus/templates/argus/party_detail.html index f7c091f..5751e55 100644 --- a/argus/templates/argus/party_detail.html +++ b/argus/templates/argus/party_detail.html @@ -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 %} - - -{% endblock navbar-collapse %} +{% block title %}{{ party.name }} – {{block.super }}{% endblock %} {% block main %} -
Name: {{ party.name }}
-
Group: {{ group }}
-
Balance: {{ balance }} or {{ party.balance }}
- -

{{ party.name }}

-

{% if party.balance < 0 %}Owed{% else %}Owes{% endif %} ${{ party.balance|abs }}

-

Edit party

+

{{ party.name }} {% if balance < 0 %}Owed{% else %}Owes{% endif %} ${{ balance|abs }} Edit party

- - - - - - - - - - - - - - {% for transaction in recent_transactions|slice:":10" %} - - - - - - - - - - {% endfor %} - -
Paid atPaid byPaid toMemoTotal cost ({{ group.currency }})CategoryShare of cost
{{ transaction.paid_at|date:"Y-m-d H:i:s" }}{{ transaction.paid_by.name }}{{ transaction.paid_to.name }}{{ transaction.memo }}{{ transaction.amount }}{{ transaction.category }} - {% for share in transaction.shares.all %} - {% if share.party == party %} - {{ share.amount }} ({{ share.percentage }}) - {% endif %} - {% endfor %} -
+ {{ block.super }} {% endblock main %} diff --git a/argus/views.py b/argus/views.py index e4693e4..f2ad77d 100644 --- a/argus/views.py +++ b/argus/views.py @@ -296,7 +296,9 @@ class GroupDetailView(TransactionListView): class GroupRelatedDetailView(TransactionListView): def get_group(self): group = super(GroupRelatedDetailView, self).get_group() - self.object = get_object_or_404(self.model, group=group) + self.object = get_object_or_404(self.model, + group=group, + pk=self.kwargs['pk']) return group def get_context_data(self, **kwargs):