Add a new demarches page, showing the demarches already done

This commit is contained in:
gregoirenovel 2018-09-13 16:13:54 +02:00
parent 561fc510e9
commit 9fe9f9b616
4 changed files with 52 additions and 0 deletions

View file

@ -0,0 +1,28 @@
@import "colors";
.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;
}
}

View file

@ -0,0 +1,12 @@
module NewUser
class DemarchesController < UserController
def index
@previous_demarches_still_active = current_user
.dossiers
.includes(:procedure)
.map(&:procedure)
.uniq
.select { |p| p.publiee? }
end
end
end

View file

@ -0,0 +1,11 @@
- content_for(:title, "Démarches")
.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")

View file

@ -292,6 +292,7 @@ Rails.application.routes.draw do
end
end
resource :feedback, only: [:create]
get 'demarches' => 'demarches#index'
end
#