diff options
Diffstat (limited to 'app')
| -rw-r--r-- | app/views/menu_items/edit.html.erb | 12 | ||||
| -rw-r--r-- | app/views/menu_items/index.html.erb | 10 | ||||
| -rw-r--r-- | app/views/menu_items/new.html.erb | 12 | ||||
| -rw-r--r-- | app/views/page_translations/edit.html.erb | 32 | ||||
| -rw-r--r-- | app/views/page_translations/show.html.erb | 18 | ||||
| -rw-r--r-- | app/views/revisions/diff.html.erb | 66 | ||||
| -rw-r--r-- | app/views/revisions/index.html.erb | 36 | ||||
| -rw-r--r-- | app/views/revisions/show.html.erb | 22 |
8 files changed, 103 insertions, 105 deletions
diff --git a/app/views/menu_items/edit.html.erb b/app/views/menu_items/edit.html.erb index 89854c93..0652dc78 100644 --- a/app/views/menu_items/edit.html.erb +++ b/app/views/menu_items/edit.html.erb | |||
| @@ -1,25 +1,25 @@ | |||
| 1 | <h1>Edit Menu Item</h1> | 1 | <h1><%= t(".title") %></h1> |
| 2 | 2 | ||
| 3 | <div id="admin_layout"> | 3 | <div id="admin_layout"> |
| 4 | <%= form_for @menu_item do |f| %> | 4 | <%= form_for @menu_item do |f| %> |
| 5 | <div id="content"> | 5 | <div id="content"> |
| 6 | <div class="layout_row_label">Search</div> | 6 | <div class="layout_row_label"><%= t("admin.common.search") %></div> |
| 7 | <div class="layout_row_content"> | 7 | <div class="layout_row_content"> |
| 8 | <%= text_field_tag :menu_search_term %> | 8 | <%= text_field_tag :menu_search_term %> |
| 9 | <div id="menu_item_search_results" class="search_results"></div> | 9 | <div id="menu_item_search_results" class="search_results"></div> |
| 10 | </div> | 10 | </div> |
| 11 | 11 | ||
| 12 | <div class="layout_row_label">Node Id</div> | 12 | <div class="layout_row_label"><%= MenuItem.human_attribute_name(:node_id) %></div> |
| 13 | <div class="layout_row_content"><%= f.text_field :node_id %></div> | 13 | <div class="layout_row_content"><%= f.text_field :node_id %></div> |
| 14 | 14 | ||
| 15 | <div class="layout_row_label">Path</div> | 15 | <div class="layout_row_label"><%= MenuItem.human_attribute_name(:path) %></div> |
| 16 | <div class="layout_row_content"><%= f.text_field :path %></div> | 16 | <div class="layout_row_content"><%= f.text_field :path %></div> |
| 17 | 17 | ||
| 18 | <div class="layout_row_label">Title</div> | 18 | <div class="layout_row_label"><%= MenuItem.human_attribute_name(:title) %></div> |
| 19 | <div class="layout_row_content"><%= f.text_field :title %></div> | 19 | <div class="layout_row_content"><%= f.text_field :title %></div> |
| 20 | 20 | ||
| 21 | <div class="layout_row_label"></div> | 21 | <div class="layout_row_label"></div> |
| 22 | <div class="layout_row_content"><%= f.submit 'Update' %></div> | 22 | <div class="layout_row_content"><%= f.submit t("admin.common.update") %></div> |
| 23 | <% end %> | 23 | <% end %> |
| 24 | </div> | 24 | </div> |
| 25 | </div> | 25 | </div> |
diff --git a/app/views/menu_items/index.html.erb b/app/views/menu_items/index.html.erb index 591eb68d..cdc60c63 100644 --- a/app/views/menu_items/index.html.erb +++ b/app/views/menu_items/index.html.erb | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | <h1>Menu Items</h1> | 1 | <h1><%= t(".title") %></h1> |
| 2 | 2 | ||
| 3 | <%= link_to new_menu_item_path, class: 'action_button' do %> | 3 | <%= link_to new_menu_item_path, class: 'action_button' do %> |
| 4 | <%= icon("plus", library: "tabler", "aria-hidden": true) %> Create menu item | 4 | <%= icon("plus", library: "tabler", "aria-hidden": true) %> <%= t(".create_item") %> |
| 5 | <% end %> | 5 | <% end %> |
| 6 | 6 | ||
| 7 | <table id="menu_item_list"> | 7 | <table id="menu_item_list"> |
| @@ -11,11 +11,11 @@ | |||
| 11 | <div></div> | 11 | <div></div> |
| 12 | </td> | 12 | </td> |
| 13 | <td class="menu_item_title"><%= menu_item.title %></td> | 13 | <td class="menu_item_title"><%= menu_item.title %></td> |
| 14 | <td><%= link_to "Edit", edit_menu_item_path(menu_item) %></td> | 14 | <td><%= link_to t("admin.common.edit"), edit_menu_item_path(menu_item) %></td> |
| 15 | <td> | 15 | <td> |
| 16 | <%= button_to menu_item_path(menu_item), method: :delete, | 16 | <%= button_to menu_item_path(menu_item), method: :delete, |
| 17 | form: { data: { confirm: "Do you really want to destroy the menu entry?" }, class: 'button_to destructive' } do %> | 17 | form: { data: { confirm: t(".confirm_destroy") }, class: 'button_to destructive' } do %> |
| 18 | <%= icon("trash", library: "tabler", "aria-hidden": true) %> Destroy | 18 | <%= icon("trash", library: "tabler", "aria-hidden": true) %> <%= t("admin.common.destroy") %> |
| 19 | <% end %> | 19 | <% end %> |
| 20 | </td> | 20 | </td> |
| 21 | </tr> | 21 | </tr> |
diff --git a/app/views/menu_items/new.html.erb b/app/views/menu_items/new.html.erb index 408ba7bd..713ac967 100644 --- a/app/views/menu_items/new.html.erb +++ b/app/views/menu_items/new.html.erb | |||
| @@ -1,20 +1,20 @@ | |||
| 1 | <h1>Add Menu Item</h1> | 1 | <h1><%= t(".title") %></h1> |
| 2 | 2 | ||
| 3 | <%= form_for @menu_item do |f| %> | 3 | <%= form_for @menu_item do |f| %> |
| 4 | <div class="layout_row_label">Search</div> | 4 | <div class="layout_row_label"><%= t("admin.common.search") %></div> |
| 5 | <div class="layout_row_content"> | 5 | <div class="layout_row_content"> |
| 6 | <%= text_field_tag :menu_search_term %> | 6 | <%= text_field_tag :menu_search_term %> |
| 7 | <div id="menu_item_search_results" class="search_results"></div> | 7 | <div id="menu_item_search_results" class="search_results"></div> |
| 8 | </div> | 8 | </div> |
| 9 | 9 | ||
| 10 | <div class="layout_row_label">Node Id</div> | 10 | <div class="layout_row_label"><%= MenuItem.human_attribute_name(:node_id) %></div> |
| 11 | <div class="layout_row_content"><%= f.text_field :node_id %></div> | 11 | <div class="layout_row_content"><%= f.text_field :node_id %></div> |
| 12 | 12 | ||
| 13 | <div class="layout_row_label">Path</div> | 13 | <div class="layout_row_label"><%= MenuItem.human_attribute_name(:path) %></div> |
| 14 | <div class="layout_row_content"><%= f.text_field :path %></div> | 14 | <div class="layout_row_content"><%= f.text_field :path %></div> |
| 15 | 15 | ||
| 16 | <div class="layout_row_label">Title</div> | 16 | <div class="layout_row_label"><%= MenuItem.human_attribute_name(:title) %></div> |
| 17 | <div class="layout_row_content"><%= f.text_field :title %></div> | 17 | <div class="layout_row_content"><%= f.text_field :title %></div> |
| 18 | 18 | ||
| 19 | <div class="layout_row_content"><%= f.submit 'Create' %></div> | 19 | <div class="layout_row_content"><%= f.submit t("admin.common.create") %></div> |
| 20 | <% end %> | 20 | <% end %> |
diff --git a/app/views/page_translations/edit.html.erb b/app/views/page_translations/edit.html.erb index ac91d22c..f398a544 100644 --- a/app/views/page_translations/edit.html.erb +++ b/app/views/page_translations/edit.html.erb | |||
| @@ -1,22 +1,20 @@ | |||
| 1 | <div class="translation_banner"> | 1 | <div class="translation_banner"> |
| 2 | Editing the <strong><%= @locale.to_s.upcase %></strong> 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 'View revision history', node_revisions_path(@node, :locale => @locale) %></p> | 5 | <p class="node_action_bar standalone_action_bar"><%= link_to t("page_translations.revision_history_link"), node_revisions_path(@node, :locale => @locale) %></p> |
| 6 | 6 | ||
| 7 | <p class="field_hint"> | 7 | <p class="field_hint"> |
| 8 | Metadata such as images, tags, template, and author belong to the page | 8 | <%= t(".metadata_hint_prefix") %> <%= link_to t(".metadata_hint_link"), edit_node_path(@node) %>. |
| 9 | as a whole, not to a single translation — change those from the | ||
| 10 | <%= link_to 'default-locale editor', edit_node_path(@node) %>. | ||
| 11 | </p> | 9 | </p> |
| 12 | 10 | ||
| 13 | <div class="node_action_bar"> | 11 | <div class="node_action_bar"> |
| 14 | <%= button_to 'Unlock + Back', unlock_node_path(@node), method: :put, | 12 | <%= button_to t("nodes.edit.unlock_back"), unlock_node_path(@node), method: :put, |
| 15 | form: { class: 'button_to state_changing' }, | 13 | form: { class: 'button_to state_changing' }, |
| 16 | disabled: @node.autosave.present? %> | 14 | disabled: @node.autosave.present? %> |
| 17 | <%= submit_tag "Save #{@locale.to_s.upcase} translation", form: "translation_edit_form" %> | 15 | <%= submit_tag t(".save_translation", :lang => @locale.to_s.upcase), form: "translation_edit_form" %> |
| 18 | <%= submit_tag "Save + Unlock + Exit", name: "unlock_exit", form: "translation_edit_form" %> | 16 | <%= submit_tag t("nodes.edit.save_unlock_exit"), name: "unlock_exit", form: "translation_edit_form" %> |
| 19 | <%= link_to "Preview ↗", preview_page_path(@page, :locale => @locale), target: "_blank", rel: "noopener", class: "preview_link" %> | 17 | <%= link_to t("nodes.edit.preview"), preview_page_path(@page, :locale => @locale), target: "_blank", rel: "noopener", class: "preview_link" %> |
| 20 | </div> | 18 | </div> |
| 21 | 19 | ||
| 22 | <div id="admin_layout"> | 20 | <div id="admin_layout"> |
| @@ -32,23 +30,23 @@ | |||
| 32 | <%= form_with url: node_translation_path(@node, @locale), method: :patch, local: true, id: "translation_edit_form", | 30 | <%= form_with url: node_translation_path(@node, @locale), method: :patch, local: true, id: "translation_edit_form", |
| 33 | data: { autosave_url: autosave_node_translation_path(@node, @locale), show_url: node_path(@node) } do |f| %> | 31 | data: { autosave_url: autosave_node_translation_path(@node, @locale), show_url: node_path(@node) } do |f| %> |
| 34 | <div id="content"> | 32 | <div id="content"> |
| 35 | <div class="layout_row_label">Title</div> | 33 | <div class="layout_row_label"><%= Page.human_attribute_name(:title) %></div> |
| 36 | <div class="layout_row_content"> | 34 | <div class="layout_row_content"> |
| 37 | <%= text_field_tag "page[title]", @translation&.title %> | 35 | <%= text_field_tag "page[title]", @translation&.title %> |
| 38 | </div> | 36 | </div> |
| 39 | 37 | ||
| 40 | <div class="layout_row_label">Abstract</div> | 38 | <div class="layout_row_label"><%= Page.human_attribute_name(:abstract) %></div> |
| 41 | <div class="layout_row_content"> | 39 | <div class="layout_row_content"> |
| 42 | <%= text_area_tag "page[abstract]", @translation&.abstract %> | 40 | <%= text_area_tag "page[abstract]", @translation&.abstract %> |
| 43 | </div> | 41 | </div> |
| 44 | 42 | ||
| 45 | <div class="layout_row_label">Body</div> | 43 | <div class="layout_row_label"><%= Page.human_attribute_name(:body) %></div> |
| 46 | <div class="body_toolbar_row"> | 44 | <div class="body_toolbar_row"> |
| 47 | <button type="button" id="preview_toggle" class="view_toggle" aria-pressed="false" aria-label="Toggle live preview" title="Toggle live preview"> | 45 | <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 | <%= icon("layout-sidebar-right", library: "tabler", "aria-hidden": true) %> <span>Live preview</span> | 46 | <%= icon("layout-sidebar-right", library: "tabler", "aria-hidden": true) %> <span><%= t("nodes.edit.live_preview") %></span> |
| 49 | </button> | 47 | </button> |
| 50 | <button type="button" id="preview_force_render" class="view_toggle" style="display:none" aria-label="Force preview render" title="Force preview render"> | 48 | <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 | <%= icon("refresh", library: "tabler", "aria-hidden": true) %> <span>Force refresh</span> | 49 | <%= icon("refresh", library: "tabler", "aria-hidden": true) %> <span><%= t("nodes.edit.force_refresh") %></span> |
| 52 | </button> | 50 | </button> |
| 53 | </div> | 51 | </div> |
| 54 | 52 | ||
| @@ -59,7 +57,7 @@ | |||
| 59 | </div> | 57 | </div> |
| 60 | </div> | 58 | </div> |
| 61 | <div id="preview_panel" style="display:none"> | 59 | <div id="preview_panel" style="display:none"> |
| 62 | <iframe id="live_preview_iframe" title="Live preview" data-src="<%= preview_page_path(@page, :locale => @locale) %>"></iframe> | 60 | <iframe id="live_preview_iframe" title="<%= t("nodes.edit.live_preview") %>" data-src="<%= preview_page_path(@page, :locale => @locale) %>"></iframe> |
| 63 | </div> | 61 | </div> |
| 64 | </div> | 62 | </div> |
| 65 | </div> | 63 | </div> |
diff --git a/app/views/page_translations/show.html.erb b/app/views/page_translations/show.html.erb index c4091fc3..0fbcd0b6 100644 --- a/app/views/page_translations/show.html.erb +++ b/app/views/page_translations/show.html.erb | |||
| @@ -1,29 +1,29 @@ | |||
| 1 | <h1>Compare — <%= 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 'View revision history', node_revisions_path(@node, :locale => @locale) %></p> | 3 | <p class="node_action_bar standalone_action_bar"><%= link_to t("page_translations.revision_history_link"), node_revisions_path(@node, :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">Title</div> | 8 | <div class="layout_row_label"><%= Page.human_attribute_name(:title) %></div> |
| 9 | <div class="layout_row_content"><%= @translation&.title %></div> | 9 | <div class="layout_row_content"><%= @translation&.title %></div> |
| 10 | 10 | ||
| 11 | <div class="layout_row_label">Abstract</div> | 11 | <div class="layout_row_label"><%= Page.human_attribute_name(:abstract) %></div> |
| 12 | <div class="layout_row_content"><%= sanitize(@translation&.abstract.to_s) %></div> | 12 | <div class="layout_row_content"><%= sanitize(@translation&.abstract.to_s) %></div> |
| 13 | 13 | ||
| 14 | <div class="layout_row_label">Body</div> | 14 | <div class="layout_row_label"><%= Page.human_attribute_name(:body) %></div> |
| 15 | <div class="layout_row_content"><%= sanitize(@translation&.body.to_s) %></div> | 15 | <div class="layout_row_content"><%= sanitize(@translation&.body.to_s) %></div> |
| 16 | </div> | 16 | </div> |
| 17 | 17 | ||
| 18 | <div class="translation_compare_column"> | 18 | <div class="translation_compare_column"> |
| 19 | <h2><%= I18n.default_locale.to_s.upcase %> (default)</h2> | 19 | <h2><%= I18n.default_locale.to_s.upcase %> (<%= t(".default_marker") %>)</h2> |
| 20 | <div class="layout_row_label">Title</div> | 20 | <div class="layout_row_label"><%= Page.human_attribute_name(:title) %></div> |
| 21 | <div class="layout_row_content"><%= @default_translation&.title %></div> | 21 | <div class="layout_row_content"><%= @default_translation&.title %></div> |
| 22 | 22 | ||
| 23 | <div class="layout_row_label">Abstract</div> | 23 | <div class="layout_row_label"><%= Page.human_attribute_name(:abstract) %></div> |
| 24 | <div class="layout_row_content"><%= sanitize(@default_translation&.abstract.to_s) %></div> | 24 | <div class="layout_row_content"><%= sanitize(@default_translation&.abstract.to_s) %></div> |
| 25 | 25 | ||
| 26 | <div class="layout_row_label">Body</div> | 26 | <div class="layout_row_label"><%= Page.human_attribute_name(:body) %></div> |
| 27 | <div class="layout_row_content"><%= sanitize(@default_translation&.body.to_s) %></div> | 27 | <div class="layout_row_content"><%= sanitize(@default_translation&.body.to_s) %></div> |
| 28 | </div> | 28 | </div> |
| 29 | </div> | 29 | </div> |
diff --git a/app/views/revisions/diff.html.erb b/app/views/revisions/diff.html.erb index 7e7b729e..1318bd37 100644 --- a/app/views/revisions/diff.html.erb +++ b/app/views/revisions/diff.html.erb | |||
| @@ -1,18 +1,18 @@ | |||
| 1 | <h1>Revisions#diff</h1> | 1 | <h1><%= t(".title") %></h1> |
| 2 | 2 | ||
| 3 | <p class="node_action_bar standalone_action_bar"> | 3 | <p class="node_action_bar standalone_action_bar"> |
| 4 | <%= link_to 'Revisions', node_revisions_path(@node) %> | 4 | <%= link_to t(".revisions_link"), node_revisions_path(@node) %> |
| 5 | </p> | 5 | </p> |
| 6 | 6 | ||
| 7 | <p class="diff_comparison_label"> | 7 | <p class="diff_comparison_label"> |
| 8 | Comparing <strong><%= describe_page_reference(params[:start_revision]) %></strong> | 8 | <%= t(".comparing") %> <strong><%= describe_page_reference(params[:start_revision]) %></strong> |
| 9 | against <strong><%= describe_page_reference(params[:end_revision]) %></strong> | 9 | <%= t(".against") %> <strong><%= describe_page_reference(params[:end_revision]) %></strong> |
| 10 | — showing the <strong><%= @locale.to_s.upcase %></strong> translation | 10 | <%= t(".showing_prefix") %> <strong><%= @locale.to_s.upcase %></strong> <%= t(".translation_suffix") %> |
| 11 | </p> | 11 | </p> |
| 12 | 12 | ||
| 13 | <% if @locale_summary.size > 1 %> | 13 | <% if @locale_summary.size > 1 %> |
| 14 | <p class="diff_locale_toggle"> | 14 | <p class="diff_locale_toggle"> |
| 15 | Locale: | 15 | <%= t("revisions.locale_label") %> |
| 16 | <% @locale_summary.each_with_index do |s, i| %> | 16 | <% @locale_summary.each_with_index do |s, i| %> |
| 17 | <%= " · ".html_safe if i > 0 %> | 17 | <%= " · ".html_safe if i > 0 %> |
| 18 | <% label = "#{s[:locale].to_s.upcase}#{' *' if s[:changed]}" %> | 18 | <% label = "#{s[:locale].to_s.upcase}#{' *' if s[:changed]}" %> |
| @@ -23,21 +23,21 @@ | |||
| 23 | <% end %> | 23 | <% end %> |
| 24 | <% end %> | 24 | <% end %> |
| 25 | </p> | 25 | </p> |
| 26 | <p class="field_hint">* has a difference between these two versions.</p> | 26 | <p class="field_hint"><%= t(".changed_hint") %></p> |
| 27 | <% end %> | 27 | <% end %> |
| 28 | 28 | ||
| 29 | <p class="diff_view_toggle"> | 29 | <p class="diff_view_toggle"> |
| 30 | View: | 30 | <%= t(".view_label") %> |
| 31 | <% if @diff_view == :inline %> | 31 | <% if @diff_view == :inline %> |
| 32 | <strong>Inline</strong> | 32 | <strong><%= t("revisions.inline") %></strong> |
| 33 | <% else %> | 33 | <% else %> |
| 34 | <%= link_to 'Inline', diff_node_revisions_path(@node, start_revision: params[:start_revision], end_revision: params[:end_revision], view: 'inline', locale: @locale) %> | 34 | <%= link_to t("revisions.inline"), diff_node_revisions_path(@node, start_revision: params[:start_revision], end_revision: params[:end_revision], view: 'inline', locale: @locale) %> |
| 35 | <% end %> | 35 | <% end %> |
| 36 | · | 36 | · |
| 37 | <% if @diff_view == :side_by_side %> | 37 | <% if @diff_view == :side_by_side %> |
| 38 | <strong>Side by side</strong> | 38 | <strong><%= t("revisions.side_by_side") %></strong> |
| 39 | <% else %> | 39 | <% else %> |
| 40 | <%= link_to 'Side by side', diff_node_revisions_path(@node, start_revision: params[:start_revision], end_revision: params[:end_revision], view: 'side_by_side', locale: @locale) %> | 40 | <%= link_to t("revisions.side_by_side"), diff_node_revisions_path(@node, start_revision: params[:start_revision], end_revision: params[:end_revision], view: 'side_by_side', locale: @locale) %> |
| 41 | <% end %> | 41 | <% end %> |
| 42 | </p> | 42 | </p> |
| 43 | 43 | ||
| @@ -49,17 +49,17 @@ | |||
| 49 | <%= select_tag :end_revision, options_for_select(@node.pages.map{|x| x.revision}, params[:end_revision].to_i) %> | 49 | <%= select_tag :end_revision, options_for_select(@node.pages.map{|x| x.revision}, params[:end_revision].to_i) %> |
| 50 | <%= hidden_field_tag :view, @diff_view %> | 50 | <%= hidden_field_tag :view, @diff_view %> |
| 51 | <%= hidden_field_tag :locale, @locale %> | 51 | <%= hidden_field_tag :locale, @locale %> |
| 52 | <%= submit_tag 'Diff' %> | 52 | <%= submit_tag t(".diff_button") %> |
| 53 | <% end %> | 53 | <% end %> |
| 54 | <% else %> | 54 | <% else %> |
| 55 | <p class="node_action_bar standalone_action_bar"><%= link_to 'Compare two numbered revisions instead', node_revisions_path(@node) %></p> | 55 | <p class="node_action_bar standalone_action_bar"><%= link_to t(".compare_numbered"), node_revisions_path(@node) %></p> |
| 56 | <% end %> | 56 | <% end %> |
| 57 | 57 | ||
| 58 | <% if @available_layer_pairs.present? %> | 58 | <% if @available_layer_pairs.present? %> |
| 59 | <div class="node_action_bar standalone_action_bar"> | 59 | <div class="node_action_bar standalone_action_bar"> |
| 60 | <% @available_layer_pairs.each do |pair| %> | 60 | <% @available_layer_pairs.each do |pair| %> |
| 61 | <% next if [params[:start_revision].to_s, params[:end_revision].to_s].sort == pair.map(&:to_s).sort %> | 61 | <% next if [params[:start_revision].to_s, params[:end_revision].to_s].sort == pair.map(&:to_s).sort %> |
| 62 | <%= button_to "Diff #{pair.first.to_s.capitalize} vs. #{pair.last.to_s.capitalize}", | 62 | <%= button_to t("nodes.show.diff_layers", :from => t("nodes.show.layer_#{pair.first}"), :to => t("nodes.show.layer_#{pair.last}")), |
| 63 | diff_node_revisions_path(@node), | 63 | diff_node_revisions_path(@node), |
| 64 | method: :get, | 64 | method: :get, |
| 65 | params: { start_revision: pair.first, end_revision: pair.last, view: @diff_view, locale: @locale }, | 65 | params: { start_revision: pair.first, end_revision: pair.last, view: @diff_view, locale: @locale }, |
| @@ -68,9 +68,9 @@ | |||
| 68 | <% if !@locked_by_other && (@node.autosave || @node.draft) %> | 68 | <% if !@locked_by_other && (@node.autosave || @node.draft) %> |
| 69 | <%= button_to revert_node_path(@node), method: :put, | 69 | <%= button_to revert_node_path(@node), method: :put, |
| 70 | params: { return_to: request.fullpath }, | 70 | params: { return_to: request.fullpath }, |
| 71 | form: { data: { confirm: "This cannot be undone. Continue?" }, class: 'button_to destructive' } do %> | 71 | form: { data: { confirm: t("admin.common.confirm_irreversible") }, class: 'button_to destructive' } do %> |
| 72 | <%= icon("trash", library: "tabler", "aria-hidden": true) %> | 72 | <%= icon("trash", library: "tabler", "aria-hidden": true) %> |
| 73 | <%= @node.draft && !@node.autosave ? "Destroy Draft" : "Discard Autosave" %> | 73 | <%= @node.draft && !@node.autosave ? t("nodes.show.destroy_draft") : t("nodes.show.discard_autosave") %> |
| 74 | <% end %> | 74 | <% end %> |
| 75 | <% end %> | 75 | <% end %> |
| 76 | </div> | 76 | </div> |
| @@ -80,34 +80,34 @@ | |||
| 80 | <% if @diff_view == :side_by_side %> | 80 | <% if @diff_view == :side_by_side %> |
| 81 | <div class="diff_side_by_side"> | 81 | <div class="diff_side_by_side"> |
| 82 | <div class="diff_column"> | 82 | <div class="diff_column"> |
| 83 | <h3>Title</h3> | 83 | <h3><%= Page.human_attribute_name(:title) %></h3> |
| 84 | <p><%= raw @diff[:title][0] %></p> | 84 | <p><%= raw @diff[:title][0] %></p> |
| 85 | <h3>Abstract</h3> | 85 | <h3><%= Page.human_attribute_name(:abstract) %></h3> |
| 86 | <p><%= raw @diff[:abstract][0] %></p> | 86 | <p><%= raw @diff[:abstract][0] %></p> |
| 87 | <h3>Body</h3> | 87 | <h3><%= Page.human_attribute_name(:body) %></h3> |
| 88 | <%= raw @diff[:body][0] %> | 88 | <%= raw @diff[:body][0] %> |
| 89 | </div> | 89 | </div> |
| 90 | <div class="diff_column"> | 90 | <div class="diff_column"> |
| 91 | <h3>Title</h3> | 91 | <h3><%= Page.human_attribute_name(:title) %></h3> |
| 92 | <p><%= raw @diff[:title][1] %></p> | 92 | <p><%= raw @diff[:title][1] %></p> |
| 93 | <h3>Abstract</h3> | 93 | <h3><%= Page.human_attribute_name(:abstract) %></h3> |
| 94 | <p><%= raw @diff[:abstract][1] %></p> | 94 | <p><%= raw @diff[:abstract][1] %></p> |
| 95 | <h3>Body</h3> | 95 | <h3><%= Page.human_attribute_name(:body) %></h3> |
| 96 | <%= raw @diff[:body][1] %> | 96 | <%= raw @diff[:body][1] %> |
| 97 | </div> | 97 | </div> |
| 98 | </div> | 98 | </div> |
| 99 | <% else %> | 99 | <% else %> |
| 100 | <h3>Title</h3> | 100 | <h3><%= Page.human_attribute_name(:title) %></h3> |
| 101 | <p><%= raw @diff[:title] %></p> | 101 | <p><%= raw @diff[:title] %></p> |
| 102 | <h3>Abstract</h3> | 102 | <h3><%= Page.human_attribute_name(:abstract) %></h3> |
| 103 | <p><%= raw @diff[:abstract] %></p> | 103 | <p><%= raw @diff[:abstract] %></p> |
| 104 | <h3>Body</h3> | 104 | <h3><%= Page.human_attribute_name(:body) %></h3> |
| 105 | <%= raw @diff[:body] %> | 105 | <%= raw @diff[:body] %> |
| 106 | <% end %> | 106 | <% end %> |
| 107 | 107 | ||
| 108 | <h3>Tags</h3> | 108 | <h3><%= Page.human_attribute_name(:tag_list) %></h3> |
| 109 | <% if @diff[:tags][:added].empty? && @diff[:tags][:removed].empty? %> | 109 | <% if @diff[:tags][:added].empty? && @diff[:tags][:removed].empty? %> |
| 110 | <p class="diff_unchanged">No change.</p> | 110 | <p class="diff_unchanged"><%= t(".no_change") %></p> |
| 111 | <% else %> | 111 | <% else %> |
| 112 | <ul class="diff_set_list"> | 112 | <ul class="diff_set_list"> |
| 113 | <% @diff[:tags][:added].each do |tag| %><li><ins><%= tag %></ins></li><% end %> | 113 | <% @diff[:tags][:added].each do |tag| %><li><ins><%= tag %></ins></li><% end %> |
| @@ -115,16 +115,16 @@ | |||
| 115 | </ul> | 115 | </ul> |
| 116 | <% end %> | 116 | <% end %> |
| 117 | 117 | ||
| 118 | <h3>Template</h3> | 118 | <h3><%= Page.human_attribute_name(:template_name) %></h3> |
| 119 | <% if @diff[:template_name][:changed] %> | 119 | <% if @diff[:template_name][:changed] %> |
| 120 | <p><del><%= @diff[:template_name][:from] || '(none)' %></del> <ins><%= @diff[:template_name][:to] || '(none)' %></ins></p> | 120 | <p><del><%= @diff[:template_name][:from] || t(".none_marker") %></del> <ins><%= @diff[:template_name][:to] || t(".none_marker") %></ins></p> |
| 121 | <% else %> | 121 | <% else %> |
| 122 | <p class="diff_unchanged">No change.</p> | 122 | <p class="diff_unchanged"><%= t(".no_change") %></p> |
| 123 | <% end %> | 123 | <% end %> |
| 124 | 124 | ||
| 125 | <h3>Assets</h3> | 125 | <h3><%= Page.human_attribute_name(:assets) %></h3> |
| 126 | <% if @diff[:assets][:added].empty? && @diff[:assets][:removed].empty? %> | 126 | <% if @diff[:assets][:added].empty? && @diff[:assets][:removed].empty? %> |
| 127 | <p class="diff_unchanged">No change.</p> | 127 | <p class="diff_unchanged"><%= t(".no_change") %></p> |
| 128 | <% else %> | 128 | <% else %> |
| 129 | <ul class="diff_set_list"> | 129 | <ul class="diff_set_list"> |
| 130 | <% @diff[:assets][:added].each do |asset| %><li><ins><%= asset.upload_file_name %></ins></li><% end %> | 130 | <% @diff[:assets][:added].each do |asset| %><li><ins><%= asset.upload_file_name %></ins></li><% end %> |
diff --git a/app/views/revisions/index.html.erb b/app/views/revisions/index.html.erb index 7ea74a6c..6bcf1820 100644 --- a/app/views/revisions/index.html.erb +++ b/app/views/revisions/index.html.erb | |||
| @@ -1,12 +1,12 @@ | |||
| 1 | <h2>Revisions for Node: <%= @node.unique_name %></h2> | 1 | <h2><%= t(".title", :path => @node.unique_name) %></h2> |
| 2 | 2 | ||
| 3 | <p class="node_action_bar standalone_action_bar"> | 3 | <p class="node_action_bar standalone_action_bar"> |
| 4 | <%= link_to 'Back to node', node_path(@node) %> | 4 | <%= link_to t(".back_to_node"), node_path(@node) %> |
| 5 | </p> | 5 | </p> |
| 6 | 6 | ||
| 7 | <% if Page.non_default_locales.any? %> | 7 | <% if Page.non_default_locales.any? %> |
| 8 | <p class="diff_locale_toggle"> | 8 | <p class="diff_locale_toggle"> |
| 9 | Locale: | 9 | <%= t("revisions.locale_label") %> |
| 10 | <% ([I18n.default_locale] + Page.non_default_locales).each_with_index do |locale, i| %> | 10 | <% ([I18n.default_locale] + Page.non_default_locales).each_with_index do |locale, i| %> |
| 11 | <%= " · ".html_safe if i > 0 %> | 11 | <%= " · ".html_safe if i > 0 %> |
| 12 | <% if locale == @locale %> | 12 | <% if locale == @locale %> |
| @@ -21,25 +21,25 @@ | |||
| 21 | <table id="revisions" class="revisions_table"> | 21 | <table id="revisions" class="revisions_table"> |
| 22 | <thead> | 22 | <thead> |
| 23 | <tr class="header"> | 23 | <tr class="header"> |
| 24 | <th>First</th> | 24 | <th><%= t(".first") %></th> |
| 25 | <th>Last</th> | 25 | <th><%= t(".last") %></th> |
| 26 | <th>Rev.</th> | 26 | <th><%= t("admin.columns.rev") %></th> |
| 27 | <th>Title</th> | 27 | <th><%= t("admin.columns.title") %></th> |
| 28 | <th>Editor</th> | 28 | <th><%= t("admin.columns.editor") %></th> |
| 29 | <th>Date</th> | 29 | <th><%= t("admin.columns.date") %></th> |
| 30 | <th></th> | 30 | <th></th> |
| 31 | <th></th> | 31 | <th></th> |
| 32 | </tr> | 32 | </tr> |
| 33 | <tr class="no_hover diff_sticky_bar"> | 33 | <tr class="no_hover diff_sticky_bar"> |
| 34 | <td colspan="8"> | 34 | <td colspan="8"> |
| 35 | <%= button_to 'Diff revisions', diff_node_revisions_path(@node), | 35 | <%= button_to t(".diff_revisions"), diff_node_revisions_path(@node), |
| 36 | method: :post, | 36 | method: :post, |
| 37 | params: { locale: @locale }, | 37 | params: { locale: @locale }, |
| 38 | form: { id: 'diff_form', class: 'button_to computation' }, | 38 | form: { id: 'diff_form', class: 'button_to computation' }, |
| 39 | disabled: true %> | 39 | disabled: true %> |
| 40 | <span id="diff_selection_label"></span> | 40 | <span id="diff_selection_label" data-against="<%= t(".against_word") %>" data-selected="<%= t(".selected_word") %>"></span> |
| 41 | <label><%= radio_button_tag :view, 'inline', true %> Inline</label> | 41 | <label><%= radio_button_tag :view, 'inline', true %> <%= t("revisions.inline") %></label> |
| 42 | <label><%= radio_button_tag :view, 'side_by_side', false %> Side by side</label> | 42 | <label><%= radio_button_tag :view, 'side_by_side', false %> <%= t("revisions.side_by_side") %></label> |
| 43 | </td> | 43 | </td> |
| 44 | </tr> | 44 | </tr> |
| 45 | </thead> | 45 | </thead> |
| @@ -53,11 +53,11 @@ | |||
| 53 | <td class="title"><%= page.translations.find_by(:locale => @locale)&.title || "—" %></td> | 53 | <td class="title"><%= page.translations.find_by(:locale => @locale)&.title || "—" %></td> |
| 54 | <td class="user"><%= page.editor.try(:login) %></td> | 54 | <td class="user"><%= page.editor.try(:login) %></td> |
| 55 | <td class="date"><%= page.updated_at %></td> | 55 | <td class="date"><%= page.updated_at %></td> |
| 56 | <td><%= link_to 'show', node_revision_path(@node, page, :locale => @locale) %></td> | 56 | <td><%= link_to t(".show_link"), node_revision_path(@node, page, :locale => @locale) %></td> |
| 57 | <td> | 57 | <td> |
| 58 | <%= button_to 'restore', restore_node_revision_path(@node, page), | 58 | <%= button_to t(".restore_link"), restore_node_revision_path(@node, page), |
| 59 | method: :put, | 59 | method: :put, |
| 60 | form: { data: { confirm: "Restore this revision?" }, class: 'button_to state_changing' } %> | 60 | form: { data: { confirm: t(".confirm_restore") }, class: 'button_to state_changing' } %> |
| 61 | </td> | 61 | </td> |
| 62 | </tr> | 62 | </tr> |
| 63 | <% end %> | 63 | <% end %> |
| @@ -73,9 +73,9 @@ | |||
| 73 | 73 | ||
| 74 | var label = document.getElementById('diff_selection_label'); | 74 | var label = document.getElementById('diff_selection_label'); |
| 75 | if (start && end) { | 75 | if (start && end) { |
| 76 | label.textContent = start.value + ' against ' + end.value; | 76 | label.textContent = start.value + ' ' + label.dataset.against + ' ' + end.value; |
| 77 | } else if (start || end) { | 77 | } else if (start || end) { |
| 78 | label.textContent = (start || end).value + ' selected'; | 78 | label.textContent = (start || end).value + ' ' + label.dataset.selected; |
| 79 | } else { | 79 | } else { |
| 80 | label.textContent = ''; | 80 | label.textContent = ''; |
| 81 | } | 81 | } |
diff --git a/app/views/revisions/show.html.erb b/app/views/revisions/show.html.erb index 64bc0eea..a39071c6 100644 --- a/app/views/revisions/show.html.erb +++ b/app/views/revisions/show.html.erb | |||
| @@ -1,39 +1,39 @@ | |||
| 1 | <% translation = @page.translations.find_by(:locale => @locale) %> | 1 | <% translation = @page.translations.find_by(:locale => @locale) %> |
| 2 | <div id="admin_layout" class="show_node"> | 2 | <div id="admin_layout" class="show_node"> |
| 3 | <h1>Revision <%= @page.revision %>: <%= translation&.title %> <small>(<%= @locale.to_s.upcase %>)</small></h1> | 3 | <h1><%= t(".title", :rev => @page.revision) %>: <%= translation&.title %> <small>(<%= @locale.to_s.upcase %>)</small></h1> |
| 4 | 4 | ||
| 5 | <div id="content"> | 5 | <div id="content"> |
| 6 | <div class="layout_row_label">Actions</div> | 6 | <div class="layout_row_label"><%= t("admin.columns.actions") %></div> |
| 7 | <div class="layout_row_content info_group"> | 7 | <div class="layout_row_content info_group"> |
| 8 | <div class="info_group_items"> | 8 | <div class="info_group_items"> |
| 9 | <div class="info_item"> | 9 | <div class="info_item"> |
| 10 | <%= link_to 'Show all revisions', node_revisions_path(@node, :locale => @locale) %> | 10 | <%= link_to t(".show_all"), node_revisions_path(@node, :locale => @locale) %> |
| 11 | </div> | 11 | </div> |
| 12 | </div> | 12 | </div> |
| 13 | </div> | 13 | </div> |
| 14 | 14 | ||
| 15 | <div class="layout_row_label">Path</div> | 15 | <div class="layout_row_label"><%= t("admin.columns.path") %></div> |
| 16 | <div class="layout_row_content"><%= @page.public_link %></div> | 16 | <div class="layout_row_content"><%= @page.public_link %></div> |
| 17 | 17 | ||
| 18 | <div class="layout_row_label">Author</div> | 18 | <div class="layout_row_label"><%= t("admin.columns.author") %></div> |
| 19 | <div class="layout_row_content"><%= @page.user.try(:login) %></div> | 19 | <div class="layout_row_content"><%= @page.user.try(:login) %></div> |
| 20 | 20 | ||
| 21 | <div class="layout_row_label">Editor</div> | 21 | <div class="layout_row_label"><%= t("admin.columns.editor") %></div> |
| 22 | <div class="layout_row_content"><%= @page.editor.try(:login) %></div> | 22 | <div class="layout_row_content"><%= @page.editor.try(:login) %></div> |
| 23 | 23 | ||
| 24 | <div class="layout_row_label">Last updated</div> | 24 | <div class="layout_row_label"><%= t("nodes.show.last_updated") %></div> |
| 25 | <div class="layout_row_content"><%= @page.updated_at %></div> | 25 | <div class="layout_row_content"><%= @page.updated_at %></div> |
| 26 | 26 | ||
| 27 | <div class="layout_row_label">Published at</div> | 27 | <div class="layout_row_label"><%= t("nodes.show.published_at") %></div> |
| 28 | <div class="layout_row_content"><%= @page.published_at %></div> | 28 | <div class="layout_row_content"><%= @page.published_at %></div> |
| 29 | 29 | ||
| 30 | <div class="layout_row_label">Title</div> | 30 | <div class="layout_row_label"><%= Page.human_attribute_name(:title) %></div> |
| 31 | <div class="layout_row_content"><%= translation&.title %></div> | 31 | <div class="layout_row_content"><%= translation&.title %></div> |
| 32 | 32 | ||
| 33 | <div class="layout_row_label">Abstract</div> | 33 | <div class="layout_row_label"><%= Page.human_attribute_name(:abstract) %></div> |
| 34 | <div class="layout_row_content"><%= translation&.abstract %></div> | 34 | <div class="layout_row_content"><%= translation&.abstract %></div> |
| 35 | 35 | ||
| 36 | <div class="layout_row_label">Body</div> | 36 | <div class="layout_row_label"><%= Page.human_attribute_name(:body) %></div> |
| 37 | <div class="layout_row_content"><%= raw translation&.body %></div> | 37 | <div class="layout_row_content"><%= raw translation&.body %></div> |
| 38 | </div> | 38 | </div> |
| 39 | </div> | 39 | </div> |
