Commit 97ff4341 authored by Skia's avatar Skia

Translate most of the Sith

parent 1b4324f3
Pipeline #58 failed with stage
in 1 minute and 5 seconds
# -*- 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')]),
),
]
{% extends "core/base.jinja" %}
{% block title %}
Accounting type list
{% trans %}Accounting type list{% endtrans %}
{% endblock %}
{% block content %}
<p><a href="{{ url('accounting:type_new') }}">New accounting type</a></p>
<p><a href="{{ url('accounting:type_new') }}">{% trans %}New accounting type{% endtrans %}</a></p>
{% if accountingtype_list %}
<h3>Accounting type list</h3>
<ul>
{% for a in accountingtype_list %}
<li><a href="{{ url('accounting:type_edit', type_id=a.id) }}">{{ a }}</a></li>
{% endfor %}
</ul>
<h3>{% trans %}Accounting type list{% endtrans %}</h3>
<ul>
{% for a in accountingtype_list %}
<li><a href="{{ url('accounting:type_edit', type_id=a.id) }}">{{ a }}</a></li>
{% endfor %}
</ul>
{% else %}
There is no types in this website.
{% trans %}There is no types in this website.{% endtrans %}
{% endif %}
{% endblock %}
{% extends "core/base.jinja" %}
{% block content %}
<p>
<a href="{{ url('accounting:bank_list') }}">Accounting</a> >
{{ object.name }}
</p>
<h2>View account</h2>
<ul>
{% for k,v in object.__dict__.items() %}
<li>{{ k }} - {{ v }}</li>
{% endfor %}
</ul>
<p><a href="{{ url('accounting:club_new') }}?parent={{ object.id }}">New club account</a></p>
<p>
<a href="{{ url('accounting:bank_list') }}">{% trans %}Accounting{% endtrans %}</a> >
{{ object.name }}
</p>
<h2>{% trans %}View account{% endtrans %}</h2>
<p><a href="{{ url('accounting:club_new') }}?parent={{ object.id }}">{% trans %}New club account{% endtrans %}</a></p>
<ul>
{% for c in object.club_accounts.all() %}
<li><a href="{{ url('accounting:club_details', c_account_id=c.id) }}">{{ c }}</a> -
<a href="{{ url('accounting:club_edit', c_account_id=c.id) }}">Edit</a> -
<a href="{{ url('accounting:club_delete', c_account_id=c.id) }}">Delete</a></li>
<a href="{{ url('accounting:club_edit', c_account_id=c.id) }}">{% trans %}Edit{% endtrans %}</a> -
<a href="{{ url('accounting:club_delete', c_account_id=c.id) }}">{% trans %}Delete{% endtrans %}</a></li>
{% endfor %}
</ul>
......
{% extends "core/base.jinja" %}
{% block title %}
Bank account list
{% trans %}Bank account list{% endtrans %}
{% endblock %}
{% block content %}
<p><a href="{{ url('accounting:type_list') }}">Manage accounting types</a></p>
<p><a href="{{ url('accounting:bank_new') }}">New bank account</a></p>
<p><a href="{{ url('accounting:type_list') }}">{% trans %}Manage accounting types{% endtrans %}</a></p>
<p><a href="{{ url('accounting:bank_new') }}">{% trans %}New bank account{% endtrans %}</a></p>
{% if bankaccount_list %}
<h3>Bank account list</h3>
<h3>{% trans %}Bank account list{% endtrans %}</h3>
<ul>
{% for a in bankaccount_list %}
<li><a href="{{ url('accounting:bank_details', b_account_id=a.id) }}">{{ a }}</a> -
<a href="{{ url('accounting:bank_edit', b_account_id=a.id) }}">Edit</a> -
<a href="{{ url('accounting:bank_delete', b_account_id=a.id) }}">Delete</a></li>
<a href="{{ url('accounting:bank_edit', b_account_id=a.id) }}">{% trans %}Edit{% endtrans %}</a> -
<a href="{{ url('accounting:bank_delete', b_account_id=a.id) }}">{% trans %}Delete{% endtrans %}</a></li>
{% endfor %}
</ul>
{% else %}
There is no accounts in this website.
{% trans %}There is no accounts in this website.{% endtrans %}
{% endif %}
{% endblock %}
......
{% extends "core/base.jinja" %}
{% block content %}
<p>
<a href="{{ url('accounting:bank_list') }}">Accounting</a> >
<a href="{{ url('accounting:bank_details', b_account_id=object.bank_account.id) }}">{{object.bank_account }}</a> >
{{ object }}
<h2>View account: {{ object.name }}</h2>
<p>
<a href="{{ url('accounting:bank_list') }}">{% trans %}Accounting{% endtrans %}</a> >
<a href="{{ url('accounting:bank_details', b_account_id=object.bank_account.id) }}">{{object.bank_account }}</a> >
{{ object }}
<h2>{% trans %}View account:{% endtrans %} {{ object.name }}</h2>
<ul>
{% for k,v in object.__dict__.items() %}
{% for k,v in object.__dict__.items() %}
<li>{{ k }} - {{ v }}</li>
{% endfor %}
{% endfor %}
</ul>
{% if not object.has_open_journal() %}
<p><a href="{{ url('accounting:journal_new') }}?parent={{ object.id }}">New journal</a></p>
<p><a href="{{ url('accounting:journal_new') }}?parent={{ object.id }}">{% trans %}New journal{% endtrans %}</a></p>
{% else %}
<p>You can not create new journal while you still have one opened</p>
<p>{% trans %}You can not create new journal while you still have one opened{% endtrans %}</p>
{% endif %}
<table>
<tr>
<td>Name</td>
<td>Start</td>
<td>End</td>
<td>Amount</td>
<td>Effective amount</td>
<td>Closed</td>
<td>{% trans %}Name{% endtrans %}</td>
<td>{% trans %}Start{% endtrans %}</td>
<td>{% trans %}End{% endtrans %}</td>
<td>{% trans %}Amount{% endtrans %}</td>
<td>{% trans %}Effective amount{% endtrans %}</td>
<td>{% trans %}Closed{% endtrans %}</td>
</tr>
{% for j in object.journals.all() %}
<tr>
<td>{{ j.name }}</td>
<td>{{ j.start_date }}</td>
{% if j.end_date %}
{% for j in object.journals.all() %}
<tr>
<td>{{ j.name }}</td>
<td>{{ j.start_date }}</td>
{% if j.end_date %}
<td>{{ j.end_date }}</td>
{% else %}
{% else %}
<td> - </td>
{% endif %}
<td>{{ j.amount }}</td>
<td>{{ j.effective_amount }}</td>
{% if j.closed %}
<td>Yes</td>
{% else %}
<td>No</td>
{% endif %}
<td> <a href="{{ url('accounting:journal_details', j_id=j.id) }}">View</a>
<a href="{{ url('accounting:journal_edit', j_id=j.id) }}">Edit</a> </td>
</tr>
{% endfor %}
{% endif %}
<td>{{ j.amount }}</td>
<td>{{ j.effective_amount }}</td>
{% if j.closed %}
<td>{% trans %}Yes{% endtrans %}</td>
{% else %}
<td>{% trans %}No{% endtrans %}</td>
{% endif %}
<td> <a href="{{ url('accounting:journal_details', j_id=j.id) }}">{% trans %}View{% endtrans %}</a>
<a href="{{ url('accounting:journal_edit', j_id=j.id) }}">{% trans %}Edit{% endtrans %}</a> </td>
</tr>
{% endfor %}
</table>
{% endblock %}
{% extends "core/base.jinja" %}
{% block content %}
<p>
<a href="{{ url('accounting:bank_list') }}">Accounting</a> >
<a href="{{ url('accounting:bank_details', b_account_id=object.club_account.bank_account.id) }}">{{object.club_account.bank_account }}</a> >
<a href="{{ url('accounting:club_details', c_account_id=object.club_account.id) }}">{{ object.club_account }}</a> >
{{ object.name }}
</p>
<p><strong>Amount: </strong>{{ object.amount }} € - <strong>Effective amount: </strong>{{ object.effective_amount }}</p>
<p>
<a href="{{ url('accounting:bank_list') }}">{% trans %}Accounting{% endtrans %}</a> >
<a href="{{ url('accounting:bank_details', b_account_id=object.club_account.bank_account.id) }}">{{object.club_account.bank_account }}</a> >
<a href="{{ url('accounting:club_details', c_account_id=object.club_account.id) }}">{{ object.club_account }}</a> >
{{ object.name }}
</p>
<p><strong>{% trans %}Amount: {% endtrans %}</strong>{{ object.amount }} € -
<strong>{% trans %}Effective amount: {% endtrans %}</strong>{{ object.effective_amount }}</p>
{% if object.closed %}
<p>Journal is closed, you can not create operation</p>
<p>{% trans %}Journal is closed, you can not create operation{% endtrans %}</p>
{% else %}
<p><a href="{{ url('accounting:op_new') }}?parent={{ object.id }}">New operation</a></p>
<p><a href="{{ url('accounting:op_new') }}?parent={{ object.id }}">{% trans %}New operation{% endtrans %}</a></p>
{% endif %}
<table>
<tr>
<td>Nb</td>
<td>Date</td>
<td>Label</td>
<td>Amount</td>
<td>Payment mode</td>
<td>{% trans %}Nb{% endtrans %}</td>
<td>{% trans %}Date{% endtrans %}</td>
<td>{% trans %}Label{% endtrans %}</td>
<td>{% trans %}Amount{% endtrans %}</td>
<td>{% trans %}Payment mode{% endtrans %}</td>
<!-- TODO: <td>Target</td> -->
<td>Code</td>
<td>Nature</td>
<td>Done</td>
<td>Comment</td>
<td>Actions</td>
<td>{% trans %}Code{% endtrans %}</td>
<td>{% trans %}Nature{% endtrans %}</td>
<td>{% trans %}Done{% endtrans %}</td>
<td>{% trans %}Comment{% endtrans %}</td>
<td>{% trans %}Actions{% endtrans %}</td>
</tr>
{% for o in object.operations.all() %}
{% for o in object.operations.all() %}
<tr>
<td>{{ o.id }}</td>
<td>{{ o.date }}</td>
......@@ -37,21 +38,17 @@
<td>{{ o.accounting_type.code }}</td>
<td>{{ o.accounting_type.label }}</td>
{% if o.done %}
<td>Yes</td>
<td>{% trans %}Yes{% endtrans %}</td>
{% else %}
<td>No</td>
<td>{% trans %}No{% endtrans %}</td>
{% endif %}
<td>{{ o.remark }}</td>
<td>
{% if not o.journal.closed %}
<a href="{{ url('accounting:op_edit', op_id=o.id) }}">Edit</a>
<a href="{{ url('accounting:op_edit', op_id=o.id) }}">{% trans %}Edit{% endtrans %}</a>
{% endif %}
</td>
</tr>
{% endfor %}
{% endfor %}
</table>
{% endblock %}
# -*- 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'),
),
]
......@@ -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()),
......
{% extends "core/base.jinja" %}
{% block content %}
<h3>Club</h3>
<p><a href="{{ url('club:club_list') }}">Back to list</a></p>
<h3>{% trans %}Club{% endtrans %}</h3>
<p><a href="{{ url('club:club_list') }}">{% trans %}Back to list{% endtrans %}</a></p>
{% if can_edit(club, user) %}
<p><a href="{{ url('club:club_edit', club_id=club.pk) }}">Edit</a></p>
<p><a href="{{ url('club:club_edit', club_id=club.pk) }}">{% trans %}Edit{% endtrans %}</a></p>
{% endif %}
{% if can_edit_prop(club, user) %}
<p><a href="{{ url('club:club_prop', club_id=club.pk) }}">Prop</a>
</p>
<p><a href="{{ url('club:club_prop', club_id=club.pk) }}">{% trans %}Prop{% endtrans %}</a>
</p>
{% endif %}
{% if can_view(club, user) %}
<p><a href="{{ url('club:club_members', club_id=club.pk) }}">Members</a></p>
<p><a href="{{ url('club:club_members', club_id=club.pk) }}">{% trans %}Members{% endtrans %}</a></p>
{% endif %}
<h3>{{ club.name }}</h3>
<p>{{ club.address }}</p>
......
{% extends "core/base.jinja" %}
{% block content %}
<h2>Edit club</h2>
<h2>{% trans %}Edit club{% endtrans %}</h2>
<form action="{{ url('club:club_edit', club_id=club.id) }}" method="post">
{% csrf_token %}
{{ form.as_p() }}
<p><input type="submit" value="Save!" /></p>
<p><input type="submit" value="{% trans %}Save{% endtrans %}" /></p>
</form>
{% endblock %}
......
{% extends "core/base.jinja" %}
{% block content %}
<h2>Edit club properties</h2>
<h2>{% trans %}Edit club properties{% endtrans %}</h2>
<form action="" method="post">
{% csrf_token %}
{{ form.as_p() }}
<p><input type="submit" value="Save!" /></p>
<p><input type="submit" value="{% trans %}Save{% endtrans %}" /></p>
</form>
{% endblock %}
......
{% 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']) %}
<p><a href="{{ url('club:club_new') }}">New club</a></p>
<p><a href="{{ url('club:club_new') }}">{% trans %}New club{% endtrans %}</a></p>
{% endif %}
{% if club_list %}
<h3>Club list</h3>
<ul>
{%- for c in club_list if c.parent is none %}
{{ display_club(c) }}
{%- endfor %}
</ul>
<h3>{% trans %}Club list{% endtrans %}</h3>
<ul>
{%- for c in club_list if c.parent is none %}
{{ display_club(c) }}
{%- endfor %}
</ul>
{% else %}
There is no club in this website.
{% trans %}There is no club in this website.{% endtrans %}
{% endif %}
{% endblock %}
......
{% extends "core/base.jinja" %}
{% block content %}
<h2>Club members</h2>
<h2>{% trans %}Club members{% endtrans %}</h2>
<ul>
{% for m in club.members.all() %}
<li>{{ m }}</li>
......@@ -10,7 +10,7 @@
<form action="{{ url('club:club_members', club_id=club.id) }}" method="post">
{% csrf_token %}
{{ form.as_p() }}
<p><input type="submit" value="Add" /></p>
<p><input type="submit" value="{% trans %}Add{% endtrans %}" /></p>
</form>
{% endblock %}
......
{% extends "core/base.jinja" %}
{% block content %}
<h3>Club tools</h3>
<p><a href="{{ url('club:club_view', club_id=object.id) }}">Back to club</a></p>
<ul>
{% if object.counters.all()|count > 0 %}
<li>Counters:
<ul>
{% for c in object.counters.all() %}
<li>{{ c }}:
<a href="{{ url('counter:details', counter_id=c.id) }}">View</a>
<a href="{{ url('counter:admin', counter_id=c.id) }}">Edit</a>
</li>
{% endfor %}
</ul>
<h3>{% trans %}Club tools{% endtrans %}</h3>
<p><a href="{{ url('club:club_view', club_id=object.id) }}">Back to club</a></p>
<ul>
{% if object.counters.all()|count > 0 %}
<li><h4>{% trans %}Counters:{% endtrans %}</h4>
<ul>
{% for c in object.counters.all() %}
<li>{{ c }}:
<a href="{{ url('counter:details', counter_id=c.id) }}">View</a>
<a href="{{ url('counter:admin', counter_id=c.id) }}">Edit</a>
</li>
{% endif %}
{% if object.club_account %}
<li>Accouting: <a href="{{ url('accounting:club_details', c_account_id=object.club_account.id) }}">{{ object }}</a></li>
{% endif %}
</ul>
{% endfor %}
</ul>
</li>
{% endif %}
{% if object.club_account %}
<li>Accouting: <a href="{{ url('accounting:club_details', c_account_id=object.club_account.id) }}">{{ object }}</a></li>
{% endif %}
</ul>
{% endblock %}
......
......@@ -25,7 +25,7 @@ class ClubView(CanViewMixin, DetailView):
pk_url_kwarg = "club_id"
template_name = 'club/club_detail.jinja'
class ClubToolsView(CanViewMixin, DetailView):
class ClubToolsView(CanEditMixin, DetailView):
"""
Tools page of a Club
"""
......
......@@ -2,7 +2,7 @@
{% block content %}
<h3>403, Forbidden</h3>
<h3>{% trans %}403, Forbidden{% endtrans %}</h3>
{% endblock %}
......@@ -2,7 +2,7 @@
{% block content %}
<h3>404, Not Found</h3>
<h3>{% trans %}404, Not Found{% endtrans %}</h3>
{% endblock %}
......
<!DOCTYPE html>
<html lang="fr">
<head>
{% block head %}
<title>{% block title %}Bienvenue sur le Sith de l'AE!{% endblock %}</title>
<link rel="stylesheet" href="{{ static('core/base.css') }}">
<link rel="stylesheet" href="{{ static('core/form.css') }}">
<link rel="stylesheet" href="{{ static('core/style.css') }}">
<script src="{{ static('core/script.js') }}"></script>
<script src="http://code.jquery.com/jquery-2.2.0.min.js"></script>
{% endblock %}
</head>
<head>
{% block head %}
<title>{% block title %}{% trans %}Welcome!{% endtrans %}{% endblock %}</title>
<link rel="stylesheet" href="{{ static('core/base.css') }}">
<link rel="stylesheet" href="{{ static('core/form.css') }}">
<link rel="stylesheet" href="{{ static('core/style.css') }}">
<script src="{{ static('core/script.js') }}"></script>
{% endblock %}
</head>
<body>
<div id="logo"><a href="{{ url('core:index') }}"><img src="{{ static('core/img/logo.png') }}" alt="Logo" /></a></div>
{% block header %}
<header>
{% if not user.is_authenticated() %}
<a href="{{ url('core:login') }}">Login</a> |
<a href="{{ url('core:register') }}">Register</a>
{% else %}
<body>
<div id="logo"><a href="{{ url('core:index') }}"><img src="{{ static('core/img/logo.png') }}"
alt="{% trans %}Logo{% endtrans %}" /></a></div>
{% block header %}
<header>
{% if not user.is_authenticated() %}
<a href="{{ url('core:login') }}">{% trans %}Login{% endtrans %}</a> |
<a href="{{ url('core:register') }}">{% trans %}Register{% endtrans %}</a>
{% else %}
<a href="{{ url('core:user_profile', user_id=user.id) }}">{{ user.get_display_name() }}</a> |
<a href="{{ url('core:user_tools') }}">Tools</a> |
<a href="{{ url('core:logout') }}">Logout</a>
{% endif %}
</header>
{% endblock %}
<nav>
<a href="{{ url('core:user_list') }}">Users</a>
<a href="{{ url('core:page', page_name="Index") }}">Pages</a>
<a href="{{ url('club:club_list') }}">Clubs</a>
</nav>
<a href="{{ url('core:user_tools') }}">{% trans %}Tools{% endtrans %}</a> |
<a href="{{ url('core:logout') }}">{% trans %}Logout{% endtrans %}</a>
{% endif %}
</header>
{% endblock %}
<nav>
<a href="{{ url('core:user_list') }}">{% trans %}Users{% endtrans %}</a>
<a href="{{ url('core:page', page_name="Index") }}">{% trans %}Pages{% endtrans %}</a>
<a href="{{ url('club:club_list') }}">{% trans %}Clubs{% endtrans %}</a>
</nav>
<div id="content">
{% if error %}
<div id="content">
{% if error %}
{{ error }}
{% endif %}
{% block content %}{% endblock %}
</div>
{% endif %}
{% block content %}
{% endblock %}
</div>
<footer>
{% block footer %}
Site réalisé par des gens biens
{% endblock %}
</footer>
<!--
{% block tests %}
{{ tests }}
{% endblock %}
-->
</body>
<footer>
{% block footer %}
{% trans %}Site made by good people{% endtrans %}
{% endblock %}
</footer>
<!--
{% block tests %}
{{ tests }}
{% endblock %}
-->
</body>
</html>
{% extends "core/base.jinja" %}
{% block content %}
<h2>Create</h2>
<form action="" method="post">
{% csrf_token %}
{{ form.as_p() }}
<p><input type="submit" value="Save!" /></p>
</form>
<h2>{% trans %}Create{% endtrans %}</h2>
<form action="" method="post">
{% csrf_token %}
{{ form.as_p() }}
<p><input type="submit" value="{% trans %}Save{% endtrans %}" /></p>
</form>
{% endblock %}
......
{% extends "core/base.jinja" %}
{% block content %}
<h2>Delete confirmation</h2>
<form action="" method="post">{% csrf_token %}
<p>Are you sure you want to delete "{{ object }}"?</p>
<input type="submit" value="Confirm" />
<input type="submit" name="cancel" value="Cancel" />
</form>
<h2>{% trans %}Delete confirmation{% endtrans %}</h2>
<form action="" method="post">{% csrf_token %}
<p>{% trans obj=object %}Are you sure you want to delete "{{ obj }}"?{% endtrans %}</p>
<input type="submit" value="{% trans %}Confirm{% endtrans %}" />
<input type="submit" name="cancel" value="{% trans %}Cancel{% endtrans %}" />
</form>
{% endblock %}
......