mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-26 09:42:46 +08:00
6f76e86171
* Implement results tab for shareable task link [SCI-8753]
66 lines
1.1 KiB
Ruby
66 lines
1.1 KiB
Ruby
module SecondaryNavigationHelper
|
|
|
|
def is_all_projects_index?
|
|
action_name == 'index'
|
|
end
|
|
|
|
def is_all_projects_archive?
|
|
action_name == 'archive'
|
|
end
|
|
|
|
def is_project_info?
|
|
action_name == 'show'
|
|
end
|
|
|
|
def is_project_show?
|
|
action_name == 'show'
|
|
end
|
|
|
|
def is_project_reports?
|
|
controller_name == 'reports' && action_name == 'index'
|
|
end
|
|
|
|
def is_project_archive?
|
|
action_name == 'experiment_archive'
|
|
end
|
|
|
|
def is_experiment_canvas?
|
|
action_name == 'canvas'
|
|
end
|
|
|
|
def is_experiment_archive?
|
|
action_name == 'module_archive'
|
|
end
|
|
|
|
def is_module_info?
|
|
action_name == 'show'
|
|
end
|
|
|
|
def is_module_protocols?
|
|
%w(protocols protocol_show).include?(action_name)
|
|
end
|
|
|
|
def is_module_results?
|
|
action_name == 'results'
|
|
end
|
|
|
|
def is_module_activities?
|
|
action_name == 'activities'
|
|
end
|
|
|
|
def is_module_archive?
|
|
action_name == 'archive'
|
|
end
|
|
|
|
def title_element
|
|
if all_projects_page?
|
|
current_team
|
|
elsif project_page?
|
|
@project
|
|
elsif experiment_page?
|
|
@experiment
|
|
elsif module_page?
|
|
@my_module
|
|
end
|
|
end
|
|
end
|