Browse Source

Organisation listing slightly modified

Refs #165
remotes/origin/master
echarp 2 years ago
parent
commit
8101f07566
  1. 6
      app/assets/javascripts/list.js.coffee
  2. 8
      app/views/orgas/_orga.html.haml
  3. 2
      app/views/orgas/index.html.haml

6
app/assets/javascripts/list.js.coffee

@ -22,6 +22,8 @@ $(document).on 'ajax:success', '.pagination .next a', (event, data) ->
# Clicking on a table.list row
visit = (elt) =>
elt.closest('tr').addClass('view').click ->
Turbolinks.visit elt.attr 'href'
elt.closest('tr').addClass('view').click (event) ->
target = $(event.target)
unless target.attr('target')? or target.parents('a').attr('target')?
Turbolinks.visit elt.attr 'href'

8
app/views/orgas/_orga.html.haml

@ -1,4 +1,4 @@
%tr{ class: orga.active ? 'active' : 'inactive' }
%tr{ class: orga.active ? 'active' : 'inactive', title: orga.tag_list }
%td.kind
- if orga.kind
%em.fa{ class: "fa-#{orga.kind.icon}",
@ -12,11 +12,15 @@
%td.updated_at
- if orga.updated_at.present?
= l orga.updated_at.to_date
%td.tags{ title: orga.tag_list }
%td.tags
- if orga.tags.count > 1
%em.fa.fa-tags
- elsif orga.tags.count.positive?
%em.fa.fa-tag
%td.url
- if orga.url
= link_to orga.url, target: '_blank' do
%em.fa.fa-external-link-alt
%td.view
= link_to orga_path orga, q: params[:q].permit, page: params[:page] do
%em.fa.fa-arrow-circle-right

2
app/views/orgas/index.html.haml

@ -18,4 +18,4 @@
%tfoot
%tr
%th(colspan='12')= paginate @orgas
%th(colspan='9')= paginate @orgas

Loading…
Cancel
Save