Files
grecia/app/helpers/site_customization_helper.rb
Javi Martín ea2aeab383 Apply rubocop Rails/FindBy rule everywhere
We didn't detect these cases because by default the rule only searches
for offenses in `app/models/`.
2019-11-08 19:15:04 +01:00

25 lines
676 B
Ruby

module SiteCustomizationHelper
def site_customization_enable_translation?(locale)
I18nContentTranslation.existing_languages.include?(locale) || locale == I18n.locale
end
def site_customization_display_translation_style(locale)
site_customization_enable_translation?(locale) ? "" : "display: none;"
end
def translation_for_locale(content, locale)
if content.present?
I18nContentTranslation.find_by(
i18n_content_id: content.id,
locale: locale
)&.value
else
false
end
end
def information_texts_tabs
[:basic, :debates, :community, :proposals, :polls, :layouts, :mailers, :management, :welcome]
end
end