Card for wei templates

This commit is contained in:
Alexandre Iooss 2020-08-25 18:36:49 +02:00
parent bca301700d
commit 4cb162de87
21 changed files with 419 additions and 399 deletions

View File

@ -8,11 +8,11 @@ SPDX-License-Identifier: GPL-3.0-or-later
{% block content %}
{% if started_activities %}
<div class="card bg-info mb-3">
<div class="card bg-secondary text-white mb-3">
<h3 class="card-header text-center">
{% trans "Current activity" %}
</h3>
<div class="card-body">
<div class="card-body text-dark">
{% for activity in started_activities %}
{% include "activity/includes/activity_info.html" %}
{% endfor %}

View File

@ -37,7 +37,6 @@ SPDX-License-Identifier: GPL-3.0-or-later
{% elif club %}
{% include "member/includes/club_info.html" %}
{% endif %}
{% endblock %}
</div>
<div class="card-footer">
{% if user_object %}
@ -66,6 +65,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
{% endif %}
</div>
</div>
{% endblock %}
</div>
<div class="col-xl-8">
{% block profile_content %}{% endblock %}

View File

@ -1 +1,110 @@
{% extends "member/base.html" %}
{% extends "base.html" %}
{% comment %}
SPDX-License-Identifier: GPL-3.0-or-later
{% endcomment %}
{% load i18n pretty_money perms %}
{% block contenttitle %}{% endblock %}
{# Use a fluid-width container #}
{% block containertype %}container-fluid{% endblock %}
{% block content %}
<div class="row mt-4">
<div class="col-xl-4">
{% block profile_info %}
{% if club %}
<div class="card bg-light">
<h4 class="card-header text-center">
{{ club.name }}
</h4>
<div class="card-top text-center">
<a href="{% url 'member:club_update_pic' club.pk %}">
<img src="{{ club.note.display_image.url }}" class="img-thumbnail mt-2">
</a>
</div>
<div class="card-body" id="profile_infos">
<dl class="row">
<dt class="col-xl-6">{% trans 'name'|capfirst %}</dt>
<dd class="col-xl-6">{{ club.name }}</dd>
{% if club.require_memberships %}
<dt class="col-xl-6">{% trans 'date start'|capfirst %}</dt>
<dd class="col-xl-6">{{ club.date_start }}</dd>
<dt class="col-xl-6">{% trans 'date end'|capfirst %}</dt>
<dd class="col-xl-6">{{ club.date_end }}</dd>
<dt class="col-xl-6">{% trans 'year'|capfirst %}</dt>
<dd class="col-xl-6">{{ club.year }}</dd>
{% if club.membership_fee_paid == club.membership_fee_unpaid %}
<dt class="col-xl-6">{% trans 'membership fee'|capfirst %}</dt>
<dd class="col-xl-6">{{ club.membership_fee_paid|pretty_money }}</dd>
{% else %}
{% with bde_kfet_fee=club.parent_club.membership_fee_paid|add:club.parent_club.parent_club.membership_fee_paid %}
<dt class="col-xl-6">{% trans 'WEI fee (paid students)'|capfirst %}</dt>
<dd class="col-xl-6">{{ club.membership_fee_paid|add:bde_kfet_fee|pretty_money }}
<i class="fas fa-question-circle"
title="{% trans "The BDE membership is included in the WEI registration." %}"></i></dd>
{% endwith %}
{% with bde_kfet_fee=club.parent_club.membership_fee_unpaid|add:club.parent_club.parent_club.membership_fee_unpaid %}
<dt class="col-xl-6">{% trans 'WEI fee (unpaid students)'|capfirst %}</dt>
<dd class="col-xl-6">{{ club.membership_fee_unpaid|add:bde_kfet_fee|pretty_money }}
<i class="fas fa-question-circle"
title="{% trans "The BDE membership is included in the WEI registration." %}"></i></dd>
{% endwith %}
{% endif %}
{% endif %}
{% if "note.view_note"|has_perm:club.note %}
<dt class="col-xl-6">{% trans 'balance'|capfirst %}</dt>
<dd class="col-xl-6">{{ club.note.balance | pretty_money }}</dd>
{% endif %}
{% if "note.change_alias"|has_perm:club.note.alias_set.first %}
<dt class="col-xl-4"><a
href="{% url 'member:club_alias' club.pk %}">{% trans 'aliases'|capfirst %}</a></dt>
<dd class="col-xl-8 text-truncate">{{ club.note.alias_set.all|join:", " }}</dd>
{% endif %}
<dt class="col-xl-4">{% trans 'email'|capfirst %}</dt>
<dd class="col-xl-8"><a href="mailto:{{ club.email }}">{{ club.email }}</a></dd>
</dl>
</div>
<div class="card-footer text-center">
{% if True %}
<a class="btn btn-primary btn-sm my-1" href="{% url 'wei:wei_list' %}"> {% trans "WEI list" %}</a>
{% endif %}
{% if club.is_current_wei %}
{% if can_add_first_year_member %}
<a class="btn btn-primary btn-sm my-1" href="{% url 'wei:wei_register_1A' wei_pk=club.pk %}"
data-turbolinks="false"> {% trans "Register 1A" %}</a>
{% endif %}
{% if can_add_any_member %}
<a class="btn btn-primary btn-sm my-1" href="{% url 'wei:wei_register_2A' wei_pk=club.pk %}"
data-turbolinks="false"> {% trans "Register 2A+" %}</a>
{% endif %}
{% if "wei.change_"|has_perm:club %}
<a class="btn btn-primary btn-sm my-1" href="{% url 'wei:wei_update' pk=club.pk %}"
data-turbolinks="false"> {% trans "Edit" %}</a>
{% endif %}
{% if can_add_bus %}
<a class="btn btn-primary btn-sm my-1" href="{% url 'wei:add_bus' pk=club.pk %}"
data-turbolinks="false"> {% trans "Add bus" %}</a>
{% endif %}
{% url 'wei:wei_detail' club.pk as club_detail_url %}
{%if request.path_info != club_detail_url %}
<a class="btn btn-primary btn-sm my-1" href="{{ club_detail_url }}">{% trans 'View WEI' %}</a>
{% endif %}
{% endif %}
</div>
</div>
{% endif %}
{% endblock %}
</div>
<div class="col-xl-8">
{% block profile_content %}{% endblock %}
</div>
</div>
{% endblock %}

View File

@ -1,9 +1,54 @@
{% extends "wei/base.html" %}
{% block profile_info %}
{% include "wei/weiclub_info.html" %}
{% endblock %}
{% load render_table from django_tables2 %}
{% load i18n %}
{% block profile_content %}
{% include "wei/bus_tables.html" %}
<div class="card">
<div class="card-header text-center">
<h4>{{ object.name }}</h4>
</div>
<div class="card-body">
{{ object.description }}
</div>
<div class="card-footer text-center">
<a class="btn btn-primary btn-sm my-1" href="{% url 'wei:update_bus' pk=object.pk %}"
data-turbolinks="false">{% trans "Edit" %}</a>
<a class="btn btn-primary btn-sm my-1" href="{% url 'wei:add_team' pk=object.pk %}"
data-turbolinks="false">{% trans "Add team" %}</a>
</div>
</div>
<hr>
{% if teams.data %}
<div class="card">
<div class="card-header position-relative" id="clubListHeading">
<a class="font-weight-bold">
<i class="fa fa-bus"></i> {% trans "Teams" %}
</a>
</div>
{% render_table teams %}
</div>
<hr>
{% endif %}
{% if memberships.data %}
<div class="card">
<div class="card-header position-relative" id="clubListHeading">
<a class="font-weight-bold">
<i class="fa fa-bus"></i> {% trans "Members" %}
</a>
</div>
{% render_table memberships %}
</div>
<hr>
<a href="{% url 'wei:wei_memberships_bus_pdf' wei_pk=club.pk bus_pk=object.pk %}" data-turbolinks="false">
<button class="btn btn-block btn-danger"><i class="fa fa-file-pdf-o"></i> {% trans "View as PDF" %}</button>
</a>
{% endif %}
{% endblock %}

View File

@ -1,15 +1,21 @@
{% extends "wei/base.html" %}
{% comment %}
SPDX-License-Identifier: GPL-3.0-or-later
{% endcomment %}
{% load crispy_forms_tags %}
{% load i18n %}
{% block profile_info %}
{% include "wei/weiclub_info.html" %}
{% endblock %}
{% block profile_content %}
<form method="post">
{% csrf_token %}
{{ form|crispy }}
<button class="btn btn-primary" type="submit">{% trans "Submit" %}</button>
</form>
<div class="card bg-light mb-3">
<h3 class="card-header text-center">
{{ title }}
</h3>
<div class="card-body">
<form method="post">
{% csrf_token %}
{{ form|crispy }}
<button class="btn btn-primary" type="submit">{% trans "Submit" %}</button>
</form>
</div>
</div>
{% endblock %}

View File

@ -1,50 +0,0 @@
{% load render_table from django_tables2 %}
{% load i18n %}
<div class="card">
<div class="card-header text-center">
<h4>{{ object.name }}</h4>
</div>
<div class="card-body">
{{ object.description }}
</div>
<div class="card-footer text-center">
<a class="btn btn-primary btn-sm my-1" href="{% url 'wei:update_bus' pk=object.pk %}" data-turbolinks="false">{% trans "Edit" %}</a>
<a class="btn btn-primary btn-sm my-1" href="{% url 'wei:add_team' pk=object.pk %}" data-turbolinks="false">{% trans "Add team" %}</a>
</div>
</div>
<hr>
{% if teams.data %}
<div class="card">
<div class="card-header position-relative" id="clubListHeading">
<a class="font-weight-bold">
<i class="fa fa-bus"></i> {% trans "Teams" %}
</a>
</div>
{% render_table teams %}
</div>
<hr>
{% endif %}
{% if memberships.data %}
<div class="card">
<div class="card-header position-relative" id="clubListHeading">
<a class="font-weight-bold">
<i class="fa fa-bus"></i> {% trans "Members" %}
</a>
</div>
{% render_table memberships %}
</div>
<hr>
<a href="{% url 'wei:wei_memberships_bus_pdf' wei_pk=club.pk bus_pk=object.pk %}" data-turbolinks="false">
<button class="btn btn-block btn-danger"><i class="fa fa-file-pdf-o"></i> {% trans "View as PDF" %}</button>
</a>
{% endif %}

View File

@ -1,9 +1,60 @@
{% extends "wei/base.html" %}
{% block profile_info %}
{% include "wei/weiclub_info.html" %}
{% endblock %}
{% load render_table from django_tables2 %}
{% load i18n %}
{% block profile_content %}
{% include "wei/busteam_tables.html" %}
<div class="card">
<div class="card-header text-center">
<h4>{{ bus.name }}</h4>
</div>
<div class="card-body">
{{ bus.description }}
</div>
<div class="card-footer text-center">
<a class="btn btn-primary btn-sm my-1" href="{% url 'wei:update_bus' pk=bus.pk %}"
data-turbolinks="false">{% trans "Edit" %}</a>
<a class="btn btn-primary btn-sm my-1" href="{% url 'wei:add_team' pk=bus.pk %}"
data-turbolinks="false">{% trans "Add team" %}</a>
</div>
</div>
<hr>
<div class="card">
<div class="card-header text-center"
style="background-color: #{{ object.color|stringformat:"06X" }}; color: #{{ -16777215|add:object.color|stringformat:"06X"|slice:"1:" }};">
<h4>{{ object.name }}</h4>
</div>
<div class="card-body">
{{ object.description }}
</div>
<div class="card-footer text-center">
<a class="btn btn-primary btn-sm my-1"
href="{% url 'wei:update_bus_team' pk=object.pk %}">{% trans "Edit" %}</a>
</div>
</div>
<hr>
{% if memberships.data or True %}
<div class="card">
<div class="card-header position-relative" id="clubListHeading">
<a class="font-weight-bold">
<i class="fa fa-bus"></i> {% trans "Teams" %}
</a>
</div>
{% render_table memberships %}
</div>
<hr>
<a href="{% url 'wei:wei_memberships_team_pdf' wei_pk=club.pk bus_pk=object.bus.pk team_pk=object.pk %}"
data-turbolinks="false">
<button class="btn btn-block btn-danger"><i class="fa fa-file-pdf-o"></i> {% trans "View as PDF" %}</button>
</a>
{% endif %}
{% endblock %}

View File

@ -1,15 +1,21 @@
{% extends "wei/base.html" %}
{% comment %}
SPDX-License-Identifier: GPL-3.0-or-later
{% endcomment %}
{% load crispy_forms_tags %}
{% load i18n %}
{% block profile_info %}
{% include "wei/weiclub_info.html" %}
{% endblock %}
{% block profile_content %}
<form method="post">
{% csrf_token %}
{{ form|crispy }}
<button class="btn btn-primary" type="submit">{% trans "Submit" %}</button>
</form>
<div class="card bg-light mb-3">
<h3 class="card-header text-center">
{{ title }}
</h3>
<div class="card-body">
<form method="post">
{% csrf_token %}
{{ form|crispy }}
<button class="btn btn-primary" type="submit">{% trans "Submit" %}</button>
</form>
</div>
</div>
{% endblock %}

View File

@ -1,54 +0,0 @@
{% load render_table from django_tables2 %}
{% load i18n %}
<div class="card">
<div class="card-header text-center">
<h4>{{ bus.name }}</h4>
</div>
<div class="card-body">
{{ bus.description }}
</div>
<div class="card-footer text-center">
<a class="btn btn-primary btn-sm my-1" href="{% url 'wei:update_bus' pk=bus.pk %}" data-turbolinks="false">{% trans "Edit" %}</a>
<a class="btn btn-primary btn-sm my-1" href="{% url 'wei:add_team' pk=bus.pk %}" data-turbolinks="false">{% trans "Add team" %}</a>
</div>
</div>
<hr>
<div class="card">
<div class="card-header text-center" style="background-color: #{{ object.color|stringformat:"06X" }}; color: #{{ -16777215|add:object.color|stringformat:"06X"|slice:"1:" }};">
<h4>{{ object.name }}</h4>
</div>
<div class="card-body">
{{ object.description }}
</div>
<div class="card-footer text-center">
<a class="btn btn-primary btn-sm my-1" href="{% url 'wei:update_bus_team' pk=object.pk %}">{% trans "Edit" %}</a>
</div>
</div>
<hr>
{% if memberships.data or True %}
<div class="card">
<div class="card-header position-relative" id="clubListHeading">
<a class="font-weight-bold">
<i class="fa fa-bus"></i> {% trans "Teams" %}
</a>
</div>
{% render_table memberships %}
</div>
<hr>
<a href="{% url 'wei:wei_memberships_team_pdf' wei_pk=club.pk bus_pk=object.bus.pk team_pk=object.pk %}" data-turbolinks="false">
<button class="btn btn-block btn-danger"><i class="fa fa-file-pdf-o"></i> {% trans "View as PDF" %}</button>
</a>
{% endif %}

View File

@ -2,10 +2,6 @@
{% load i18n %}
{% load crispy_forms_tags %}
{% block profile_info %}
{% include "wei/weiclub_info.html" %}
{% endblock %}
{% block profile_content %}
<div class="card">
<div class="card-header text-center">

View File

@ -2,10 +2,6 @@
{% load i18n %}
{% load crispy_forms_tags %}
{% block profile_info %}
{% include "wei/weiclub_info.html" %}
{% endblock %}
{% block profile_content %}
<div class="card">
<div class="card-header text-center">

View File

@ -2,10 +2,6 @@
{% load i18n %}
{% load crispy_forms_tags %}
{% block profile_info %}
{% include "wei/weiclub_info.html" %}
{% endblock %}
{% block profile_content %}
<div class="card">
<div class="card-header text-center">

View File

@ -1,21 +1,109 @@
{% extends "wei/base.html" %}
{% block profile_info %}
{% include "wei/weiclub_info.html" %}
{% endblock %}
{% comment %}
SPDX-License-Identifier: GPL-3.0-or-later
{% endcomment %}
{% load render_table from django_tables2 %}
{% load i18n perms %}
{% block profile_content %}
{% include "wei/weiclub_tables.html" %}
<div class="card bg-white mb-3">
<div class="card-header text-center">
<h4>Week-End d'Intégration</h4>
</div>
<div class="card-body">
<p class="lead font-italic">
Le WEI (Week-End dIntégration), ou 3 jours dimmersion dans les profondeurs du
monde post-préparatoire.
</p>
<p>
Que serait une école sans son week-end dintégration ? Quelques semaines après la
rentrée, on embarque tous et toutes à bord de bus à thèmes pour quelques jours
inoubliables dans une destination inconnue. Lobjectif de ce week-end : permettre aux
nouvel·les arrivant·es de se lâcher après 2 ans de dur labeur (voire 3 pour les plus
chanceux), de découvrir lambiance familiale de lENS ainsi que de nouer des liens avec
ceux·elles quils côtoieront par la suite. Dose de chants et de fun garantie !
</p>
</div>
{% if club.is_current_wei %}
<div class="card-footer text-center">
{% if not my_registration %}
{% if not not_first_year %}
<a class="btn btn-success" href="{% url "wei:wei_register_1A_myself" wei_pk=club.pk %}" data-turbolinks="false">
{% trans "Register to the WEI! 1A" %}
</a>
{% endif %}
<a class="btn btn-success" href="{% url "wei:wei_register_2A_myself" wei_pk=club.pk %}" data-turbolinks="false">
{% trans "Register to the WEI! 2A+" %}</a>
{% else %}
<a class="btn btn-warning" href="{% url "wei:wei_update_registration" pk=my_registration.pk %}"
data-turbolinks="false">
{% trans "Update my registration" %}
</a>
{% endif %}
</div>
{% endif %}
</div>
{% if buses.data %}
<div class="card bg-white mb-3">
<div class="card-header position-relative" id="clubListHeading">
<span class="font-weight-bold">
<i class="fa fa-bus"></i> {% trans "Buses" %}
</span>
</div>
{% render_table buses %}
</div>
{% endif %}
{% if member_list.data %}
<div class="card bg-white mb-3">
<div class="card-header position-relative" id="clubListHeading">
<a class="stretched-link font-weight-bold text-decoration-none"
href="{% url "wei:wei_memberships" pk=club.pk %}">
<i class="fa fa-users"></i> {% trans "Members of the WEI" %}
</a>
</div>
{% render_table member_list %}
</div>
{% endif %}
{% if history_list.data %}
<div class="card bg-white mb-3">
<div class="card-header position-relative" id="historyListHeading">
<a class="stretched-link font-weight-bold text-decoration-none" {% if "note.view_note"|has_perm:club.note %}
href="{% url 'note:transactions' pk=club.note.pk %}" {% endif %}>
<i class="fa fa-euro"></i> {% trans "Transaction history" %}
</a>
</div>
<div id="history_list">
{% render_table history_list %}
</div>
</div>
{% endif %}
{% if pre_registrations.data %}
<div class="card bg-white mb-3">
<div class="card-header position-relative" id="historyListHeading">
<a class="stretched-link font-weight-bold text-decoration-none"
href="{% url 'wei:wei_registrations' pk=club.pk %}">
<i class="fa fa-user-plus"></i> {% trans "Unvalidated registrations" %}
</a>
</div>
<div id="history_list">
{% render_table pre_registrations %}
</div>
</div>
{% endif %}
{% endblock %}
{% block extrajavascript %}
<script>
<script>
function refreshHistory() {
$("#history_list").load("{% url 'wei:wei_detail' pk=object.pk %} #history_list");
$("#profile_infos").load("{% url 'wei:wei_detail' pk=object.pk %} #profile_infos");
}
$(document).ready(function() {
$(document).ready(function () {
$(".no-perm").parent().addClass("d-none");
if ($("a[data-type='validate-membership']:not(.d-none)").length === 0) {
$("a[data-type='validate-membership']").parent().addClass("d-none");
@ -26,5 +114,5 @@
$("#delete-membership-header").addClass("d-none");
}
});
</script>
</script>
{% endblock %}

View File

@ -1,17 +1,21 @@
{% extends "wei/base.html" %}
{% comment %}
SPDX-License-Identifier: GPL-3.0-or-later
{% endcomment %}
{% load crispy_forms_tags %}
{% load i18n %}
{% block profile_info %}
{% if club %}
{% include "wei/weiclub_info.html" %}
{% endif %}
{% endblock %}
{% block profile_content %}
<div class="card bg-light mb-3">
<h3 class="card-header text-center">
{{ title }}
</h3>
<div class="card-body">
<form method="post">
{% csrf_token %}
{{ form|crispy }}
<button class="btn btn-primary" type="submit">{% trans "Submit" %}</button>
</form>
</div>
</div>
{% endblock %}

View File

@ -1,81 +0,0 @@
{% load i18n static pretty_money perms %}
<div class="card bg-light shadow">
<div class="card-header text-center">
<h4>{{ club.name }} </h4>
</div>
<div class="card-top text-center">
<a href="{% url 'member:club_update_pic' club.pk %}">
<img src="{{ club.note.display_image.url }}" class="img-thumbnail mt-2" >
</a>
</div>
<div class="card-body" id="profile_infos">
<dl class="row">
<dt class="col-xl-6">{% trans 'name'|capfirst %}</dt>
<dd class="col-xl-6">{{ club.name }}</dd>
{% if club.require_memberships %}
<dt class="col-xl-6">{% trans 'date start'|capfirst %}</dt>
<dd class="col-xl-6">{{ club.date_start }}</dd>
<dt class="col-xl-6">{% trans 'date end'|capfirst %}</dt>
<dd class="col-xl-6">{{ club.date_end }}</dd>
<dt class="col-xl-6">{% trans 'year'|capfirst %}</dt>
<dd class="col-xl-6">{{ club.year }}</dd>
{% if club.membership_fee_paid == club.membership_fee_unpaid %}
<dt class="col-xl-6">{% trans 'membership fee'|capfirst %}</dt>
<dd class="col-xl-6">{{ club.membership_fee_paid|pretty_money }}</dd>
{% else %}
{% with bde_kfet_fee=club.parent_club.membership_fee_paid|add:club.parent_club.parent_club.membership_fee_paid %}
<dt class="col-xl-6">{% trans 'WEI fee (paid students)'|capfirst %}</dt>
<dd class="col-xl-6">{{ club.membership_fee_paid|add:bde_kfet_fee|pretty_money }}
<i class="fas fa-question-circle" title="{% trans "The BDE membership is included in the WEI registration." %}"></i></dd>
{% endwith %}
{% with bde_kfet_fee=club.parent_club.membership_fee_unpaid|add:club.parent_club.parent_club.membership_fee_unpaid %}
<dt class="col-xl-6">{% trans 'WEI fee (unpaid students)'|capfirst %}</dt>
<dd class="col-xl-6">{{ club.membership_fee_unpaid|add:bde_kfet_fee|pretty_money }}
<i class="fas fa-question-circle" title="{% trans "The BDE membership is included in the WEI registration." %}"></i></dd>
{% endwith %}
{% endif %}
{% endif %}
{% if "note.view_note"|has_perm:club.note %}
<dt class="col-xl-6">{% trans 'balance'|capfirst %}</dt>
<dd class="col-xl-6">{{ club.note.balance | pretty_money }}</dd>
{% endif %}
{% if "note.change_alias"|has_perm:club.note.alias_set.first %}
<dt class="col-xl-4"><a href="{% url 'member:club_alias' club.pk %}">{% trans 'aliases'|capfirst %}</a></dt>
<dd class="col-xl-8 text-truncate">{{ club.note.alias_set.all|join:", " }}</dd>
{% endif %}
<dt class="col-xl-4">{% trans 'email'|capfirst %}</dt>
<dd class="col-xl-8"><a href="mailto:{{ club.email }}">{{ club.email }}</a></dd>
</dl>
</div>
<div class="card-footer text-center">
{% if True %}
<a class="btn btn-primary btn-sm my-1" href="{% url 'wei:wei_list' %}"> {% trans "WEI list" %}</a>
{% endif %}
{% if club.is_current_wei %}
{% if can_add_first_year_member %}
<a class="btn btn-primary btn-sm my-1" href="{% url 'wei:wei_register_1A' wei_pk=club.pk %}" data-turbolinks="false"> {% trans "Register 1A" %}</a>
{% endif %}
{% if can_add_any_member %}
<a class="btn btn-primary btn-sm my-1" href="{% url 'wei:wei_register_2A' wei_pk=club.pk %}" data-turbolinks="false"> {% trans "Register 2A+" %}</a>
{% endif %}
{% if "wei.change_"|has_perm:club %}
<a class="btn btn-primary btn-sm my-1" href="{% url 'wei:wei_update' pk=club.pk %}" data-turbolinks="false"> {% trans "Edit" %}</a>
{% endif %}
{% if can_add_bus %}
<a class="btn btn-primary btn-sm my-1" href="{% url 'wei:add_bus' pk=club.pk %}" data-turbolinks="false"> {% trans "Add bus" %}</a>
{% endif %}
{% url 'wei:wei_detail' club.pk as club_detail_url %}
{%if request.path_info != club_detail_url %}
<a class="btn btn-primary btn-sm my-1" href="{{ club_detail_url }}">{% trans 'View WEI' %}</a>
{% endif %}
{% endif %}
</div>
</div>

View File

@ -1,82 +0,0 @@
{% load render_table from django_tables2 %}
{% load i18n %}
{% load perms %}
<div class="card">
<div class="card-header text-center">
<h4>WEI</h4>
</div>
<div class="card-body">
<p>LE WEI, c'est cool !</p>
</div>
{% if club.is_current_wei %}
<div class="card-footer text-center">
{% if not my_registration %}
{% if not not_first_year %}
<a href="{% url "wei:wei_register_1A_myself" wei_pk=club.pk %}" data-turbolinks="false"><button class="btn btn-success">{% trans "Register to the WEI! 1A" %}</button></a>
{% endif %}
<a href="{% url "wei:wei_register_2A_myself" wei_pk=club.pk %}" data-turbolinks="false"><button class="btn btn-success">{% trans "Register to the WEI! 2A+" %}</button></a>
{% else %}
<a href="{% url "wei:wei_update_registration" pk=my_registration.pk %}" data-turbolinks="false"><button class="btn btn-warning">{% trans "Update my registration" %}</button></a>
{% endif %}
</div>
{% endif %}
</div>
<hr>
{% if buses.data %}
<div class="card">
<div class="card-header position-relative" id="clubListHeading">
<a class="font-weight-bold">
<i class="fa fa-bus"></i> {% trans "Buses" %}
</a>
</div>
{% render_table buses %}
</div>
<hr>
{% endif %}
{% if member_list.data %}
<div class="card">
<div class="card-header position-relative" id="clubListHeading">
<a class="stretched-link font-weight-bold" href="{% url "wei:wei_memberships" pk=club.pk %}">
<i class="fa fa-users"></i> {% trans "Members of the WEI" %}
</a>
</div>
{% render_table member_list %}
</div>
<hr>
{% endif %}
{% if history_list.data %}
<div class="card">
<div class="card-header position-relative" id="historyListHeading">
<a class="stretched-link font-weight-bold" {% if "note.view_note"|has_perm:club.note %} href="{% url 'note:transactions' pk=club.note.pk %}" {% endif %}>
<i class="fa fa-euro"></i> {% trans "Transaction history" %}
</a>
</div>
<div id="history_list">
{% render_table history_list %}
</div>
</div>
<hr>
{% endif %}
{% if pre_registrations.data %}
<div class="card">
<div class="card-header position-relative" id="historyListHeading">
<a class="stretched-link font-weight-bold" href="{% url 'wei:wei_registrations' pk=club.pk %}">
<i class="fa fa-user-plus"></i> {% trans "Unvalidated registrations" %}
</a>
</div>
<div id="history_list">
{% render_table pre_registrations %}
</div>
</div>
<hr>
{% endif %}

View File

@ -4,10 +4,6 @@
{% load pretty_money %}
{% load perms %}
{% block profile_info %}
{% include "wei/weiclub_info.html" %}
{% endblock %}
{% block profile_content %}
<div class="card bg-light shadow">
<div class="card-header text-center">

View File

@ -2,10 +2,6 @@
{% load i18n %}
{% load render_table from django_tables2 %}
{% block profile_info %}
{% include "wei/weiclub_info.html" %}
{% endblock %}
{% block profile_content %}
<input id="searchbar" type="text" class="form-control" placeholder="Nom/prénom/note/bus/équipe ...">
<hr>

View File

@ -2,10 +2,6 @@
{% load i18n %}
{% load crispy_forms_tags %}
{% block profile_info %}
{% include "wei/weiclub_info.html" %}
{% endblock %}
{% block profile_content %}
<div class="card bg-light shadow">
<div class="card-header text-center">

View File

@ -1,34 +1,40 @@
{% extends "wei/base.html" %}
{% comment %}
SPDX-License-Identifier: GPL-3.0-or-later
{% endcomment %}
{% load i18n %}
{% load crispy_forms_tags %}
{% block profile_info %}
{% include "wei/weiclub_info.html" %}
{% endblock %}
{% block profile_content %}
<div class="card bg-light mb-3">
<h3 class="card-header text-center">
{{ title }}
</h3>
<div class="card-body">
<form method="post">
{% csrf_token %}
{{ form|crispy }}
{{ membership_form|crispy }}
<button class="btn btn-primary" type="submit">{% trans "Submit" %}</button>
</form>
</div>
</div>
{% endblock %}
{% block extrajavascript %}
{% if not object.membership %}
<script>
$(document).ready(function() {
{% if not object.membership %}
<script>
$(document).ready(function () {
function refreshTeams() {
let buses = [];
$("input[name='bus']:checked").each(function(ignored) {
$("input[name='bus']:checked").each(function (ignored) {
buses.push($(this).parent().text().trim());
});
console.log(buses);
$("input[name='team']").each(function() {
$("input[name='team']").each(function () {
let label = $(this).parent();
$(this).parent().addClass('d-none');
buses.forEach(function(bus) {
buses.forEach(function (bus) {
if (label.text().includes(bus))
label.removeClass('d-none');
});
@ -39,6 +45,6 @@
refreshTeams();
});
</script>
{% endif %}
</script>
{% endif %}
{% endblock %}

View File

@ -2,10 +2,6 @@
{% load i18n %}
{% load render_table from django_tables2 %}
{% block profile_info %}
{% include "wei/weiclub_info.html" %}
{% endblock %}
{% block profile_content %}
<input id="searchbar" type="text" class="form-control" placeholder="Nom/prénom/note ...">
<hr>