Better display for WEI member list

Signed-off-by: Yohann D'ANELLO <ynerant@crans.org>
This commit is contained in:
Yohann D'ANELLO 2021-08-23 19:00:26 +02:00
parent 9086d33158
commit aa35724be2
Signed by: ynerant
GPG Key ID: 3A75C55819C8CF85
3 changed files with 44 additions and 34 deletions

View File

@ -108,7 +108,7 @@ class WEIRegistrationTable(tables.Table):
} }
model = WEIRegistration model = WEIRegistration
template_name = 'django_tables2/bootstrap4.html' template_name = 'django_tables2/bootstrap4.html'
fields = ('user', 'user__first_name', 'user__last_name', 'first_year',) fields = ('user', 'user__first_name', 'user__last_name', 'first_year', 'caution_check',)
row_attrs = { row_attrs = {
'class': 'table-row', 'class': 'table-row',
'id': lambda record: "row-" + str(record.pk), 'id': lambda record: "row-" + str(record.pk),
@ -147,7 +147,7 @@ class WEIMembershipTable(tables.Table):
model = WEIMembership model = WEIMembership
template_name = 'django_tables2/bootstrap4.html' template_name = 'django_tables2/bootstrap4.html'
fields = ('user', 'user__last_name', 'user__first_name', 'registration__gender', 'user__profile__department', fields = ('user', 'user__last_name', 'user__first_name', 'registration__gender', 'user__profile__department',
'year', 'bus', 'team', ) 'year', 'bus', 'team', 'registration__caution_check', )
row_attrs = { row_attrs = {
'class': 'table-row', 'class': 'table-row',
'id': lambda record: "row-" + str(record.pk), 'id': lambda record: "row-" + str(record.pk),

View File

@ -6,28 +6,32 @@ SPDX-License-Identifier: GPL-3.0-or-later
{% load render_table from django_tables2 %} {% load render_table from django_tables2 %}
{% block profile_content %} {% block profile_content %}
<input id="searchbar" type="text" class="form-control" placeholder="Nom/prénom/note/bus/équipe ..."> <div class="card">
<hr> <div class="card-body">
<input id="searchbar" type="text" class="form-control" placeholder="Nom/prénom/note/bus/équipe ...">
<hr>
<div id="memberships_table"> <div id="memberships_table">
{% if table.data %} {% if table.data %}
{% render_table table %} {% render_table table %}
{% else %} {% else %}
<div class="alert alert-warning"> <div class="alert alert-warning">
{% trans "There is no membership found with this pattern." %} {% trans "There is no membership found with this pattern." %}
</div> </div>
{% endif %} {% endif %}
</div>
</div> </div>
<a href="{% url 'wei:wei_registrations' pk=club.pk %}"> <div class="card-footer text-center">
<button class="btn btn-block btn-info">{% trans "View unvalidated registrations..." %}</button> <a href="{% url 'wei:wei_registrations' pk=club.pk %}">
</a> <button class="btn btn-block btn-info">{% trans "View unvalidated registrations..." %}</button>
</a>
<hr> <hr>
<a href="{% url 'wei:wei_memberships_pdf' wei_pk=club.pk %}" data-turbolinks="false">
<a href="{% url 'wei:wei_memberships_pdf' wei_pk=club.pk %}" data-turbolinks="false"> <button class="btn btn-block btn-danger"><i class="fa fa-file-pdf-o"></i> {% trans "View as PDF" %}</button>
<button class="btn btn-block btn-danger"><i class="fa fa-file-pdf-o"></i> {% trans "View as PDF" %}</button> </a>
</a> </div>
</div>
{% endblock %} {% endblock %}
{% block extrajavascript %} {% block extrajavascript %}

View File

@ -6,22 +6,28 @@ SPDX-License-Identifier: GPL-3.0-or-later
{% load render_table from django_tables2 %} {% load render_table from django_tables2 %}
{% block profile_content %} {% block profile_content %}
<input id="searchbar" type="text" class="form-control" placeholder="Nom/prénom/note ..."> <div class="card">
<hr> <div class="card-body">
<input id="searchbar" type="text" class="form-control" placeholder="Nom/prénom/note ...">
<hr>
<div id="registrations_table"> <div id="registrations_table">
{% if table.data %} {% if table.data %}
{% render_table table %} {% render_table table %}
{% else %} {% else %}
<div class="alert alert-warning"> <div class="alert alert-warning">
{% trans "There is no pre-registration found with this pattern." %} {% trans "There is no pre-registration found with this pattern." %}
</div> </div>
{% endif %} {% endif %}
</div>
</div> </div>
<a href="{% url 'wei:wei_memberships' pk=club.pk %}"> <div class="card-footer text-center">
<button class="btn btn-block btn-info">{% trans "View validated memberships..." %}</button> <a href="{% url 'wei:wei_memberships' pk=club.pk %}">
</a> <button class="btn btn-block btn-info">{% trans "View validated memberships..." %}</button>
</a>
</div>
</div>
{% endblock %} {% endblock %}
{% block extrajavascript %} {% block extrajavascript %}