From de9a3a5591d4b17c0e0f17abc0ee8ffe85de50e6 Mon Sep 17 00:00:00 2001 From: erdgeist Date: Sat, 25 Jul 2026 14:24:03 +0200 Subject: Extract admin strings to i18n: assets and events clusters --- app/views/assets/edit.html.erb | 32 ++++++++++++++++---------------- app/views/assets/index.html.erb | 18 +++++++++--------- app/views/assets/new.html.erb | 28 ++++++++++++++-------------- app/views/assets/show.html.erb | 30 +++++++++++++++--------------- 4 files changed, 54 insertions(+), 54 deletions(-) (limited to 'app/views/assets') diff --git a/app/views/assets/edit.html.erb b/app/views/assets/edit.html.erb index 46f8ed9f..5214e082 100644 --- a/app/views/assets/edit.html.erb +++ b/app/views/assets/edit.html.erb @@ -1,5 +1,5 @@
-

Editing asset

+

<%= t(".title") %>

<%= form_for(@asset, html: { multipart: true }) do |f| %> <%= form_error_messages(f) %> @@ -9,56 +9,56 @@
<%= f.text_field :name %>
<% if @asset.upload.present? %> -
Current File
+
<%= t(".current_file") %>
<%= @asset.upload.url %> (<%= number_to_human_size(@asset.upload.size) %>)
<% end %> -
<%= f.label :upload, "Replace file" %>
+
<%= f.label :upload, t(".replace_file") %>
<%= f.file_field :upload %> -

…or drop a file here.

+

<%= t("assets.form.drop_hint") %>

<%= f.label :creator %>
<%= f.text_field :creator %>
-
<%= f.label :source_url, "Source URL" %>
+
<%= f.label :source_url %>
<%= f.text_field :source_url %>
-
<%= f.label :license_key, "License" %>
+
<%= f.label :license_key %>
<%= f.select :license_key, options_for_select( - [["— none —", ""]] + AssetLicense.keys.map { |key| [t("asset_licenses.#{key}"), key] }, + [[t("assets.form.none_option"), ""]] + AssetLicense.keys.map { |key| [t("asset_licenses.#{key}"), key] }, @asset.license_key ) %>
-
attach to page
+
<%= t("assets.form.attach_to_page") %>
<%= text_field_tag :asset_node_search_term, @attach_node&.title, - :placeholder => "Search for a page…", :autocomplete => "off" %> + :placeholder => t("assets.form.attach_search_placeholder"), :autocomplete => "off" %>
<%= hidden_field_tag :node_id, @attach_node&.id %> - Optional — attaches this asset to that page, all pending versions included. + <%= t("assets.form.attach_hint") %>
- - Applies only if the page has no headline yet. + + <%= t("assets.form.headline_hint") %>
-
Actions
+
<%= t("admin.columns.actions") %>
-
<%= f.submit 'Update' %>
-
<%= link_to 'Show', @asset %>
-
<%= link_to 'Back', assets_path %>
+
<%= f.submit t("admin.common.update") %>
+
<%= link_to t("admin.common.show"), @asset %>
+
<%= link_to t("admin.common.back"), assets_path %>
diff --git a/app/views/assets/index.html.erb b/app/views/assets/index.html.erb index ff1300a2..81d2686a 100644 --- a/app/views/assets/index.html.erb +++ b/app/views/assets/index.html.erb @@ -1,16 +1,16 @@ -

Assets

+

<%= t(".title") %>

<%= link_to new_asset_path, class: 'action_button' do %> - <%= icon("plus", library: "tabler", "aria-hidden": true) %> Create asset + <%= icon("plus", library: "tabler", "aria-hidden": true) %> <%= t(".create_asset") %> <% end %> <%= will_paginate @assets %> - - - + + + @@ -20,10 +20,10 @@ - - - + + <% end %> diff --git a/app/views/assets/new.html.erb b/app/views/assets/new.html.erb index 7bb8a9ce..51e66cd2 100644 --- a/app/views/assets/new.html.erb +++ b/app/views/assets/new.html.erb @@ -1,5 +1,5 @@
-

New asset

+

<%= t(".title") %>

<%= form_for(@asset, :html => { :multipart => true }) do |f| %> <%= form_error_messages(f) %> @@ -8,51 +8,51 @@
<%= f.label :name %>
<%= f.text_field :name %>
-
<%= f.label :upload, "File" %>
+
<%= f.label :upload %>
<%= f.file_field :upload %> -

…or drop a file here.

+

<%= t("assets.form.drop_hint") %>

