diff options
Diffstat (limited to 'app/views/page_translations')
| -rw-r--r-- | app/views/page_translations/edit.html.erb | 59 | ||||
| -rw-r--r-- | app/views/page_translations/show.html.erb | 38 |
2 files changed, 58 insertions, 39 deletions
diff --git a/app/views/page_translations/edit.html.erb b/app/views/page_translations/edit.html.erb index 20ec1c9a..3a4c8659 100644 --- a/app/views/page_translations/edit.html.erb +++ b/app/views/page_translations/edit.html.erb | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | <%= t(".editing_prefix") %> <strong><%= @locale.to_s.upcase %></strong> <%= t(".translation_of") %> <strong><%= title_for_node(@node) %></strong>. | 2 | <%= t(".editing_prefix") %> <strong><%= @locale.to_s.upcase %></strong> <%= t(".translation_of") %> <strong><%= title_for_node(@node) %></strong>. |
| 3 | </div> | 3 | </div> |
| 4 | 4 | ||
| 5 | <p class="node_action_bar standalone_action_bar"><%= link_to t("page_translations.revision_history_link"), node_revisions_path(@node, :translation_locale => @locale) %></p> | 5 | <p class="node_action_bar"><%= link_to t("page_translations.revision_history_link"), node_revisions_path(@node, :translation_locale => @locale) %></p> |
| 6 | 6 | ||
| 7 | <p class="field_hint"> | 7 | <p class="field_hint"> |
| 8 | <%= t(".metadata_hint_prefix") %> <%= link_to t(".metadata_hint_link"), edit_node_path(@node) %>. | 8 | <%= t(".metadata_hint_prefix") %> <%= link_to t(".metadata_hint_link"), edit_node_path(@node) %>. |
| @@ -27,38 +27,45 @@ | |||
| 27 | </li> | 27 | </li> |
| 28 | <% end %> | 28 | <% end %> |
| 29 | </ul> | 29 | </ul> |
| 30 | |||
| 30 | <%= form_with url: node_translation_path(@node, @locale), method: :patch, local: true, id: "translation_edit_form", | 31 | <%= form_with url: node_translation_path(@node, @locale), method: :patch, local: true, id: "translation_edit_form", |
| 31 | data: { autosave_url: autosave_node_translation_path(@node, @locale), show_url: node_path(@node) } do |f| %> | 32 | data: { autosave_url: autosave_node_translation_path(@node, @locale), show_url: node_path(@node) } do |f| %> |
| 32 | <div id="edit_grid"> | 33 | <div class="layout_row"> |
| 33 | <div id="content"> | 34 | <div class="layout_row_label"><%= Page.human_attribute_name(:title) %></div> |
| 34 | <div class="layout_row_label"><%= Page.human_attribute_name(:title) %></div> | 35 | <div class="layout_row_content"> |
| 35 | <div class="layout_row_content"> | 36 | <%= text_field_tag "page[title]", @translation&.title %> |
| 36 | <%= text_field_tag "page[title]", @translation&.title %> | 37 | </div> |
| 37 | </div> | 38 | </div> |
| 38 | 39 | ||
| 39 | <div class="layout_row_label"><%= Page.human_attribute_name(:abstract) %></div> | 40 | <div class="layout_row"> |
| 40 | <div class="layout_row_content"> | 41 | <div class="layout_row_label"><%= Page.human_attribute_name(:abstract) %></div> |
| 41 | <%= text_area_tag "page[abstract]", @translation&.abstract %> | 42 | <div class="layout_row_content"> |
| 42 | </div> | 43 | <%= text_area_tag "page[abstract]", @translation&.abstract %> |
| 44 | </div> | ||
| 45 | </div> | ||
| 43 | 46 | ||
| 47 | <div id="body_field"> | ||
| 48 | <div class="layout_row"> | ||
| 44 | <div class="layout_row_label"><%= Page.human_attribute_name(:body) %></div> | 49 | <div class="layout_row_label"><%= Page.human_attribute_name(:body) %></div> |
| 45 | <div class="body_toolbar_row"> | 50 | <div class="layout_row_content"> |
| 46 | <button type="button" id="preview_toggle" class="view_toggle" aria-pressed="false" aria-label="<%= t("admin.common.toggle_preview") %>" title="<%= t("admin.common.toggle_preview") %>"> | 51 | <div class="body_toolbar_row"> |
| 47 | <%= icon("layout-sidebar-right", library: "tabler", "aria-hidden": true) %> <span><%= t("nodes.edit.live_preview") %></span> | 52 | <button type="button" id="preview_toggle" class="view_toggle" aria-pressed="false" aria-label="<%= t("admin.common.toggle_preview") %>" title="<%= t("admin.common.toggle_preview") %>"> |
| 48 | </button> | 53 | <%= icon("layout-sidebar-right", library: "tabler", "aria-hidden": true) %> <span><%= t("nodes.edit.live_preview") %></span> |
| 49 | <button type="button" id="preview_force_render" class="view_toggle" style="display:none" aria-label="<%= t("admin.common.force_render") %>" title="<%= t("admin.common.force_render") %>"> | 54 | </button> |
| 50 | <%= icon("refresh", library: "tabler", "aria-hidden": true) %> <span><%= t("nodes.edit.force_refresh") %></span> | 55 | <button type="button" id="preview_force_render" class="view_toggle" style="display:none" aria-label="<%= t("admin.common.force_render") %>" title="<%= t("admin.common.force_render") %>"> |
| 51 | </button> | 56 | <%= icon("refresh", library: "tabler", "aria-hidden": true) %> <span><%= t("nodes.edit.force_refresh") %></span> |
| 52 | </div> | 57 | </button> |
| 58 | </div> | ||
| 53 | 59 | ||
| 54 | <div id="editor_and_preview"> | 60 | <div id="editor_and_preview"> |
| 55 | <div class="preview_content"> | 61 | <div class="preview_content"> |
| 56 | <div class="layout_row_content"> | 62 | <div class="layout_row_content"> |
| 57 | <%= text_area_tag "page[body]", @translation&.body, :class => 'with_editor' %> | 63 | <%= text_area_tag "page[body]", @translation&.body, :class => 'with_editor' %> |
| 64 | </div> | ||
| 65 | </div> | ||
| 66 | <div id="preview_panel" style="display:none"> | ||
| 67 | <iframe id="live_preview_iframe" title="<%= t("nodes.edit.live_preview") %>" data-src="<%= preview_page_path(@page, :locale => @locale) %>"></iframe> | ||
| 58 | </div> | 68 | </div> |
| 59 | </div> | ||
| 60 | <div id="preview_panel" style="display:none"> | ||
| 61 | <iframe id="live_preview_iframe" title="<%= t("nodes.edit.live_preview") %>" data-src="<%= preview_page_path(@page, :locale => @locale) %>"></iframe> | ||
| 62 | </div> | 69 | </div> |
| 63 | </div> | 70 | </div> |
| 64 | </div> | 71 | </div> |
diff --git a/app/views/page_translations/show.html.erb b/app/views/page_translations/show.html.erb index 5f94ac38..b230c35e 100644 --- a/app/views/page_translations/show.html.erb +++ b/app/views/page_translations/show.html.erb | |||
| @@ -1,29 +1,41 @@ | |||
| 1 | <h1><%= t(".title") %> — <%= title_for_node(@node) %></h1> | 1 | <h1><%= t(".title") %> — <%= title_for_node(@node) %></h1> |
| 2 | 2 | ||
| 3 | <p class="node_action_bar standalone_action_bar"><%= link_to t("page_translations.revision_history_link"), node_revisions_path(@node, :translation_locale => @locale) %></p> | 3 | <p class="node_action_bar"><%= link_to t("page_translations.revision_history_link"), node_revisions_path(@node, :translation_locale => @locale) %></p> |
| 4 | 4 | ||
| 5 | <div class="translation_compare"> | 5 | <div class="translation_compare"> |
| 6 | <div class="translation_compare_column"> | 6 | <div class="translation_compare_column"> |
| 7 | <h2><%= @locale.to_s.upcase %></h2> | 7 | <h2><%= @locale.to_s.upcase %></h2> |
| 8 | <div class="layout_row_label"><%= Page.human_attribute_name(:title) %></div> | 8 | <div class="layout_row"> |
| 9 | <div class="layout_row_content"><%= @translation&.title %></div> | 9 | <div class="layout_row_label"><%= Page.human_attribute_name(:title) %></div> |
| 10 | <div class="layout_row_content"><%= @translation&.title %></div> | ||
| 11 | </div> | ||
| 10 | 12 | ||
| 11 | <div class="layout_row_label"><%= Page.human_attribute_name(:abstract) %></div> | 13 | <div class="layout_row"> |
| 12 | <div class="layout_row_content"><%= sanitize(@translation&.abstract.to_s) %></div> | 14 | <div class="layout_row_label"><%= Page.human_attribute_name(:abstract) %></div> |
| 15 | <div class="layout_row_content"><%= sanitize(@translation&.abstract.to_s) %></div> | ||
| 16 | </div> | ||
| 13 | 17 | ||
| 14 | <div class="layout_row_label"><%= Page.human_attribute_name(:body) %></div> | 18 | <div class="layout_row"> |
| 15 | <div class="layout_row_content"><%= sanitize(@translation&.body.to_s) %></div> | 19 | <div class="layout_row_label"><%= Page.human_attribute_name(:body) %></div> |
| 20 | <div class="layout_row_content"><%= sanitize(@translation&.body.to_s) %></div> | ||
| 21 | </div> | ||
| 16 | </div> | 22 | </div> |
| 17 | 23 | ||
| 18 | <div class="translation_compare_column"> | 24 | <div class="translation_compare_column"> |
| 19 | <h2><%= I18n.default_locale.to_s.upcase %> (<%= t(".default_marker") %>)</h2> | 25 | <h2><%= I18n.default_locale.to_s.upcase %> (<%= t(".default_marker") %>)</h2> |
| 20 | <div class="layout_row_label"><%= Page.human_attribute_name(:title) %></div> | 26 | <div class="layout_row"> |
| 21 | <div class="layout_row_content"><%= @default_translation&.title %></div> | 27 | <div class="layout_row_label"><%= Page.human_attribute_name(:title) %></div> |
| 28 | <div class="layout_row_content"><%= @default_translation&.title %></div> | ||
| 29 | </div> | ||
| 22 | 30 | ||
| 23 | <div class="layout_row_label"><%= Page.human_attribute_name(:abstract) %></div> | 31 | <div class="layout_row"> |
| 24 | <div class="layout_row_content"><%= sanitize(@default_translation&.abstract.to_s) %></div> | 32 | <div class="layout_row_label"><%= Page.human_attribute_name(:abstract) %></div> |
| 33 | <div class="layout_row_content"><%= sanitize(@default_translation&.abstract.to_s) %></div> | ||
| 34 | </div> | ||
| 25 | 35 | ||
| 26 | <div class="layout_row_label"><%= Page.human_attribute_name(:body) %></div> | 36 | <div class="layout_row"> |
| 27 | <div class="layout_row_content"><%= sanitize(@default_translation&.body.to_s) %></div> | 37 | <div class="layout_row_label"><%= Page.human_attribute_name(:body) %></div> |
| 38 | <div class="layout_row_content"><%= sanitize(@default_translation&.body.to_s) %></div> | ||
| 39 | </div> | ||
| 28 | </div> | 40 | </div> |
| 29 | </div> | 41 | </div> |
