mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-10-10 22:06:46 +08:00
Fix project actions, fix edit icons [SCI-8391]
This commit is contained in:
parent
7a6fe5050d
commit
cf9f86b5d2
3 changed files with 28 additions and 15 deletions
|
@ -56,7 +56,7 @@ module Toolbars
|
||||||
{
|
{
|
||||||
name: 'edit',
|
name: 'edit',
|
||||||
label: I18n.t('experiments.index.edit_option'),
|
label: I18n.t('experiments.index.edit_option'),
|
||||||
icon: 'fa fa-pen',
|
icon: 'fa fa-pencil-alt',
|
||||||
button_class: 'edit-btn',
|
button_class: 'edit-btn',
|
||||||
path: edit_experiment_path(experiment),
|
path: edit_experiment_path(experiment),
|
||||||
type: 'remote-modal'
|
type: 'remote-modal'
|
||||||
|
|
|
@ -58,7 +58,7 @@ module Toolbars
|
||||||
{
|
{
|
||||||
name: 'edit',
|
name: 'edit',
|
||||||
label: I18n.t('experiments.table.toolbar.edit'),
|
label: I18n.t('experiments.table.toolbar.edit'),
|
||||||
icon: 'fa fa-pen',
|
icon: 'fa fa-pencil-alt',
|
||||||
button_id: 'editTask',
|
button_id: 'editTask',
|
||||||
type: :legacy
|
type: :legacy
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,12 +31,12 @@ module Toolbars
|
||||||
return [] if @item_type == :none
|
return [] if @item_type == :none
|
||||||
|
|
||||||
[
|
[
|
||||||
|
restore_action,
|
||||||
edit_action,
|
edit_action,
|
||||||
access_action,
|
access_action,
|
||||||
move_action,
|
move_action,
|
||||||
export_action,
|
export_action,
|
||||||
archive_action,
|
archive_action,
|
||||||
restore_action,
|
|
||||||
comments_action,
|
comments_action,
|
||||||
activities_action,
|
activities_action,
|
||||||
delete_folder_action
|
delete_folder_action
|
||||||
|
@ -48,8 +48,7 @@ module Toolbars
|
||||||
def edit_action
|
def edit_action
|
||||||
return unless @single
|
return unless @single
|
||||||
|
|
||||||
return unless @item_type == :project
|
if @items.first.is_a?(Project)
|
||||||
|
|
||||||
project = @items.first
|
project = @items.first
|
||||||
|
|
||||||
return unless can_manage_project?(project)
|
return unless can_manage_project?(project)
|
||||||
|
@ -57,11 +56,25 @@ module Toolbars
|
||||||
{
|
{
|
||||||
name: 'edit',
|
name: 'edit',
|
||||||
label: I18n.t('projects.index.edit_option'),
|
label: I18n.t('projects.index.edit_option'),
|
||||||
icon: 'fa fa-pen',
|
icon: 'fas fa-pencil-alt',
|
||||||
button_class: 'edit-btn',
|
button_class: 'edit-btn',
|
||||||
path: edit_project_path(project),
|
path: edit_project_path(project),
|
||||||
type: :legacy
|
type: :legacy
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
project_folder = @items.first
|
||||||
|
|
||||||
|
return unless can_create_project_folders?(project_folder.team)
|
||||||
|
|
||||||
|
{
|
||||||
|
name: 'edit',
|
||||||
|
label: I18n.t('projects.index.edit_option'),
|
||||||
|
icon: 'fas fa-pencil-alt',
|
||||||
|
button_class: 'edit-btn',
|
||||||
|
path: edit_project_folder_path(project_folder),
|
||||||
|
type: :legacy
|
||||||
|
}
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def access_action
|
def access_action
|
||||||
|
@ -82,7 +95,7 @@ module Toolbars
|
||||||
{
|
{
|
||||||
name: 'access',
|
name: 'access',
|
||||||
label: I18n.t('general.access'),
|
label: I18n.t('general.access'),
|
||||||
icon: 'fa fa-door-open',
|
icon: 'fas fa-door-open',
|
||||||
button_class: 'access-btn',
|
button_class: 'access-btn',
|
||||||
path: path,
|
path: path,
|
||||||
type: 'remote-modal'
|
type: 'remote-modal'
|
||||||
|
|
Loading…
Add table
Reference in a new issue