diff --git a/accounting/migrations/0011_auto_20160718_1805.py b/accounting/migrations/0011_auto_20160718_1805.py new file mode 100644 index 00000000..5c8e9ea8 --- /dev/null +++ b/accounting/migrations/0011_auto_20160718_1805.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('accounting', '0010_remove_operation_type'), + ] + + operations = [ + migrations.AlterField( + model_name='operation', + name='mode', + field=models.CharField(max_length=255, verbose_name='payment method', choices=[('cheque', 'Check'), ('cash', 'Cash'), ('transfert', 'Transfert'), ('card', 'Credit card')]), + ), + ] diff --git a/accounting/templates/accounting/accountingtype_list.jinja b/accounting/templates/accounting/accountingtype_list.jinja index 0961289a..6c84529d 100644 --- a/accounting/templates/accounting/accountingtype_list.jinja +++ b/accounting/templates/accounting/accountingtype_list.jinja @@ -1,23 +1,20 @@ {% extends "core/base.jinja" %} {% block title %} - Accounting type list +{% trans %}Accounting type list{% endtrans %} {% endblock %} {% block content %} -

New accounting type

+

{% trans %}New accounting type{% endtrans %}

{% if accountingtype_list %} -

Accounting type list

- +

{% trans %}Accounting type list{% endtrans %}

+ {% else %} - There is no types in this website. + {% trans %}There is no types in this website.{% endtrans %} {% endif %} {% endblock %} - - - diff --git a/accounting/templates/accounting/bank_account_details.jinja b/accounting/templates/accounting/bank_account_details.jinja index 93d20581..434d7ef1 100644 --- a/accounting/templates/accounting/bank_account_details.jinja +++ b/accounting/templates/accounting/bank_account_details.jinja @@ -1,22 +1,17 @@ {% extends "core/base.jinja" %} {% block content %} -

-Accounting > -{{ object.name }} -

-

View account

- -

New club account

+

+ {% trans %}Accounting{% endtrans %} > + {{ object.name }} +

+

{% trans %}View account{% endtrans %}

+

{% trans %}New club account{% endtrans %}

diff --git a/accounting/templates/accounting/bank_account_list.jinja b/accounting/templates/accounting/bank_account_list.jinja index 1ef7eadc..dde74d66 100644 --- a/accounting/templates/accounting/bank_account_list.jinja +++ b/accounting/templates/accounting/bank_account_list.jinja @@ -1,23 +1,23 @@ {% extends "core/base.jinja" %} {% block title %} - Bank account list +{% trans %}Bank account list{% endtrans %} {% endblock %} {% block content %} -

Manage accounting types

-

New bank account

+

{% trans %}Manage accounting types{% endtrans %}

+

{% trans %}New bank account{% endtrans %}

{% if bankaccount_list %} -

Bank account list

+

{% trans %}Bank account list{% endtrans %}

{% else %} - There is no accounts in this website. + {% trans %}There is no accounts in this website.{% endtrans %} {% endif %} {% endblock %} diff --git a/accounting/templates/accounting/club_account_details.jinja b/accounting/templates/accounting/club_account_details.jinja index ebc0757f..c2bd5f13 100644 --- a/accounting/templates/accounting/club_account_details.jinja +++ b/accounting/templates/accounting/club_account_details.jinja @@ -1,53 +1,49 @@ {% extends "core/base.jinja" %} {% block content %} -

-Accounting > -{{object.bank_account }} > -{{ object }} -

View account: {{ object.name }}

+

+ {% trans %}Accounting{% endtrans %} > + {{object.bank_account }} > + {{ object }} +

{% trans %}View account:{% endtrans %} {{ object.name }}

{% if not object.has_open_journal() %} -

New journal

+

{% trans %}New journal{% endtrans %}

{% else %} -

You can not create new journal while you still have one opened

+

{% trans %}You can not create new journal while you still have one opened{% endtrans %}

