mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-10-06 20:05:55 +08:00
Project card permission with not assigned team admin [SCI-8727]
This commit is contained in:
parent
71e5c81f8b
commit
e1ab7bda4b
2 changed files with 107 additions and 91 deletions
|
@ -13,6 +13,7 @@ module Toolbars
|
|||
@project_folders = current_user.current_team.project_folders.where(id: project_folder_ids)
|
||||
|
||||
@items = @projects + @project_folders
|
||||
@not_assigned = @projects.any? { |project| !project.assigned_users.include?(current_user) }
|
||||
|
||||
@single = @items.length == 1
|
||||
|
||||
|
@ -29,6 +30,7 @@ module Toolbars
|
|||
|
||||
def actions
|
||||
return [] if @item_type == :none
|
||||
return [access_action] if @not_assigned
|
||||
|
||||
[
|
||||
restore_action,
|
||||
|
|
|
@ -3,7 +3,11 @@
|
|||
<% project_form = f %>
|
||||
<%= f.hidden_field :archived, value: !project.archived %>
|
||||
<% end %>
|
||||
|
||||
<% assigned = project.assigned_users.include?(current_user) %>
|
||||
<ul class="dropdown-menu dropdown-menu-right" aria-labelledby="projectActionsDropdown">
|
||||
<% if assigned %>
|
||||
|
||||
<!-- Restore project -->
|
||||
<% if project.archived? && can_restore_project?(project) %>
|
||||
<li class="form-dropdown-item">
|
||||
|
@ -97,4 +101,14 @@
|
|||
<span><%= t('projects.index.activities_option') %></span>
|
||||
</a>
|
||||
</li>
|
||||
<% else %>
|
||||
<!-- Project members access -->
|
||||
<li class="form-dropdown-item">
|
||||
<%= link_to can_manage_project_users?(project) ? edit_access_permissions_project_path(project) : access_permissions_project_path(project),
|
||||
data: { action: 'remote-modal'} do %>
|
||||
<i class="sn-icon sn-icon-project-member-access"></i>
|
||||
<%= I18n.t('projects.index.project_members_access') %>
|
||||
<% end %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
|
|
Loading…
Add table
Reference in a new issue