Merge branch 'develop' into staging

This commit is contained in:
Simon Lehericey 2017-03-13 14:01:16 +01:00
commit 49e17d7a51
6 changed files with 21 additions and 19 deletions

View file

@ -39,7 +39,7 @@ class Procedure < ActiveRecord::Base
MAIL_TEMPLATE_TYPES = %w(InitiatedMail ReceivedMail ClosedMail RefusedMail WithoutContinuationMail) MAIL_TEMPLATE_TYPES = %w(InitiatedMail ReceivedMail ClosedMail RefusedMail WithoutContinuationMail)
MAIL_TEMPLATE_TYPES.each do |name| MAIL_TEMPLATE_TYPES.each do |name|
has_one "#{name.underscore}".to_sym, class_name: "Mails::#{name}" has_one "#{name.underscore}".to_sym, class_name: "Mails::#{name}", dependent: :destroy
define_method("#{name.underscore}_with_override") do define_method("#{name.underscore}_with_override") do
self.send("#{name.underscore}_without_override") || Object.const_get("Mails::#{name}").default self.send("#{name.underscore}_without_override") || Object.const_get("Mails::#{name}").default
end end

View file

@ -14,5 +14,5 @@
.col-xs-3 .col-xs-3
= form_tag invites_dossier_path(dossier_id: @facade.dossier.id), method: :post, class: 'form-inline' do = form_tag invites_dossier_path(dossier_id: @facade.dossier.id), method: :post, class: 'form-inline' do
= text_field_tag :email, '', class: 'form-control', placeholder: 'Envoyer une invitation' = text_field_tag :email, '', class: 'form-control', placeholder: 'Envoyer une invitation'
= submit_tag 'Ajouter', class: 'btn btn-success', id: 'send-invitation' = submit_tag 'Ajouter', class: 'btn btn-success', id: 'send-invitation', data: {confirm: "Envoyer l'invitation ?"}

View file

@ -5,19 +5,21 @@
#action-block #action-block
- if gestionnaire_signed_in? - if gestionnaire_signed_in?
- if !@facade.dossier.read_only? || @facade.dossier.initiated? - if !@facade.dossier.read_only? || @facade.dossier.initiated?
= link_to 'Passer en instruction', backoffice_dossier_receive_path(@facade.dossier), method: :post, class: 'btn btn-danger btn-block' = link_to 'Passer en instruction', backoffice_dossier_receive_path(@facade.dossier), method: :post, class: 'btn btn-danger btn-block', data: { confirm: "Confirmer vous le passage en instruction de ce dossier ?" }
- elsif @facade.dossier.received? - elsif @facade.dossier.received?
= form_tag(url_for({controller: 'backoffice/dossiers', action: :close, dossier_id: @facade.dossier.id}), class: 'form-inline action_button', method: 'POST', style: 'display:inline', 'data-toggle' => :tooltip, title: 'Accepter') do %ul.list-inline
%button.action.close-dossier %li
= link_to url_for({controller: 'backoffice/dossiers', action: :close, dossier_id: @facade.dossier.id}), class: 'btn btn-success', method: :post, title: 'Accepter', data: { toggle: :tooltip, confirm: "Accepter ce dossier ?" } do
%i.fa.fa-check %i.fa.fa-check
= form_tag(url_for({controller: 'backoffice/dossiers', action: :without_continuation, dossier_id: @facade.dossier.id}), class: 'form-inline action_button', method: 'POST', style: 'display:inline', 'data-toggle' => :tooltip, title: 'Classer sans suite') do %li
%button.action.forget-dossier = link_to url_for({controller: 'backoffice/dossiers', action: :without_continuation, dossier_id: @facade.dossier.id}), class: 'btn btn-warning', method: :post, title: 'Classer sans suite', data: { toggle: :tooltip, confirm: "Classer sans suite ce dossier ?" } do
%i.fa.fa-circle-o %i.fa.fa-circle-o
= form_tag(url_for({controller: 'backoffice/dossiers', action: :refuse, dossier_id: @facade.dossier.id}), class: 'form-inline action_button', method: 'POST', style: 'display:inline', 'data-toggle' => :tooltip, title: 'Refuser') do %li
%button.action.refuse-dossier = link_to url_for({controller: 'backoffice/dossiers', action: :refuse, dossier_id: @facade.dossier.id}), class: 'btn btn-danger', method: :post, title: 'Refuser', data: { toggle: :tooltip, confirm: "Refuser ce dossier ?" } do
%i.fa.fa-times %i.fa.fa-times
= link_to 'Reouvrir', backoffice_dossier_reopen_path(@facade.dossier), method: :post, class: 'btn btn-default btn-block'
= link_to 'Reouvrir', backoffice_dossier_reopen_path(@facade.dossier), method: :post, class: 'btn btn-default btn-block', data: { confirm: "Confirmer vous la réouverture de ce dossier ?" }
%hr %hr
- if @facade.dossier.archived? - if @facade.dossier.archived?
@ -26,7 +28,7 @@
= link_to 'Désarchiver', unarchive_backoffice_dossier_path(@facade.dossier), method: :post, class: 'btn btn-default btn-block' = link_to 'Désarchiver', unarchive_backoffice_dossier_path(@facade.dossier), method: :post, class: 'btn btn-default btn-block'
- else - else
= link_to 'Archiver', archive_backoffice_dossier_path(@facade.dossier), method: :post, class: 'btn btn-default btn-block' = link_to 'Archiver', archive_backoffice_dossier_path(@facade.dossier), method: :post, class: 'btn btn-default btn-block', data: { confirm: "Confirmer vous l'archivage de ce dossier ?" }

