From 5a979f96dccedd5731000037a9297a0dc6f83386 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Barnab=C3=A9?= Date: Thu, 23 Sep 2021 12:36:05 +0200 Subject: [PATCH] Select all p_customer_sheets export --- app/models/p_customer_sheet.rb | 2 +- .../admin/p_customer_sheets/index.html.haml | 18 +++++++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/app/models/p_customer_sheet.rb b/app/models/p_customer_sheet.rb index b09c5f4..158e723 100644 --- a/app/models/p_customer_sheet.rb +++ b/app/models/p_customer_sheet.rb @@ -40,7 +40,7 @@ class PCustomerSheet < ApplicationRecord :tot_amount_ht => {:name => "Total HT", :reorder => true, :sort_name => "cc_tot_amount_ht", :sort_name => "p_customer_sheets.cc_tot_amount_ht"}, :tot_amount_ttc => {:name => "Total TTC", :reorder => true, :sort_name => "cc_tot_amount_ttc", :sort_name => "p_customer_sheets.cc_tot_amount_ttc"}, :state => {:name => "Statut", :reorder => false, :as => :state}, - :check_box => {:name => "Export excel", :reorder => false}, + :check_box => {:name => "Export excel #{''}", :reorder => false}, :actions => {:name => "Actions", :reorder => false}, } diff --git a/app/views/admin/p_customer_sheets/index.html.haml b/app/views/admin/p_customer_sheets/index.html.haml index ad62a4b..f61d281 100644 --- a/app/views/admin/p_customer_sheets/index.html.haml +++ b/app/views/admin/p_customer_sheets/index.html.haml @@ -199,7 +199,7 @@ Attention ! %br %br - Selection de plusieurs clients détécté + Selection de plusieurs clients détéctée %br Vous avez selectionné des commandes liées à différents clients. %br @@ -213,6 +213,17 @@ Confirmer :javascript + $("#check-all").parent().on("click", function(event) { + console.log(event.currentTarget) + event.currentTarget.classList.toggle("checked") + if(event.currentTarget.classList.contains("checked")){ + $('.table input[type=checkbox]').prop("checked", true) + }else{ + $('.table input[type=checkbox]').prop("checked", false) + } + }) + + "#dataTable tbody tr" function submitExport() { $('#export-form').submit() } @@ -235,4 +246,9 @@ } +:scss + th > i { + cursor: pointer; + } +