scinote-web/app/views/access_permissions/modals/_show_modal.html.erb
2021-04-30 13:26:06 +02:00

23 lines
1.1 KiB
Text

<% # frozen_string_literal: true %>
<div class="modal fade" tabindex="-1" role="dialog">
<div class="modal-dialog modal-md" role="document">
<div class="modal-content" id="user_assignments_modal">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title"><%= t '.title', resource_name: resource.name %></h4>
</div>
<div class="modal-body">
<%= render partial: 'access_permissions/partials/user_assignment', collection: resource.user_assignments, cached: ->(user_assignment) { [user_assignment. resource, current_user] } %>
</div>
<div class="modal-footer">
<% if can_manage_resource %>
<%= link_to new_resource_path, class: 'btn btn-default pull-left', data: { action: 'swap-remote-container', target: '#user_assignments_modal' } do %>
<i class="fas fa-plus"></i>
<%= t '.new_resource_assignments', resource: resource.model_name.human.downcase %>
<% end %>
<% end %>
</div>
</div>
</div>
</div>