From 1200d25f264f3d81299a8bdd3a35e16d23b0d1eb Mon Sep 17 00:00:00 2001 From: benjaminhenkel Date: Mon, 24 Jun 2019 17:00:10 +0200 Subject: [PATCH 1/7] Update _list.html.haml --- app/views/admin/procedures/_list.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/admin/procedures/_list.html.haml b/app/views/admin/procedures/_list.html.haml index 833a6a6fc..e47503397 100644 --- a/app/views/admin/procedures/_list.html.haml +++ b/app/views/admin/procedures/_list.html.haml @@ -26,7 +26,7 @@ %td = link_to('Cloner', admin_procedure_clone_path(procedure.id), data: { method: :put }, class: 'btn-sm btn-primary clone-btn') - if !procedure.publiee_ou_archivee? - = link_to('X', url_for(controller: 'admin/procedures', action: :destroy, id: procedure.id), data: { method: :delete, confirm: "Confirmez-vous la suppression de la démarche ?" }, class: 'btn-sm btn-danger') + = link_to('X', url_for(controller: 'admin/procedures', action: :destroy, id: procedure.id), data: { method: :delete, confirm: "Confirmez-vous la suppression de la démarche ? \n\n Attention : toute suppression est définitive et s’appliquera aux éventuels autres administrateurs de cette démarche !" }, class: 'btn-sm btn-danger') = smart_listing.paginate = smart_listing.pagination_per_page_links From c5704fa22fcc65b15f04077c58d51300b658368b Mon Sep 17 00:00:00 2001 From: Paul Chavard Date: Tue, 25 Jun 2019 16:37:24 +0200 Subject: [PATCH 2/7] Remove unused code from Commentaire --- app/models/commentaire.rb | 1 - app/views/shared/dossiers/messages/_message.html.haml | 7 +------ spec/models/commentaire_spec.rb | 2 -- 3 files changed, 1 insertion(+), 9 deletions(-) diff --git a/app/models/commentaire.rb b/app/models/commentaire.rb index 68b571164..866593071 100644 --- a/app/models/commentaire.rb +++ b/app/models/commentaire.rb @@ -1,6 +1,5 @@ class Commentaire < ApplicationRecord belongs_to :dossier, inverse_of: :commentaires, touch: true - belongs_to :piece_justificative belongs_to :user belongs_to :gestionnaire diff --git a/app/views/shared/dossiers/messages/_message.html.haml b/app/views/shared/dossiers/messages/_message.html.haml index 518fbc191..74f314ad8 100644 --- a/app/views/shared/dossiers/messages/_message.html.haml +++ b/app/views/shared/dossiers/messages/_message.html.haml @@ -10,12 +10,7 @@ = commentaire_date(commentaire) .rich-text= sanitize(simple_format(commentaire.body)) - - if commentaire.piece_justificative - .attachment-link - = link_to commentaire.piece_justificative.content_url, class: "button", target: "_blank", rel: "noopener", title: "Télécharger" do - %span.icon.attachment - = commentaire.piece_justificative.original_filename - - elsif commentaire.file.present? + - if commentaire.file.present? .attachment-link = link_to commentaire.file_url, class: "button", target: "_blank", rel: "noopener", title: "Télécharger" do %span.icon.attachment diff --git a/spec/models/commentaire_spec.rb b/spec/models/commentaire_spec.rb index 0c58a56bf..9822f15db 100644 --- a/spec/models/commentaire_spec.rb +++ b/spec/models/commentaire_spec.rb @@ -7,8 +7,6 @@ describe Commentaire do it { is_expected.to have_db_column(:updated_at) } it { is_expected.to belong_to(:dossier) } - it { is_expected.to belong_to(:piece_justificative) } - describe "#notify" do let(:procedure) { create(:procedure) } let(:gestionnaire) { create(:gestionnaire) } From 7064f7e97332280c7faec264834ec38ed8c84c62 Mon Sep 17 00:00:00 2001 From: clemkeirua Date: Tue, 25 Jun 2019 17:13:52 +0200 Subject: [PATCH 3/7] enable crisp websockets and css --- config/initializers/content_security_policy.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config/initializers/content_security_policy.rb b/config/initializers/content_security_policy.rb index 9d46a3874..80adc4584 100644 --- a/config/initializers/content_security_policy.rb +++ b/config/initializers/content_security_policy.rb @@ -13,7 +13,8 @@ Rails.application.config.content_security_policy do |policy| # Pour les CSS, on a beaucoup de style inline et quelques balises