Improve club templates

This commit is contained in:
Skia
2016-09-02 09:23:21 +02:00
parent b2df8fbf18
commit 29f565f514
7 changed files with 94 additions and 39 deletions

View File

@ -0,0 +1,57 @@
{% extends "core/base.jinja" %}
{% block content %}
<div class="tool-bar">
<div>{{ club.name }}</div>
<div class="tools">
<a href="{{ url('club:club_view', club_id=club.id) }}"
{%- if tab == "infos" -%}
class="selected_tab"
{%- endif -%}
>{% trans %}Infos{% endtrans %}</a>
{% if can_view(club, user) %}
<a href="{{ url('club:club_members', club_id=club.pk) }}"
{%- if tab == "members" -%}
class="selected_tab"
{%- endif -%}
>{% trans %}Members{% endtrans %}</a>
{% endif %}
{% if can_view(club, user) %}
<a href="{{ url('club:tools', club_id=club.id) }}"
{%- if tab == "tools" -%}
class="selected_tab"
{%- endif -%}
>{% trans %}Tools{% endtrans %}</a>
{% endif %}
{% if can_edit(club, request.user) %}
<a href="{{ url('club:club_edit', club_id=club.id) }}"
{%- if tab == "edit" -%}
class="selected_tab"
{%- endif -%}
>{% trans %}Edit{% endtrans %}</a>
{% endif %}
{% if can_edit_prop(club, request.user) %}
<a href="{{ url('club:club_prop', club_id=club.id) }}"
{%- if tab == "props" -%}
class="selected_tab"
{%- endif -%}
>{% trans %}Props{% endtrans %}</a>
{% endif %}
</div>
<hr>
</div>
<div>
{% block club %}
{% endblock %}
</div>
{% endblock %}

View File

@ -1,35 +1,8 @@
{% extends "core/base.jinja" %}
{% extends "club/club_base.jinja" %}
{% from 'core/macros.jinja' import user_profile_link %}
{% block content %}
{% block club %}
<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) }}">{% trans %}Edit{% endtrans %}</a></p>
{% endif %}
{% if can_edit_prop(club, user) %}
<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) }}">{% trans %}Members{% endtrans %}</a></p>
{% endif %}
<h3>{{ club.name }}</h3>
<p>{{ club.address }}</p>
<table>
<thead>
<td>{% trans %}User{% endtrans %}</td>
<td>{% trans %}Role{% endtrans %}</td>
</thead>
<tbody>
{% for m in club.members.filter(end_date=None).order_by('-role').all() %}
<tr>
<td>{{ user_profile_link(m.user) }}</td>
<td>{{ settings.SITH_CLUB_ROLES[m.role] }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endblock %}

View File

@ -1,6 +1,6 @@
{% extends "core/base.jinja" %}
{% extends "club/club_base.jinja" %}
{% block content %}
{% block club %}
<h2>{% trans %}Edit club{% endtrans %}</h2>
<form action="{{ url('club:club_edit', club_id=club.id) }}" method="post">
{% csrf_token %}

View File

@ -1,6 +1,6 @@
{% extends "core/base.jinja" %}
{% extends "club/club_base.jinja" %}
{% block content %}
{% block club %}
<h2>{% trans %}Edit club properties{% endtrans %}</h2>
<form action="" method="post">
{% csrf_token %}

View File

@ -1,18 +1,20 @@
{% extends "core/base.jinja" %}
{% extends "club/club_base.jinja" %}
{% from 'core/macros.jinja' import user_profile_link %}
{% block content %}
{% block club %}
<h2>{% trans %}Club members{% endtrans %}</h2>
<table>
<thead>
<td>{% trans %}User{% endtrans %}</td>
<td>{% trans %}Role{% endtrans %}</td>
<td>{% trans %}Description{% endtrans %}</td>
</thead>
<tbody>
{% for m in club.members.filter(end_date=None).order_by('-role').all() %}
<tr>
<td>{{ user_profile_link(m.user) }}</td>
<td>{{ settings.SITH_CLUB_ROLES[m.role] }}</td>
<td>{{ m.description }}</td>
</tr>
{% endfor %}
</tbody>

View File

@ -1,8 +1,7 @@
{% extends "core/base.jinja" %}
{% extends "club/club_base.jinja" %}
{% block content %}
{% block club %}
<h3>{% trans %}Club tools{% endtrans %}</h3>
<p><a href="{{ url('club:club_view', club_id=object.id) }}">Back to club</a></p>
<div>
{% if object.counters.filter(type="OFFICE")|count > 0 %}
<h4>{% trans %}Counters:{% endtrans %}</h4>