diff options
| -rw-r--r-- | app/assets/javascripts/selectable_table.coffee | 1 | ||||
| -rw-r--r-- | app/views/workbenches/show.html.slim | 66 |
2 files changed, 2 insertions, 65 deletions
diff --git a/app/assets/javascripts/selectable_table.coffee b/app/assets/javascripts/selectable_table.coffee index bb5fd6484..7cddc3744 100644 --- a/app/assets/javascripts/selectable_table.coffee +++ b/app/assets/javascripts/selectable_table.coffee @@ -3,6 +3,7 @@ selection = [] $(this).on 'click', "[type='checkbox']", (e)-> if e.currentTarget.id == '0' + selection = [] if e.currentTarget.checked $("[type='checkbox']").each -> $(this).prop('checked', true) diff --git a/app/views/workbenches/show.html.slim b/app/views/workbenches/show.html.slim index 17da76ec8..61175db98 100644 --- a/app/views/workbenches/show.html.slim +++ b/app/views/workbenches/show.html.slim @@ -36,7 +36,7 @@ = new_pagination @wbench_refs, 'pull-right' = table_builder @wbench_refs, - { @wbench_refs.human_attribute_name(:name) => 'name', @wbench_refs.human_attribute_name(:status) => 'status', + { @wbench_refs.human_attribute_name(:name) => 'name', @wbench_refs.human_attribute_name(:status) => Proc.new {|w| w.archived? ? ("<span class='fa fa-archive'></span> Conservé").html_safe : '-'}, 'Organisation' => Proc.new {|w| w.organisation.name}, @wbench_refs.human_attribute_name(:validity_period) => Proc.new {|w| w.validity_period.nil? ? '-' : t('validity_range', debut: l(w.try(:validity_period).try(:begin), format: :short), end: l(w.try(:validity_period).try(:end), format: :short))}, 'Nb lignes' => Proc.new {|w| w.lines.count}, @@ -46,70 +46,6 @@ :selectable, 'table' - / Old one - / table.table - / thead - / tr - / th = Referential.human_attribute_name(:name) - / th = Referential.human_attribute_name(:updated_at) - / th = "Publié le" - / th = Referential.human_attribute_name(:validity_period) - / th = Referential.human_attribute_name(:lines) - / th = Referential.human_attribute_name(:organisation) - / th = "Etat" - / th = "Actions" - / - / tbody - / - @wbench_refs.each do |referential| - / tr - / td = referential.name - / td = l referential.updated_at, format: :long - / td - / td - / - if referential.validity_period.nil? - / = Referential.human_attribute_name('no_validity_period') - / - else - / => Referential.human_attribute_name('start_validity_period') - / => l referential.validity_period.begin, format: :long - / => Referential.human_attribute_name('end_validity_period') - / => l referential.validity_period.end, format: :long - / - / td = referential.lines.count - / td = referential.organisation.name - / - / / Status (archived?) - / td.text-center - / - if referential.archived? - / span.fa.fa-archive title="Archivé" - / - else - / = "-" - / - / / Actions - / td.text-center - / .btn-group.btn-group-xs - / .btn-primary.btn.dropdown-toggle data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" - / span.fa.fa-bars - / span.caret - / - / ul.dropdown-menu - / li = link_to "Voir", referential_path(referential) - / - / - if policy(referential).update? - / li = link_to "Editer", edit_referential_path(referential) - / - / li = link_to "Cloner", new_referential_path(from: referential) - / - / - if referential.archived? - / - if referential.can_unarchive? - / li = link_to "Désarchiver", unarchive_referential_path(referential), method: :put - / - else - / li.disabled title="L'action est impossible pour ce référentiel" - / = link_to "Désarchiver", "#" - / - else - / li = link_to "Archiver", archive_referential_path(referential), method: :put - / - / li = link_to "Supprimer", referential_path(referential), method: :delete, :data => {:confirm => t('referentials.actions.destroy_confirm')} - = new_pagination @wbench_refs, 'pull-right' - else |
