Mutualize some accompagnateur show template code in a partial

This commit is contained in:
gregoirenovel 2017-12-15 11:26:19 +01:00
parent 60c845986c
commit e4f7f20698
3 changed files with 26 additions and 47 deletions

View file

@ -2,27 +2,5 @@
= render partial: 'header', locals: { avis: @avis, dossier: @dossier }
.container
.tab-title Identité du demandeur
.card
- if @dossier.entreprise.present?
= render partial: 'new_gestionnaire/dossiers/identite_entreprise', locals: { entreprise: @dossier.entreprise }
= render partial: 'new_gestionnaire/shared/show', locals: { dossier: @dossier, demande_seen_at: nil }
- if @dossier.individual.present?
= render partial: 'new_gestionnaire/dossiers/identite_individual', locals: { individual: @dossier.individual }
.tab-title Formulaire
- champs = @dossier.ordered_champs.decorate
- if champs.any?
.card
= render partial: 'new_gestionnaire/dossiers/champs', locals: { champs: champs, demande_seen_at: nil }
- if @dossier.procedure.use_api_carto
.tab-title Cartographie
.card
= render partial: 'new_gestionnaire/dossiers/map', locals: { dossier: @dossier }
- if @dossier.procedure.cerfa_flag? || @dossier.types_de_piece_justificative.any?
.tab-title Pièces jointes
.card
= render partial: "new_gestionnaire/dossiers/pieces_jointes", locals: { dossier: @dossier, demande_seen_at: nil }

View file

@ -2,27 +2,4 @@
= render partial: "header", locals: { dossier: @dossier }
.container
.tab-title Identité du demandeur
.card
- if @dossier.entreprise.present?
= render partial: "identite_entreprise", locals: { entreprise: @dossier.entreprise }
- if @dossier.individual.present?
= render partial: "identite_individual", locals: { individual: @dossier.individual }
.tab-title Formulaire
- champs = @dossier.ordered_champs.includes(:type_de_champ).decorate
- if champs.any?
.card
= render partial: "champs", locals: { champs: champs, demande_seen_at: @demande_seen_at }
- if @dossier.procedure.use_api_carto
.tab-title Cartographie
.card
= render partial: "map", locals: { dossier: @dossier }
- if @dossier.procedure.cerfa_flag? || @dossier.types_de_piece_justificative.any?
.tab-title Pièces jointes
.card
= render partial: "pieces_jointes", locals: { dossier: @dossier, demande_seen_at: @demande_seen_at }
= render partial: 'new_gestionnaire/shared/show', locals: { dossier: @dossier, demande_seen_at: @demande_seen_at }

View file

@ -0,0 +1,24 @@
.container
.tab-title Identité du demandeur
.card
- if dossier.entreprise.present?
= render partial: "new_gestionnaire/dossiers/identite_entreprise", locals: { entreprise: dossier.entreprise }
- if dossier.individual.present?
= render partial: "new_gestionnaire/dossiers/identite_individual", locals: { individual: dossier.individual }
.tab-title Formulaire
- champs = dossier.ordered_champs.includes(:type_de_champ).decorate
- if champs.any?
.card
= render partial: "new_gestionnaire/dossiers/champs", locals: { champs: champs, demande_seen_at: demande_seen_at }
- if dossier.procedure.use_api_carto
.tab-title Cartographie
.card
= render partial: "new_gestionnaire/dossiers/map", locals: { dossier: dossier }
- if dossier.procedure.cerfa_flag? || dossier.types_de_piece_justificative.any?
.tab-title Pièces jointes
.card
= render partial: "new_gestionnaire/dossiers/pieces_jointes", locals: { dossier: dossier, demande_seen_at: demande_seen_at }