Merge branch 'develop' into staging

This commit is contained in:
Xavier J 2016-10-27 14:03:16 +02:00
commit ed01f48464
13 changed files with 30 additions and 17 deletions

View file

@ -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 <i class="fa fa-chevron-down" />')
}
});
}

View file

@ -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é.'

View file

@ -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é'

View file

@ -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

View file

@ -6,7 +6,7 @@ class MailReceived < MailTemplate
self.body ||= "Bonjour,
<br>
<br>
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.<br>
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.<br>
<br>
En vous souhaitant une bonne journée,
<br>

View file

@ -15,6 +15,7 @@ class TypeDeChamp < ActiveRecord::Base
pays: 'pays',
regions: 'regions',
departements: 'departements',
engagement: 'engagement',
header_section: 'header_section'
}

View file

@ -20,7 +20,11 @@ class PieceJustificativeUploader < CarrierWave::Uploader::Base
def cache_dir
if Rails.env.production?
if Features.opensimplif?
'/tmp/opensimplif-cache'
else
'/tmp/tps-cache'
end
else
'/tmp/tps-dev-cache'
end

View file

@ -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"}

View file

@ -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}

View file

@ -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/, '<br>').html_safe

View file

@ -1,3 +1,3 @@
remote_storage: true
unified_login: true
opensimplif: true
unified_login: false
opensimplif: false

View file

@ -20,4 +20,5 @@ fr:
pays: 'Pays'
regions: 'Régions'
departements: 'Départements'
engagement: 'Engagement'
header_section: 'Titre de section'

View file

@ -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