scinote-web/app/views/repositories/_share_repository_modal.html.erb

65 lines
3.3 KiB
Text
Raw Normal View History

2019-08-12 21:02:16 +08:00
<div class="modal share-repo-modal" tabindex="-1" role="dialog" >
<%= form_for :shares, url: team_repository_team_repositories_path(current_team, @repository), remote: :true,
data: { success_message: t("repositories.index.modal_share.success_message", inventory_name: @repository.name) } do |f| %>
2019-08-05 19:07:29 +08:00
<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>
2019-08-12 21:02:16 +08:00
<div class="modal-body share-repo-container">
<div class="header">
<span class="team-selector"><%= t("repositories.index.modal_share.share_with_team") %></span>
<span class="permission-selector"><%= t("repositories.index.modal_share.can_edit") %></span>
2019-08-12 21:02:16 +08:00
</div>
<div class="data-list">
<div class="all-teams">
<span class="team-selector" title="<%= t("repositories.index.modal_share.all_teams_tooltip") %>">
<span class="sci-checkbox-container">
<%= check_box_tag 'select_all_teams', 0, @repository.shared_read? || @repository.shared_write?, { class: 'sci-checkbox' } %>
<span class="sci-checkbox-label"></span>
</span>
<%= t("repositories.index.modal_share.all_teams") %>
2019-08-12 21:02:16 +08:00
</span>
<span class="permission-selector">
<span class="sci-toggle-checkbox-container">
<%= check_box_tag 'select_all_write_permission', 0, @repository.shared_write?, { class: 'hidden sci-toggle-checkbox' }%>
<span class="sci-toggle-checkbox-label"></span>
</span>
2019-08-12 21:02:16 +08:00
</span>
</div>
<div class="teams-list">
<% (current_user.teams - [@repository.team]).each do |t| %>
2019-08-12 21:02:16 +08:00
<div class="team-container">
<div class="team-selector">
<span class="sci-checkbox-container">
<%= check_box_tag 'share_team_ids[]', t.id, @repository.private_shared_with?(t), {id: "shared_#{t.id}", class: "sci-checkbox"} %>
<span class="sci-checkbox-label"></span>
</span>
2019-08-12 21:02:16 +08:00
<%= t.name %>
</div>
<div class="permission-selector">
<span class="sci-toggle-checkbox-container">
<%= check_box_tag 'write_permissions[]', t.id, @repository.private_shared_with_write?(t), {
id: "editable_#{t.id}",
class: (@repository.private_shared_with?(t) ? 'sci-toggle-checkbox' : 'sci-toggle-checkbox hidden')
}.compact %>
<span class="sci-toggle-checkbox-label"></span>
</span>
2019-08-12 21:02:16 +08:00
</div>
</div>
2019-08-05 19:07:29 +08:00
<% end %>
2019-08-12 21:02:16 +08:00
</div>
2019-08-05 19:07:29 +08:00
</div>
</div>
<%= hidden_field_tag 'permission_changes', {}%>
2019-08-05 19:07:29 +08:00
<div class="modal-footer">
<%= f.submit t("repositories.index.modal_share.submit"), class: "btn btn-primary" %>
</div>
</div>
</div>
<% end %>
</div>