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