Add a new demarches page, showing the demarches already done
This commit is contained in:
parent
561fc510e9
commit
9fe9f9b616
4 changed files with 52 additions and 0 deletions
28
app/assets/stylesheets/new_design/demarches_index.scss
Normal file
28
app/assets/stylesheets/new_design/demarches_index.scss
Normal 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;
|
||||
}
|
||||
}
|
12
app/controllers/new_user/demarches_controller.rb
Normal file
12
app/controllers/new_user/demarches_controller.rb
Normal 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
|
11
app/views/new_user/demarches/index.html.haml
Normal file
11
app/views/new_user/demarches/index.html.haml
Normal 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")
|
|
@ -292,6 +292,7 @@ Rails.application.routes.draw do
|
|||
end
|
||||
end
|
||||
resource :feedback, only: [:create]
|
||||
get 'demarches' => 'demarches#index'
|
||||
end
|
||||
|
||||
#
|
||||
|
|
Loading…
Reference in a new issue