summaryrefslogtreecommitdiff
path: root/app/views/nodes/edit.html.erb
diff options
context:
space:
mode:
authorerdgeist <erdgeist@erdgeist.org>2026-07-25 02:23:13 +0200
committererdgeist <erdgeist@erdgeist.org>2026-07-25 02:23:13 +0200
commit0a5d7806700bb3154529b99abc75d37ccc46faff (patch)
tree16c4b705d824c83c5887ae7661928c0c4f93c2c3 /app/views/nodes/edit.html.erb
parent90207029de7474082310d0725801d60f7145fa98 (diff)
Extract admin strings to i18n: the nodes cluster
Diffstat (limited to 'app/views/nodes/edit.html.erb')
-rw-r--r--app/views/nodes/edit.html.erb70
1 files changed, 35 insertions, 35 deletions
diff --git a/app/views/nodes/edit.html.erb b/app/views/nodes/edit.html.erb
index 4d58e62c..1d07a21e 100644
--- a/app/views/nodes/edit.html.erb
+++ b/app/views/nodes/edit.html.erb
@@ -1,18 +1,18 @@
1<h1><%= title_for_node(@node) %></h1> 1<h1><%= title_for_node(@node) %></h1>
2 2
3<div class="node_action_bar"> 3<div class="node_action_bar">
4 <%= button_to 'Unlock + Back', unlock_node_path(@node), method: :put, 4 <%= button_to t(".unlock_back"), unlock_node_path(@node), method: :put,
5 form: { class: 'button_to state_changing' }, 5 form: { class: 'button_to state_changing' },
6 disabled: @node.autosave.present? %> 6 disabled: @node.autosave.present? %>
7 7
8 <% if @node.autosave || (@node.draft && @node.head) %> 8 <% if @node.autosave || (@node.draft && @node.head) %>
9 <%= button_to revert_node_path(@node), method: :put, 9 <%= button_to revert_node_path(@node), method: :put,
10 form: { data: { confirm: "This cannot be undone. Continue?" }, class: 'button_to destructive' } do %> 10 form: { data: { confirm: t(".confirm_discard") }, class: 'button_to destructive' } do %>
11 <%= icon("trash", library: "tabler", "aria-hidden": true) %> 11 <%= icon("trash", library: "tabler", "aria-hidden": true) %>
12 <%= @node.draft && !@node.autosave ? "Destroy Draft" : "Discard Autosave" %> 12 <%= @node.draft && !@node.autosave ? t(".destroy_draft") : t(".discard_autosave") %>
13 <% end %> 13 <% end %>
14 <% if pair = @node.available_layer_pairs.find { |p| p.include?(:autosave) } %> 14 <% if pair = @node.available_layer_pairs.find { |p| p.include?(:autosave) } %>
15 <%= button_to 'What changed?', 15 <%= button_to t(".what_changed"),
16 diff_node_revisions_path(@node), 16 diff_node_revisions_path(@node),
17 method: :get, 17 method: :get,
18 params: { start_revision: pair.first, end_revision: pair.last }, 18 params: { start_revision: pair.first, end_revision: pair.last },
@@ -20,9 +20,9 @@
20 <% end %> 20 <% end %>
21 <% end %> 21 <% end %>
22 22
23 <%= submit_tag "Save Draft", form: dom_id(@node, :edit) %> 23 <%= submit_tag t(".save_draft"), form: dom_id(@node, :edit) %>
24 <%= submit_tag "Save + Unlock + Exit", form: dom_id(@node, :edit) %> 24 <%= submit_tag t(".save_unlock_exit"), form: dom_id(@node, :edit) %>
25 <%= link_to "Preview", preview_page_path(@page), target: "_blank", rel: "noopener", class: "preview_link" %> 25 <%= link_to t(".preview"), preview_page_path(@page), target: "_blank", rel: "noopener", class: "preview_link" %>
26</div> 26</div>
27 27
28<div id="admin_layout"> 28<div id="admin_layout">
@@ -37,13 +37,13 @@
37 <div id="edit_grid"> 37 <div id="edit_grid">
38 38
39 <div id="main_fields"> 39 <div id="main_fields">
40 <div class="layout_row_label">Title</div> 40 <div class="layout_row_label"><%= t("admin.columns.title") %></div>
41 <div class="layout_row_content"><%= d.text_field :title %></div> 41 <div class="layout_row_content"><%= d.text_field :title %></div>
42 42
43 <div class="layout_row_label">Abstract</div> 43 <div class="layout_row_label"><%= t(".abstract") %></div>
44 <div class="layout_row_content"><%= d.text_area :abstract %></div> 44 <div class="layout_row_content"><%= d.text_area :abstract %></div>
45 45
46 <div class="layout_row_label">Attachments</div> 46 <div class="layout_row_label"><%= t(".attachments") %></div>
47 <div class="layout_row_content"> 47 <div class="layout_row_content">
48 <div id="related_assets" 48 <div id="related_assets"
49 data-search-url="<%= search_node_related_assets_path(@node) %>" 49 data-search-url="<%= search_node_related_assets_path(@node) %>"
@@ -61,18 +61,18 @@
61 <span class="related_asset_handle"><%= icon("grip-vertical", library: "tabler", "aria-hidden": true) %></span> 61 <span class="related_asset_handle"><%= icon("grip-vertical", library: "tabler", "aria-hidden": true) %></span>
62 <%= image_tag related.asset.upload.url(:thumb) %> 62 <%= image_tag related.asset.upload.url(:thumb) %>
63 <button type="button" class="related_asset_set_headline" 63 <button type="button" class="related_asset_set_headline"
64 aria-pressed="<%= related.headline? %>" aria-label="Set as headline image" 64 aria-pressed="<%= related.headline? %>" aria-label="<%= t('.set_headline_label') %>"
65 title="Use this photo as the page's headline image"> 65 title="<%= t(".set_headline_title") %>">
66 <%= icon("star", library: "tabler", "aria-hidden": true) %> 66 <%= icon("star", library: "tabler", "aria-hidden": true) %>
67 </button> 67 </button>
68 <button type="button" class="related_asset_remove" aria-label="Remove image"> 68 <button type="button" class="related_asset_remove" aria-label="<%= t('.remove_image_label') %>">
69 <%= icon("x", library: "tabler", "aria-hidden": true) %> 69 <%= icon("x", library: "tabler", "aria-hidden": true) %>
70 </button> 70 </button>
71 </li> 71 </li>
72 <% end %> 72 <% end %>
73 </ul> 73 </ul>
74 <p class="field_hint">The starred image or PDF becomes this page's headline on the public site. If none is starred, visitors get a link to browse all attached images instead.</p> 74 <p class="field_hint"><%= t(".headline_hint") %></p>
75 <%= text_field_tag nil, nil, id: "related_asset_search_term", placeholder: "Search images to attach…", autocomplete: "off" %> 75 <%= text_field_tag nil, nil, id: "related_asset_search_term", placeholder: t(".attach_search_placeholder"), autocomplete: "off" %>
76 <div id="related_asset_search_results" class="search_results"></div> 76 <div id="related_asset_search_results" class="search_results"></div>
77 </div> 77 </div>
78 </div> 78 </div>
@@ -81,10 +81,10 @@
81 <li> 81 <li>
82 <span class="related_asset_handle"><%= icon("grip-vertical", library: "tabler", "aria-hidden": true) %></span> 82 <span class="related_asset_handle"><%= icon("grip-vertical", library: "tabler", "aria-hidden": true) %></span>
83 <img src=""> 83 <img src="">
84 <button type="button" class="related_asset_set_headline" aria-pressed="false" aria-label="Set as headline image"> 84 <button type="button" class="related_asset_set_headline" aria-pressed="false" aria-label="<%= t('.set_headline_label') %>">
85 <%= icon("star", library: "tabler", "aria-hidden": true) %> 85 <%= icon("star", library: "tabler", "aria-hidden": true) %>
86 </button> 86 </button>
87 <button type="button" class="related_asset_remove" aria-label="Remove image"> 87 <button type="button" class="related_asset_remove" aria-label="<%= t('.remove_image_label') %>">
88 <%= icon("x", library: "tabler", "aria-hidden": true) %> 88 <%= icon("x", library: "tabler", "aria-hidden": true) %>
89 </button> 89 </button>
90 </li> 90 </li>
@@ -92,9 +92,9 @@
92 </div> 92 </div>
93 93
94 <details id="metadata_details"> 94 <details id="metadata_details">
95 <summary>Metadata (slug, parent, tags, template, author, images)</summary> 95 <summary><%= t(".metadata_summary") %></summary>
96 <div id="metadata"> 96 <div id="metadata">
97 <div class="layout_row_label">Slug</div> 97 <div class="layout_row_label"><%= t(".slug") %></div>
98 <div class="layout_row_content"> 98 <div class="layout_row_content">
99 <%= f.text_field( 99 <%= f.text_field(
100 :staged_slug, :value => @node.staged_slug || @node.slug 100 :staged_slug, :value => @node.staged_slug || @node.slug
@@ -102,10 +102,10 @@
102 %> 102 %>
103 </div> 103 </div>
104 104
105 <div class="layout_row_label">parent</div> 105 <div class="layout_row_label"><%= t(".parent") %></div>
106 <div class="layout_row_content"> 106 <div class="layout_row_content">
107 <%= text_field_tag :move_to_search_term, @node.parent.title rescue "" %> 107 <%= text_field_tag :move_to_search_term, @node.parent.title rescue "" %>
108 <p class="field_hint">Start typing to find a new parent for this node.</p> 108 <p class="field_hint"><%= t(".parent_hint") %></p>
109 <div id="move_to_search_results" class="search_results"></div> 109 <div id="move_to_search_results" class="search_results"></div>
110 <%= f.hidden_field( 110 <%= f.hidden_field(
111 :staged_parent_id, 111 :staged_parent_id,
@@ -114,22 +114,22 @@
114 %> 114 %>
115 </div> 115 </div>
116 116
117 <div class="layout_row_label">Tags</div> 117 <div class="layout_row_label"><%= t(".tags") %></div>
118 <div class="layout_row_content"> 118 <div class="layout_row_content">
119 <%= text_field_tag :tag_list, @page.tag_list.join(', ') %> 119 <%= text_field_tag :tag_list, @page.tag_list.join(', ') %>
120 <span class="field_hint">Comma separated, lowercase.</span> 120 <span class="field_hint"><%= t(".tags_hint") %></span>
121 </div> 121 </div>
122 122
123 <div class="layout_row_label">Publish at</div> 123 <div class="layout_row_label"><%= t(".publish_at") %></div>
124 <div class="layout_row_content"><%= d.datetime_select :published_at, :value => @page.published_at %></div> 124 <div class="layout_row_content"><%= d.datetime_select :published_at, :value => @page.published_at %></div>
125 125
126 <div class="layout_row_label">Template</div> 126 <div class="layout_row_label"><%= t(".template") %></div>
127 <div class="layout_row_content"> 127 <div class="layout_row_content">
128 <%= d.select :template_name, custom_page_templates, {:prompt => 'Select Template'} %> 128 <%= d.select :template_name, custom_page_templates, {:prompt => 'Select Template'} %>
129 <span class="field_hint">Set automatically based on how this node was created - change it if needed.</span> 129 <span class="field_hint"><%= t(".template_hint") %></span>
130 </div> 130 </div>
131 131
132 <div class="layout_row_label">Author</div> 132 <div class="layout_row_label"><%= t(".author") %></div>
133 <div class="layout_row_content"> 133 <div class="layout_row_content">
134 <%= d.select :user_id, user_list, 134 <%= d.select :user_id, user_list,
135 :selected => @page.user_id || @node.draft&.user_id || @node.head&.user_id %> 135 :selected => @page.user_id || @node.draft&.user_id || @node.head&.user_id %>
@@ -139,13 +139,13 @@
139 </details> 139 </details>
140 140
141 <div id="content"> 141 <div id="content">
142 <div class="layout_row_label">Body</div> 142 <div class="layout_row_label"><%= t(".body") %></div>
143 <div class="body_toolbar_row"> 143 <div class="body_toolbar_row">
144 <button type="button" id="preview_toggle" class="view_toggle" aria-pressed="false" aria-label="Toggle live preview" title="Toggle live preview"> 144 <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') %>">
145 <%= icon("layout-sidebar-right", library: "tabler", "aria-hidden": true) %> <span>Live preview</span> 145 <%= icon("layout-sidebar-right", library: "tabler", "aria-hidden": true) %> <span><%= t(".live_preview") %></span>
146 </button> 146 </button>
147 <button type="button" id="preview_force_render" class="view_toggle" style="display:none" aria-label="Force preview render" title="Force preview render"> 147 <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') %>">
148 <%= icon("refresh", library: "tabler", "aria-hidden": true) %> <span>Force refresh</span> 148 <%= icon("refresh", library: "tabler", "aria-hidden": true) %> <span><%= t(".force_refresh") %></span>
149 </button> 149 </button>
150 </div> 150 </div>
151 151
@@ -154,7 +154,7 @@
154 <div class="layout_row_content"><%= d.text_area :body, :class => 'with_editor' %></div> 154 <div class="layout_row_content"><%= d.text_area :body, :class => 'with_editor' %></div>
155 </div> 155 </div>
156 <div id="preview_panel" style="display:none"> 156 <div id="preview_panel" style="display:none">
157 <iframe id="live_preview_iframe" title="Live preview" data-src="<%= preview_page_path(@page, :locale => I18n.default_locale) %>"></iframe> 157 <iframe id="live_preview_iframe" title="<%= t('.live_preview') %>" data-src="<%= preview_page_path(@page, :locale => I18n.default_locale) %>"></iframe>
158 </div> 158 </div>
159 </div> 159 </div>
160 </div> 160 </div>
@@ -162,8 +162,8 @@
162 <% end %> 162 <% end %>
163 163
164 <div class="node_action_bar"> 164 <div class="node_action_bar">
165 <%= f.submit 'Save Draft' %> 165 <%= f.submit t(".save_draft") %>
166 <%= f.submit 'Save + Unlock + Exit' %> 166 <%= f.submit t(".save_unlock_exit") %>
167 </div> 167 </div>
168 <% end %> 168 <% end %>
169</div> 169</div>