Skip to content

Commit

Permalink
Merge pull request #165 from etalab/features/entities-in-summary
Browse files Browse the repository at this point in the history
Displays entities in summaries
  • Loading branch information
skelz0r authored Apr 22, 2024
2 parents 9d1dc41 + 4a4879b commit f609789
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 63 deletions.
2 changes: 2 additions & 0 deletions app/views/authorization_request_forms/summary.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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 %>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<div class="fr-container-fluid">
<div class="fr-grid-row">
<div class="fr-col-12 fr-col-lg-6 fr-pr-4v fr-pb-4v">
<div class="fr-basic-card">
<div class="contact-card__kind">
Organisation
</div>

<div class="contact-card__full_name">
<%= @authorization_request.organization.raison_sociale %>
</div>

<%
%w[
siret
address
code_naf_with_libelle
].each do |organization_attribute|
%>
<% next unless @authorization_request.organization.public_send(organization_attribute).present? %>

<div class="contact-card__attribute">
<div class="contact-card__attribute-label">
<%= Organization.human_attribute_name(organization_attribute) %>
</div>
<div class="contact-card__attribute-value">
<%= @authorization_request.organization.public_send(organization_attribute) %>
</div>
</div>
<% end %>
</div>
</div>

<div class="fr-col-12 fr-col-lg-6 fr-pr-4v fr-pb-4v">
<div class="fr-basic-card">
<div class="contact-card__kind">
Demandeur
</div>

<div class="contact-card__full_name">
<%= @authorization_request.applicant.full_name %>
</div>

<%
%w[
job_title
email
phone_number
].each do |user_attribute|
%>
<div class="contact-card__attribute">
<div class="contact-card__attribute-label">
<%= User.human_attribute_name(user_attribute) %>
</div>
<div class="contact-card__attribute-value">
<%= @authorization_request.applicant.public_send(user_attribute) %>
</div>
</div>
<% end %>
</div>
</div>
</div>
</div>
64 changes: 1 addition & 63 deletions app/views/instruction/authorization_requests/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,67 +1,5 @@
<%= authorization_request_form_tag(@authorization_request) do |f| %>
<div class="fr-container-fluid">
<div class="fr-grid-row">
<div class="fr-col-12 fr-col-lg-6 fr-pr-4v fr-pb-4v">
<div class="fr-basic-card">
<div class="contact-card__kind">
Organisation
</div>

<div class="contact-card__full_name">
<%= @authorization_request.organization.raison_sociale %>
</div>

<%
%w[
siret
address
code_naf_with_libelle
].each do |organization_attribute|
%>
<% next unless @authorization_request.organization.public_send(organization_attribute).present? %>

<div class="contact-card__attribute">
<div class="contact-card__attribute-label">
<%= Organization.human_attribute_name(organization_attribute) %>
</div>
<div class="contact-card__attribute-value">
<%= @authorization_request.organization.public_send(organization_attribute) %>
</div>
</div>
<% end %>
</div>
</div>

<div class="fr-col-12 fr-col-lg-6 fr-pr-4v fr-pb-4v">
<div class="fr-basic-card">
<div class="contact-card__kind">
Demandeur
</div>

<div class="contact-card__full_name">
<%= @authorization_request.applicant.full_name %>
</div>

<%
%w[
job_title
email
phone_number
].each do |user_attribute|
%>
<div class="contact-card__attribute">
<div class="contact-card__attribute-label">
<%= User.human_attribute_name(user_attribute) %>
</div>
<div class="contact-card__attribute-value">
<%= @authorization_request.applicant.public_send(user_attribute) %>
</div>
</div>
<% end %>
</div>
</div>
</div>
</div>
<%= render partial: 'authorization_requests/shared/organization_and_applicant' %>

<div class="info-block">
<h3>
Expand Down

0 comments on commit f609789

Please sign in to comment.