mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-10 03:49:24 +00:00
Translate most of the Sith
This commit is contained in:
25
club/migrations/0003_auto_20160718_1819.py
Normal file
25
club/migrations/0003_auto_20160718_1819.py
Normal 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'),
|
||||
),
|
||||
]
|
@ -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()),
|
||||
|
@ -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>
|
||||
|
@ -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 %}
|
||||
|
||||
|
@ -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 %}
|
||||
|
||||
|
@ -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 %}
|
||||
|
||||
|
@ -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 %}
|
||||
|
||||
|
@ -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 %}
|
||||
|
||||
|
||||
|
@ -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
|
||||
"""
|
||||
|
Reference in New Issue
Block a user