Commit 4a0b9071 authored by alexandre's avatar alexandre

Score list sorting

parent 933149f4
......@@ -2402,6 +2402,28 @@ window.W = window.W || {};
className: 'scores__filters panel panel--right',
triggers: {
'click .js-sort-by-title': 'sortByTitle',
'click .js-sort-by-date': 'sortByDate'
},
onSortByTitle: function() {
console.log("ok");
this.collection.state.sortKey = "title";
this.collection.fetch();
// this.collection.setSorting("title");
// this.collection.sort();
},
onSortByDate: function() {
console.log("ok");
this.collection.state.sortKey = "-created_at";
this.collection.fetch();
// this.collection.setSorting("-created_at");
// this.collection.sort();
},
regions: {
search: {
el: '#search',
......
<p><%- t('Classer') %>: <span class="js-sort-by-title"><%- t('Par titre') %></span> <span class="js-sort-by-date"><%- t('Par date') %></span></p>
<br>
<h1 class="search__heading">Recherche</h1>
<form class="search__form panel-form" action="search_submit" method="get" accept-charset="utf-8">
<input class="search__textfield search-input panel-form__textfield" type="text" placeholder="<%- t('Titre ou auteur') %>">
......
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