Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
irfm
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
6
Issues
6
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
regardscitoyens
irfm
Commits
bd0b6c7d
Commit
bd0b6c7d
authored
May 05, 2017
by
Nicolas Joyard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ajout filtrage liste parlementaires
parent
40326940
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
1 deletion
+27
-1
irfm/templates/list.html.j2
irfm/templates/list.html.j2
+27
-1
No files found.
irfm/templates/list.html.j2
View file @
bd0b6c7d
...
...
@@ -6,7 +6,14 @@
<b>Liste des {{ parlementaires|length }} parlementaires</b>
</header>
<table class="table table-condensed table-striped sortable">
<article class="panel-body">
<div class="input-group">
<span class="input-group-addon" id="search-header">Filtrer les parlementaires</span>
<input type="search" autocomplete="off" class="form-control" id="search" placeholder="Nom, groupe, circonscription..." aria-describedby="search-header">
</div>
</article>
<table class="table table-condensed table-striped sortable searchable">
<thead>
<tr>
<th colspan="2" data-defaultsort="asc" data-mainsort="1">Parlementaire</th>
...
...
@@ -21,6 +28,7 @@
<tr>
<td>
<img class="chamber-icon" src="{{ url_for('static', filename=parl.chambre|lower+'.png') }}">
<span class="search-vector">{{ parl.nom }} {{ parl.prenom }} {{ parl.nom_circo }} {{ parl.num_deptmt }} {{ parl.groupe_sigle }} {{ parl.groupe }}</span>
</td>
<td data-value="{{ parl.nom }} {{ parl.prenom }}">{{ parl.prenom }} {{ parl.nom }}</td>
<td>{{ parl.groupe_sigle }}</td>
...
...
@@ -44,10 +52,28 @@
{% block header %}
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='bootstrap-sortable.css') }}">
<style>
.search-vector { display: none; }
</style>
{% endblock %}
{% block scripts %}
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
<script src="{{ url_for('static', filename='moment.min.js') }}"></script>
<script src="{{ url_for('static', filename='bootstrap-sortable.js') }}"></script>
<script>
$(document).ready(function () {
(function ($) {
$('#search').keyup(function () {
var rex = new RegExp($(this).val(), 'i');
$('.searchable tbody tr').hide();
$('.searchable tbody tr').filter(function () {
return rex.test($(this).find('.search-vector').text());
}).show();
});
}(jQuery));
});
</script>
{% endblock %}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment