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:
@@ -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
|
||||||
// -----------
|
// -----------
|
||||||
|
|
||||||
|
|||||||
@@ -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 }
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user