Highlight translation interface and translatable form fields

Only when translations interface is enabled.

Co-Authored-By: alessandro <agileontheweb@gmail.com>
This commit is contained in:
Senén Rodero Rodríguez
2019-05-31 18:18:20 +02:00
parent 6183f14d9d
commit a6e8fecc16
2 changed files with 22 additions and 1 deletions

View File

@@ -1080,6 +1080,19 @@ form {
} }
} }
.translatable-fields {
&.highlight {
display: inline-block;
padding-top: $line-height;
width: 100%;
}
}
.translation-locale {
padding-top: $line-height;
}
// 07. Callout // 07. Callout
// ----------- // -----------

View File

@@ -14,6 +14,10 @@ module TranslatableFormHelper
(controller.class.parents & [Admin, Management, Valuation]).any? (controller.class.parents & [Admin, Management, Valuation]).any?
end end
def highlight_translation_html_class
"highlight" if translations_interface_enabled?
end
class TranslatableFormBuilder < FoundationRailsHelper::FormBuilder class TranslatableFormBuilder < FoundationRailsHelper::FormBuilder
attr_accessor :translations attr_accessor :translations
@@ -66,9 +70,13 @@ module TranslatableFormHelper
end end
end end
def highlight_translation_html_class
@template.highlight_translation_html_class
end
def translations_options(resource, locale) def translations_options(resource, locale)
{ {
class: "translatable-fields js-globalize-attribute", class: "translatable-fields js-globalize-attribute #{highlight_translation_html_class}",
style: @template.display_translation_style(resource.globalized_model, locale), style: @template.display_translation_style(resource.globalized_model, locale),
data: { locale: locale } data: { locale: locale }
} }