Add first club views, this still sucks, particularly on the right managment

This commit is contained in:
Skia
2016-02-02 16:34:36 +01:00
parent afc87888a6
commit d51ab088d8
13 changed files with 215 additions and 4 deletions

View File

@ -0,0 +1,27 @@
{% extends "core/base.jinja" %}
{% block content %}
<h3>Club</h3>
<p><a href="{{ url('club:club_list') }}">Back to list</a></p>
{% if user.can_edit(club) %}
<p><a href="{{ url('club:club_edit', club_id=club.pk) }}">Edit</a></p>
<p><a href="{{ url('club:club_members', club_id=club.pk) }}">Edit members</a></p>
{% endif %}
{% if user.is_owner(club) or user.membership.filter(end_date=None).filter(club=club.id).first() is not none %}
<p><a href="{{ url('club:club_prop', club_id=club.pk) }}">Prop</a>
TODO FIXME: this code sucks and is just a test!
We need something really easy to manage the views rights regarding the subscribing status and the membership of
someone!
</p>
{% endif %}
<h3>{{ club.name }}</h3>
<p>{{ club.address }}</p>
<ul>
{% for m in club.members.all() %}
<li>{{ m }}</li>
{% endfor %}
</ul>
{% endblock %}

View File

@ -0,0 +1,13 @@
{% extends "core/base.jinja" %}
{% block content %}
<h2>Edit club</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>
</form>
{% endblock %}

View File

@ -0,0 +1,13 @@
{% extends "core/base.jinja" %}
{% block content %}
<h2>Edit club properties</h2>
<form action="{{ url('club:club_prop', club_id=club.id) }}" method="post">
{% csrf_token %}
{{ form.as_p() }}
<p><input type="submit" value="Save!" /></p>
</form>
{% endblock %}

View File

@ -0,0 +1,33 @@
{% extends "core/base.jinja" %}
{% block title %}
Club list
{% endblock %}
{% macro display_club(club) -%}
<li><a href="{{ url('club:club_view', club_id=club.id) }}">{{ club.name }}</a>
{%- if club.children.all()|length != 0 %}
<ul>
{%- for c in club.children.all() %}
{{ display_club(c) }}
{%- endfor %}
</ul>
{%- endif -%}
</li>
{%- endmacro %}
{% block content %}
{% if club_list %}
<h3>Club list</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.
{% endif %}
{% endblock %}

View File

@ -0,0 +1,13 @@
{% extends "core/base.jinja" %}
{% block content %}
<h2>Edit club</h2>
<form action="{{ url('club:club_members', club_id=club.id) }}" method="post">
{% csrf_token %}
{{ form.as_p() }}
<p><input type="submit" value="Save!" /></p>
</form>
{% endblock %}