{% endif %} - - - - - - + + + + + + - {% for j in object.journals.all() %} - - - - {% if j.end_date %} + {% for j in object.journals.all() %} + + + + {% if j.end_date %} - {% else %} + {% else %} - {% endif %} - - - {% if j.closed %} - - {% else %} - - {% endif %} - - - {% endfor %} + {% endif %} + + + {% if j.closed %} + + {% else %} + + {% endif %} + + + {% endfor %}
NameStartEndAmountEffective amountClosed{% trans %}Name{% endtrans %}{% trans %}Start{% endtrans %}{% trans %}End{% endtrans %}{% trans %}Amount{% endtrans %}{% trans %}Effective amount{% endtrans %}{% trans %}Closed{% endtrans %}
{{ j.name }}{{ j.start_date }}
{{ j.name }}{{ j.start_date }}{{ j.end_date }} - {{ j.amount }} €{{ j.effective_amount }} €YesNo View - Edit
{{ j.amount }} €{{ j.effective_amount }} €{% trans %}Yes{% endtrans %}{% trans %}No{% endtrans %} {% trans %}View{% endtrans %} + {% trans %}Edit{% endtrans %}
- {% endblock %} - - - diff --git a/accounting/templates/accounting/journal_details.jinja b/accounting/templates/accounting/journal_details.jinja index ed77b62a..d08be1b6 100644 --- a/accounting/templates/accounting/journal_details.jinja +++ b/accounting/templates/accounting/journal_details.jinja @@ -1,33 +1,34 @@ {% extends "core/base.jinja" %} {% block content %} -

-Accounting > -{{object.club_account.bank_account }} > -{{ object.club_account }} > -{{ object.name }} -

-

Amount: {{ object.amount }} € - Effective amount: {{ object.effective_amount }} €

+

+ {% trans %}Accounting{% endtrans %} > + {{object.club_account.bank_account }} > + {{ object.club_account }} > + {{ object.name }} +

+

{% trans %}Amount: {% endtrans %}{{ object.amount }} € - + {% trans %}Effective amount: {% endtrans %}{{ object.effective_amount }} €

{% if object.closed %} -

Journal is closed, you can not create operation

+

{% trans %}Journal is closed, you can not create operation{% endtrans %}

{% else %} -

New operation

+

{% trans %}New operation{% endtrans %}

