agenda-libre-ruby/app/views/orgas/_types.haml

24 lines
895 B
Plaintext

- params[:q] = {} if params[:q].nil?
- p = params[:q].clone.permit
%ul.counters
-# The reorder and specific count are required for the "near" scope
- @unfiltered_orgas.reorder('').group(:kind).count(:all).each do |kind, count|
- p[:kind_id_eq] = kind.id
%li{ title: Kind.human_attribute_name("name_#{kind.name}") }
= link_to orgas_url(q: p, active: params[:active]) do
%em.fa{ class: "fa-#{kind.icon}" }
= count
- count = @unfiltered_orgas.count :all
- if count.positive?
%li{ title: Kind.human_attribute_name('active').pluralize + '?' }
- p[:kind_id_eq] = params[:q][:kind_id_eq]
\/
= link_to orgas_url(q: p, active: params[:active].present? && params[:active] != 'true') do
- if params[:active].nil? || params[:active] == 'true'
%em.fa.fa-heartbeat
- else
%em.fa.fa-heart-broken
= count