2018-12-13 18:18:09 +08:00
|
|
|
<% cache [current_user, project] do %>
|
2020-12-31 05:17:04 +08:00
|
|
|
<div class="dropdown project-actions-menu <%= 'new-comments' if has_unseen_comments?(project) %>">
|
|
|
|
<button class="btn btn-light dropdown-toggle icon-btn" type="button" id="projectActionsDropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
|
|
|
|
<i class="fas fa-ellipsis-h"></i>
|
|
|
|
</button>
|
|
|
|
<% project_form = nil %>
|
|
|
|
<%= form_for project, format: :json, method: :put, remote: true, html: { id: "edit-project-#{view}-form-#{project.id}" } do |f| %>
|
|
|
|
<% project_form = f %>
|
|
|
|
<%= f.hidden_field :archived, value: !project.archived %>
|
|
|
|
<% end %>
|
|
|
|
<ul class="dropdown-menu dropdown-menu-right" aria-labelledby="projectActionsDropdown">
|
|
|
|
<!-- Edit project -->
|
|
|
|
<% if project.active? && can_manage_project?(project) %>
|
|
|
|
<li>
|
|
|
|
<a href="<%= edit_project_path(project, format: :json) %>"
|
|
|
|
class="edit-project-btn"
|
|
|
|
data-action="edit"
|
|
|
|
data-remote="true">
|
|
|
|
<i class="fas fa-pen"></i>
|
|
|
|
<span><%= t('projects.index.edit_option') %></span>
|
|
|
|
</a>
|
|
|
|
</li>
|
2018-10-01 21:39:42 +08:00
|
|
|
<% end %>
|
2020-12-31 05:17:04 +08:00
|
|
|
<!-- Archive/restore project -->
|
|
|
|
<% if project.active? && can_archive_project?(project) %>
|
2021-01-20 00:21:22 +08:00
|
|
|
<li class="form-dropdown-item">
|
|
|
|
<%= button_to(project_path(project, format: :json),
|
|
|
|
method: :put,
|
|
|
|
remote: true,
|
|
|
|
class: 'btn btn-light',
|
|
|
|
form_class: 'project-archive-restore-form',
|
|
|
|
data: { confirm: t('projects.index.archive_confirm') },
|
|
|
|
params: { project: { archived: true } }) do %>
|
|
|
|
<i class="fas fa-archive"></i>
|
|
|
|
<span><%= t('projects.index.archive_option') %></span>
|
2021-02-11 18:50:59 +08:00
|
|
|
<% end %>
|
2020-12-04 16:38:34 +08:00
|
|
|
</li>
|
2020-12-31 05:17:04 +08:00
|
|
|
<% elsif project.archived? && can_restore_project?(project) %>
|
2021-01-20 00:21:22 +08:00
|
|
|
<li class="form-dropdown-item">
|
|
|
|
<%= button_to(project_path(project, format: :json),
|
|
|
|
method: :put,
|
|
|
|
remote: true,
|
|
|
|
class: 'btn btn-light',
|
|
|
|
form_class: 'project-archive-restore-form',
|
|
|
|
params: { project: { archived: false } }) do %>
|
2020-12-31 05:17:04 +08:00
|
|
|
<i class="fas fa-undo"></i>
|
2020-12-29 05:49:52 +08:00
|
|
|
<span><%= t('projects.index.restore_option') %></span>
|
2021-01-20 00:21:22 +08:00
|
|
|
<% end %>
|
2020-12-04 16:38:34 +08:00
|
|
|
</li>
|
2020-12-31 05:17:04 +08:00
|
|
|
<% end %>
|
2021-04-18 18:23:29 +08:00
|
|
|
<!-- Project members access -->
|
|
|
|
<% if can_read_project?(project) %>
|
|
|
|
<li class="form-dropdown-item">
|
2021-09-07 17:27:52 +08:00
|
|
|
<%= link_to can_manage_project_users?(project) ? edit_access_permissions_project_path(project) : access_permissions_project_path(project),
|
2021-04-18 23:19:16 +08:00
|
|
|
class: 'btn btn-light',
|
|
|
|
data: { action: 'remote-modal'} do %>
|
|
|
|
<i class="fas fa-door-open"></i>
|
2021-04-18 18:23:29 +08:00
|
|
|
<%= I18n.t('projects.index.project_members_access') %>
|
|
|
|
<% end %>
|
|
|
|
</li>
|
|
|
|
<% end %>
|
2020-12-31 05:17:04 +08:00
|
|
|
<!-- Show comments -->
|
|
|
|
<li>
|
|
|
|
<a href="#"
|
|
|
|
class="open-comments-sidebar"
|
|
|
|
data-turbolinks="false"
|
|
|
|
data-object-type="Project"
|
|
|
|
data-object-id="<%= project.id %>">
|
|
|
|
<i class="fas fa-comment"></i>
|
2021-01-11 17:03:13 +08:00
|
|
|
<span id="comment-count-<%= project.id %>">
|
2020-12-31 05:17:04 +08:00
|
|
|
<%= t('projects.index.comments_option', comments_count: project.comment_count) %>
|
|
|
|
</span>
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<!-- Open activities -->
|
|
|
|
<li>
|
|
|
|
<a href="/global_activities?<%= Activity.url_search_query({ subjects: { Project: [project.id] } }) %>">
|
|
|
|
<i class="fas fa-list"></i>
|
|
|
|
<span><%= t('projects.index.activities_option') %></span>
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
2018-12-13 18:18:09 +08:00
|
|
|
<% end %>
|