diff --git a/app/assets/javascripts/description.js b/app/assets/javascripts/description.js index 652aadf06..d04e75a4b 100644 --- a/app/assets/javascripts/description.js +++ b/app/assets/javascripts/description.js @@ -63,11 +63,4 @@ function toggle_header_section_composents() { } }); }); - - $.each($("a.mask_section_button"), function (index, e) { - if (index != 0) { - $(e).click(); - $(e).html('Afficher la section ') - } - }); } \ No newline at end of file diff --git a/app/controllers/users/description_controller.rb b/app/controllers/users/description_controller.rb index 81021f13e..cf9c159af 100644 --- a/app/controllers/users/description_controller.rb +++ b/app/controllers/users/description_controller.rb @@ -65,7 +65,7 @@ class Users::DescriptionController < UsersController @dossier.initiated! end - flash.notice = 'Félicitation, votre demande a bien été enregistrée.' + flash.notice = 'Félicitations, votre demande a bien été enregistrée.' redirect_to url_for(controller: :recapitulatif, action: :show, dossier_id: @dossier.id) else flash.notice = 'Votre brouillon a bien été sauvegardé.' diff --git a/app/controllers/users/dossiers_controller.rb b/app/controllers/users/dossiers_controller.rb index 59ff595ea..8e175d8b2 100644 --- a/app/controllers/users/dossiers_controller.rb +++ b/app/controllers/users/dossiers_controller.rb @@ -132,7 +132,7 @@ class Users::DossiersController < UsersController end def destroy - dossier = Dossier.find(params[:id]) + dossier = current_user.dossiers.find(params[:id]) if dossier.brouillon? dossier.destroy flash.notice = 'Brouillon supprimé' diff --git a/app/controllers/users/recapitulatif_controller.rb b/app/controllers/users/recapitulatif_controller.rb index 214e8e594..8be4629a2 100644 --- a/app/controllers/users/recapitulatif_controller.rb +++ b/app/controllers/users/recapitulatif_controller.rb @@ -1,4 +1,5 @@ class Users::RecapitulatifController < UsersController + before_action only: [:show] do authorized_routes? self.class end @@ -27,7 +28,7 @@ class Users::RecapitulatifController < UsersController def self.route_authorization { - states: [:initiated, :replied, :updated, :validated, :submitted, :closed] + states: [:initiated, :replied, :updated, :validated, :received, :submitted, :without_continuation, :closed] } end diff --git a/app/models/mail_received.rb b/app/models/mail_received.rb index 232260865..d2980f188 100644 --- a/app/models/mail_received.rb +++ b/app/models/mail_received.rb @@ -6,7 +6,7 @@ class MailReceived < MailTemplate self.body ||= "Bonjour,

- Votre administration vous confirme la bonne réception de votre dossier n°--numero_dossier-- complet. Celui-ci sera instruit dans le délais légal déclaré par votre interlocuteur.
+ Votre administration vous confirme la bonne réception de votre dossier n°--numero_dossier-- complet. Celui-ci sera instruit dans le délai légal déclaré par votre interlocuteur.

