2019-09-23 10:50:14 +00:00
|
|
|
{% extends "base.html" %}
|
|
|
|
{% load render_table from django_tables2 %}
|
2020-04-16 21:31:36 +00:00
|
|
|
{% load crispy_forms_tags %}
|
|
|
|
{% load i18n %}
|
2020-08-01 13:47:45 +00:00
|
|
|
{% load perms %}
|
2020-04-16 21:31:36 +00:00
|
|
|
|
2019-09-23 10:50:14 +00:00
|
|
|
{% block content %}
|
2020-04-01 18:14:16 +00:00
|
|
|
<input id="searchbar" type="text" class="form-control" placeholder="Nom/prénom/note/section ...">
|
2019-09-23 10:50:14 +00:00
|
|
|
|
2020-04-01 18:14:16 +00:00
|
|
|
<hr>
|
2019-09-23 10:50:14 +00:00
|
|
|
|
2020-04-01 18:14:16 +00:00
|
|
|
<div id="user_table">
|
2020-04-06 06:58:39 +00:00
|
|
|
{% if table.data %}
|
|
|
|
{% render_table table %}
|
|
|
|
{% else %}
|
|
|
|
<div class="alert alert-warning">
|
2020-04-16 21:31:36 +00:00
|
|
|
{% trans "There is no user with this pattern." %}
|
2020-04-06 06:58:39 +00:00
|
|
|
</div>
|
|
|
|
{% endif %}
|
2019-09-23 10:50:14 +00:00
|
|
|
</div>
|
|
|
|
|
2020-08-01 13:47:45 +00:00
|
|
|
<hr>
|
|
|
|
|
|
|
|
{% if "member.change_profile_registration_valid"|has_perm:user %}
|
|
|
|
<a class="btn btn-block btn-secondary" href="{% url 'registration:future_user_list' %}">
|
|
|
|
<i class="fas fa-user-plus"></i> {% trans "Registrations" %}
|
|
|
|
</a>
|
|
|
|
{% endif %}
|
2019-09-23 10:50:14 +00:00
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
{% block extrajavascript %}
|
|
|
|
<script type="text/javascript">
|
2020-04-01 18:14:16 +00:00
|
|
|
$(document).ready(function() {
|
|
|
|
let old_pattern = null;
|
|
|
|
let searchbar_obj = $("#searchbar");
|
2020-06-21 20:27:32 +00:00
|
|
|
var timer_on = false;
|
|
|
|
var timer;
|
2019-09-23 10:50:14 +00:00
|
|
|
|
2020-04-01 18:14:16 +00:00
|
|
|
function reloadTable() {
|
|
|
|
let pattern = searchbar_obj.val();
|
|
|
|
|
|
|
|
if (pattern === old_pattern || pattern === "")
|
|
|
|
return;
|
|
|
|
|
2020-07-30 13:49:59 +00:00
|
|
|
$("#user_table").load(location.pathname + "?search=" + pattern.replace(" ", "%20") + " #user_table", init);
|
2020-04-01 18:14:16 +00:00
|
|
|
}
|
2019-09-23 10:50:14 +00:00
|
|
|
|
2020-06-21 20:27:32 +00:00
|
|
|
searchbar_obj.keyup(function() {
|
|
|
|
if (timer_on)
|
|
|
|
clearTimeout(timer);
|
|
|
|
timer_on = true;
|
|
|
|
setTimeout(reloadTable, 0);
|
|
|
|
});
|
2020-04-01 18:14:16 +00:00
|
|
|
|
|
|
|
function init() {
|
|
|
|
$(".table-row").click(function() {
|
|
|
|
window.document.location = $(this).data("href");
|
2020-06-21 20:27:32 +00:00
|
|
|
timer_on = false;
|
2020-04-01 18:14:16 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
init();
|
|
|
|
});
|
2019-09-23 10:50:14 +00:00
|
|
|
</script>
|
|
|
|
{% endblock %}
|