module ApplicationHelper include ActionView::Helpers::AssetTagHelper include ActionView::Helpers::UrlHelper include InputSanitizeHelper def module_page? controller_name == 'my_modules' end def experiment_page? controller_name == 'experiments' end def project_page? controller_name == 'projects' && action_name.in?(%w(show experiment_archive)) end def all_projects_page? controller_name == 'projects' && action_name.in?(%w(index archive)) end def display_tooltip(message, len = Constants::NAME_TRUNCATION_LENGTH) return '' unless message if message.strip.length > len sanitize_input("
#{user.email}
) if user_still_in_team user_t = user.user_teams .where('user_teams.team_id = ?', team) .first user_description += %(#{I18n.t('atwho.users.popover_html', role: user_t.role.capitalize, team: user_t.team.name, time: I18n.l(user_t.created_at, format: :full_date))}