From 7a617868148eeef3396e27d4c3946d55c3288555 Mon Sep 17 00:00:00 2001 From: Xavier J Date: Mon, 1 Feb 2016 17:16:00 +0100 Subject: [PATCH] Active landing page --- app/assets/javascripts/application.js | 9 ----- app/assets/stylesheets/application.scss | 35 ++++++++++++++---- app/assets/stylesheets/landing.scss | 44 +++++++++++++---------- app/assets/stylesheets/ul.scss | 6 ++-- app/controllers/root_controller.rb | 2 +- app/views/layouts/application.html.haml | 14 +++++--- app/views/root/landing.html.haml | 28 +++++++-------- spec/controllers/root_controller_spec.rb | 8 ++++- spec/features/admin/connection_spec.rb | 2 +- spec/features/users/list_dossiers_spec.rb | 2 +- 10 files changed, 87 insertions(+), 63 deletions(-) diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 31ae83487..2115af656 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -27,12 +27,3 @@ //= require smart_listing //= require turf //= require franceconnect - -$(document).ready(function() { - $('.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 - return false; - }); -}); \ No newline at end of file diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index 14c1f936e..7929fa457 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -23,21 +23,27 @@ @import "bootstrap"; body { - background-color: rgb(255, 255, 255) + background-color: rgb(255, 255, 255); } html, body { height: 100%; } +body { + padding-top: 50px; +} + #wrap { min-height: 100%; margin-bottom: -50px; } + #wrap:after { content: ""; display: block; } + #footer, #wrap:after { height: 40px; } @@ -46,6 +52,11 @@ html, body { background-color: rgb(240, 240, 240) } +.main_div { + margin-left: 10rem; + margin-right: 10rem; +} + .logo { margin-left: 10px; padding-top: 5px; @@ -85,14 +96,26 @@ html, body { margin-right: 105px; } -.alert.alert-success, -.alert.alert-danger { - margin-top: -20px + +#header { + top: 0; + left: -3px; + position: fixed; + width: 100%; + z-index: 10; + } + .navbar { height: 35px; - background-color: rgb(235, 235, 235) + background-color: rgba(235, 235, 235, 0.95); + + .sign_in_FC { + margin-top: -18px; + height: 70px; + } + } .btn { @@ -161,6 +184,7 @@ div.pagination { height: 52px; width: 100%; margin-top: 0px; + z-index: 10; } @@ -212,7 +236,6 @@ div.pagination { margin-top: -4px; } - #fconnect-access { right: 50px; } diff --git a/app/assets/stylesheets/landing.scss b/app/assets/stylesheets/landing.scss index 224a0e438..ca3599d0e 100644 --- a/app/assets/stylesheets/landing.scss +++ b/app/assets/stylesheets/landing.scss @@ -1,15 +1,13 @@ -#wrap { -} - .max-size { - margin-left: -13%; - margin-right: -13%; + margin-left: -10rem; + margin-right: -10rem; } #landing { - margin-top: -20px; background-image: image-url('landing_background.jpg'); + background-attachment: fixed; + background-position: top left; background-repeat: no-repeat; #title { @@ -20,30 +18,34 @@ font-size: 35px; } + .btn { + text-shadow: none; + } + + .btn-lg { + font-size: 20px; + padding: 12px 18px; + } + color: white; padding-top: 6%; - padding-bottom: 9%; + padding-bottom: 7%; text-shadow: 3px 3px 4px rgba(0, 0, 0, .6); } .logo img { width: 70px; } - - #buttons { - margin-top: 5%; - - button { - margin-left: 30px; - margin-right: 30px; - } - } } #suite { + .row{ + width: 100%; + margin-left: 0; + margin-right: 0; + } .word { border-bottom: solid darkgrey 1px; - //height: 300px; img { padding-top: 50px; @@ -57,18 +59,22 @@ img { width: 300px; } + + ul { + margin-top: 11%; + } } .echanger { ul { - margin-top: 6%; + margin-top: 4%; } } .profiter { border-bottom: none; ul { - margin-top: 9%; + margin-top: 11%; } } } \ No newline at end of file diff --git a/app/assets/stylesheets/ul.scss b/app/assets/stylesheets/ul.scss index ab1bfff2a..147fcda1b 100644 --- a/app/assets/stylesheets/ul.scss +++ b/app/assets/stylesheets/ul.scss @@ -1,13 +1,11 @@ .dynamic_ul { - list-style-type: none; margin-left: 20px; margin-top: 13%; li { font: 200 20px/1.5 Helvetica, Verdana, sans-serif; - border-bottom: 1px solid #ccc; - margin-top: 9px; - margin-bottom: 9px; + margin-top: 15px; + margin-bottom: 15px; } li:last-child { diff --git a/app/controllers/root_controller.rb b/app/controllers/root_controller.rb index 07a118f58..05e204c2b 100644 --- a/app/controllers/root_controller.rb +++ b/app/controllers/root_controller.rb @@ -11,7 +11,7 @@ class RootController < ApplicationController redirect_to admin_procedures_path else - redirect_to new_user_session_path + render 'landing' end end end \ No newline at end of file diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 38ac3a218..dea69cedb 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -9,10 +9,11 @@ = javascript_include_tag 'application', 'data-turbolinks-track' => true = csrf_meta_tags %body - #beta - Beta %div#wrap - %div.navbar + %div#header.navbar + + #beta + Beta = image_tag('marianne_small.png', class: 'logo') %a{href: '/'} = image_tag('logo-tps.png', class: 'logo') @@ -38,6 +39,9 @@ = current_user.email = link_to "Déconnexion", '/users/sign_out', method: :delete, :class => 'btn btn-md' + -#- else + -# = link_to "Se connecter", '/users/sign_in', method: :get, :class => 'btn btn-md' + -# = link_to "S'inscrire", '/users/sign_up', method: :get, :class => 'btn btn-md' #flash_message.center - if flash.notice @@ -47,7 +51,7 @@ .alert.alert-danger = flash.alert - %div{:style => 'margin-left:10%; margin-right:10%;'} + %div.main_div = yield %br @@ -60,7 +64,7 @@ =link_to 'SGMAP', "http://etatplateforme.modernisation.gouv.fr" - 2016. All Rights Reserved + 2016 - Tous droits réservés =link_to 'contact@tps.apientreprise.fr', "mailto:contact@tps.apientreprise.fr" diff --git a/app/views/root/landing.html.haml b/app/views/root/landing.html.haml index 47aa3a696..61333cb38 100644 --- a/app/views/root/landing.html.haml +++ b/app/views/root/landing.html.haml @@ -7,19 +7,15 @@ %br %h3.center - Simplifié toutes vos démarches pour les rendre 100% en ligne. + Simplifiez toutes vos démarches pour les rendre 100% en ligne. - #buttons.center - %button.js-scrollTo.btn.btn-lg.btn-default{cible: '.simplifier'} - Simplifier - %button.js-scrollTo.btn.btn-lg.btn-default{cible: '.securiser'} - Sécuriser - %button.js-scrollTo.btn.btn-lg.btn-default{cible: '.echanger'} - Échanger - %button.js-scrollTo.btn.btn-lg.btn-default{cible: '.faciliter'} - Faciliter - %button.js-scrollTo.btn.btn-lg.btn-default{cible: '.profiter'} - Profiter + %br + %br + + .center + =mail_to "contact@tps.apientreprise.fr", 'Ouvrir un compte TPS',{ subject: 'Ouvrir un compte TPS', + body: 'Bonjour, je souhaiterais ouvrir un compte TPS. Merci de me recontacter par email ou par téléphone au _____.', + class: 'btn btn-lg btn-default' } #suite.max-size .row.word.simplifier @@ -32,7 +28,7 @@ %li %a Ne demander que les informations strictement nécessaires %li - %a Gérer les procédures, publication, suspension, en un clic. + %a Gérer les procédures, publication, suspension, en un clic .row.word.securiser .col-md-6.col-lg-6 @@ -61,10 +57,10 @@ .row.word.faciliter .col-md-6.col-lg-6 %ul.dynamic_ul - %li - Construire la démarche en plusieurs fois %li Gagner du temps sur l’instruction + %li + Profiter des ressources cartographiques directement mobilisées, si nécessaire .col-md-6.col-lg-6 = image_tag image_url('keywords/faciliter.png') @@ -77,4 +73,4 @@ %li Récupérer des informations officielles collectées directement auprès des administrations %li - Profiter des ressources cartographiques directement mobilisées, si nécessaire \ No newline at end of file + Construire la démarche en plusieurs fois \ No newline at end of file diff --git a/spec/controllers/root_controller_spec.rb b/spec/controllers/root_controller_spec.rb index 0fe3f6b4b..dac28dc82 100644 --- a/spec/controllers/root_controller_spec.rb +++ b/spec/controllers/root_controller_spec.rb @@ -29,6 +29,12 @@ describe RootController, type: :controller do end context 'when nobody is connected' do - it { expect(subject).to redirect_to(new_user_session_path) } + render_views + + before do + subject + end + + it { expect(response.body).to have_css('#landing') } end end \ No newline at end of file diff --git a/spec/features/admin/connection_spec.rb b/spec/features/admin/connection_spec.rb index 733c77c3e..dc6659ef1 100644 --- a/spec/features/admin/connection_spec.rb +++ b/spec/features/admin/connection_spec.rb @@ -32,7 +32,7 @@ feature 'Administrator connection' do page.find_by_id('admin_sign_out').click end scenario 'admin is redireted to home page' do - expect(page).to have_css('#login_user') + expect(page).to have_css('#landing') end end context 'when clicking on profile' do diff --git a/spec/features/users/list_dossiers_spec.rb b/spec/features/users/list_dossiers_spec.rb index 44b277fc9..297863d81 100644 --- a/spec/features/users/list_dossiers_spec.rb +++ b/spec/features/users/list_dossiers_spec.rb @@ -9,7 +9,7 @@ feature 'user access to the list of his dossier' do before do last_updated_dossier.update_attributes(nom_projet: 'salut la compagnie') - visit root_path + visit new_user_session_path within('#new_user') do page.find_by_id('user_email').set user.email page.find_by_id('user_password').set user.password