scinote-web/app/views/access_permissions/projects/modals/_show_modal.html.erb

28 lines
1.4 KiB
Text
Raw Normal View History

2021-04-18 23:19:16 +08:00
<% # frozen_string_literal: true %>
<div class="modal fade" tabindex="-1" role="dialog" data-action="modal-close" data-target="<%= projects_path %>">
<div class="modal-dialog modal-lg" role="document">
2021-04-18 23:19:16 +08:00
<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">
<% resource.user_assignments.each do |user_assignment| %>
<% cache [user_assignment, resource, current_user, user_assignment.user] do %>
<%= render partial: 'access_permissions/partials/user_assignment', locals: { user_assignment: user_assignment, user: user_assignment.user, resource: resource } %>
<% end %>
<% end %>
2021-04-18 23:19:16 +08:00
</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 %>
2021-04-18 23:19:16 +08:00
</div>
</div>
</div>
</div>