From 7b9e7718a3b8f5bc6eb9239c0efc088ed951940c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Chai=CC=88b=20Martinez?= Date: Fri, 8 Mar 2019 11:26:08 +0100 Subject: [PATCH 1/5] admin: redesign the account request page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Chaïb Martinez --- app/views/demandes/new.html.haml | 8 ++-- app/views/root/administration.html.haml | 63 +++++++++++++++---------- app/views/root/landing.html.haml | 4 +- 3 files changed, 43 insertions(+), 32 deletions(-) diff --git a/app/views/demandes/new.html.haml b/app/views/demandes/new.html.haml index 43ab4aa3b..7461c8211 100644 --- a/app/views/demandes/new.html.haml +++ b/app/views/demandes/new.html.haml @@ -4,9 +4,9 @@ = render partial: "root/footer" .container.demande - %h1 Demande de compte administrateur + %h1 Demande de compte administrateur pour créer une 1er démarche de test - .card + .card.featured .card-title Vous souhaitez seulement compléter une démarche sur notre site ? %p @@ -52,7 +52,7 @@ Vous utilisez un email orange, wanadoo, free, gmail etc. ? Merci de nous %a{ href: contact_admin_path, target:'_blank', rel: 'noopener' } contacter préalablement. - = email_field_tag :email, nil, placeholder: 'jean.martin@developpement-durable.gouv.fr', required: true + = email_field_tag :email, nil, placeholder: 'jean.martin@developpement-durable.gouv.fr', required: true, pattern:'^.+@((?!hotmail)(?!gmail)(?!orange)(?!free)(?!wanadoo).)+\..+$' = label_tag :phone do Quel est votre numéro de téléphone (ligne directe) ? @@ -90,4 +90,4 @@ %span.mandatory * = number_field_tag :nb_of_dossiers, nil, required: true - = submit_tag 'Envoyer', class: 'button', data: { disable: true } + = submit_tag 'Demander un compte administrateur pour créer une 1er démarche de test', class: 'button primary expand large', data: { disable: true } diff --git a/app/views/root/administration.html.haml b/app/views/root/administration.html.haml index fc80e2490..e8754a80e 100644 --- a/app/views/root/administration.html.haml +++ b/app/views/root/administration.html.haml @@ -7,47 +7,57 @@ .hero-wrapper .hero-text %p.hero-tagline - %em.hero-tagline-em Dématérialisez et simplifiez - vos démarches administratives + %em.hero-tagline-em Dématérialisez + vos démarches administratives et + %em.hero-tagline-em simplifiez + la vie de vos usagers .hero-illustration %img{ :src => image_url("landing/hero/dematerialiser.svg"), alt: "" } - .landing-panel.usagers-panel - .container - .role-panel-wrapper.role-administrations-panel - .role-panel-30.role-administrations-image - %img.role-image{ :src => image_url("landing/roles/administrations.svg"), alt: "" } - - .role-panel-70 - %h1.role-panel-title Vous êtes une administration et êtes prête pour dématérialiser ? - %p.role-panel-explanation Créez des formulaires en ligne en quelques minutes et instruisez les demandes des usagers sur une plateforme dédiée - - = link_to "Demander un compte administrateur", - new_demande_path, - class: "role-panel-button-primary", - rel: "noopener noreferrer" - .landing-panel.more-info .container .role-panel-wrapper.role-administrations-panel .role-panel-70 - %h1.role-panel-title Vous voulez en savoir plus ? - %p.role-panel-explanation Découvrez notre outil + %h1.role-panel-title Est-ce fait pour mon administration ? + %p.role-panel-explanation Découvrez notre outil avec notre Webinaire en ligne ou lisez notre documentation - = link_to "Contactez-nous", - contact_admin_path, + = link_to "Inscription à notre webinaire de présentation", + "https://app.livestorm.co/demarches-simplifiees/presentation-general-de-demarches-simplifieesfr", rel: "noopener noreferrer", + target: "_blank", class: "role-panel-button-primary" - = link_to "Consultez notre documentation", + = link_to "Documentation", DOC_URL, rel: "noopener noreferrer", + target: "_blank", class: "role-panel-button-secondary" .role-panel-30.role-more-info-image %img.role-image{ :src => image_url("landing/roles/usagers.svg"), alt: "" } +.landing-panel.usagers-panel + .container + .role-panel-wrapper.role-administrations-panel + .role-panel-30.role-administrations-image + %img.role-image{ :src => image_url("landing/roles/administrations.svg"), alt: "" } + + .role-panel-70 + %h1.role-panel-title Votre administration est prête pour dématérialiser + %p.role-panel-explanation Créez un premier formulaire "de test" en quelques minutes. Instruisez les demandes des usagers sur notre plateforme + + = link_to "Créez une démarche de test maintenant", + new_demande_path, + class: "role-panel-button-primary", + rel: "noopener noreferrer" + %br + %br + %br + + + + .landing-panel.features-panel .container %ul.features @@ -194,15 +204,16 @@ .half.first-half %h1.cta-panel-title Vous êtes prêt pour dématérialiser ? %p.cta-panel-explanation Réduisez vos temps d'instruction de 50 % - = link_to "Demander un compte", + = link_to "Créer une démarche de test", new_demande_path, class: "cta-panel-button-blue" .half %h1.cta-panel-title Vous voulez en savoir plus ? - %p.cta-panel-explanation Nous vous faisons découvrir l'outil - = link_to "Contactez-nous", - contact_admin_path, + %p.cta-panel-explanation Participez à notre prochain Webinaire + = link_to "Inscription à notre webinaire", + "https://app.livestorm.co/demarches-simplifiees/presentation-general-de-demarches-simplifieesfr", + target: "_blank", class: "cta-panel-button-blue" .clearfix diff --git a/app/views/root/landing.html.haml b/app/views/root/landing.html.haml index 5469e3a2d..ed9c4df2d 100644 --- a/app/views/root/landing.html.haml +++ b/app/views/root/landing.html.haml @@ -80,8 +80,8 @@ .container .cta-panel-wrapper %div - %h1.cta-panel-title Vous êtes une administration ? - %p.cta-panel-explanation Vous souhaitez dématerialiser une démarche administrative ? + %h1.cta-panel-title Administration : vous voulez dématerialiser ? + %p.cta-panel-explanation Proposez à vos usagers de remplir leurs dossiers en ligne %div = link_to "Découvrez notre outil", administration_path, From 4b5c5171f7b435926ec4361b07fceaf8b40179d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Chai=CC=88b=20Martinez?= Date: Fri, 15 Mar 2019 15:08:47 +0100 Subject: [PATCH 2/5] admin: minor text changes Fix #3493 --- app/views/demandes/new.html.haml | 17 +++++++++++++---- app/views/root/administration.html.haml | 16 ++++++++-------- 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/app/views/demandes/new.html.haml b/app/views/demandes/new.html.haml index 7461c8211..5cb4b83ad 100644 --- a/app/views/demandes/new.html.haml +++ b/app/views/demandes/new.html.haml @@ -3,12 +3,20 @@ - content_for :footer do = render partial: "root/footer" -.container.demande - %h1 Demande de compte administrateur pour créer une 1er démarche de test + +.container.demande + + %b + Étape 1 : demandez un compte administrateur + >> Étape 2 : recevez une confirmation par email >> Étape 3 : créez une démarche de test + %br + %br + %h1 Demande de compte administrateur pour créer une 1ère démarche de test .card.featured .card-title Vous souhaitez seulement compléter une démarche sur notre site ? + %p Vous n'avez pas besoin de compte administrateur ! %p @@ -52,7 +60,8 @@ Vous utilisez un email orange, wanadoo, free, gmail etc. ? Merci de nous %a{ href: contact_admin_path, target:'_blank', rel: 'noopener' } contacter préalablement. - = email_field_tag :email, nil, placeholder: 'jean.martin@developpement-durable.gouv.fr', required: true, pattern:'^.+@((?!hotmail)(?!gmail)(?!orange)(?!free)(?!wanadoo).)+\..+$' + + = email_field_tag :email, nil, placeholder: 'jean.martin@developpement-durable.gouv.fr', required: true, pattern:'^.+@((?!hotmail)(?!gmail)(?!orange)(?!free)(?!wanadoo).)+\..+$',title:'Saisir un email valide et ne se finissant pas par Orange, Wanadoo, Free, etc.' = label_tag :phone do Quel est votre numéro de téléphone (ligne directe) ? @@ -90,4 +99,4 @@ %span.mandatory * = number_field_tag :nb_of_dossiers, nil, required: true - = submit_tag 'Demander un compte administrateur pour créer une 1er démarche de test', class: 'button primary expand large', data: { disable: true } + = submit_tag 'Demander un compte administrateur pour créer une 1ère démarche de test', class: 'button primary expand large', data: { disable: true } diff --git a/app/views/root/administration.html.haml b/app/views/root/administration.html.haml index e8754a80e..df176903f 100644 --- a/app/views/root/administration.html.haml +++ b/app/views/root/administration.html.haml @@ -7,10 +7,8 @@ .hero-wrapper .hero-text %p.hero-tagline - %em.hero-tagline-em Dématérialisez - vos démarches administratives et - %em.hero-tagline-em simplifiez - la vie de vos usagers + %em.hero-tagline-em Dématérialisez et simplifiez + vos démarches administratives .hero-illustration %img{ :src => image_url("landing/hero/dematerialiser.svg"), alt: "" } @@ -20,9 +18,9 @@ .role-panel-wrapper.role-administrations-panel .role-panel-70 %h1.role-panel-title Est-ce fait pour mon administration ? - %p.role-panel-explanation Découvrez notre outil avec notre Webinaire en ligne ou lisez notre documentation + %p.role-panel-explanation Découvrez notre outil et posez nous vos questions lors de notre démonstration en ligne ou lisez notre documentation - = link_to "Inscription à notre webinaire de présentation", + = link_to "Participer à notre démonstration en ligne", "https://app.livestorm.co/demarches-simplifiees/presentation-general-de-demarches-simplifieesfr", rel: "noopener noreferrer", target: "_blank", @@ -45,9 +43,11 @@ .role-panel-70 %h1.role-panel-title Votre administration est prête pour dématérialiser - %p.role-panel-explanation Créez un premier formulaire "de test" en quelques minutes. Instruisez les demandes des usagers sur notre plateforme + %p.role-panel-explanation Créez un premier formulaire de test en quelques minutes - = link_to "Créez une démarche de test maintenant", + + + = link_to "Créez une démarche de test", new_demande_path, class: "role-panel-button-primary", rel: "noopener noreferrer" From 418466ca7a8314867cb37ec0b8ea774ae72b7568 Mon Sep 17 00:00:00 2001 From: Paul Chavard Date: Thu, 28 Mar 2019 17:14:23 +0100 Subject: [PATCH 3/5] Supprimer le code mort carto --- app/assets/stylesheets/carte.scss | 64 ---------------------- app/assets/stylesheets/new_design/map.scss | 1 - app/javascript/new_design/carto.js | 25 --------- app/javascript/packs/application.js | 1 - 4 files changed, 91 deletions(-) delete mode 100644 app/javascript/new_design/carto.js diff --git a/app/assets/stylesheets/carte.scss b/app/assets/stylesheets/carte.scss index b0e5134e7..eb9f459a8 100644 --- a/app/assets/stylesheets/carte.scss +++ b/app/assets/stylesheets/carte.scss @@ -3,74 +3,10 @@ // You can use Sass (SCSS) here: http://sass-lang.com/ @import "bootstrap"; -#carte-page { - #map { - height: 600px; - z-index: 0; - } - - #map.edit { - width: 70%; - } - - .list { - margin-bottom: 20px; - - h3 { - margin-top: 0px; - } - - ul li { - margin-bottom: 10px; - } - } -} - .leaflet-container path { cursor: url("/assets/edit.png"), default !important; } -#map.mode-create { - cursor: url("/assets/pencil.png"), crosshair !important; -} - -#map g path.leaflet-polygon { - transition: all 0.25s; - stroke-width: 4px; - stroke-opacity: 1; - stroke: #D7217E; - position: absolute; - z-index: 100; - fill: #D7217E; - fill-opacity: 0.75; -} - -#map.mode-delete path.leaflet-polygon { - cursor: no-drop !important; - - &:hover { - fill: #4D4D4D !important; - } -} - -#map div.leaflet-edge { - box-shadow: 0 0 0 2px #FFFFFF, 0 0 10px rgba(0, 0, 0, 0.35); - border: 5px solid #D7217E; - border-radius: 10px; - transition: opacity 0.25s; - cursor: move; - opacity: 0; - pointer-events: none; - box-sizing: border-box; - width: 0 !important; - height: 0 !important; -} - -#map.mode-edit div.leaflet-edge { - opacity: 1; - pointer-events: all; -} - .info { padding: 6px 8px; font: 14px/16px Arial, Helvetica, sans-serif; diff --git a/app/assets/stylesheets/new_design/map.scss b/app/assets/stylesheets/new_design/map.scss index c7cb4c564..aa30790d2 100644 --- a/app/assets/stylesheets/new_design/map.scss +++ b/app/assets/stylesheets/new_design/map.scss @@ -1,4 +1,3 @@ -#map, .carte { height: 400px; margin-bottom: 16px; diff --git a/app/javascript/new_design/carto.js b/app/javascript/new_design/carto.js deleted file mode 100644 index 310c8429b..000000000 --- a/app/javascript/new_design/carto.js +++ /dev/null @@ -1,25 +0,0 @@ -import { getData } from '../shared/data'; -import { - initMap, - drawCadastre, - drawQuartiersPrioritaires, - drawUserSelection -} from '../shared/carte'; - -function initialize() { - const element = document.getElementById('map'); - - if (element) { - const data = getData('carto'); - const map = initMap(element, data.position); - - // draw external polygons - drawCadastre(map, data); - drawQuartiersPrioritaires(map, data); - - // draw user polygon - drawUserSelection(map, data); - } -} - -addEventListener('turbolinks:load', initialize); diff --git a/app/javascript/packs/application.js b/app/javascript/packs/application.js index 75f75f5d0..df20804b9 100644 --- a/app/javascript/packs/application.js +++ b/app/javascript/packs/application.js @@ -14,7 +14,6 @@ import '../shared/remote-input'; import '../shared/franceconnect'; import '../shared/toggle-target'; -import '../new_design/carto'; import '../new_design/dropdown'; import '../new_design/form-validation'; import '../new_design/select2'; From f945b9ec632297eda4a07d9a410cbc654edcd447 Mon Sep 17 00:00:00 2001 From: simon lehericey Date: Mon, 1 Apr 2019 16:24:56 +0200 Subject: [PATCH 4/5] Champ Siret: Fix siret-champ save When a user enter a siret, it calls siret_controller in ajax. The champ value is stil nil, so champ.present? is false because champ.blank is redefined to focus on value. Thus the champ is not updated. --- app/controllers/champs/siret_controller.rb | 6 +++--- spec/controllers/champs/siret_controller_spec.rb | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/champs/siret_controller.rb b/app/controllers/champs/siret_controller.rb index 763146915..4923f6585 100644 --- a/app/controllers/champs/siret_controller.rb +++ b/app/controllers/champs/siret_controller.rb @@ -13,9 +13,9 @@ class Champs::SiretController < ApplicationController etablissement = find_etablisement_with_siret if etablissement.present? @etablissement = etablissement - if @champ.present? - etablissement.champ = @champ - etablissement.save! + + if !@champ.nil? + @champ.update!(value: etablissement.siret, etablissement: etablissement) end else @champ&.update!(value: '') diff --git a/spec/controllers/champs/siret_controller_spec.rb b/spec/controllers/champs/siret_controller_spec.rb index dfacb8f36..154b3e4ca 100644 --- a/spec/controllers/champs/siret_controller_spec.rb +++ b/spec/controllers/champs/siret_controller_spec.rb @@ -6,7 +6,7 @@ describe Champs::SiretController, type: :controller do describe '#show' do let(:dossier) { create(:dossier, user: user, procedure: procedure) } - let(:champ) { create(:champ_siret, dossier: dossier) } + let(:champ) { create(:champ_siret, dossier: dossier, value: nil, etablissement: nil) } let(:params) do { champ_id: champ.id, From 8525761332018fcd6a6b9050f7bd68b33514888c Mon Sep 17 00:00:00 2001 From: Mathieu Magnin Date: Tue, 2 Apr 2019 14:38:47 +0200 Subject: [PATCH 5/5] Revert english dates --- app/helpers/application_helper.rb | 16 ----- .../shared/dossiers/_champ_row.html.haml | 4 -- .../dossiers/_identite_entreprise.html.haml | 8 +-- .../_infos_association.html.haml | 6 +- .../etablissement/_infos_entreprise.html.haml | 2 +- spec/helpers/application_helper_spec.rb | 58 ------------------- 6 files changed, 8 insertions(+), 86 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index efadf5712..28dc0af2a 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -119,20 +119,4 @@ module ApplicationHelper {} end end - - def try_format_date(date) - begin - date.is_a?(String) ? Date.parse(date).strftime("%d %B %Y") : date.strftime("%d %B %Y") - rescue - date - end - end - - def try_format_datetime(datetime) - begin - datetime.is_a?(String) ? Time.zone.parse(datetime).strftime("%d %B %Y %R") : datetime.strftime("%d %B %Y %R") - rescue - datetime - end - end end diff --git a/app/views/shared/dossiers/_champ_row.html.haml b/app/views/shared/dossiers/_champ_row.html.haml index 62f6feb87..361c6e786 100644 --- a/app/views/shared/dossiers/_champ_row.html.haml +++ b/app/views/shared/dossiers/_champ_row.html.haml @@ -30,10 +30,6 @@ = render partial: "shared/champs/siret/show", locals: { champ: c, profile: profile } - when TypeDeChamp.type_champs.fetch(:textarea) = render partial: "shared/champs/textarea/show", locals: { champ: c } - - when TypeDeChamp.type_champs.fetch(:date) - = try_format_date(c.to_s) - - when TypeDeChamp.type_champs.fetch(:datetime) - = try_format_datetime(c.to_s) - else = sanitize(c.to_s) diff --git a/app/views/shared/dossiers/_identite_entreprise.html.haml b/app/views/shared/dossiers/_identite_entreprise.html.haml index 33f0ce548..87be8390f 100644 --- a/app/views/shared/dossiers/_identite_entreprise.html.haml +++ b/app/views/shared/dossiers/_identite_entreprise.html.haml @@ -22,7 +22,7 @@ %td= etablissement.naf %tr %th.libelle Date de création : - %td= try_format_date(etablissement.entreprise.date_creation) + %td= etablissement.entreprise.date_creation&.strftime("%d/%m/%Y") %tr %th.libelle Effectif de l'organisation : %td= effectif(etablissement) @@ -64,10 +64,10 @@ %td= etablissement.association_objet %tr %th.libelle Date de création : - %td= try_format_date(etablissement.association_date_creation) + %td= etablissement.association_date_creation&.strftime("%d/%m/%Y") %tr %th.libelle Date de publication : - %td= try_format_date(etablissement.association_date_publication) + %td= etablissement.association_date_publication&.strftime("%d/%m/%Y") %tr %th.libelle Date de déclaration : - %td= try_format_date(etablissement.association_date_declaration) + %td= etablissement.association_date_declaration&.strftime("%d/%m/%Y") diff --git a/app/views/users/dossiers/etablissement/_infos_association.html.haml b/app/views/users/dossiers/etablissement/_infos_association.html.haml index d8afcbdb6..4fe9b8f91 100644 --- a/app/views/users/dossiers/etablissement/_infos_association.html.haml +++ b/app/views/users/dossiers/etablissement/_infos_association.html.haml @@ -13,12 +13,12 @@ %li Date de création : - = try_format_date(etablissement.association_date_creation) + = etablissement.association_date_creation&.strftime('%d/%m/%Y') %li Date de déclaration : - = try_format_date(etablissement.association_date_declaration) + = etablissement.association_date_declaration&.strftime('%d/%m/%Y') %li Date de publication : - = try_format_date(etablissement.association_date_publication) + = etablissement.association_date_publication&.strftime('%d/%m/%Y') diff --git a/app/views/users/dossiers/etablissement/_infos_entreprise.html.haml b/app/views/users/dossiers/etablissement/_infos_entreprise.html.haml index 9667a54bd..54f03b486 100644 --- a/app/views/users/dossiers/etablissement/_infos_entreprise.html.haml +++ b/app/views/users/dossiers/etablissement/_infos_entreprise.html.haml @@ -22,7 +22,7 @@ %li Date de création : - = try_format_date(etablissement.entreprise.date_creation) + = etablissement.entreprise.date_creation&.strftime('%d/%m/%Y') %li Effectif organisation : diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb index 6998f17d2..30a7becef 100644 --- a/spec/helpers/application_helper_spec.rb +++ b/spec/helpers/application_helper_spec.rb @@ -17,62 +17,4 @@ describe ApplicationHelper do it { is_expected.to be_nil } end end - - describe "#try_format_date" do - subject { try_format_date(date) } - - describe 'try formatting 2019-01-24' do - let(:date) { "2019-01-24" } - it { is_expected.to eq("24 January 2019") } - end - - describe 'try formatting 24/01/2019' do - let(:date) { "24/01/2019" } - it { is_expected.to eq("24 January 2019") } - end - - describe 'try formatting 2019-01-32' do - let(:date) { "2019-01-32" } - it { is_expected.to eq("2019-01-32") } - end - - describe 'try formatting a blank string' do - let(:date) { "" } - it { is_expected.to eq("") } - end - - describe 'try formatting a nil string' do - let(:date) { nil } - it { is_expected.to be_nil } - end - end - - describe "#try_format_datetime" do - subject { try_format_datetime(datetime) } - - describe 'try formatting 31/01/2019 11:25' do - let(:datetime) { "31/01/2019 11:25" } - it { is_expected.to eq("31 January 2019 11:25") } - end - - describe 'try formatting 2019-01-31 11:25' do - let(:datetime) { "2019-01-31 11:25" } - it { is_expected.to eq("31 January 2019 11:25") } - end - - describe 'try formatting 2019-01-32 11:25' do - let(:datetime) { "2019-01-32 11:25" } - it { is_expected.to eq("2019-01-32 11:25") } - end - - describe 'try formatting a blank string' do - let(:datetime) { "" } - it { is_expected.to eq("") } - end - - describe 'try formatting a nil string' do - let(:datetime) { nil } - it { is_expected.to be_nil } - end - end end