scinote-web/app/views/repositories/_share_repository_modal.html.erb
2019-08-09 14:15:50 +02:00

36 lines
1.6 KiB
Text

<div class="modal" id="share-repo-modal" tabindex="-1" role="dialog" >
<%= form_for :shares, url: multiple_update_team_repository_team_repositories_path(current_team, @repository), remote: :true do |f| %>
<div class="modal-dialog" role="document">
<div class="modal-content">
<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" id="create-repo-modal-label">
<%= t("repositories.index.modal_share.title") %>
</h4>
</div>
<div class="modal-body">
<div>
<table style="width: 80%; margin: 0 auto">
<tr>
<th>Share with Team</th><th>Can Edit</th>
</tr>
<% (current_user.teams - [@repository.team]).each do |t| %>
<tr>
<td>
<%= check_box_tag 'share_team_ids[]', t.id, @repository.shared_with?(t), {id: "shared_#{t.id}"} %>
<%= t.name %>
</td>
<td><%= check_box_tag 'write_permissions[]', t.id, @repository.shared_with_write?(t), {id: "editable_#{t.id}", class: ('hidden' unless @repository.shared_with?(t))}.compact %></td>
</tr>
<% end %>
</table>
</div>
</div>
<%= hidden_field_tag 'permission_changes', {}%>
<div class="modal-footer">
<%= f.submit t("repositories.index.modal_share.submit"), class: "btn btn-primary" %>
</div>
</div>
</div>
<% end %>
</div>