Skip to content

Commit

Permalink
Move applicant information so all card can display it
Browse files Browse the repository at this point in the history
  - if a request has no description in it, the current_user_mentions of current_user_is_applicant information will not display
  • Loading branch information
Isalafont committed May 22, 2024
1 parent fc5f890 commit c04f355
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions app/views/dashboard/_authorization_request_card.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,21 @@
<% if authorization_request.respond_to?(:description) %>
<div class="card-description">
<%= truncate(authorization_request.description, length: 30) %>

<% if authorization_request.only_in_contacts?(current_user) %>
<p class="fr-text--xs fr-text-grey fr-my-2v">
<%= t('.current_user_mentions', contact_types: authorization_request.humanized_contact_types_for(current_user).to_sentence) %>
</p>
<% elsif authorization_request.applicant == current_user %>
<p class="fr-text--xs fr-text-grey fr-my-2v">
<%= t('.current_user_is_applicant') %>
</p>
<% end %>
</div>
<% end %>

<div class="card-applicant-information">
<% if authorization_request.only_in_contacts?(current_user) %>
<p class="fr-text--xs fr-text-grey fr-my-2v">
<%= t('.current_user_mentions', contact_types: authorization_request.humanized_contact_types_for(current_user).to_sentence) %>
</p>
<% elsif authorization_request.applicant == current_user %>
<p class="fr-text--xs fr-text-grey fr-my-2v">
<%= t('.current_user_is_applicant') %>
</p>
<% end %>
</div>

<% if authorization_request.already_been_validated? %>
<%= link_to t('.show_cta'), authorization_path(authorization_request.latest_authorization), class: %w(fr-btn fr-btn--sm) %>
<% else %>
Expand Down

0 comments on commit c04f355

Please sign in to comment.