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 18, 2018
2 parents 400afa6 + 530baf6 commit 7ed975f
Show file tree
Hide file tree
Showing 27 changed files with 263 additions and 45 deletions.
1 change: 1 addition & 0 deletions app/assets/images/icons/download-white.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 32 additions & 0 deletions app/assets/stylesheets/new_design/demarches_index.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
@import "colors";

#demarches-index {
margin-bottom: 30px;
}

.page-title {
margin-top: 30px;
margin-bottom: 30px;
}

.list-header {
color: $grey;
font-weight: bold;
margin-bottom: 10px;
}

.demarche-links {
border-top: 1px solid $border-grey;
margin-bottom: 30px;
}

.demarche-link {
display: block;
padding: 10px;
border-bottom: 1px solid $border-grey;
width: 100%;

&:hover {
background-color: $lighter-blue;
}
}
2 changes: 2 additions & 0 deletions app/assets/stylesheets/new_design/dossier_show.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
@import "constants";

#dossier-show {
margin-bottom: 30px;

.sub-header {
.label {
float: right;
Expand Down
4 changes: 4 additions & 0 deletions app/assets/stylesheets/new_design/icons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@
background-image: image-url("icons/attachment.svg");
}

&.download {
background-image: image-url("icons/download-white.svg");
}

&.lock {
background-image: image-url("icons/lock.svg");
}
Expand Down
7 changes: 6 additions & 1 deletion app/assets/stylesheets/new_design/patron.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
@import "placeholders";
@import "colors";

.patron {
p {
margin-bottom: 20px;
}

.icon.download {
background-color: $blue;
box-shadow: 0px 0px 1px 2px $blue;
}
}
24 changes: 17 additions & 7 deletions app/assets/stylesheets/new_design/status_overview.scss
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,28 @@
margin: auto;
}

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

.decision {
font-size: 1.2em;
margin-top: $default-padding * 3;
margin-bottom: $default-padding * 3;
}

.icon {
margin-right: $default-spacer;
}

h3 {
font-size: 1.1em;
font-weight: bold;
margin-bottom: $default-spacer;
}

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

blockquote {
quotes: "« " " »" "" "";
margin-bottom: $default-padding * 3;
}

blockquote::before {
Expand All @@ -77,7 +87,7 @@
content: close-quote;
}

.icon {
margin-right: $default-spacer;
.action {
margin-bottom: $default-padding * 3;
}
}
21 changes: 21 additions & 0 deletions app/controllers/new_user/demarches_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
module NewUser
class DemarchesController < UserController
def index
@previous_demarches_still_active = current_user
.dossiers
.includes(:procedure)
.map(&:procedure)
.uniq
.select { |p| p.publiee? }

@popular_demarches = Procedure
.select("procedures.*, COUNT(*) AS procedures_count")
.joins(:dossiers)
.publiees
.where(dossiers: { created_at: 7.days.ago..Time.now })
.group("procedures.id")
.order("procedures_count DESC")
.limit(5)
end
end
end
6 changes: 0 additions & 6 deletions app/controllers/new_user/dossiers_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ module NewUser
class DossiersController < UserController
include DossierHelper

helper_method :new_demarche_url

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]
before_action :ensure_dossier_can_be_updated, only: [:update_identite, :update_brouillon, :modifier, :update]
Expand Down Expand Up @@ -177,10 +175,6 @@ def recherche
end
end

def new_demarche_url
"https://doc.demarches-simplifiees.fr/listes-des-demarches"
end

private

def ensure_dossier_can_be_updated
Expand Down
25 changes: 25 additions & 0 deletions app/views/new_user/demarches/index.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
- content_for(:title, "Démarches")

- content_for :footer do
= render partial: "new_user/dossiers/index_footer"

#demarches-index
.container
%h1.page-title Démarches

- if @previous_demarches_still_active.present?
%h2.list-header SUR LESQUELLES VOUS AVEZ DÉJÀ DÉPOSÉ UN DOSSIER
%ul.demarche-links
- @previous_demarches_still_active.each do |demarche|
%li
= link_to(demarche.libelle, commencer_url(procedure_path: demarche.path), class: "demarche-link")

- if @popular_demarches.present?
%h2.list-header LES PLUS POPULAIRES
%ul.demarche-links
- @popular_demarches.each do |demarche|
%li
= link_to(demarche.libelle, commencer_url(procedure_path: demarche.path), class: "demarche-link")

