diff --git a/app/controllers/new_administrateur/procedures_controller.rb b/app/controllers/new_administrateur/procedures_controller.rb index a13053da6..3e0ce2710 100644 --- a/app/controllers/new_administrateur/procedures_controller.rb +++ b/app/controllers/new_administrateur/procedures_controller.rb @@ -2,10 +2,15 @@ module NewAdministrateur class ProceduresController < AdministrateurController def apercu @dossier = procedure_without_control.new_dossier + @tab = apercu_tab end private + def apercu_tab + params[:tab] || 'dossier' + end + def procedure_without_control Procedure.find(params[:id]) end diff --git a/app/views/new_administrateur/procedures/apercu.html.haml b/app/views/new_administrateur/procedures/apercu.html.haml index 233de2a26..b5a8dcc4d 100644 --- a/app/views/new_administrateur/procedures/apercu.html.haml +++ b/app/views/new_administrateur/procedures/apercu.html.haml @@ -1,6 +1,22 @@ -.dossier-edit - .dossier-header - .container - %h1 Prévisualisation de la procédure #{@dossier.procedure.libelle} +.dossiers-headers.accompagnateur-header + .container + %h1.page-title Prévisualisation de la procédure #{@dossier.procedure.libelle} -= render partial: "shared/dossiers/edit", locals: { dossier: @dossier, apercu: true } + %ul.tabs + %li{ class: (@tab == 'dossier') ? 'active' : nil }> + = link_to(apercu_procedure_path(@dossier.procedure, tab: 'dossier')) do + le dossier + - if @dossier.champs_private.size > 0 + %li{ class: (@tab == 'annotations-privees') ? 'active' : nil }> + = link_to(apercu_procedure_path(@dossier.procedure, tab: 'annotations-privees')) do + les annotations privees + +- if @tab == 'dossier' + = render partial: "shared/dossiers/edit", locals: { dossier: @dossier, apercu: true } +- else + .container + = form_for @dossier, url: '', method: :get, html: { class: 'form' } do |f| + = f.fields_for :champs_private, @dossier.champs_private do |champ_form| + - champ = champ_form.object + = render partial: "shared/dossiers/editable_champs/editable_champ", + locals: { champ: champ, form: champ_form }