En vous souhaitant une bonne journée,
diff --git a/app/models/type_de_champ.rb b/app/models/type_de_champ.rb index 7bf0b143b..553efdf4e 100644 --- a/app/models/type_de_champ.rb +++ b/app/models/type_de_champ.rb @@ -15,6 +15,7 @@ class TypeDeChamp < ActiveRecord::Base pays: 'pays', regions: 'regions', departements: 'departements', + engagement: 'engagement', header_section: 'header_section' } diff --git a/app/uploaders/piece_justificative_uploader.rb b/app/uploaders/piece_justificative_uploader.rb index 5f26b3d5f..868ca5bef 100644 --- a/app/uploaders/piece_justificative_uploader.rb +++ b/app/uploaders/piece_justificative_uploader.rb @@ -20,7 +20,11 @@ class PieceJustificativeUploader < CarrierWave::Uploader::Base def cache_dir if Rails.env.production? - '/tmp/tps-cache' + if Features.opensimplif? + '/tmp/opensimplif-cache' + else + '/tmp/tps-cache' + end else '/tmp/tps-dev-cache' end diff --git a/app/views/dossiers/_tab_objects_dossier.html.haml b/app/views/dossiers/_tab_objects_dossier.html.haml index b95c33a60..3384c2e26 100644 --- a/app/views/dossiers/_tab_objects_dossier.html.haml +++ b/app/views/dossiers/_tab_objects_dossier.html.haml @@ -11,7 +11,7 @@ %a{href: "#invites", 'aria-controls' => "invites", role: "tab", 'data-toggle' => "tab"} Invités - - if gestionnaire_signed_in? + - if gestionnaire_signed_in? && (!request.env['PATH_INFO'].include?('users/dossiers') ) %li{role: "presentation"} %a{href: "#followers", 'aria-controls' => "followers", role: "tab", 'data-toggle' => "tab"} Abonnés @@ -30,7 +30,7 @@ - if gestionnaire_signed_in? || @facade.dossier.owner?(current_user.email) %div{role: "tabpanel", class: "tab-pane fade", id:"invites"} = render partial: '/dossiers/invites' - - if gestionnaire_signed_in? + - if gestionnaire_signed_in? && !request.env['PATH_INFO'].include?('users/dossiers') %div{role: "tabpanel", class: "tab-pane fade", id:"followers"} = render partial: 'followers' %div{role: "tabpanel", class: "tab-pane fade", id:"champs_private"} diff --git a/app/views/users/description/_champs.html.haml b/app/views/users/description/_champs.html.haml index ee75df222..83fc7cc71 100644 --- a/app/views/users/description/_champs.html.haml +++ b/app/views/users/description/_champs.html.haml @@ -8,7 +8,7 @@ -actual_header_section = champ.id -else - - unless champ.type_champ == 'checkbox' + - unless champ.type_champ == 'checkbox' || champ.type_champ == 'engagement' %h4 = champ.libelle - if champ.mandatory? @@ -38,6 +38,9 @@ - elsif champ.type_champ == 'regions' =render partial: 'users/description/champs/regions', locals: {champ: champ} + - elsif champ.type_champ == 'engagement' + =render partial: 'users/description/champs/engagement', locals: {champ: champ} + - elsif champ.type_champ == 'departements' =render partial: 'users/description/champs/departements', locals: {champ: champ} diff --git a/app/views/users/description/champs/_engagement.html.haml b/app/views/users/description/champs/_engagement.html.haml new file mode 100644 index 000000000..9381266cf --- /dev/null +++ b/app/views/users/description/champs/_engagement.html.haml @@ -0,0 +1,8 @@ +%h4{style:'margin-left:15px;'} + = champ.libelle + - if champ.mandatory? + = '*' + %input{type: 'hidden', name:"champs['#{champ.id}']", id: "champs_#{champ.id}", value: ''} + %input{type: 'checkbox', style:'margin-left: 15px;', name:"champs['#{champ.id}']", id: "champs_#{champ.id}", checked: ('checked' if champ.value == 'on')} +%div{style:'margin-left: 5%; margin-right: 5%; text-align: justify; text-justify: inter-word;'} + = champ.description.gsub(/\r\n/, '
').html_safe \ No newline at end of file diff --git a/config/initializers/features.yml b/config/initializers/features.yml index 876c862b7..e77e684a6 100644 --- a/config/initializers/features.yml +++ b/config/initializers/features.yml @@ -1,3 +1,3 @@ remote_storage: true -unified_login: true -opensimplif: true \ No newline at end of file +unified_login: false +opensimplif: false diff --git a/config/locales/models/type_de_champ/fr.yml b/config/locales/models/type_de_champ/fr.yml index 2698aba3d..83d87828b 100644 --- a/config/locales/models/type_de_champ/fr.yml +++ b/config/locales/models/type_de_champ/fr.yml @@ -20,4 +20,5 @@ fr: pays: 'Pays' regions: 'Régions' departements: 'Départements' + engagement: 'Engagement' header_section: 'Titre de section' \ No newline at end of file diff --git a/spec/views/backoffice/dossiers/show.html.html_spec.rb b/spec/views/backoffice/dossiers/show.html.html_spec.rb index 89ef91ff3..1cd58d236 100644 --- a/spec/views/backoffice/dossiers/show.html.html_spec.rb +++ b/spec/views/backoffice/dossiers/show.html.html_spec.rb @@ -9,6 +9,8 @@ describe 'backoffice/dossiers/show.html.haml', type: :view do before do sign_in gestionnaire assign(:facade, (DossierFacades.new dossier.id, gestionnaire.email)) + + @request.env['PATH_INFO'] = 'backoffice/user' end context 'on the dossier gestionnaire page' do