Files
nairobi/app/helpers/site_customization_helper.rb
Javi Martín 65c9786db7 Apply Layout/RedundantLineBreak rule to short lines
We're not adding the rule because it would apply the current line length
rule of 110 characters per line. We still haven't decided whether we'll
keep that rule or make lines shorter so they're easier to read,
particularly when vertically splitting the editor window.

So, for now, I'm applying the rule to lines which are about 90
characters long.
2021-09-03 11:49:53 +02:00

22 lines
671 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, :machine_learning]
end
end