-
Notifications
You must be signed in to change notification settings - Fork 5
/
index.html.erb
83 lines (82 loc) · 3.93 KB
/
index.html.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<div class="fr-container">
<div class="fr-grid-row">
<div class="fr-col-12">
<%= link_to t('.links.profile'), user_profile_path, class: %w(fr-link fr-icon-account-fill fr-link--icon-left fr-text--lg pull-right fr-mb-2w ) %>
</div>
<div class="fr-col-12">
<h1 class="fr-h1 fr-mb-4w">
<% if @authorization_requests.empty? %>
<%= t('.no_authorization_requests') %>
<% else %>
<%= t('.title', api_label: t(".#{@authorization_requests.first.api}"), count: @authorization_requests.count).html_safe %>
<% end %>
</h1>
</div>
</div>
<div class="fr-row">
<div class="fr-col-12">
<div class="fr-container fr-container--bordered fr-p-0">
<div class="fr-grid-row fr-p-4v fr-grid-row--middle fr-grid-row--gutters">
<div class="fr-col-12 fr-col-sm-3 center">
<strong><%= t('.table.head.authorization_request') %></strong>
</div>
<div class="fr-col-12 fr-col-sm-4 center">
<strong><%= t('.table.head.token') %></strong>
</div>
<div class="fr-col-12 fr-col-sm-3 center">
<strong><%= t('.table.head.actions') %></strong>
</div>
<div class="fr-col-12 fr-col-sm-2 center">
<strong><%= t('.table.head.detail') %></strong>
</div>
</div>
<% @authorization_requests.each do |authorization_request| %>
<div id="<%= dom_id(authorization_request) %>" class="fr-grid-row fr-grid-row--gutters fr-grid-row--middle fr-p-4v">
<div class="fr-col-12 fr-col-sm-3 fr-p-0 center">
<h2 class="fr-h6 fr-mb-0"><%= authorization_request.intitule %></h2>
<%= authorization_request_status_badge(authorization_request) %>
<span class="fr-hint-text">
<%= link_to t('.links.to_datapass', external_id: authorization_request.external_id).html_safe,
datapass_authorization_request_url(authorization_request),
id: dom_id(authorization_request, :authorization_request_link),
class: %w(fr-link fr-text--sm fr-mt-2v),
target: '_blank'
%>
</span>
<span class="fr-text--xs"><span class="fr-icon-user-fill fr-icon--xs fr-pr-1v" aria-hidden="true"></span>Vous êtes
<%= authorization_request.user_authorization_request_roles.for_user(@current_user).map { |uarr|
I18n.t("user_authorization_request_roles.role.#{uarr.role}")
}.join(', ')
%>
</span>
</div>
<div class="fr-col-12 fr-col-sm-4 fr-p-0 center">
<% if authorization_request.token %>
<%= render partial: 'shared/tokens/detail_short',
locals: {
token: authorization_request.token.decorate
}
%>
<% end %>
<% authorization_request.tokens.blacklisted_later.decorate.each do |banned_token| %>
<%= render partial: 'shared/tokens/detail_short',
locals: {
token: banned_token.decorate
}
%>
<% end %>
</div>
<div class="fr-col-12 fr-col-sm-3 center">
<% authorization_request_expected_actions(authorization_request, current_user).each do |action| %>
<%= render partial: "shared/authorization_requests/actions/#{action[:action]}", locals: { label: action[:label], authorization_request:, to_datapass_reopen: action[:to_datapass_reopen] } %>
<% end %>
</div>
<div class="fr-col-12 fr-col-sm-2 center">
<%= link_to "", authorization_request_path(authorization_request), class: %w[fr-btn fr-btn--lg fr-btn--tertiary-no-outline fr-icon-arrow-right-line] %>
</div>
</div>
<% end %>
</div>
</div>
</div>
</div>