diff --git a/Gemfile b/Gemfile
index 195f3c2c7..7511a4e87 100644
--- a/Gemfile
+++ b/Gemfile
@@ -57,7 +57,7 @@ gem 'bootstrap-datepicker-rails'
gem 'chartkick'
-
+gem 'leaflet-rails'
gem 'logstasher'
diff --git a/app/assets/javascripts/api_carto/qp.js b/app/assets/javascripts/api_carto/qp.js
index 2627b7848..18a953e59 100644
--- a/app/assets/javascripts/api_carto/qp.js
+++ b/app/assets/javascripts/api_carto/qp.js
@@ -1,4 +1,4 @@
-function onDocumentReady() { if (typeof L != 'undefined') {
+function onDocumentReady() { if (typeof L != 'undefined' && typeof L.drawLocal != 'undefined') {
(function () {
API_URL = '//api-adresse.data.gouv.fr';
diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js
index d0e2c8989..7242859cf 100644
--- a/app/assets/javascripts/application.js
+++ b/app/assets/javascripts/application.js
@@ -17,4 +17,5 @@
//= require jquery
//= require bootstrap-sprockets
//= require bootstrap-datepicker/core
-//= require bootstrap-datepicker/locales/bootstrap-datepicker.fr.js
\ No newline at end of file
+//= require bootstrap-datepicker/locales/bootstrap-datepicker.fr.js
+//= require leaflet
\ No newline at end of file
diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss
index 098d31bbf..5df9fdb80 100644
--- a/app/assets/stylesheets/application.scss
+++ b/app/assets/stylesheets/application.scss
@@ -1,3 +1,5 @@
+//= depend_on_asset "layers.png"
+//= depend_on_asset "layers-2x.png"
/*
* This is a manifest file that'll be compiled into application.css, which will include all the files
* listed below.
@@ -13,6 +15,7 @@
*= require_tree .
*= require_self
*= require bootstrap-datepicker3
+ *= require leaflet
*/
@import "bootstrap-sprockets";
@import "bootstrap";
diff --git a/app/models/dossier.rb b/app/models/dossier.rb
index 81269a181..2b0efa7b4 100644
--- a/app/models/dossier.rb
+++ b/app/models/dossier.rb
@@ -32,8 +32,16 @@ class Dossier < ActiveRecord::Base
end
end
+ def sous_domaine
+ if Rails.env.production?
+ 'tps'
+ else
+ 'tps-dev'
+ end
+ end
+
def mailto
- "mailto:#{formulaire.email_contact}?subject=Demande%20de%20contact&body=Bonjour,%0A%0AJe%20vous%20informe%20que%20j'ai%20rempli%20le%20dossier%20sur%20admi_facile.%20Vous%20pouvez%20y%20acc%C3%A9der%20en%20suivant%20le%20lien%20suivant%20:%20%0Ahttps://admi_facile.apientreprise.fr/admin/dossiers/#{id}%20%0A%20Le%20num%C3%A9ro%20de%20mon%20dossier%20est%20le%20#{id}"
+ "mailto:#{formulaire.email_contact}?subject=Demande%20de%20contact&body=Bonjour,%0A%0AJe%20vous%20informe%20que%20j'ai%20rempli%20le%20dossier%20sur%20TPS.%20Vous%20pouvez%20y%20acc%C3%A9der%20en%20suivant%20le%20lien%20suivant%20:%20%0Ahttps://#{sous_domaine}.apientreprise.fr/admin/dossiers/#{id}%20%0A%20Le%20num%C3%A9ro%20de%20mon%20dossier%20est%20le%20#{id}"
end
private
diff --git a/app/views/carte/_carte_sources_CSS.html.haml b/app/views/carte/_carte_sources_CSS.html.haml
index 9fb2c41dc..2682e2f1e 100644
--- a/app/views/carte/_carte_sources_CSS.html.haml
+++ b/app/views/carte/_carte_sources_CSS.html.haml
@@ -1,5 +1,5 @@
%div#sources_CSS_api_carto
%link{:href => "https://leaflet.github.io/Leaflet.draw/leaflet.draw.css", :rel => "stylesheet", :type => "text/css"}
- %link{:href => "https://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css", :rel => "stylesheet", :type => "text/css"}
+
%link{:href => "https://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css", :rel => "stylesheet"}
%link{:href => "https://cdn.rawgit.com/CliffCloud/Leaflet.EasyButton/dd04bbf160aa33c44aa63e8a744b3632c162c340/src/easy-button.css", :rel => "stylesheet"}
diff --git a/app/views/carte/_carte_sources_JS.html.haml b/app/views/carte/_carte_sources_JS.html.haml
index b9ea31c99..9c3f3df71 100644
--- a/app/views/carte/_carte_sources_JS.html.haml
+++ b/app/views/carte/_carte_sources_JS.html.haml
@@ -2,7 +2,7 @@
="var dossier_id =#{@dossier.id}"
%div#sources_JS_api_carto
- %script{:src => "https://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js"}
+
%script{:src => "https://leaflet.github.io/Leaflet.draw/leaflet.draw.js"}
%script{:src => "https://cdnjs.cloudflare.com/ajax/libs/spin.js/2.0.1/spin.min.js"}
%script{:src => "https://cdn.rawgit.com/CliffCloud/Leaflet.EasyButton/14332b70b18bdec80f4cce86c643372883bf90aa/src/easy-button.bar.js"}
diff --git a/app/views/carte/_carte_sources_JS_backend.html.haml b/app/views/carte/_carte_sources_JS_backend.html.haml
index d3e25e21c..e9d961be2 100644
--- a/app/views/carte/_carte_sources_JS_backend.html.haml
+++ b/app/views/carte/_carte_sources_JS_backend.html.haml
@@ -3,7 +3,7 @@
="var ref_dossier=#{@dossier.ref_dossier}"
%div#sources_JS_api_carto_backend
- %script{:src => "https://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js"}
+
%script{:src => "https://leaflet.github.io/Leaflet.draw/leaflet.draw.js"}
%script{:src => "https://cdnjs.cloudflare.com/ajax/libs/spin.js/2.0.1/spin.min.js"}
%script{:src => "https://cdn.rawgit.com/CliffCloud/Leaflet.EasyButton/14332b70b18bdec80f4cce86c643372883bf90aa/src/easy-button.bar.js"}
diff --git a/app/views/dossiers/show.html.haml b/app/views/dossiers/show.html.haml
index 94045b4e6..b414270c1 100644
--- a/app/views/dossiers/show.html.haml
+++ b/app/views/dossiers/show.html.haml
@@ -1,5 +1,6 @@
.container
- %h2 Récapitulatif de vos informations
+ %h2 Récapitulatif de vos informations (récupérées auprès de l'INSEE et d'INFOGREFFE)
+ %br
%div.row
= render partial: 'infos_entreprise'
diff --git a/app/views/start/index.html.haml b/app/views/start/index.html.haml
index e24f2a408..7f9248082 100644
--- a/app/views/start/index.html.haml
+++ b/app/views/start/index.html.haml
@@ -1,6 +1,7 @@
.container.center
- %h1.cover-heading TPS
- %h4.cover-heading Téléprocédures simplifiées
+ %h1.cover-heading TéléProcédure administrative Simplifiée
+ %p
+ Site de démonstration d’un service public de saisie d’un projet ou de dépôt d’une démarche administrative, auprès d’un ou plusieurs organismes publics, simplifié des informations déjà connues des administrations, grâce à la fourniture du numéro SIRET.
.row{style:'margin-top:10%'}
-if !user_signed_in?
.col-lg-6.col-md-6
diff --git a/config/application.rb b/config/application.rb
index d86dad9b7..37ae06820 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -25,6 +25,7 @@ module TPS
config.assets.paths << Rails.root.join('app', 'assets', 'javascript')
config.assets.paths << Rails.root.join('app', 'assets', 'javascript', 'api_carto')
config.assets.paths << Rails.root.join('app', 'assets', 'javascript', 'api_carto', 'lib')
+ config.assets.paths << Rails.root.join('app', 'assets', 'javascript', 'api_carto', 'lib', 'images')
# Do not swallow errors in after_commit/after_rollback callbacks.
config.active_record.raise_in_transactional_callbacks = true
diff --git a/spec/models/dossier_spec.rb b/spec/models/dossier_spec.rb
index b2fac1938..a0af975fe 100644
--- a/spec/models/dossier_spec.rb
+++ b/spec/models/dossier_spec.rb
@@ -126,7 +126,7 @@ describe Dossier do
let(:dossier) { create(:dossier) }
let(:email_contact) { dossier.formulaire.email_contact }
subject { dossier.mailto }
- it { is_expected.to eq("mailto:#{email_contact}?subject=Demande%20de%20contact&body=Bonjour,%0A%0AJe%20vous%20informe%20que%20j'ai%20rempli%20le%20dossier%20sur%20admi_facile.%20Vous%20pouvez%20y%20acc%C3%A9der%20en%20suivant%20le%20lien%20suivant%20:%20%0Ahttps://admi_facile.apientreprise.fr/admin/dossiers/#{dossier.id}%20%0A%20Le%20num%C3%A9ro%20de%20mon%20dossier%20est%20le%20#{dossier.id}")}
+ it { is_expected.to eq("mailto:#{email_contact}?subject=Demande%20de%20contact&body=Bonjour,%0A%0AJe%20vous%20informe%20que%20j'ai%20rempli%20le%20dossier%20sur%20TPS.%20Vous%20pouvez%20y%20acc%C3%A9der%20en%20suivant%20le%20lien%20suivant%20:%20%0Ahttps://tps-dev.apientreprise.fr/admin/dossiers/#{dossier.id}%20%0A%20Le%20num%C3%A9ro%20de%20mon%20dossier%20est%20le%20#{dossier.id}")}
end
end
end