1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
<div class="translation_banner">
Editing the <strong><%= @locale.to_s.upcase %></strong> translation of <strong><%= title_for_node(@node) %></strong>.
</div>
<p class="node_action_bar standalone_action_bar"><%= link_to 'View revision history', node_revisions_path(@node, :locale => @locale) %></p>
<p class="field_hint">
Metadata such as images, tags, template, and author belong to the page
as a whole, not to a single translation — change those from the
<%= link_to 'default-locale editor', edit_node_path(@node) %>.
</p>
<div class="node_action_bar">
<%= button_to 'Unlock + Back', unlock_node_path(@node), method: :put,
form: { class: 'button_to state_changing' },
disabled: @node.autosave.present? %>
<%= submit_tag "Save #{@locale.to_s.upcase} translation", form: "translation_edit_form" %>
<%= submit_tag "Save + Unlock + Exit", form: "translation_edit_form" %>
<%= link_to "Preview ↗", preview_page_path(@page, :locale => @locale), target: "_blank", rel: "noopener", class: "preview_link" %>
</div>
<div id="page_editor">
<ul id="related_asset_list" style="display:none">
<% @page.related_assets.includes(:asset).each do |related| %>
<li data-large-url="<%= related.asset.upload.url(:large) %>"
data-original-url="<%= related.asset.upload.url %>"
data-name="<%= related.asset.name %>">
<%= image_tag related.asset.upload.url(:thumb) %>
</li>
<% end %>
</ul>
<%= form_with url: node_translation_path(@node, @locale), method: :patch, local: true, id: "translation_edit_form",
data: { autosave_url: autosave_node_translation_path(@node, @locale), show_url: node_path(@node) } do |f| %>
<div id="content">
<div class="node_description">Title</div>
<div class="node_content">
<%= text_field_tag "page[title]", @translation&.title %>
</div>
<div class="node_description">Abstract</div>
<div class="node_content">
<%= text_area_tag "page[abstract]", @translation&.abstract %>
</div>
<div class="node_description">Body</div>
<div class="body_toolbar_row">
<button type="button" id="preview_toggle" class="view_toggle" aria-pressed="false" aria-label="Toggle live preview" title="Toggle live preview">
<%= icon("layout-sidebar-right", library: "tabler", "aria-hidden": true) %> <span>Live preview</span>
</button>
<button type="button" id="preview_force_render" class="view_toggle" style="display:none" aria-label="Force preview render" title="Force preview render">
<%= icon("refresh", library: "tabler", "aria-hidden": true) %> <span>Force refresh</span>
</button>
</div>
<div id="editor_and_preview">
<div class="preview_content">
<div class="node_content">
<%= text_area_tag "page[body]", @translation&.body, :class => 'with_editor' %>
</div>
</div>
<div id="preview_panel" style="display:none">
<iframe id="live_preview_iframe" title="Live preview" data-src="<%= preview_page_path(@page, :locale => @locale) %>"></iframe>
</div>
</div>
</div>
<% end %>
</div>
|