-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #655 from etalab/display_all_habilitations_of_a_re…
…quest Init a tab for instructors to visualise habilitations
- Loading branch information
Showing
26 changed files
with
342 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
ul li.authorization-row { | ||
display: block; | ||
border-bottom: 1px solid rgba(0,0,0,0.1); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
class Instruction::AuthorizationsController < Instruction::AbstractAuthorizationRequestsController | ||
def index | ||
authorize [:instruction, @authorization_request], :show? | ||
|
||
@authorizations = AuthorizationRequest | ||
.find(params[:authorization_request_id]) | ||
.authorizations | ||
.includes(:approving_instructor) | ||
.order(created_at: :desc) | ||
end | ||
|
||
private | ||
|
||
def layout_name | ||
'instruction/authorization_request' | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 41 additions & 24 deletions
65
app/views/instruction/authorization_request_events/_authorization_request_event.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,44 @@ | ||
<li id="<%= dom_id(authorization_request_event) %>" class="authorization-request-event"> | ||
<%= | ||
content_tag( | ||
:span, | ||
'', | ||
class: [ | ||
"fr-icon-#{t(".#{authorization_request_event.name}.icon", default: 'error-warning-line')}", | ||
"fr-text-#{t(".#{authorization_request_event.name}.color", default: 'info')}", | ||
] | ||
) | ||
%> | ||
<li id="<%= dom_id(authorization_request_event) %>" class="fr-grid-row"> | ||
<div class="fr-mr-1w"> | ||
<%= | ||
content_tag( | ||
:span, | ||
'', | ||
class: [ | ||
"fr-icon-#{t(".#{authorization_request_event.name}.icon", default: 'error-warning-line')}", | ||
"fr-text-#{t(".#{authorization_request_event.name}.color", default: 'info')}", | ||
] | ||
) | ||
%> | ||
</div> | ||
|
||
<%= | ||
t( | ||
".#{authorization_request_event.name}.text", | ||
**{ | ||
user_full_name: authorization_request_event.user_full_name, | ||
text: authorization_request_event.text, | ||
copied_from_authorization_request_id: authorization_request_event.copied_from_authorization_request_id, | ||
}.compact | ||
).html_safe | ||
%> | ||
<div class="fr-col"> | ||
<%= | ||
t( | ||
".#{authorization_request_event.name}.text", | ||
**{ | ||
user_full_name: authorization_request_event.user_full_name, | ||
text: authorization_request_event.text, | ||
copied_from_authorization_request_id: authorization_request_event.copied_from_authorization_request_id, | ||
}.compact | ||
).html_safe | ||
%> | ||
|
||
<%= time_tag authorization_request_event.created_at do %> | ||
<%= authorization_request_event.created_at.strftime("%d/%m/%Y") %> | ||
<% end %> | ||
<% if authorization_request_event.name == 'approve' %> | ||
<div class="fr-mt-1w"> | ||
<%= link_to( | ||
t('.approve.view_authorization'), | ||
authorization_request_authorization_path(authorization_request_event.authorization_request, authorization_request_event.authorization), | ||
target: '_blank', | ||
class: 'fr-link' | ||
) %> | ||
</div> | ||
<% end %> | ||
</div> | ||
|
||
<div> | ||
<%= time_tag authorization_request_event.created_at do %> | ||
<%= authorization_request_event.created_at.strftime("%d/%m/%Y") %> | ||
<% end %> | ||
</div> | ||
</li> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<h3> <%= t('.title') %> </h3> | ||
|
||
<ul class="fr-mt-2w fr-p-0"> | ||
<% @authorizations.each do |authorization| %> | ||
<li class="authorization-row fr-mb-4w fr-pb-2w"> | ||
<div class="fr-grid-row fr-grid-row--middle"> | ||
<div class="fr-col"> | ||
<ul class="fr-badge-group"> | ||
<li> | ||
<span class="fr-badge fr-badge--no-icon"> | ||
<%= t("authorization.id_badge", id: authorization.id) %> | ||
</span> | ||
</li> | ||
<li> | ||
<span class="fr-badge fr-badge--no-icon"> | ||
<%= t("authorization.date_badge", date: authorization.created_at.strftime('%d/%m/%Y')) %> | ||
</span> | ||
</li> | ||
|
||
<% if authorization.definition.stage.exists? %> | ||
<li> | ||
<%= authorization_stage_badge(authorization) %> | ||
</li> | ||
<% end %> | ||
</ul> | ||
|
||
<% if authorization.approving_instructor.present? %> | ||
<div> | ||
Validé par <strong><%= authorization.approving_instructor.email %></strong> | ||
</div> | ||
<% end %> | ||
</div> | ||
|
||
<div> | ||
<%= link_to t('.show_cta'), authorization_request_authorization_path(@authorization_request, authorization), class: "fr-btn" %> | ||
</div> | ||
</div> | ||
</li> | ||
<% end %> | ||
</ul> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.