summaryrefslogtreecommitdiff
path: root/app/views/page_translations/edit.html.erb
blob: 89b594e875c5e935bfdb888dc1b87e2f0ea63e02 (plain)
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
<div class="translation_banner">
  Editing the <strong><%= @locale.to_s.upcase %></strong> translation of <strong><%= title_for_node(@node) %></strong>.
</div>

<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">
    <%= 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="node_content">
        <%= text_area_tag "page[body]", @translation&.body, :class => 'with_editor' %>
      </div>
    </div>
  <% end %>
</div>