diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index e9049908b..567658f93 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -50,7 +50,7 @@ function scroll_to() { $('.js-scrollTo').on('click', function () { // Au clic sur un élément var page = $(this).attr('cible'); // Page cible var speed = 600; // Durée de l'animation (en ms) - $('html, body').animate({scrollTop: $(page).offset().top - 100}, speed); // Go + $('html, body').animate({scrollTop: $(page).offset().top - 200}, speed); // Go return false; }); } diff --git a/app/assets/javascripts/landing.js b/app/assets/javascripts/landing.js deleted file mode 100644 index 7c519c0f0..000000000 --- a/app/assets/javascripts/landing.js +++ /dev/null @@ -1,17 +0,0 @@ -$(document).on('page:load', all_video); -$(document).ready(all_video); - -function all_video() { - $(".all_video").on('click', function(event){ - $("#all_video").slideToggle(200); - - if (event.stopPropagation) { - event.stopPropagation(); - } - event.cancelBubble = true; - - return false; - }); -} - - diff --git a/app/assets/stylesheets/landing.scss b/app/assets/stylesheets/landing.scss index cde9c323e..e241fe95d 100644 --- a/app/assets/stylesheets/landing.scss +++ b/app/assets/stylesheets/landing.scss @@ -39,6 +39,10 @@ color: white; } +.latest_release{ + margin-left: 1% +} + #landing_body{ .split-hr-left { margin-left: auto; diff --git a/app/controllers/administrateurs/sessions_controller.rb b/app/controllers/administrateurs/sessions_controller.rb index f7f676790..be676864f 100644 --- a/app/controllers/administrateurs/sessions_controller.rb +++ b/app/controllers/administrateurs/sessions_controller.rb @@ -2,12 +2,12 @@ class Administrateurs::SessionsController < Sessions::SessionsController def demo return redirect_to root_path if Rails.env.production? - @administrateur = Administrateur.new(email: 'admin@tps.fr', password: 'password') - render 'new' + @user = User.new(email: DemoEmails[:admin], password: 'password') + render 'users/sessions/new' end def new - @administrateur = Administrateur.new + redirect_to new_user_session_path end def create diff --git a/app/controllers/gestionnaires/sessions_controller.rb b/app/controllers/gestionnaires/sessions_controller.rb index 36121470a..c0f7d7b9b 100644 --- a/app/controllers/gestionnaires/sessions_controller.rb +++ b/app/controllers/gestionnaires/sessions_controller.rb @@ -2,12 +2,12 @@ class Gestionnaires::SessionsController < Sessions::SessionsController def demo return redirect_to root_path if Rails.env.production? - @gestionnaire = Gestionnaire.new(email: 'gestionnaire@apientreprise.fr', password: 'password') - render 'new' + @user = User.new(email: DemoEmails[:gestionnaire], password: 'password') + render 'users/sessions/new' end def new - @gestionnaire = Gestionnaire.new + redirect_to new_user_session_path end def create diff --git a/app/controllers/root_controller.rb b/app/controllers/root_controller.rb index 363ccefae..0878b7b94 100644 --- a/app/controllers/root_controller.rb +++ b/app/controllers/root_controller.rb @@ -32,8 +32,6 @@ class RootController < ApplicationController return redirect_to administrations_path end - # @latest_release = Github::Releases.latest - @latest_release = nil render 'landing' end end diff --git a/app/controllers/users/sessions_controller.rb b/app/controllers/users/sessions_controller.rb index e5348695f..33e91c7a9 100644 --- a/app/controllers/users/sessions_controller.rb +++ b/app/controllers/users/sessions_controller.rb @@ -4,8 +4,7 @@ class Users::SessionsController < Sessions::SessionsController def demo return redirect_to root_path if Rails.env.production? - @user = User.new(email: 'demo@tps.fr', password: 'password') - + @user = User.new(email: DemoEmails[:user], password: 'password') render 'new' end diff --git a/app/lib/github/api.rb b/app/lib/github/api.rb deleted file mode 100644 index 8aab0ce86..000000000 --- a/app/lib/github/api.rb +++ /dev/null @@ -1,20 +0,0 @@ -class Github::API - - def self.base_uri - 'https://api.github.com' - end - - def self.latest_release - call '/repos/sgmap/tps/releases/latest' - end - - private - - def self.call(end_point, params = {}) - RestClient::Resource.new( - base_uri+end_point, timeout: 5 - ).get(params: params) - rescue RestClient::Forbidden - nil - end -end diff --git a/app/lib/github/releases.rb b/app/lib/github/releases.rb deleted file mode 100644 index ec8ef101b..000000000 --- a/app/lib/github/releases.rb +++ /dev/null @@ -1,11 +0,0 @@ -class Github::Releases - - def self.latest - latest_release = Github::API.latest_release - return nil if latest_release.nil? - - release = Hashie::Mash.new JSON.parse(latest_release) - release.published_at = release.published_at.to_date.strftime('%d/%m/%Y') - release - end -end \ No newline at end of file diff --git a/app/views/layouts/_footer.html.haml b/app/views/layouts/_footer.html.haml index 89aad0171..41b2dbeff 100644 --- a/app/views/layouts/_footer.html.haml +++ b/app/views/layouts/_footer.html.haml @@ -1,7 +1,9 @@ %div#footer %p{class: "copyright col-md-push-#{12-main_container_size} col-md-#{main_container_size} col-lg-push-#{12-main_container_size} col-lg-#{main_container_size} text-muted small"} = link_to 'SGMAP', "http://etatplateforme.modernisation.gouv.fr" - 2016 + = Time.now.year + \- + = link_to 'Nouveautés', 'https://github.com/sgmap/tps/releases', target: '_blank' \- = link_to 'CGU / Mentions légales', cgu_path \- diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 12b60bafb..1730f61a7 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -13,7 +13,9 @@ %body = render partial: 'layouts/support_navigator_banner' #beta{class:(Rails.env == 'production' ? '' : 'beta_staging')} - - if Rails.env != 'production' + - if Rails.env == 'production' + Beta + - else Env Test - if Rails.env == 'test' diff --git a/app/views/root/landing.html.haml b/app/views/root/landing.html.haml index 472a04034..ef8e807e9 100644 --- a/app/views/root/landing.html.haml +++ b/app/views/root/landing.html.haml @@ -71,32 +71,16 @@ #utilisateurs.col-xs-12.col-sm-12.col-md-12.col-lg-12 %h4 Ils nous font confiances - Consel regional Ile de France, - Politique de la ville du Pas de calais, - DRIEA Ile de France - + Conseil Regional Ile de France, Politique de la ville du Pas de Calais (ensemble des administrations et collectivités territoriales concernées), DRIEA Ile de France %br - - Préfecture de la martinique, - DRIEE Ile de France, - Ministère de l'écologie et du développement durable, - MEME, - CCI Normandie + Préfecture de la Martinique, DRIEE Ile de France, Ministère de l’écologie et du développement durable, MEEM, CCI Normandie, DGE %br .row #partenaires.col-xs-12.col-sm-12.col-md-12.col-lg-12 %h4 Ils travaillent avec nous - Insee - Infogreff, - Ministere de la jeunesse et du sport, - IGN, - DGFIP - France Connect, - BAN, - api.gouv.fr - Euroquity, - BPI, - FNTP, - Qualibat \ No newline at end of file + Insee, Infogreffe, Ministère de la jeunesse et du sport, IGN, DGFIP, CGET, France Connect, Open Streetmap, la BAN, api.gouv.fr, Euroquity - BPI, FNTP, Qualibat + + .split-hr-left + diff --git a/app/views/root/landing_v1.html.haml b/app/views/root/landing_v1.html.haml deleted file mode 100644 index f8aca2f2b..000000000 --- a/app/views/root/landing_v1.html.haml +++ /dev/null @@ -1,123 +0,0 @@ -#landing.max-size - #title - %h1.center - TPS - %h2.center - TéléProcédure Simplifiée - - %br - %h3.center - Dématérialisez, réceptionnez et co-instruisez toutes vos démarches depuis un espace unique. - - %br - %br - .center - %button.js-scrollTo.btn.btn-lg.btn-success{cible: '.demo_account'} - Envie d'essayer ? - - -#suite.max-size - .row.word.simplifier - .col-md-6.col-sm-6.col-xs-6.col-lg-6 - = image_tag image_url('keywords/simplifier.png') - .col-md-6.col-sm-6.col-xs-6.col-lg-6 - %ul.dynamic_ul - %li - Générateur simplifié de démarches en ligne pour les administrations - %li - Ne demander que les informations strictement nécessaires - %li - Profiter d’une identification simplifiée grâce à - %a{href: 'http://www.modernisation.gouv.fr/ladministration-change-avec-le-numerique/par-son-systeme-dinformation/france-connect-un-acces-universel-aux-administrations-en-ligne', - target: '_blank'} - FranceConnect - - .row.word.echanger - .col-md-6.col-sm-6.col-xs-6.col-lg-6 - %ul.dynamic_ul - %li - Tchatter avec les services traitant jusqu’à la complétude du dossier - %li - Etre notifié de manière électronique - %li - Accompagner les usagers dans leur démarche - %li - Vérifier les pièces au fur et à mesure - .col-md-6.col-sm-6.col-xs-6.col-lg-6 - = image_tag image_url('keywords/echanger.png') - - .row.word.profiter - .col-md-6.col-sm-6.col-xs-6.col-lg-6 - = image_tag image_url('keywords/profiter.png') - .col-md-6.col-sm-6.col-xs-6.col-lg-6 - %ul.dynamic_ul - %li - Profiter des ressources cartographiques directement mobilisées, si nécessaire - %li - Récupérer des informations officielles collectées directement auprès des administrations - - .row.word.news - .latest_release.col-md-7.col-sm-7.col-xs-7.col-lg-7 - - if @latest_release.nil? - %p - Erreur dans la récupération des données - -else - %h3.text-info - = "Dernière version (#{@latest_release.tag_name} - #{@latest_release.published_at})" - .body - =@latest_release.body.html_safe - - .center - \- - %br - %a{href: 'https://github.com/sgmap/tps/releases', target: '_blank'} - = 'Voir toutes les versions' - - .col-md-5.col-sm-5.col-xs-5.col-lg-5 - #video.center - %iframe{:allowfullscreen => "", :frameborder => "0", :height => "270", :src => "//www.dailymotion.com/embed/video/x3lp4cs", :width => "480"} - %br - =link_to 'Toutes les vidéos', '#', {style: 'text-decoration: none', class: 'all_video btn btn-default btn-sm'} - #all_video{style:'display: none'} - %br - %ul - %li - =link_to "Création d'une démarche avec TPS (Téléprocédure Simplifiée)", "http://dai.ly/x3s2o65", {target: '_blank'} - %li - =link_to "Etape 2 avec TPS : saisine de l'administration par un usager avec France Connect", "http://dai.ly/x3s2oj6", {target: '_blank'} - %li - =link_to "Etape 3 avec TPS : l'accompagnement par les services et l'invitation d'autres partenaires publics à co-instruire", "http://dai.ly/x3s2oqp", {target: '_blank'} - %li - =link_to "TPS: dernière étape, la validation du dossier et notification", "http://dai.ly/x3s2p6k", {target: '_blank'} - - .row.word.demo_account.center - .col-md-4.col-sm-4.col-xs-4.col-lg-4 - %h3.text-primary Acteurs publics - %h4 Créez des démarches en ligne simplifiées et sécurisées. - =link_to 'Démonstration', 'https://tps-dev.apientreprise.fr/administrateurs/sign_in/demo', {class: 'btn btn-lg btn-primary'} - .col-md-4.col-sm-4.col-xs-4.col-lg-4 - %h3.text-warning Agents et services - %h4 Accompagnez et co-traitez les projets avec les usagers. - =link_to 'Démonstration', 'https://tps-dev.apientreprise.fr/gestionnaires/sign_in/demo', {class: 'btn btn-lg btn-warning'} - - .col-md-4.col-sm-4.col-xs-4.col-lg-4 - %h3.text-success Usagers - %h4 Profitez de démarches simplifiées et d’échanges continus avec les services traitants. - =link_to 'Démonstration', 'https://tps-dev.apientreprise.fr/users/sign_in/demo', {class: 'btn btn-lg btn-success'} - - .row.word.documentation - .col-md-4.col-sm-4.col-xs-4.col-lg-4.center - = image_tag image_url('keywords/documentation.png') - .col-md-4.col-sm-4.col-xs-4.col-lg-4 - %ul.dynamic_ul - %li - =link_to 'Dépliant de présentation', '/data/TPS_Trois_volets.pdf', {target: '_blank'} - %li - =link_to 'Documentation d’utilisation', '/data/TPS_documentations_v1_1.pdf', {target: '_blank'} - -#%li - -# = link_to 'Documentation des APIs (béta)', '/docs', {target: '_blank'} - .col-md-4.col-sm-4.col-xs-4.col-lg-4.center - = link_to 'Demander un accès administrateur', 'https://tps.apientreprise.fr/users/dossiers/new?procedure_id=31', {class: 'btn btn-lg btn-primary', target: '_blank'} - - - diff --git a/app/views/users/sessions/new.html.haml b/app/views/users/sessions/new.html.haml index a9c187ac7..7d22b6700 100644 --- a/app/views/users/sessions/new.html.haml +++ b/app/views/users/sessions/new.html.haml @@ -32,7 +32,8 @@ .actions = f.submit "Se connecter", class:'btn btn-primary' %br - = render "users/shared/links" + - if @user.email != DemoEmails[:gestionnaire] && @user.email != DemoEmails[:admin] + = render "users/shared/links" diff --git a/config/initializers/demo_emails.rb b/config/initializers/demo_emails.rb new file mode 100644 index 000000000..e9e52c963 --- /dev/null +++ b/config/initializers/demo_emails.rb @@ -0,0 +1,5 @@ +DemoEmails = { + user: 'demo@tps.fr', + gestionnaire: 'gestionnaire@apientreprise.fr', + admin: 'admin@tps.fr' +} \ No newline at end of file