2016-02-12 16:52:43 +01:00
|
|
|
module SearchHelper
|
2016-08-25 10:40:03 +02:00
|
|
|
def experiments_results(tag)
|
|
|
|
experiments = []
|
|
|
|
tag.my_modules.each do |mod|
|
|
|
|
experiments << mod.experiment
|
|
|
|
end
|
|
|
|
experiments.uniq
|
|
|
|
end
|
2016-10-11 16:16:48 +02:00
|
|
|
|
2017-01-25 09:48:49 +01:00
|
|
|
def route_to_other_team(path, search_team, text)
|
|
|
|
if search_team != current_team
|
2016-10-11 16:16:48 +02:00
|
|
|
link_to text,
|
|
|
|
path,
|
2017-05-12 13:23:29 +02:00
|
|
|
data: { no_turbolink: true,
|
|
|
|
confirm: t('users.settings.changed_team_in_search',
|
2017-01-25 09:48:49 +01:00
|
|
|
team: search_team.name) }
|
2016-10-11 16:16:48 +02:00
|
|
|
else
|
2017-05-12 13:23:29 +02:00
|
|
|
link_to text, path, data: { no_turbolink: true }
|
2016-10-11 16:16:48 +02:00
|
|
|
end
|
|
|
|
end
|
2017-01-06 10:10:33 +01:00
|
|
|
|
2017-01-25 09:48:49 +01:00
|
|
|
def route_to_other_team_btn(path, search_team, text)
|
|
|
|
if search_team != current_team
|
2017-01-06 10:10:33 +01:00
|
|
|
link_to text,
|
|
|
|
path,
|
2018-04-25 13:57:12 +02:00
|
|
|
class: 'btn btn-success',
|
2017-01-25 09:48:49 +01:00
|
|
|
data: { confirm: t('users.settings.changed_team_in_search',
|
|
|
|
team: search_team.name) }
|
2017-01-06 10:10:33 +01:00
|
|
|
else
|
2018-04-25 13:57:12 +02:00
|
|
|
link_to text, path, class: 'btn btn-success'
|
2017-01-06 10:10:33 +01:00
|
|
|
end
|
|
|
|
end
|
2016-02-12 16:52:43 +01:00
|
|
|
end
|