diff options
Diffstat (limited to 'app/views')
| -rw-r--r-- | app/views/nodes/edit.html.erb | 3 | ||||
| -rw-r--r-- | app/views/nodes/show.html.erb | 37 | ||||
| -rw-r--r-- | app/views/revisions/diff.html.erb | 19 |
3 files changed, 56 insertions, 3 deletions
diff --git a/app/views/nodes/edit.html.erb b/app/views/nodes/edit.html.erb index f629985e..a40f3949 100644 --- a/app/views/nodes/edit.html.erb +++ b/app/views/nodes/edit.html.erb | |||
| @@ -154,8 +154,7 @@ | |||
| 154 | <div id="redirect_target_field" style="<%= "display: none;" unless @page.redirect.present? %>"> | 154 | <div id="redirect_target_field" style="<%= "display: none;" unless @page.redirect.present? %>"> |
| 155 | <div class="input_group" data-clears="page_redirect_node_id"> | 155 | <div class="input_group" data-clears="page_redirect_node_id"> |
| 156 | <span class="field_search_icon"><%= icon("search", library: "tabler", "aria-hidden": true) %></span> | 156 | <span class="field_search_icon"><%= icon("search", library: "tabler", "aria-hidden": true) %></span> |
| 157 | <%= text_field_tag :redirect_search_term, | 157 | <%= text_field_tag :redirect_search_term, @page.redirect_node&.title, |
| 158 | Node.find_by(:id => @page.redirect_node_id)&.title, | ||
| 159 | :placeholder => "—", :class => "clearable_input" %> | 158 | :placeholder => "—", :class => "clearable_input" %> |
| 160 | <div id="redirect_search_results" class="search_results"></div> | 159 | <div id="redirect_search_results" class="search_results"></div> |
| 161 | <button type="button" class="field_clear" aria-label="clear input">×</button> | 160 | <button type="button" class="field_clear" aria-label="clear input">×</button> |
diff --git a/app/views/nodes/show.html.erb b/app/views/nodes/show.html.erb index 24ac4084..d8c08eb1 100644 --- a/app/views/nodes/show.html.erb +++ b/app/views/nodes/show.html.erb | |||
| @@ -9,14 +9,35 @@ | |||
| 9 | <div class="info_group_items"> | 9 | <div class="info_group_items"> |
| 10 | <div class="info_item"> | 10 | <div class="info_item"> |
| 11 | <span class="info_label"><%= t(".head") %></span> | 11 | <span class="info_label"><%= t(".head") %></span> |
| 12 | <% if @node.head&.redirect.present? %> | ||
| 13 | <span class="flag_stack"> | ||
| 14 | <%= flag("arrow-ramp-right", | ||
| 15 | redirect_flag_hint(@node.head), | ||
| 16 | :tier => :attention) %> | ||
| 17 | </span> | ||
| 18 | <% end %> | ||
| 12 | <%= @node.head ? t(".head_line", :title => @node.head.title, :rev => @node.head.revision, :time => @node.head.updated_at) : t(".never_published") %> | 19 | <%= @node.head ? t(".head_line", :title => @node.head.title, :rev => @node.head.revision, :time => @node.head.updated_at) : t(".never_published") %> |
| 13 | </div> | 20 | </div> |
| 14 | <div class="info_item"> | 21 | <div class="info_item"> |
| 15 | <span class="info_label"><%= t(".draft") %></span> | 22 | <span class="info_label"><%= t(".draft") %></span> |
| 23 | <% if @node.draft&.redirect.present? %> | ||
| 24 | <span class="flag_stack"> | ||
| 25 | <%= flag("arrow-ramp-right", | ||
| 26 | redirect_flag_hint(@node.draft), | ||
| 27 | :tier => :attention) %> | ||
| 28 | </span> | ||
| 29 | <% end %> | ||
| 16 | <%= @node.draft ? t(".draft_line", :title => @node.draft.title, :rev => @node.draft.revision, :time => @node.draft.updated_at) : t(".none") %> | 30 | <%= @node.draft ? t(".draft_line", :title => @node.draft.title, :rev => @node.draft.revision, :time => @node.draft.updated_at) : t(".none") %> |
| 17 | </div> | 31 | </div> |
| 18 | <div class="info_item"> | 32 | <div class="info_item"> |
| 19 | <span class="info_label"><%= t(".autosave") %></span> | 33 | <span class="info_label"><%= t(".autosave") %></span> |
| 34 | <% if @node.autosave&.redirect.present? %> | ||
| 35 | <span class="flag_stack"> | ||
| 36 | <%= flag("arrow-ramp-right", | ||
| 37 | redirect_flag_hint(@node.autosave), | ||
| 38 | :tier => :attention) %> | ||
| 39 | </span> | ||
| 40 | <% end %> | ||
| 20 | <%= @node.autosave ? t(".autosave_line", :title => @node.autosave.title, :time => @node.autosave.updated_at) : t(".none") %> | 41 | <%= @node.autosave ? t(".autosave_line", :title => @node.autosave.title, :time => @node.autosave.updated_at) : t(".none") %> |
| 21 | </div> | 42 | </div> |
| 22 | </div> | 43 | </div> |
| @@ -56,6 +77,11 @@ | |||
| 56 | <% confirm += " " + t(".confirm_publish_moves", | 77 | <% confirm += " " + t(".confirm_publish_moves", |
| 57 | :path => @node.prospective_unique_name) %> | 78 | :path => @node.prospective_unique_name) %> |
| 58 | <% end %> | 79 | <% end %> |
| 80 | <% if @node.draft.redirect.present? && @node.head&.redirect.blank? %> | ||
| 81 | <% confirm += " " + t(".confirm_publish_redirects") %> | ||
| 82 | <% elsif @node.draft.redirect.present? && @node.draft.redirect_differs_from?(@node.head) %> | ||
| 83 | <% confirm += " " + t(".confirm_publish_redirect_changes") %> | ||
| 84 | <% end %> | ||
| 59 | <%= button_to t(".publish"), publish_node_path(@node), method: :put, | 85 | <%= button_to t(".publish"), publish_node_path(@node), method: :put, |
| 60 | form: { data: { confirm: confirm }, class: 'button_to state_changing' } %> | 86 | form: { data: { confirm: confirm }, class: 'button_to state_changing' } %> |
| 61 | <% else %> | 87 | <% else %> |
| @@ -246,6 +272,17 @@ | |||
| 246 | </p> | 272 | </p> |
| 247 | <% end %> | 273 | <% end %> |
| 248 | 274 | ||
| 275 | <% if (redirect = @node.head&.redirect_target) %> | ||
| 276 | <p class="pending_address"> | ||
| 277 | <%= icon("arrow-right", library: "tabler", "aria-hidden": true) %> | ||
| 278 | <% if redirect.internal? %> | ||
| 279 | <%= t(".redirects_to", :path => redirect.node.unique_name) %> | ||
| 280 | <% else %> | ||
| 281 | <%= t(".redirects_to_url", :url => redirect.url) %> | ||
| 282 | <% end %> | ||
| 283 | </p> | ||
| 284 | <% end %> | ||
| 285 | |||
| 249 | <div class="link_matrix link_matrix_<%= link_locales.size %>"> | 286 | <div class="link_matrix link_matrix_<%= link_locales.size %>"> |
| 250 | <div class="link_matrix_head"> | 287 | <div class="link_matrix_head"> |
| 251 | <span></span> | 288 | <span></span> |
diff --git a/app/views/revisions/diff.html.erb b/app/views/revisions/diff.html.erb index 17146615..eb7955c2 100644 --- a/app/views/revisions/diff.html.erb +++ b/app/views/revisions/diff.html.erb | |||
| @@ -74,7 +74,8 @@ | |||
| 74 | @diff[:template_name][:changed] || | 74 | @diff[:template_name][:changed] || |
| 75 | @diff[:published_at][:changed] || @diff[:user][:changed] || | 75 | @diff[:published_at][:changed] || @diff[:user][:changed] || |
| 76 | @diff[:tags][:added].any? || @diff[:tags][:removed].any? || | 76 | @diff[:tags][:added].any? || @diff[:tags][:removed].any? || |
| 77 | @diff[:assets][:added].any? || @diff[:assets][:removed].any? %> | 77 | @diff[:assets][:added].any? || @diff[:assets][:removed].any? || |
| 78 | @diff[:redirect][:changed] || @diff[:redirect_node][:changed] %> | ||
| 78 | 79 | ||
| 79 | <div class="diff_preamble"> | 80 | <div class="diff_preamble"> |
| 80 | <div class="diff_meta"> | 81 | <div class="diff_meta"> |
| @@ -98,6 +99,22 @@ | |||
| 98 | </p> | 99 | </p> |
| 99 | <% end %> | 100 | <% end %> |
| 100 | 101 | ||
| 102 | <% if @diff[:redirect][:changed] %> | ||
| 103 | <h3><%= Page.human_attribute_name(:redirect) %></h3> | ||
| 104 | <p> | ||
| 105 | <del><%= @diff[:redirect][:from] ? t("nodes.edit.redirect_mode_#{@diff[:redirect][:from]}") : t(".none_marker") %></del> | ||
| 106 | <ins><%= @diff[:redirect][:to] ? t("nodes.edit.redirect_mode_#{@diff[:redirect][:to]}") : t(".none_marker") %></ins> | ||
| 107 | </p> | ||
| 108 | <% end %> | ||
| 109 | |||
| 110 | <% if @diff[:redirect_node][:changed] %> | ||
| 111 | <h3><%= Page.human_attribute_name(:redirect_node) %></h3> | ||
| 112 | <p> | ||
| 113 | <del><%= @diff[:redirect_node][:from]&.unique_name || t(".none_marker") %></del> | ||
| 114 | <ins><%= @diff[:redirect_node][:to]&.unique_name || t(".none_marker") %></ins> | ||
| 115 | </p> | ||
| 116 | <% end %> | ||
| 117 | |||
| 101 | <% if @diff[:published_at][:changed] %> | 118 | <% if @diff[:published_at][:changed] %> |
| 102 | <h3><%= Page.human_attribute_name(:published_at) %></h3> | 119 | <h3><%= Page.human_attribute_name(:published_at) %></h3> |
| 103 | <p> | 120 | <p> |
