From 8101f07566c6a361b3ab3ca0bed4001aa2137a9b Mon Sep 17 00:00:00 2001 From: echarp Date: Tue, 4 Feb 2020 21:22:42 +0100 Subject: [PATCH] Organisation listing slightly modified Refs #165 --- app/assets/javascripts/list.js.coffee | 6 ++++-- app/views/orgas/_orga.html.haml | 8 ++++++-- app/views/orgas/index.html.haml | 2 +- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/app/assets/javascripts/list.js.coffee b/app/assets/javascripts/list.js.coffee index 6d81e668..83996fe2 100644 --- a/app/assets/javascripts/list.js.coffee +++ b/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' diff --git a/app/views/orgas/_orga.html.haml b/app/views/orgas/_orga.html.haml index de7eb1e7..ab5e8f5f 100644 --- a/app/views/orgas/_orga.html.haml +++ b/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 diff --git a/app/views/orgas/index.html.haml b/app/views/orgas/index.html.haml index 4d8914c0..a27e0773 100644 --- a/app/views/orgas/index.html.haml +++ b/app/views/orgas/index.html.haml @@ -18,4 +18,4 @@ %tfoot %tr - %th(colspan='12')= paginate @orgas + %th(colspan='9')= paginate @orgas