trombi: add custom club memberships

Signed-off-by: Skia <skia@libskia.so>
This commit is contained in:
Skia
2017-06-12 23:52:59 +02:00
parent 5df9be9188
commit f26f2f4229
8 changed files with 276 additions and 59 deletions

View File

@ -0,0 +1,44 @@
{% extends "core/base.jinja" %}
{% block title %}
{% trans %}Edit profile{% endtrans %}
{% endblock %}
{% block content %}
<h2>{% trans %}Edit profile{% endtrans %}</h2>
<p> <a href="{{ url('trombi:user_tools') }}">{% trans %}Back to tools{% endtrans %}</a></p>
<form action="" method="post" enctype="multipart/form-data">
{% csrf_token %}
{{ form.as_p() }}
<p><input type="submit" value="{% trans %}Save{% endtrans %}" /></p>
</form>
<h4>{% trans %}Club{% endtrans %}</h4>
<a href="{{ url('trombi:reset_memberships') }}">
{% trans %}Reset club memberships in Trombi (delete exising ones, does not impact real club memberships){% endtrans %}
</a>
<table style="max-width: 80%; margin: auto;">
<thead>
<tr>
<td>{% trans %}Club{% endtrans %}</td>
<td>{% trans %}Role{% endtrans %}</td>
<td>{% trans %}Dates{% endtrans %}</td>
</tr>
</thead>
<tbody>
{% for m in user.trombi_user.memberships.all() %}
<tr>
<td>{{ m.club }}</td>
<td>{{ m.role }}</td>
<td>{{ m.start }} - {{ m.end }}</td>
<td>
<a href="{{ url('trombi:edit_membership', membership_id=m.id) }}">{% trans %}Edit{% endtrans %}</a>
<a href="{{ url('trombi:delete_membership', membership_id=m.id) }}">{% trans %}Delete{% endtrans %}</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endblock %}

View File

@ -8,6 +8,7 @@
<h3>{% trans user_name=trombi_user.user.get_display_name() %}{{ user_name }}'s Trombi profile{% endtrans %}</h3>
<p> <a href="{{ url('trombi:user_tools') }}">{% trans %}Back to tools{% endtrans %}</a></p>
<div>
<h4>{% trans %}Pictures{% endtrans %}</h4>
{% set profile_file = None %}
{% set scrub_file = None %}
{% if trombi_user.profile_pict %}
@ -20,10 +21,36 @@
{% else %}
{% set scrub_file = static('core/img/na.gif') %}
{% endif %}
<div style="max-width: 410px; margin: auto;">
<img src="{{ profile_file }}" alt="" style="max-width: 200px">
<img src="{{ scrub_file }}" alt="" style="max-width: 200px">
<div style="max-width: 410px; margin: auto; text-align: center;">
<div>
<img src="{{ profile_file }}" alt="" style="max-width: 200px">
<img src="{{ scrub_file }}" alt="" style="max-width: 200px">
</div>
<div>
<em>{{ trombi_user.user.get_short_name() }}</em>
</div>
</div>
{% if trombi_user.memberships.exists() %}
<h4>{% trans %}Club{% endtrans %}</h4>
<table style="max-width: 70%; margin: auto;">
<thead>
<tr>
<td>{% trans %}Club{% endtrans %}</td>
<td>{% trans %}Role{% endtrans %}</td>
<td>{% trans %}Date{% endtrans %}</td>
</tr>
</thead>
<tbody>
{% for m in trombi_user.memberships.all() %}
<tr>
<td>{{ m.club }}</td>
<td>{{ m.role }}</td>
<td>{{ m.start }} - {{ m.end }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}
<dl>
{% for c in trombi_user.received_comments.filter(is_moderated=True) %}
<dt style="font-weight: bold; font-size: 110%">{{ c.author.user.get_display_name() }}</dt>