Add sort list on demo page
This commit is contained in:
parent
afd6d443f3
commit
47932890cc
7 changed files with 47 additions and 22 deletions
27
app/views/demo/_list.html.haml
Normal file
27
app/views/demo/_list.html.haml
Normal file
|
@ -0,0 +1,27 @@
|
|||
- unless smart_listing.empty?
|
||||
%table.table
|
||||
%tr
|
||||
%th{colspan: 4}
|
||||
%h4 Lien vers les procédures TPS
|
||||
%tr
|
||||
%th= smart_listing.sortable 'ID', 'id'
|
||||
%th= smart_listing.sortable 'Titre', 'libelle'
|
||||
%th Description
|
||||
%th= smart_listing.sortable 'Organisation', 'organisation'
|
||||
|
||||
- smart_listing.collection.each do |procedure|
|
||||
- procedure = procedure.decorate
|
||||
%tr
|
||||
%td
|
||||
= procedure.id
|
||||
%td.col-md-4.col-lg-4
|
||||
= link_to procedure.libelle, procedure.lien
|
||||
%td
|
||||
= procedure.description
|
||||
%td.col-md-3.col-lg-3
|
||||
= procedure.organisation
|
||||
|
||||
= smart_listing.paginate
|
||||
= smart_listing.pagination_per_page_links
|
||||
- else
|
||||
%p Aucune procédure trouvée
|
|
@ -1,20 +1 @@
|
|||
%table.table
|
||||
%tr
|
||||
%th{colspan: 4}
|
||||
%h4 Lien vers les procédures TPS
|
||||
%tr
|
||||
%th ID
|
||||
%th Titre
|
||||
%th Description
|
||||
%th Organisation
|
||||
|
||||
- @procedures.each do |procedure|
|
||||
%tr
|
||||
%td
|
||||
= procedure.id
|
||||
%td.col-md-4.col-lg-4
|
||||
= link_to procedure.libelle, procedure.lien
|
||||
%td
|
||||
= procedure.description
|
||||
%td.col-md-3.col-lg-3
|
||||
= procedure.organisation
|
||||
= smart_listing_render :procedures
|
1
app/views/demo/index.js.erb
Normal file
1
app/views/demo/index.js.erb
Normal file
|
@ -0,0 +1 @@
|
|||
<%= smart_listing_update :procedures %>
|
Loading…
Add table
Add a link
Reference in a new issue