dossiers: add a button to start a new demarche
This commit is contained in:
parent
20aeae5029
commit
9f70e72d83
5 changed files with 21 additions and 1 deletions
5
app/assets/stylesheets/new_design/dossiers_headers.scss
Normal file
5
app/assets/stylesheets/new_design/dossiers_headers.scss
Normal file
|
@ -0,0 +1,5 @@
|
|||
.dossiers-headers {
|
||||
.new-demarche {
|
||||
float: right;
|
||||
}
|
||||
}
|
|
@ -77,3 +77,7 @@
|
|||
padding-right: $default-spacer;
|
||||
}
|
||||
}
|
||||
|
||||
.dossiers-table-empty {
|
||||
text-align: center;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
module NewUser
|
||||
class DossiersController < UserController
|
||||
helper_method :new_demarche_url
|
||||
|
||||
before_action :ensure_ownership!, except: [:index, :modifier, :update]
|
||||
before_action :ensure_ownership_or_invitation!, only: [:modifier, :update]
|
||||
before_action :ensure_dossier_can_be_updated, only: [:update_identite, :update]
|
||||
|
@ -112,6 +114,10 @@ module NewUser
|
|||
end
|
||||
end
|
||||
|
||||
def new_demarche_url
|
||||
"https://doc.demarches-simplifiees.fr/listes-des-demarches"
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def ensure_dossier_can_be_updated
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
.dossiers-headers.sub-header
|
||||
.container
|
||||
= link_to "Commencer une nouvelle démarche", new_demarche_url, class: "button secondary new-demarche"
|
||||
|
||||
- if @dossiers_invites.count == 0
|
||||
%h1.page-title Mes dossiers
|
||||
|
||||
|
@ -52,4 +54,6 @@
|
|||
= paginate(@dossiers)
|
||||
|
||||
- else
|
||||
.dossiers-table-empty
|
||||
%h2.empty-text Aucun dossier.
|
||||
= link_to "Commencer une nouvelle démarche", new_demarche_url, class: "button primary"
|
||||
|
|
|
@ -7,6 +7,7 @@ describe 'new_user/dossiers/index.html.haml', type: :view do
|
|||
let(:current_tab) { 'mes-dossiers' }
|
||||
|
||||
before do
|
||||
allow(view).to receive(:new_demarche_url).and_return('#')
|
||||
assign(:user_dossiers, Kaminari.paginate_array(user_dossiers).page(1))
|
||||
assign(:dossiers_invites, Kaminari.paginate_array(dossiers_invites).page(1))
|
||||
assign(:dossiers, Kaminari.paginate_array(user_dossiers).page(1))
|
||||
|
|
Loading…
Reference in a new issue