View file

@ -38,4 +38,4 @@
%li %li
= form_tag invites_dossier_path(dossier_id: @facade.dossier.id), method: :post, class: 'form-inline', id: 'send-invitation' do = form_tag invites_dossier_path(dossier_id: @facade.dossier.id), method: :post, class: 'form-inline', id: 'send-invitation' do
= text_field_tag :email, '', class: 'form-control', placeholder: 'Envoyer une invitation', id: 'invitation-email' = text_field_tag :email, '', class: 'form-control', placeholder: 'Envoyer une invitation', id: 'invitation-email'
= submit_tag 'Ajouter', class: 'btn btn-success' = submit_tag 'Ajouter', class: 'btn btn-success', data: {confirm: "Envoyer l'invitation ?"}

View file

@ -28,4 +28,4 @@
%li %li
= form_tag invites_dossier_path(dossier_id: @facade.dossier.id), method: :post, class: 'form-inline', id: 'send-invitation' do = form_tag invites_dossier_path(dossier_id: @facade.dossier.id), method: :post, class: 'form-inline', id: 'send-invitation' do
= text_field_tag :email, '', class: 'form-control', placeholder: 'Envoyer une invitation', id: 'invitation-email' = text_field_tag :email, '', class: 'form-control', placeholder: 'Envoyer une invitation', id: 'invitation-email'
= submit_tag 'Ajouter', class: 'btn btn-success' = submit_tag 'Ajouter', class: 'btn btn-success', data: {confirm: "Envoyer l'invitation ?"}

View file

@ -75,9 +75,9 @@ describe 'layouts/left_panels/_left_panel_backoffice_dossierscontroller_show.htm
it { expect(rendered).to have_content('En instruction') } it { expect(rendered).to have_content('En instruction') }
it 'button accepter / refuser / classer sans suite are present' do it 'button accepter / refuser / classer sans suite are present' do
expect(rendered).to have_css('form[data-toggle="tooltip"][title="Accepter"]') expect(rendered).to have_css('a[title="Accepter"]')
expect(rendered).to have_css('form[data-toggle="tooltip"][title="Classer sans suite"]') expect(rendered).to have_css('a[title="Classer sans suite"]')
expect(rendered).to have_css('form[data-toggle="tooltip"][title="Refuser"]') expect(rendered).to have_css('a[title="Refuser"]')
end end
end end