2020-08-23 08:06:16 +00:00
|
|
|
{% extends "wei/base.html" %}
|
2020-09-01 08:20:16 +00:00
|
|
|
{% comment %}
|
|
|
|
SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
{% endcomment %}
|
2020-04-21 15:49:06 +00:00
|
|
|
{% load i18n %}
|
|
|
|
{% load render_table from django_tables2 %}
|
|
|
|
|
|
|
|
{% block profile_content %}
|
2021-08-23 17:00:26 +00:00
|
|
|
<div class="card">
|
|
|
|
<div class="card-body">
|
|
|
|
<input id="searchbar" type="text" class="form-control" placeholder="Nom/prénom/note ...">
|
|
|
|
<hr>
|
2020-04-21 15:49:06 +00:00
|
|
|
|
2021-08-23 17:00:26 +00:00
|
|
|
<div id="registrations_table">
|
|
|
|
{% if table.data %}
|
|
|
|
{% render_table table %}
|
|
|
|
{% else %}
|
|
|
|
<div class="alert alert-warning">
|
|
|
|
{% trans "There is no pre-registration found with this pattern." %}
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
2020-04-21 15:49:06 +00:00
|
|
|
</div>
|
|
|
|
|
2021-08-23 17:00:26 +00:00
|
|
|
<div class="card-footer text-center">
|
|
|
|
<a href="{% url 'wei:wei_memberships' pk=club.pk %}">
|
|
|
|
<button class="btn btn-block btn-info">{% trans "View validated memberships..." %}</button>
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
2020-04-21 15:49:06 +00:00
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
{% block extrajavascript %}
|
|
|
|
<script type="text/javascript">
|
|
|
|
$(document).ready(function() {
|
|
|
|
let old_pattern = null;
|
|
|
|
let searchbar_obj = $("#searchbar");
|
|
|
|
|
|
|
|
function reloadTable() {
|
|
|
|
let pattern = searchbar_obj.val();
|
|
|
|
|
|
|
|
if (pattern === old_pattern)
|
|
|
|
return;
|
|
|
|
|
|
|
|
$("#registrations_table").load(location.pathname + "?search=" + pattern.replace(" ", "%20") + " #registrations_table");
|
|
|
|
}
|
|
|
|
|
|
|
|
searchbar_obj.keyup(reloadTable);
|
2020-08-04 18:04:41 +00:00
|
|
|
|
|
|
|
$(".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");
|
|
|
|
$("#validate-membership-header").addClass("d-none");
|
|
|
|
}
|
|
|
|
if ($("a[data-type='delete-membership']:not(.d-none)").length === 0) {
|
|
|
|
$("a[data-type='delete-membership']").parent().addClass("d-none");
|
|
|
|
$("#delete-membership-header").addClass("d-none");
|
|
|
|
}
|
2020-04-21 15:49:06 +00:00
|
|
|
});
|
|
|
|
</script>
|
|
|
|
{% endblock %}
|