agenda-libre-ruby/app/views/orgas/index.html.haml

48 lines
1.4 KiB
Plaintext

= render 'search'
= render '/regions/selector'
%h2
%em.fa.fa-users
= title t 'orgas.search.title', entity: Orga.model_name.human
%table.list.autopagerize_page_element
%thead
%th= sort_link @search, :kind_name, Orga.human_attribute_name(:kind)
%th= sort_link @search, :name
%th= sort_link @search, :city
%th= sort_link @search, :department
%th= sort_link @search, :region_name, Orga.human_attribute_name(:region)
%th= sort_link @search, :updated_at, Orga.human_attribute_name(:updated_at)
%th/
%th/
%th/
%tbody
- @orgas.each do |orga|
%tr{ class: orga.active ? 'active' : 'inactive' }
%td
- if orga.kind
%em.fa{ class: "fa-#{orga.kind.icon}",
title: Kind.human_attribute_name("name_#{orga.kind.name}") }
%td
= orga.name
- if orga.url =~ /^http/
= image_tag orga.url + '/favicon.ico', alt: '', class: :favicon
%td= orga.city
%td= orga.department
%td= orga.region
%td
- if orga.updated_at.present?
= l orga.updated_at.to_date
%td
= link_to orga.url do
%em.fa.fa-external-link
%td
= link_to orga_path(orga, q: params[:q], page: params[:page]) do
%em.fa.fa-eye
%td
= link_to edit_orga_path orga do
%em.fa.fa-pencil
= paginate @orgas