mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-10 11:59:23 +00:00
Add first club views, this still sucks, particularly on the right managment
This commit is contained in:
27
club/templates/club/club_detail.jinja
Normal file
27
club/templates/club/club_detail.jinja
Normal 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 %}
|
||||
|
||||
|
||||
|
13
club/templates/club/club_edit.jinja
Normal file
13
club/templates/club/club_edit.jinja
Normal 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 %}
|
||||
|
||||
|
||||
|
13
club/templates/club/club_edit_prop.jinja
Normal file
13
club/templates/club/club_edit_prop.jinja
Normal 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 %}
|
||||
|
||||
|
||||
|
33
club/templates/club/club_list.jinja
Normal file
33
club/templates/club/club_list.jinja
Normal 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 %}
|
||||
|
||||
|
||||
|
13
club/templates/club/club_members.jinja
Normal file
13
club/templates/club/club_members.jinja
Normal 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 %}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user