{% endif %} - - - - - + + + + + - - - - - + + + + + - {% for o in object.operations.all() %} + {% for o in object.operations.all() %} @@ -37,21 +38,17 @@ {% if o.done %} - + {% else %} - + {% endif %} - {% endfor %} + {% endfor %}
NbDateLabelAmountPayment mode{% trans %}Nb{% endtrans %}{% trans %}Date{% endtrans %}{% trans %}Label{% endtrans %}{% trans %}Amount{% endtrans %}{% trans %}Payment mode{% endtrans %} CodeNatureDoneCommentActions{% trans %}Code{% endtrans %}{% trans %}Nature{% endtrans %}{% trans %}Done{% endtrans %}{% trans %}Comment{% endtrans %}{% trans %}Actions{% endtrans %}
{{ o.id }} {{ o.date }}{{ o.accounting_type.code }} {{ o.accounting_type.label }}Yes{% trans %}Yes{% endtrans %}No{% trans %}No{% endtrans %}{{ o.remark }} {% if not o.journal.closed %} - Edit + {% trans %}Edit{% endtrans %} {% endif %}
- {% endblock %} - - - diff --git a/club/migrations/0003_auto_20160718_1819.py b/club/migrations/0003_auto_20160718_1819.py new file mode 100644 index 00000000..1eb03e84 --- /dev/null +++ b/club/migrations/0003_auto_20160718_1819.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models +from django.conf import settings + + +class Migration(migrations.Migration): + + dependencies = [ + ('club', '0002_auto_20160718_1456'), + ] + + operations = [ + migrations.AlterField( + model_name='membership', + name='club', + field=models.ForeignKey(to='club.Club', verbose_name='club', related_name='members'), + ), + migrations.AlterField( + model_name='membership', + name='user', + field=models.ForeignKey(to=settings.AUTH_USER_MODEL, verbose_name='user', related_name='membership'), + ), + ] diff --git a/club/models.py b/club/models.py index 0152bb63..f0dd07d0 100644 --- a/club/models.py +++ b/club/models.py @@ -74,7 +74,7 @@ class Club(models.Model): Method to see if that object can be edited by the given user """ ms = self.get_membership_for(user) - if ms is not None and ms.role >= 7: + if ms is not None: return True return False @@ -104,8 +104,8 @@ class Membership(models.Model): A User is currently member of all the Clubs where its Membership has an end_date set to null/None. Otherwise, it's a past membership kept because it can be very useful to see who was in which Club in the past. """ - user = models.ForeignKey(User, related_name="membership", null=False, blank=False) - club = models.ForeignKey(Club, related_name="members", null=False, blank=False) + user = models.ForeignKey(User, verbose_name=_('user'), related_name="membership", null=False, blank=False) + club = models.ForeignKey(Club, verbose_name=_('club'), related_name="members", null=False, blank=False) start_date = models.DateField(_('start date'), auto_now=True) end_date = models.DateField(_('end date'), null=True, blank=True) role = models.IntegerField(_('role'), choices=sorted(settings.SITH_CLUB_ROLES.items()), diff --git a/club/templates/club/club_detail.jinja b/club/templates/club/club_detail.jinja index fc3b8927..c5814da5 100644 --- a/club/templates/club/club_detail.jinja +++ b/club/templates/club/club_detail.jinja @@ -1,17 +1,17 @@ {% extends "core/base.jinja" %} {% block content %} -

Club

-

Back to list

+

{% trans %}Club{% endtrans %}

+

{% trans %}Back to list{% endtrans %}

{% if can_edit(club, user) %} -

Edit

+

{% trans %}Edit{% endtrans %}

{% endif %} {% if can_edit_prop(club, user) %} -

Prop -

+

{% trans %}Prop{% endtrans %} +

{% endif %} {% if can_view(club, user) %} -

Members

+

{% trans %}Members{% endtrans %}

{% endif %}

{{ club.name }}

{{ club.address }}

diff --git a/club/templates/club/club_edit.jinja b/club/templates/club/club_edit.jinja index a7dcdf31..aa43bb20 100644 --- a/club/templates/club/club_edit.jinja +++ b/club/templates/club/club_edit.jinja @@ -1,11 +1,11 @@ {% extends "core/base.jinja" %} {% block content %} -

Edit club

+

{% trans %}Edit club{% endtrans %}

{% csrf_token %} {{ form.as_p() }} -

+

{% endblock %} diff --git a/club/templates/club/club_edit_prop.jinja b/club/templates/club/club_edit_prop.jinja index 400be64d..80605f89 100644 --- a/club/templates/club/club_edit_prop.jinja +++ b/club/templates/club/club_edit_prop.jinja @@ -1,11 +1,11 @@ {% extends "core/base.jinja" %} {% block content %} -

Edit club properties

+

{% trans %}Edit club properties{% endtrans %}

{% csrf_token %} {{ form.as_p() }} -

+

{% endblock %} diff --git a/club/templates/club/club_list.jinja b/club/templates/club/club_list.jinja index 9cbe2d43..4c880558 100644 --- a/club/templates/club/club_list.jinja +++ b/club/templates/club/club_list.jinja @@ -1,7 +1,7 @@ {% extends "core/base.jinja" %} {% block title %} - Club list +{% trans %}Club list{% endtrans %} {% endblock %} {% macro display_club(club) -%} @@ -18,17 +18,17 @@ {% block content %} {% if user.is_superuser or user.is_in_group(settings.SITH_GROUPS['root']['name']) %} -

New club

+

{% trans %}New club{% endtrans %}

{% endif %} {% if club_list %} -

Club list

- +

{% trans %}Club list{% endtrans %}

+ {% else %} - There is no club in this website. + {% trans %}There is no club in this website.{% endtrans %} {% endif %} {% endblock %} diff --git a/club/templates/club/club_members.jinja b/club/templates/club/club_members.jinja index 2788d934..d9c9de11 100644 --- a/club/templates/club/club_members.jinja +++ b/club/templates/club/club_members.jinja @@ -1,7 +1,7 @@ {% extends "core/base.jinja" %} {% block content %} -

Club members

+

{% trans %}Club members{% endtrans %}