Merge pull request #3726 from betagouv/dev

2019-04-02-01
This commit is contained in:
LeSim 2019-04-02 15:28:56 +02:00 committed by GitHub
commit db92d03435
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 63 additions and 212 deletions

View file

@ -3,74 +3,10 @@
// You can use Sass (SCSS) here: http://sass-lang.com/ // You can use Sass (SCSS) here: http://sass-lang.com/
@import "bootstrap"; @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 { .leaflet-container path {
cursor: url("/assets/edit.png"), default !important; 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 { .info {
padding: 6px 8px; padding: 6px 8px;
font: 14px/16px Arial, Helvetica, sans-serif; font: 14px/16px Arial, Helvetica, sans-serif;

View file

@ -1,4 +1,3 @@
#map,
.carte { .carte {
height: 400px; height: 400px;
margin-bottom: 16px; margin-bottom: 16px;

View file

@ -13,9 +13,9 @@ class Champs::SiretController < ApplicationController
etablissement = find_etablisement_with_siret etablissement = find_etablisement_with_siret
if etablissement.present? if etablissement.present?
@etablissement = etablissement @etablissement = etablissement
if @champ.present?
etablissement.champ = @champ if !@champ.nil?
etablissement.save! @champ.update!(value: etablissement.siret, etablissement: etablissement)
end end
else else
@champ&.update!(value: '') @champ&.update!(value: '')

View file

@ -119,20 +119,4 @@ module ApplicationHelper
{} {}
end end
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 end

View file

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

View file

@ -14,7 +14,6 @@ import '../shared/remote-input';
import '../shared/franceconnect'; import '../shared/franceconnect';
import '../shared/toggle-target'; import '../shared/toggle-target';
import '../new_design/carto';
import '../new_design/dropdown'; import '../new_design/dropdown';
import '../new_design/form-validation'; import '../new_design/form-validation';
import '../new_design/select2'; import '../new_design/select2';

View file

@ -3,12 +3,20 @@
- content_for :footer do - content_for :footer do
= render partial: "root/footer" = render partial: "root/footer"
.container.demande
%h1 Demande de compte administrateur
.card
.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 .card-title
Vous souhaitez seulement compléter une démarche sur notre site ? Vous souhaitez seulement compléter une démarche sur notre site ?
%p %p
Vous n'avez pas besoin de compte administrateur ! Vous n'avez pas besoin de compte administrateur !
%p %p
@ -52,7 +60,8 @@
Vous utilisez un email orange, wanadoo, free, gmail etc. ? Merci de nous Vous utilisez un email orange, wanadoo, free, gmail etc. ? Merci de nous
%a{ href: contact_admin_path, target:'_blank', rel: 'noopener' } %a{ href: contact_admin_path, target:'_blank', rel: 'noopener' }
contacter préalablement. 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).)+\..+$',title:'Saisir un email valide et ne se finissant pas par Orange, Wanadoo, Free, etc.'
= label_tag :phone do = label_tag :phone do
Quel est votre numéro de téléphone (ligne directe) ? Quel est votre numéro de téléphone (ligne directe) ?
@ -90,4 +99,4 @@
%span.mandatory * %span.mandatory *
= number_field_tag :nb_of_dossiers, nil, required: true = 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 1ère démarche de test', class: 'button primary expand large', data: { disable: true }

View file

@ -13,40 +13,50 @@
.hero-illustration .hero-illustration
%img{ :src => image_url("landing/hero/dematerialiser.svg"), alt: "" } %img{ :src => image_url("landing/hero/dematerialiser.svg"), alt: "" }
.landing-panel.usagers-panel .landing-panel.more-info
.container
.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 et posez nous vos questions lors de notre démonstration en ligne ou lisez notre documentation
= link_to "Participer à notre démonstration en ligne",
"https://app.livestorm.co/demarches-simplifiees/presentation-general-de-demarches-simplifieesfr",
rel: "noopener noreferrer",
target: "_blank",
class: "role-panel-button-primary"
= 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 .container
.role-panel-wrapper.role-administrations-panel .role-panel-wrapper.role-administrations-panel
.role-panel-30.role-administrations-image .role-panel-30.role-administrations-image
%img.role-image{ :src => image_url("landing/roles/administrations.svg"), alt: "" } %img.role-image{ :src => image_url("landing/roles/administrations.svg"), alt: "" }
.role-panel-70 .role-panel-70
%h1.role-panel-title Vous êtes une administration et êtes prête pour dématérialiser ? %h1.role-panel-title Votre administration est 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 %p.role-panel-explanation Créez un premier formulaire de test en quelques minutes
= link_to "Demander un compte administrateur",
= link_to "Créez une démarche de test",
new_demande_path, new_demande_path,
class: "role-panel-button-primary", class: "role-panel-button-primary",
rel: "noopener noreferrer" rel: "noopener noreferrer"
%br
%br
%br
.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
= link_to "Contactez-nous",
contact_admin_path,
rel: "noopener noreferrer",
class: "role-panel-button-primary"
= link_to "Consultez notre documentation",
DOC_URL,
rel: "noopener noreferrer",
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.features-panel .landing-panel.features-panel
.container .container
@ -194,15 +204,16 @@
.half.first-half .half.first-half
%h1.cta-panel-title Vous êtes prêt pour dématérialiser ? %h1.cta-panel-title Vous êtes prêt pour dématérialiser ?
%p.cta-panel-explanation Réduisez vos temps d'instruction de 50 % %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, new_demande_path,
class: "cta-panel-button-blue" class: "cta-panel-button-blue"
.half .half
%h1.cta-panel-title Vous voulez en savoir plus ? %h1.cta-panel-title Vous voulez en savoir plus ?
%p.cta-panel-explanation Nous vous faisons découvrir l'outil %p.cta-panel-explanation Participez à notre prochain Webinaire
= link_to "Contactez-nous", = link_to "Inscription à notre webinaire",
contact_admin_path, "https://app.livestorm.co/demarches-simplifiees/presentation-general-de-demarches-simplifieesfr",
target: "_blank",
class: "cta-panel-button-blue" class: "cta-panel-button-blue"
.clearfix .clearfix

View file

@ -80,8 +80,8 @@
.container .container
.cta-panel-wrapper .cta-panel-wrapper
%div %div
%h1.cta-panel-title Vous êtes une administration ? %h1.cta-panel-title Administration : vous voulez dématerialiser ?
%p.cta-panel-explanation Vous souhaitez dématerialiser une démarche administrative ? %p.cta-panel-explanation Proposez à vos usagers de remplir leurs dossiers en ligne
%div %div
= link_to "Découvrez notre outil", = link_to "Découvrez notre outil",
administration_path, administration_path,

View file

@ -30,10 +30,6 @@
= render partial: "shared/champs/siret/show", locals: { champ: c, profile: profile } = render partial: "shared/champs/siret/show", locals: { champ: c, profile: profile }
- when TypeDeChamp.type_champs.fetch(:textarea) - when TypeDeChamp.type_champs.fetch(:textarea)
= render partial: "shared/champs/textarea/show", locals: { champ: c } = 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 - else
= sanitize(c.to_s) = sanitize(c.to_s)

View file

@ -22,7 +22,7 @@
%td= etablissement.naf %td= etablissement.naf
%tr %tr
%th.libelle Date de création : %th.libelle Date de création :
%td= try_format_date(etablissement.entreprise.date_creation) %td= etablissement.entreprise.date_creation&.strftime("%d/%m/%Y")
%tr %tr
%th.libelle Effectif de l'organisation : %th.libelle Effectif de l'organisation :
%td= effectif(etablissement) %td= effectif(etablissement)
@ -64,10 +64,10 @@
%td= etablissement.association_objet %td= etablissement.association_objet
%tr %tr
%th.libelle Date de création : %th.libelle Date de création :
%td= try_format_date(etablissement.association_date_creation) %td= etablissement.association_date_creation&.strftime("%d/%m/%Y")
%tr %tr
%th.libelle Date de publication : %th.libelle Date de publication :
%td= try_format_date(etablissement.association_date_publication) %td= etablissement.association_date_publication&.strftime("%d/%m/%Y")
%tr %tr
%th.libelle Date de déclaration : %th.libelle Date de déclaration :
%td= try_format_date(etablissement.association_date_declaration) %td= etablissement.association_date_declaration&.strftime("%d/%m/%Y")

View file

@ -13,12 +13,12 @@
%li %li
Date de création : Date de création :
= try_format_date(etablissement.association_date_creation) = etablissement.association_date_creation&.strftime('%d/%m/%Y')
%li %li
Date de déclaration : Date de déclaration :
= try_format_date(etablissement.association_date_declaration) = etablissement.association_date_declaration&.strftime('%d/%m/%Y')
%li %li
Date de publication : Date de publication :
= try_format_date(etablissement.association_date_publication) = etablissement.association_date_publication&.strftime('%d/%m/%Y')

View file

@ -22,7 +22,7 @@
%li %li
Date de création : Date de création :
= try_format_date(etablissement.entreprise.date_creation) = etablissement.entreprise.date_creation&.strftime('%d/%m/%Y')
%li %li
Effectif organisation : Effectif organisation :

View file

@ -6,7 +6,7 @@ describe Champs::SiretController, type: :controller do
describe '#show' do describe '#show' do
let(:dossier) { create(:dossier, user: user, procedure: procedure) } 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 let(:params) do
{ {
champ_id: champ.id, champ_id: champ.id,

View file

@ -17,62 +17,4 @@ describe ApplicationHelper do
it { is_expected.to be_nil } it { is_expected.to be_nil }
end end
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 end