Commit 14b919c0 authored by Baptiste Jonglez's avatar Baptiste Jonglez

Ajout d'un bout de js pour rechercher dans les utilisateurs

Nécessite un jquery plus récent

(patch de quota de février 2016)
parent 4bbf1f5c
This diff is collapsed.
This diff is collapsed.
......@@ -6,6 +6,7 @@
{% if not users %}
<div class="alert">Il n'y a aucun utilisateur.</div>
{% else %}
<input id="filter" type="text" class="form-control" placeholder="Rechercher...">
<table class="table table-striped">
<thead>
<tr>
......@@ -16,7 +17,7 @@
<th>Actions</th>
</tr>
</thead>
<tbody>
<tbody class="searchable">
{% for user in users %}
<tr>
<td>{{ user.email }}</td>
......@@ -47,6 +48,5 @@
<p>
{% endif %}
<a class="pull-right btn btn-primary btn-small" href="{{ url_for('admin_user_add') }}">+ Ajouter un utilisateur</a>
{% endblock %}
......@@ -70,7 +70,26 @@
</div>
</div> <!-- container -->
<script src="{{ url_for('static', filename='js/jquery.js') }}"></script>
<script src="{{ url_for('static', filename='js/jquery-1.12.0.min.js') }}"></script>
<script src="{{ url_for('static', filename='js/bootstrap.js') }}"></script>
<script>
$(document).ready(function () {
(function ($) {
$('#filter').keyup(function () {
var rex = new RegExp($(this).val(), 'i');
$('.searchable tr').hide();
$('.searchable tr').filter(function () {
return rex.test($(this).text());
}).show();
})
}(jQuery));
});
</script>
</body>
</html>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment