Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
gregoirenovel committed Sep 24, 2018
2 parents 4ce6ab4 + f402dc1 commit 0e8b1b9
Show file tree
Hide file tree
Showing 17 changed files with 230 additions and 19 deletions.
Binary file added app/assets/images/tour-de-france/atelier1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/tour-de-france/atelier2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions app/assets/images/tour-de-france/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions app/assets/stylesheets/new_design/_constants.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
$page-width: 1040px;
$small-page-width: 840px;

$default-spacer: 8px;
$default-padding: 2 * $default-spacer;
Expand Down
6 changes: 6 additions & 0 deletions app/assets/stylesheets/new_design/common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,9 @@ a {
max-width: $page-width + 2 * $default-padding;
margin: 0 auto;
}

.small-container {
@include horizontal-padding($default-padding);
max-width: $small-page-width + 2 * $default-padding;
margin: 0 auto;
}
7 changes: 6 additions & 1 deletion app/assets/stylesheets/new_design/dossier_show.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
}

.title-container {
margin-bottom: $default-padding * 2;
margin-bottom: $default-spacer;
padding-left: 32px;

.icon.folder {
Expand All @@ -31,6 +31,11 @@
color: $grey;
font-weight: bold;
}

.header-actions {
margin-bottom: $default-spacer;
text-align: right;
}
}

.button.edit-form {
Expand Down
91 changes: 91 additions & 0 deletions app/assets/stylesheets/new_design/tour_de_france.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
@import "colors";

$default-space: 15px;

.tour-de-france {
.blue-panel {
background-color: $blue;
}

.white-panel {
padding-top: 2 * $default-space;
padding-bottom: 2 * $default-space;
}

.photos-panel {
background: linear-gradient(#FFFFFF, #FFFFFF 50%, $light-grey 50%, $light-grey 100%);
padding-top: 2 * $default-space;
padding-bottom: 2 * $default-space;
}

.grey-panel {
background-color: $light-grey;
padding-top: 2 * $default-space;
padding-bottom: 2 * $default-space;
}

p {
margin-bottom: $default-space;
}

h2 {
font-size: 20px;
font-weight: bold;
margin-bottom: $default-space;
}

h3 {
font-weight: bold;
}

h4 {
color: $grey;
margin-bottom: $default-space;
}

ul {
list-style-type: disc;
margin-left: 15px;
}

li {
margin-bottom: 5px;
}

.cards {
.card:nth-of-type(even) {
margin-right: 0px;
}
}

$card-margin-bottom: 2 * $default-space;

.card {
padding: 15px;
margin-bottom: $card-margin-bottom;
border-radius: 5px;
box-shadow: none;
border: 1px solid rgba(0, 0, 0, 0.15);
min-height: 230px;
}

$card-half-horizontal-spacing: 4 * $default-space;

.card-half {
width: calc((100% - #{$card-half-horizontal-spacing}) / 2);
margin-right: 3 * $default-space;
}

.tour-de-france-logo {
width: 400px;
margin: 0 auto;
display: block;
padding-top: 2 * $default-space;
padding-bottom: 2 * $default-space;
}

.atelier-photo {
width: 380px;
border-radius: 5px;
}
}
19 changes: 11 additions & 8 deletions app/controllers/new_user/dossiers_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ module NewUser
class DossiersController < UserController
include DossierHelper

before_action :ensure_ownership!, except: [:index, :show, :demande, :messagerie, :brouillon, :update_brouillon, :modifier, :update, :recherche]
before_action :ensure_ownership_or_invitation!, only: [:show, :demande, :messagerie, :brouillon, :update_brouillon, :modifier, :update, :create_commentaire]
ACTIONS_ALLOWED_TO_ANY_USER = [:index, :recherche]
ACTIONS_ALLOWED_TO_OWNER_OR_INVITE = [:show, :demande, :messagerie, :brouillon, :update_brouillon, :modifier, :update, :create_commentaire]

before_action :ensure_ownership!, except: ACTIONS_ALLOWED_TO_ANY_USER + ACTIONS_ALLOWED_TO_OWNER_OR_INVITE
before_action :ensure_ownership_or_invitation!, only: ACTIONS_ALLOWED_TO_OWNER_OR_INVITE
before_action :ensure_dossier_can_be_updated, only: [:update_identite, :update_brouillon, :modifier, :update]
before_action :forbid_invite_submission!, only: [:update_brouillon]
before_action :forbid_closed_submission!, only: [:update_brouillon]
Expand Down Expand Up @@ -122,14 +125,14 @@ def update
flash.now.alert = errors
render :modifier
else
if current_user.owns?(dossier)
if Flipflop.new_dossier_details?
redirect_to demande_dossier_path(@dossier)
else
if Flipflop.new_dossier_details?
redirect_to demande_dossier_path(@dossier)
else
if current_user.owns?(dossier)
redirect_to users_dossier_recapitulatif_path(@dossier)
else
redirect_to users_dossiers_invite_path(@dossier.invite_for_user(current_user))
end
else
redirect_to users_dossiers_invite_path(@dossier.invite_for_user(current_user))
end
end
end
Expand Down
6 changes: 6 additions & 0 deletions app/controllers/tour_de_france_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
class TourDeFranceController < ApplicationController
layout 'new_application'

def index
end
end
4 changes: 4 additions & 0 deletions app/controllers/users/dossiers/invites_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ def authenticate_user!
def show
@facade = InviteDossierFacades.new params[:id].to_i, current_user.email

if Flipflop.new_dossier_details?
return redirect_to dossier_path(@facade.dossier)
end

if @facade.dossier.brouillon?
redirect_to brouillon_dossier_path(@facade.dossier)
else
Expand Down
10 changes: 10 additions & 0 deletions app/views/invites/_dropdown.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
%span.button.dropdown.invite-user-action
%span.icon.person
- if dossier.invites.count > 0
Voir les personnes invitées
%span.badge= dossier.invites.count
- else
Inviter une personne à modifier ce dossier

.dropdown-content.fade-in-down
= render partial: "invites/form", locals: { dossier: dossier }
4 changes: 4 additions & 0 deletions app/views/new_user/dossiers/show/_header.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
%h1= dossier.procedure.libelle
%h2 Dossier nº #{dossier.id}

- if current_user.owns?(dossier)
.header-actions
= render partial: 'invites/dropdown', locals: { dossier: dossier }

%ul.tabs
= dynamic_tab_item('Résumé', dossier_path(dossier))
= dynamic_tab_item('Demande', [demande_dossier_path(dossier), modifier_dossier_path(dossier)])
Expand Down
11 changes: 1 addition & 10 deletions app/views/shared/dossiers/_header.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,4 @@

.dossier-form-actions
- if current_user.owns?(dossier)
%span.button.dropdown.invite-user-action
%span.icon.person
- if dossier.invites.count > 0
Voir les personnes invitées
%span.badge= dossier.invites.count
- else
Inviter une personne à modifier ce dossier

.dropdown-content.fade-in-down
= render partial: "invites/form", locals: { dossier: dossier }
= render partial: 'invites/dropdown', locals: { dossier: dossier }
83 changes: 83 additions & 0 deletions app/views/tour_de_france/index.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
- content_for(:title, 'Tour de France 2018')

- content_for :footer do
= render partial: "root/footer"

.tour-de-france
.blue-panel
.small-container
%img.tour-de-france-logo{ src: image_url("tour-de-france/logo.svg") }
.white-panel
.small-container
%h2 Présentation
%p
Cet automne, l’équipe de demarches-simplifiees.fr se lance dans un Tour de France afin de sensibiliser les agents publics aux bénéfices du numérique pour leur métier. Notre mission est de faciliter la mise en ligne de nouveaux services et d’accompagner les administrations d’État et territoriales dans la dématérialisation.
%p
Que vous ayez un profil SI ou métier, ce sera pour vous l’occasion de vous former à l’utilisation de demarches-simplifiees.fr et de mettre en place des services en ligne pour les formulaires que vous traitez encore en papier.
%p
La journée type se déroulera en deux temps :
.cards
.card.card-half.pull-left
%h3 Matin
%h4 9 h 30 - 12 h 00
Interventions consacrées aux enjeux généraux de la dématérialisation, à la présentation de demarches-simplifiees.fr et à des retours d’expériences d’agents utilisant déjà cette plateforme sur le territoire.
.card.card-half.pull-right
%h3 Après-midi
%h4 13 h 30 - 16 h 30
Ateliers de formation avec une réflexion étape par étape sur les problématiques liées au passage à la dématérialisation. Vous pourrez identifier des cas d’usage, apprendre à créer des formulaires en ligne et organiser l’instruction sur demarches-simplifiees.fr.
%p
Ces événements sont une opportunité pour tous les agents publics d’améliorer leur environnement de travail et le service rendu aux usagers, n’hésitez pas à relayer l’information auprès des services déconcentrés et des collectivités.
.photos-panel
.small-container
%img.atelier-photo.pull-left{ src: image_url("tour-de-france/atelier1.jpg") }
%img.atelier-photo.pull-right{ src: image_url("tour-de-france/atelier2.jpg") }
.clearfix
.grey-panel
.small-container
%h2.below-photos Inscription
%p
Vous souhaitez participer à l’événement dans votre région ? Inscrivez-vous à l’événement en remplissant le formulaire via le lien correspondant à votre région ci-dessous.
%p
Les places aux ateliers sont restreintes, ainsi si vous faite la demande de participation dans le formulaire d’inscription vous recevrez une confirmation ultérieure par email.
%ul
%li
= link_to("Étape Normandie, le 26 septembre à Rouen", "https://www.demarches-simplifiees.fr/commencer/tour-de-france-etape-normandie", target: "_blank")
%li
= link_to("Étape Occitanie, le 15 octobre à Toulouse", "https://www.demarches-simplifiees.fr/commencer/tour-de-france-demarches-simplifiees-fr-occitanie", target: "_blank")
%li
= link_to("Étape Nouvelle-Aquitaine, le 17 octobre à Bordeaux", "https://www.demarches-simplifiees.fr/commencer/tour-de-france-demarches-simplifiees-fr-aquitaine", target: "_blank")
%li
= link_to("Étape Martinique, le 24 octobre à Fort-de-France", "https://www.demarches-simplifiees.fr/commencer/tour-de-france-demarches-simplifiees-fr-martinique", target: "_blank")
%li
= link_to("Étape PACA, le 6 novembre à Marseille", "https://www.demarches-simplifiees.fr/commencer/tour-de-france-demarches-simplifiees-fr-paca", target: "_blank")
%li
= link_to("Étape Corse, le 8 novembre à Ajaccio", "https://www.demarches-simplifiees.fr/commencer/tour-de-france-demarches-simplifiees-fr-corse", target: "_blank")
%li
= link_to("Étape Ile-de-France, le 13 novembre à Paris", "https://www.demarches-simplifiees.fr/commencer/tour-de-france-demarches-simplifiees-iledefrance", target: "_blank")
%li
= link_to("Étape Bourgogne Franche-Comté, le 14 novembre à Dijon", "https://www.demarches-simplifiees.fr/commencer/tour-de-france-demarches-simplifiees-bourgogne-fc", target: "_blank")
%li
= link_to("Étape Pays de la Loire, le 20 novembre à Nantes", "https://www.demarches-simplifiees.fr/commencer/tour-de-france-demarches-simplifiees-fr-paysloire", target: "_blank")
%li
= link_to("Étape Bretagne, le 22 novembre à Rennes", "https://www.demarches-simplifiees.fr/commencer/tour-de-france-demarches-simplifiees-fr-bretagne", target: "_blank")
%li
= link_to("Étape Hauts-de-France, le 27 novembre à Lille", "https://www.demarches-simplifiees.fr/commencer/tour-de-france-demarches-simplifiees-hautsdefrance", target: "_blank")
%li
= link_to("Étape Grand-Est, le 29 novembre à Metz", "https://www.demarches-simplifiees.fr/commencer/tour-de-france-demarches-simplifiees-fr-grand-est", target: "_blank")
%li
= link_to("Étape Centre Val-de-Loire, le 4 décembre à Orleans", "https://www.demarches-simplifiees.fr/commencer/tour-de-france-demarches-simplifiees-centre-vdl", target: "_blank")
%li
= link_to("Étape Auvergne-Rhone-Alpes, le 7 décembre à Lyon", "https://www.demarches-simplifiees.fr/commencer/tour-de-france-demarches-simplifiees-auvergne-rhon", target: "_blank")
1 change: 1 addition & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@
#

root 'root#index'
get '/tour-de-france' => 'tour_de_france#index'
get '/administration' => 'root#administration'

get 'users' => 'users#index'
Expand Down
1 change: 1 addition & 0 deletions spec/views/new_user/dossiers/demande.html.haml_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
let(:dossier) { create(:dossier, :en_construction, :with_entreprise, procedure: procedure) }

before do
sign_in dossier.user
assign(:dossier, dossier)
end

Expand Down
4 changes: 4 additions & 0 deletions spec/views/new_user/dossiers/show/_header.html.haml_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
describe 'new_user/dossiers/show/header.html.haml', type: :view do
let(:dossier) { create(:dossier, :en_construction, procedure: create(:procedure)) }

before do
sign_in dossier.user
end

subject! { render 'new_user/dossiers/show/header.html.haml', dossier: dossier }

it 'affiche les informations du dossier' do
Expand Down

0 comments on commit 0e8b1b9

Please sign in to comment.