%h2.list-header TOUTES LES DÉMARCHES
= link_to("Voir l'intégralité des démarches disponibles", LISTE_DES_DEMARCHES_URL, class: "button")
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,4 @@
%p= politique

.footer-row.footer-bottom-line
= link_to "Accessibilité", accessibilite_index_path, :class => "footer-link"
= link_to "CGU", CGU_URL, :class => "footer-link", :target => "_blank", rel: "noopener noreferrer"
= link_to "Mentions légales", MENTIONS_LEGALES_URL, :class => "footer-link", :target => "_blank", rel: "noopener noreferrer"
= contact_link "Contact technique", class: "footer-link", dossier_id: dossier.id
= render partial: "new_user/dossiers/general_footer_row", locals: { dossier: @dossier }
7 changes: 7 additions & 0 deletions app/views/new_user/dossiers/_general_footer_row.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
= link_to "Accessibilité", accessibilite_index_path, :class => "footer-link"
= link_to "CGU", CGU_URL, :class => "footer-link", :target => "_blank", rel: "noopener noreferrer"
= link_to "Mentions légales", MENTIONS_LEGALES_URL, :class => "footer-link", :target => "_blank", rel: "noopener noreferrer"
= contact_link "Contact technique", class: "footer-link", dossier_id: dossier&.id
4 changes: 4 additions & 0 deletions app/views/new_user/dossiers/_index_footer.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
%footer.dossier-footer
.container
.footer-row.footer-bottom-line
= render partial: "new_user/dossiers/general_footer_row", locals: { dossier: nil }
2 changes: 1 addition & 1 deletion app/views/new_user/dossiers/brouillon.html.haml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
- content_for(:title, "Modification du brouillon nº #{@dossier.id} (#{@dossier.procedure.libelle})")

- content_for :footer do
= render partial: "new_user/dossiers/footer", locals: { dossier: @dossier }
= render partial: "new_user/dossiers/dossier_footer", locals: { dossier: @dossier }

.dossier-edit
.dossier-header.sub-header
Expand Down
4 changes: 4 additions & 0 deletions app/views/new_user/dossiers/demande.html.haml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
- content_for(:title, "Demande · Dossier nº #{@dossier.id} (#{@dossier.procedure.libelle})")

- content_for :footer do
= render partial: "new_user/dossiers/dossier_footer", locals: { dossier: @dossier }

#dossier-show
= render partial: 'new_user/dossiers/show/header', locals: { dossier: @dossier }

Expand All @@ -8,3 +11,4 @@
.container
- if [email protected]_only?
= link_to "Modifier le dossier", modifier_dossier_path(@dossier), class: 'button primary edit-form'
.clearfix
2 changes: 1 addition & 1 deletion app/views/new_user/dossiers/identite.html.haml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
- content_for(:title, "Nouveau dossier (#{@dossier.procedure.libelle})")

- content_for :footer do
= render partial: "new_user/dossiers/footer", locals: { dossier: @dossier }
= render partial: "new_user/dossiers/dossier_footer", locals: { dossier: @dossier }

.two-columns
.columns-container
Expand Down
7 changes: 5 additions & 2 deletions app/views/new_user/dossiers/index.html.haml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
- content_for(:title, "Dossiers")

- content_for :footer do
= render partial: "new_user/dossiers/index_footer"

.dossiers-headers.sub-header
.container
= link_to "Commencer une nouvelle démarche", new_demarche_url, class: "button secondary new-demarche"
= link_to "Commencer une nouvelle démarche", demarches_url, class: "button secondary new-demarche"

- if @dossiers_invites.count == 0
%h1.page-title Mes dossiers
Expand Down Expand Up @@ -63,4 +66,4 @@
.dossiers-table-empty
%h2.empty-text Aucun dossier.
%p.empty-text-details Vous n’avez pas encore commencé de démarche.
= link_to "Commencer une nouvelle démarche", new_demarche_url, class: "button primary"
= link_to "Commencer une nouvelle démarche", demarches_url, class: "button primary"
3 changes: 3 additions & 0 deletions app/views/new_user/dossiers/messagerie.html.haml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
- content_for(:title, "Messagerie · Dossier nº #{@dossier.id} (#{@dossier.procedure.libelle})")

