From 4a4879b6233d919525aa0e6929f9d90f9941d17c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Loi=CC=88c=20Delmaire?= Date: Fri, 19 Apr 2024 15:38:17 +0200 Subject: [PATCH] Displays entities in summaries Otherwise we don't know which organization and applicant is --- .../summary.html.erb | 2 + .../_organization_and_applicant.html.erb | 63 ++++++++++++++++++ .../authorization_requests/show.html.erb | 64 +------------------ 3 files changed, 66 insertions(+), 63 deletions(-) create mode 100644 app/views/authorization_requests/shared/_organization_and_applicant.html.erb diff --git a/app/views/authorization_request_forms/summary.html.erb b/app/views/authorization_request_forms/summary.html.erb index b1cfa411f..c2e662dba 100644 --- a/app/views/authorization_request_forms/summary.html.erb +++ b/app/views/authorization_request_forms/summary.html.erb @@ -82,6 +82,8 @@ <% end %> <% end %> + <%= render partial: 'authorization_requests/shared/organization_and_applicant' %> + <% if @authorization_request.draft? && !@authorization_request.reopening? %> <%= render partial: 'authorization_request_forms/shared/tos_checkboxes', locals: { f: f } %> <% end %> diff --git a/app/views/authorization_requests/shared/_organization_and_applicant.html.erb b/app/views/authorization_requests/shared/_organization_and_applicant.html.erb new file mode 100644 index 000000000..ea080d7bd --- /dev/null +++ b/app/views/authorization_requests/shared/_organization_and_applicant.html.erb @@ -0,0 +1,63 @@ +
+
+
+
+
+ Organisation +
+ +
+ <%= @authorization_request.organization.raison_sociale %> +
+ + <% + %w[ + siret + address + code_naf_with_libelle + ].each do |organization_attribute| + %> + <% next unless @authorization_request.organization.public_send(organization_attribute).present? %> + +
+
+ <%= Organization.human_attribute_name(organization_attribute) %> +
+
+ <%= @authorization_request.organization.public_send(organization_attribute) %> +
+
+ <% end %> +
+
+ +
+
+
+ Demandeur +
+ +
+ <%= @authorization_request.applicant.full_name %> +
+ + <% + %w[ + job_title + email + phone_number + ].each do |user_attribute| + %> +
+
+ <%= User.human_attribute_name(user_attribute) %> +
+
+ <%= @authorization_request.applicant.public_send(user_attribute) %> +
+
+ <% end %> +
+
+
+
diff --git a/app/views/instruction/authorization_requests/show.html.erb b/app/views/instruction/authorization_requests/show.html.erb index bc3d915c6..aa71f24ff 100644 --- a/app/views/instruction/authorization_requests/show.html.erb +++ b/app/views/instruction/authorization_requests/show.html.erb @@ -1,67 +1,5 @@ <%= authorization_request_form_tag(@authorization_request) do |f| %> -
-
-
-
-
- Organisation -
- -
- <%= @authorization_request.organization.raison_sociale %> -
- - <% - %w[ - siret - address - code_naf_with_libelle - ].each do |organization_attribute| - %> - <% next unless @authorization_request.organization.public_send(organization_attribute).present? %> - -
-
- <%= Organization.human_attribute_name(organization_attribute) %> -
-
- <%= @authorization_request.organization.public_send(organization_attribute) %> -
-
- <% end %> -
-
- -
-
-
- Demandeur -
- -
- <%= @authorization_request.applicant.full_name %> -
- - <% - %w[ - job_title - email - phone_number - ].each do |user_attribute| - %> -
-
- <%= User.human_attribute_name(user_attribute) %> -
-
- <%= @authorization_request.applicant.public_send(user_attribute) %> -
-
- <% end %> -
-
-
-
+ <%= render partial: 'authorization_requests/shared/organization_and_applicant' %>