2016-02-12 23:52:43 +08:00
|
|
|
module SecondaryNavigationHelper
|
|
|
|
|
2018-05-08 22:33:42 +08:00
|
|
|
def is_all_projects_index?
|
|
|
|
action_name == 'index'
|
|
|
|
end
|
|
|
|
|
|
|
|
def is_all_projects_archive?
|
|
|
|
action_name == 'archive'
|
|
|
|
end
|
|
|
|
|
2016-02-12 23:52:43 +08:00
|
|
|
def is_project_info?
|
2016-07-29 22:46:25 +08:00
|
|
|
action_name == 'show'
|
2016-02-12 23:52:43 +08:00
|
|
|
end
|
|
|
|
|
2016-07-29 22:20:35 +08:00
|
|
|
def is_project_show?
|
2016-07-29 22:46:25 +08:00
|
|
|
action_name == 'show'
|
2016-02-12 23:52:43 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
def is_project_reports?
|
2016-07-29 22:48:56 +08:00
|
|
|
controller_name == 'reports' && action_name == 'index'
|
2016-02-12 23:52:43 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
def is_project_archive?
|
2016-07-29 22:46:25 +08:00
|
|
|
action_name == 'experiment_archive'
|
2016-07-29 22:20:35 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
def is_experiment_canvas?
|
2016-07-29 22:46:25 +08:00
|
|
|
action_name == 'canvas'
|
2016-07-29 22:20:35 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
def is_experiment_archive?
|
2016-07-29 22:46:25 +08:00
|
|
|
action_name == 'module_archive'
|
2016-02-12 23:52:43 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
def is_module_info?
|
2016-07-29 22:46:25 +08:00
|
|
|
action_name == 'show'
|
2016-02-12 23:52:43 +08:00
|
|
|
end
|
|
|
|
|
2016-07-21 19:11:15 +08:00
|
|
|
def is_module_protocols?
|
2023-08-07 16:45:52 +08:00
|
|
|
%w(protocols protocol_show).include?(action_name)
|
2016-02-12 23:52:43 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
def is_module_results?
|
2023-10-16 15:54:34 +08:00
|
|
|
(%w(index).include?(action_name) && controller_name == 'results') || action_name == 'results_show'
|
2016-02-12 23:52:43 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
def is_module_activities?
|
2016-07-29 22:46:25 +08:00
|
|
|
action_name == 'activities'
|
2016-02-12 23:52:43 +08:00
|
|
|
end
|
|
|
|
|
2018-04-19 21:12:26 +08:00
|
|
|
def title_element
|
2018-05-08 22:33:42 +08:00
|
|
|
if all_projects_page?
|
|
|
|
current_team
|
|
|
|
elsif project_page?
|
2018-04-19 21:12:26 +08:00
|
|
|
@project
|
|
|
|
elsif experiment_page?
|
|
|
|
@experiment
|
|
|
|
elsif module_page?
|
|
|
|
@my_module
|
|
|
|
end
|
|
|
|
end
|
2016-02-12 23:52:43 +08:00
|
|
|
end
|