Wrap translation fields in a div

This way we can show/hide that div when displaying translations, and we
can remove the duplication applying the same logic to the label, the
input, the error and the CKEditor.

This way we also solve the problem of the textarea of the CKEditor
taking space when we switch locales, as well as CKEditor itself taking
space even when not displayed.
This commit is contained in:
Javi Martín
2018-10-11 12:03:08 +02:00
parent ffb8207f84
commit 7479223d59
4 changed files with 35 additions and 64 deletions

View File

@@ -32,11 +32,7 @@
<%= translations_form.label :body, nil, hint: t("admin.legislation.draft_versions.form.use_markdown") %>
</div>
<%= content_tag :div,
class: "markdown-editor clear js-globalize-attribute",
data: { locale: translations_form.locale },
style: translations_form.display_style do %>
<div class="markdown-editor">
<div class="small-12 medium-8 column fullscreen-container">
<div class="markdown-editor-header truncate">
<%= t("admin.legislation.draft_versions.form.title_html",
@@ -66,7 +62,7 @@
<div class="small-12 medium-6 column markdown-preview">
</div>
<% end %>
</div>
<% end %>
<div class="small-12 medium-9 column">