mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-18 15:13:21 +08:00
75 lines
2.9 KiB
Text
75 lines
2.9 KiB
Text
<% project_form = nil %>
|
|
<%= form_for project, format: :json, method: :put, remote: true, html: { id: "edit-project-dropdown-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>
|
|
<% end %>
|
|
<!-- Archive/restore project -->
|
|
<% if project.active? && can_archive_project?(project) %>
|
|
<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>
|
|
<% end %>
|
|
</li>
|
|
<% elsif project.archived? && can_restore_project?(project) %>
|
|
<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 %>
|
|
<i class="fas fa-undo"></i>
|
|
<span><%= t('projects.index.restore_option') %></span>
|
|
<% end %>
|
|
</li>
|
|
<% end %>
|
|
<!-- 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),
|
|
class: 'btn btn-light',
|
|
data: { action: 'remote-modal'} do %>
|
|
<i class="fas fa-door-open"></i>
|
|
<%= I18n.t('projects.index.project_members_access') %>
|
|
<% end %>
|
|
</li>
|
|
<!-- 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>
|
|
<span id="comment-count-<%= project.id %>">
|
|
<%= t('projects.index.comments_option', comments_count: project.comments.count) %>
|
|
</span>
|
|
</a>
|
|
</li>
|
|
<!-- Open activities -->
|
|
<li>
|
|
<a href="/global_activities?<%= Activity.url_search_query({ subjects: { Project: [project] } }) %>">
|
|
<i class="fas fa-list"></i>
|
|
<span><%= t('projects.index.activities_option') %></span>
|
|
</a>
|
|
</li>
|
|
</ul>
|