<%= f.label :creator %>
<%= f.text_field :creator %>
-
<%= f.label :source_url, "Source URL" %>
+
<%= f.label :source_url %>
<%= f.text_field :source_url %>
-
<%= f.label :license_key, "License" %>
+
<%= f.label :license_key %>
<%= f.select :license_key, options_for_select( - [["— none —", ""]] + AssetLicense.keys.map { |key| [t("asset_licenses.#{key}"), key] }, + [[t("assets.form.none_option"), ""]] + AssetLicense.keys.map { |key| [t("asset_licenses.#{key}"), key] }, @asset.license_key ) %>
-
attach to page
+
<%= t("assets.form.attach_to_page") %>
<%= text_field_tag :asset_node_search_term, @attach_node&.title, - :placeholder => "Search for a page…", :autocomplete => "off" %> + :placeholder => t("assets.form.attach_search_placeholder"), :autocomplete => "off" %>
<%= hidden_field_tag :node_id, @attach_node&.id %> - Optional — attaches this asset to that page, all pending versions included. + <%= t("assets.form.attach_hint") %>
- - Applies only if the page has no headline yet. + + <%= t("assets.form.headline_hint") %>
-
Actions
+
<%= t("admin.columns.actions") %>
-
<%= f.submit 'Create' %>
-
<%= link_to 'Back', assets_path %>
+
<%= f.submit f.submit t("admin.common.create") %>
+
<%= link_to link_to t("admin.common.back"), assets_path %>
diff --git a/app/views/assets/show.html.erb b/app/views/assets/show.html.erb index 4ec77dff..f5a7e055 100644 --- a/app/views/assets/show.html.erb +++ b/app/views/assets/show.html.erb @@ -2,16 +2,16 @@

<%= @asset.name %>

-
Actions
+
<%= t("admin.columns.actions") %>
<%= link_to edit_asset_path(@asset), class: 'action_button' do %> - <%= icon("edit", library: "tabler", "aria-hidden": true) %> Edit + <%= icon("edit", library: "tabler", "aria-hidden": true) %> <%= t("admin.common.edit") %> <% end %>
- <%= link_to 'Back', assets_path %> + <%= link_to link_to t("admin.common.back"), assets_path %>
<%= link_to admin_log_path(:asset_id => @asset.id), :class => "action_button" do %> <%= icon("history", library: "tabler", "aria-hidden": true) %> <%= t("node_actions.asset_history") %> @@ -20,11 +20,11 @@
<% if @asset.has_variant?(:medium) %> -
Thumbnail
+
<%= t(".thumbnail") %>
<%= image_tag @asset.upload.url(:medium), style: "max-width: 300px; max-height: 300px;" %>
<% end %> -
Attached to
+
<%= t(".attached_to") %>
<% nodes = @asset.attached_nodes %> <% if nodes.any? %> @@ -36,34 +36,34 @@ <%= icon("star", library: "tabler", "aria-hidden": true) %> <% end %> <% unless node.head && node.head.related_assets.exists?(:asset_id => @asset.id) %> - pending versions only + <%= t(".pending_only") %> <% end %> <% end %> <% else %> - — not attached to any page — + <%= t(".not_attached") %> <% end %> <%= link_to new_node_path(:asset_id => @asset.id), :class => "action_button" do %> - <%= icon("file-plus", library: "tabler", "aria-hidden": true) %> New page with this attachment + <%= icon("file-plus", library: "tabler", "aria-hidden": true) %> <%= t(".new_page_with_attachment") %> <% end %>
-
Public Path
+
<%= t(".public_path") %>
<% public_path = @asset.upload.url.sub(/\?\d+$/, "") %> <%= link_to public_path, public_path, target: "_blank", rel: "noopener" %>
-
Creator
+
<%= t(".creator") %>
<%= @asset.creator.presence || "—" %>
-
Source
+
<%= t(".source") %>
<% if @asset.source_url.present? %> <%= link_to @asset.source_url, @asset.source_url %> @@ -72,7 +72,7 @@ <% end %>
-
License
+
<%= t(".license") %>
<% if (license = AssetLicense.find(@asset.license_key)) %> <%= t("asset_licenses.#{license.key}") %> @@ -81,10 +81,10 @@ <% end %>
-
Content Type
+
<%= t(".content_type") %>
<%= @asset.upload.content_type %>
-
Size
+
<%= t(".size") %>
<%= "#{@asset.upload.size/1024} KB" %>
-- cgit v1.3
PreviewNameType<%= t("admin.columns.preview") %><%= t("admin.columns.name") %><%= t("admin.columns.type") %> <% if asset.has_variant?(:thumb) %><%= image_tag asset.upload.url(:thumb), style: "max-width: 100px; max-height: 100px;" %><% end %> <%= link_to asset.name, asset.upload.url %> <%= asset.upload.content_type %><%= link_to 'Show', asset %><%= link_to 'Edit', edit_asset_path(asset) %><%= button_to asset, method: :delete, form: { data: { confirm: 'Are you sure?' }, class: 'button_to destructive' } do %> - <%= icon("trash", library: "tabler", "aria-hidden": true) %> Destroy + <%= link_to t("admin.common.show"), asset %><%= link_to t("admin.common.edit"), edit_asset_path(asset) %><%= button_to asset, method: :delete, form: { data: { confirm: t("admin.common.confirm_sure") }, class: 'button_to destructive' } do %> + <%= icon("trash", library: "tabler", "aria-hidden": true) %> <%= t("admin.common.destroy") %> <% end %>