- content_for :footer do
= render partial: "new_user/dossiers/dossier_footer", locals: { dossier: @dossier }

#dossier-show
= render partial: 'new_user/dossiers/show/header', locals: { dossier: @dossier }

Expand Down
3 changes: 3 additions & 0 deletions app/views/new_user/dossiers/modifier.html.haml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
- content_for(:title, "Modifier · Dossier nº #{@dossier.id} (#{@dossier.procedure.libelle})")

- content_for :footer do
= render partial: "new_user/dossiers/dossier_footer", locals: { dossier: @dossier }

#dossier-show
= render partial: 'new_user/dossiers/show/header', locals: { dossier: @dossier }

Expand Down
14 changes: 5 additions & 9 deletions app/views/new_user/dossiers/show.html.haml
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
- content_for(:title, "Résumé · Dossier nº #{@dossier.id} (#{@dossier.procedure.libelle})")

- content_for :footer do
= render partial: "new_user/dossiers/dossier_footer", locals: { dossier: @dossier }

#dossier-show
= render partial: 'new_user/dossiers/show/header', locals: { dossier: @dossier }

.container
= render partial: 'new_user/dossiers/show/status_overview', locals: { dossier: @dossier }

- latest_message = @dossier.commentaires.last
- if latest_message.present?
.latest-message-section
%h3.tab-title Dernier message

.message.inverted-background
= render partial: "shared/dossiers/messages/message", locals: { commentaire: latest_message, connected_user: current_user, messagerie_seen_at: nil }

= link_to commentaire_answer_action(latest_message, current_user), messagerie_dossier_url(@dossier, anchor: 'new_commentaire'), class: 'button send'
- if [email protected]?
= render partial: 'new_user/dossiers/show/latest_message', locals: { dossier: @dossier }
9 changes: 9 additions & 0 deletions app/views/new_user/dossiers/show/_latest_message.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
- latest_message = dossier.commentaires.last
- if latest_message.present?
.latest-message-section
%h3.tab-title Dernier message

.message.inverted-background
= render partial: "shared/dossiers/messages/message", locals: { commentaire: latest_message, connected_user: current_user, messagerie_seen_at: nil }

= link_to commentaire_answer_action(latest_message, current_user), messagerie_dossier_url(dossier, anchor: 'new_commentaire'), class: 'button send'
27 changes: 18 additions & 9 deletions app/views/new_user/dossiers/show/_status_overview.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,25 @@

- elsif dossier.accepte?
.accepte
%p
%p.decision
%span.icon.accept
Votre dossier a été
= succeed '.' do
%strong accepté

- if dossier.motivation.present?
%h3 Motif de l’acceptation
%blockquote= dossier.motivation
- if dossier.motivation.present?
%h3 Motif de l’acceptation
%blockquote= dossier.motivation

- if dossier.attestation.present?
.action
= link_to attestation_dossier_path(dossier), target: '_blank', class: 'button primary' do
%span.icon.download
Télécharger l’attestation

- elsif dossier.refuse?
.refuse
%p
%p.decision
%span.icon.refuse
Nous sommes désolés, votre dossier a malheureusement été
= succeed '.' do
Expand All @@ -50,14 +56,17 @@
%h3 Motif du refus
%blockquote= dossier.motivation

.action
= link_to 'Envoyer un message à l’administration', messagerie_dossier_url(dossier, anchor: 'new_commentaire'), class: 'button'

- elsif dossier.sans_suite?
.sans-suite
%p
%p.decision
%span.icon.without-continuation
Votre dossier a été classé
= succeed '.' do
%strong sans suite

- if dossier.motivation.present?
%h3 Motif du classement sans suite
%blockquote= dossier.motivation
- if dossier.motivation.present?
%h3 Motif du classement sans suite
%blockquote= dossier.motivation
1 change: 1 addition & 0 deletions app/views/root/patron.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
%span.icon.search
%span.icon.sign-out
%span.icon.info
%span.icon.download
%span.icon.frown
%span.icon.meh
%span.icon.smile
Expand Down
1 change: 1 addition & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@
end
end
resource :feedback, only: [:create]
get 'demarches' => 'demarches#index'
end

#
Expand Down
Loading

0 comments on commit 7ed975f

Please sign in to comment.