Merge pull request #2151 from betagouv/dev

2018-06-26-01
This commit is contained in:
gregoirenovel 2018-06-26 18:06:41 +02:00 committed by GitHub
commit 7cd682fd4a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 56 additions and 15 deletions

View file

@ -38,6 +38,7 @@ function on_change_type_de_champ_select (){
break;
case 'drop_down_list':
case 'multiple_drop_down_list':
case 'linked_drop_down_list':
parent.children(".drop-down-list").addClass('show-inline');
break;
case 'piece_justificative':

View file

@ -110,6 +110,10 @@ $auth-breakpoint: $two-columns-breakpoint;
font-weight: bold;
}
}
.auth-signup-button {
white-space: nowrap;
}
}
.identity-form {

View file

@ -1,13 +1,16 @@
module TypeDeChampHelper
TOGGLES = {
'piece_justificative' => :champ_pj?,
'siret' => :champ_siret?,
'linked_drop_down_list' => :champ_linked_dropdown?
}
def tdc_options
tdcs = TypeDeChamp.type_de_champs_list_fr
if !Flipflop.champ_pj?
tdcs.reject! { |tdc| tdc.last == "piece_justificative" }
end
if !Flipflop.champ_siret?
tdcs.reject! { |tdc| tdc.last == "siret" }
tdcs.select! do |tdc|
toggle = TOGGLES[tdc.last]
toggle.blank? || Flipflop.send(toggle)
end
tdcs

View file

@ -0,0 +1,2 @@
class Champs::LinkedDropDownListChamp < Champ
end

View file

@ -13,6 +13,7 @@ class TypeDeChamp < ApplicationRecord
yes_no: 'yes_no',
drop_down_list: 'drop_down_list',
multiple_drop_down_list: 'multiple_drop_down_list',
linked_drop_down_list: 'linked_drop_down_list',
pays: 'pays',
regions: 'regions',
departements: 'departements',

View file

@ -0,0 +1,2 @@
class TypesDeChamp::LinkedDropDownListTypeDeChamp < TypeDeChamp
end

View file

@ -14,7 +14,7 @@
%h4 Description
= ff.text_area :description, class: 'form-control description', placeholder: 'Description', rows: 3
.form-group.drop-down-list{ class: (%w(drop_down_list multiple_drop_down_list).include?(type_champ) ? 'show-inline' : nil), style: 'margin-right: 5px;' }
.form-group.drop-down-list{ class: (%w(drop_down_list multiple_drop_down_list linked_drop_down_list).include?(type_champ) ? 'show-inline' : nil), style: 'margin-right: 5px;' }
%h4 Liste déroulante
= ff.fields_for :drop_down_list_attributes, ff.object.object.drop_down_list do |fff|
~ fff.text_area :value, class: 'form-control drop_down_list', placeholder: "Ecrire une valeur par ligne et --valeur-- pour un séparateur.", rows: 3, cols: 30

View file

@ -13,7 +13,9 @@
%p
Afin de vous accompagner dans la découverte de demarches-simplifiees.fr, je vous propose de mappeler pour faire un point sur vos besoins de dématérialisation.
%br
Vous pouvez me joindre au numéro suivant : 01 76 42 02 87.
Vous pouvez me joindre au numéro suivant :
= CONTACT_PHONE
\.
%p
Je vous invite également à consulter notre site de documentation qui regroupe l'ensemble des informations relatives à demarches-simplifiees.fr ainsi que des tutoriels dutilisation :

View file

@ -27,9 +27,11 @@
.contact-details
Vous avez besoin daide ? Contactez-nous :
%br
par téléphone : 01 76 42 02 87
par téléphone :
= link_to CONTACT_PHONE, "tel:#{CONTACT_PHONE}"
%br
= " par email : <a href='mailto:#{CONTACT_EMAIL}'>#{CONTACT_EMAIL}</a>"
par email :
= link_to CONTACT_EMAIL, "mailto:#{CONTACT_EMAIL}"
- if nav_bar_profile == :user
%ul.header-tabs

View file

@ -6,7 +6,8 @@ Cordialement,
%br
Équipe demarches-simplifiees.fr
%br
Téléphone (standard) : 01 76 42 02 87
Téléphone (standard) :
= CONTACT_PHONE
%br
Incubateur de Services Numériques / beta.gouv.fr
%br

View file

@ -6,6 +6,11 @@
%tr
%th.libelle SIRET :
%td= etablissement.siret
- if etablissement.siret != etablissement.entreprise.siret_siege_social
%tr
%th.libelle SIRET du siège social:
%td= etablissement.entreprise.siret_siege_social
%tr
%th.libelle Forme juridique :
%td= sanitize(etablissement.entreprise.forme_juridique)

View file

@ -44,5 +44,6 @@
= df.check_box :autorisation_donnees, required: true
J'accepte
= link_to "les CGU", CGU_URL, target: :blank
%span.mandatory *
= f.submit "Continuer", class: "button large primary expand"

View file

@ -57,4 +57,4 @@
%p.register
%span
Nouveau sur demarches-simplifiees.fr ?
= link_to "Créer un compte", new_registration_path(resource_name), class: "button"
= link_to "Créer un compte", new_registration_path(resource_name), class: "button auth-signup-button"

View file

@ -11,6 +11,8 @@ Flipflop.configure do
title: "Champ pièce justificative"
feature :champ_siret,
title: "Champ SIRET"
feature :champ_linked_dropdown,
title: "Champ double menu déroulant"
end
feature :web_hook

View file

@ -3,5 +3,7 @@ if !defined?(CONTACT_EMAIL)
EQUIPE_EMAIL = "equipe@demarches-simplifiees.fr"
TECH_EMAIL = "tech@demarches-simplifiees.fr"
CONTACT_PHONE = "01 76 42 02 87"
OLD_CONTACT_EMAIL = "contact@tps.apientreprise.fr"
end

View file

@ -1,4 +1,4 @@
require_relative "emails"
require_relative "contacts"
# Use this hook to configure devise mailer, warden hooks and so forth.
# Many of these configuration options can be set straight in your model.

View file

@ -17,13 +17,14 @@ fr:
address: 'Adresse'
yes_no: 'Oui/Non'
drop_down_list: 'Menu déroulant'
multiple_drop_down_list: 'Menu déroulant à choix multiples'
linked_drop_down_list: 'Deux menus déroulants liés'
pays: 'Pays'
regions: 'Régions'
departements: 'Départements'
engagement: 'Engagement'
header_section: 'Titre de section'
explication: 'Explication'
multiple_drop_down_list: 'Menu déroulant à choix multiples'
dossier_link: 'Lien vers un autre dossier'
piece_justificative: 'Pièce justificative'
siret: 'SIRET'

View file

@ -34,7 +34,7 @@ module Mailers
#{detail_procedures(procedures)}
Pour toute question vous pouvez nous joindre par téléphone au 01 76 42 02 87
Pour toute question vous pouvez nous joindre par téléphone au #{CONTACT_PHONE}
ou sur ladresse email #{CONTACT_EMAIL}.
-- \nLéquipe demarches-simplifiees.fr
HEREDOC

View file

@ -50,6 +50,10 @@ FactoryBot.define do
type_champ 'multiple_drop_down_list'
drop_down_list { create(:drop_down_list) }
end
factory :type_de_champ_linked_drop_down_list, class: 'TypesDeChamp::LinkedDropDownListTypeDeChamp' do
type_champ 'linked_drop_down_list'
drop_down_list { create(:drop_down_list) }
end
factory :type_de_champ_pays, class: 'TypesDeChamp::PaysTypeDeChamp' do
type_champ 'pays'
end

View file

@ -3,6 +3,7 @@ require 'spec_helper'
describe 'layouts/_new_header.html.haml', type: :view do
describe 'logo link' do
before do
sign_in user
allow(controller).to receive(:nav_bar_profile).and_return(profile)
render
end
@ -10,15 +11,22 @@ describe 'layouts/_new_header.html.haml', type: :view do
subject { rendered }
context 'when rendering for user' do
let(:user) { create(:user) }
let(:profile) { :user }
it { is_expected.to have_css("a.header-logo[href=\"#{users_dossiers_path}\"]") }
end
context 'when rendering for gestionnaire' do
let(:user) { create(:gestionnaire) }
let(:profile) { :gestionnaire }
it { is_expected.to have_css("a.header-logo[href=\"#{gestionnaire_procedures_path}\"]") }
it "displays the contact infos" do
expect(rendered).to have_text("Contact")
expect(rendered).to have_link(CONTACT_EMAIL, href: "mailto:#{CONTACT_EMAIL}")
end
end
end
end