Translate most of the Sith

This commit is contained in:
Skia
2016-07-19 19:03:16 +02:00
parent 1b4324f38f
commit 97ff4341a7
55 changed files with 1238 additions and 475 deletions

View File

@ -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'),
),
]

View File

@ -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()),

View File

@ -1,17 +1,17 @@
{% 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>

View File

@ -1,11 +1,11 @@
{% 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 %}

View File

@ -1,11 +1,11 @@
{% 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 %}

View File

@ -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']) %}
<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 %}

View File

@ -1,7 +1,7 @@
{% 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 %}

View File

@ -1,25 +1,25 @@
{% 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 %}

View File

@ -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
"""