From 50ca5e40f461290a2db7452b95f80dd3188dba1d Mon Sep 17 00:00:00 2001 From: erdgeist Date: Fri, 24 Jul 2026 18:04:56 +0200 Subject: Rename layout classes to what they actually do --- app/views/assets/edit.html.erb | 46 +++++++++++++++++++++--------------------- app/views/assets/new.html.erb | 40 ++++++++++++++++++------------------ app/views/assets/show.html.erb | 44 ++++++++++++++++++++-------------------- 3 files changed, 65 insertions(+), 65 deletions(-) (limited to 'app/views/assets') diff --git a/app/views/assets/edit.html.erb b/app/views/assets/edit.html.erb index d0a39aa3..46f8ed9f 100644 --- a/app/views/assets/edit.html.erb +++ b/app/views/assets/edit.html.erb @@ -1,34 +1,34 @@ -
+

Editing asset

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

…or drop a file here.

-
<%= f.label :creator %>
-
<%= f.text_field :creator %>
+
<%= f.label :creator %>
+
<%= f.text_field :creator %>
-
<%= f.label :source_url, "Source URL" %>
-
<%= f.text_field :source_url %>
+
<%= f.label :source_url, "Source URL" %>
+
<%= f.text_field :source_url %>
-
<%= f.label :license_key, "License" %>
-
+
<%= f.label :license_key, "License" %>
+
<%= f.select :license_key, options_for_select( [["— none —", ""]] + AssetLicense.keys.map { |key| [t("asset_licenses.#{key}"), key] }, @@ -36,8 +36,8 @@ ) %>
-
attach to page
-
+
attach to page
+
<%= text_field_tag :asset_node_search_term, @attach_node&.title, :placeholder => "Search for a page…", :autocomplete => "off" %> @@ -47,18 +47,18 @@ Optional — attaches this asset to that page, all pending versions included.
-
-
+
+
Applies only if the page has no headline yet.
-
Actions
-
-
-
<%= f.submit 'Update' %>
-
<%= link_to 'Show', @asset %>
-
<%= link_to 'Back', assets_path %>
+
Actions
+
+
+
<%= f.submit 'Update' %>
+
<%= link_to 'Show', @asset %>
+
<%= link_to 'Back', assets_path %>
diff --git a/app/views/assets/new.html.erb b/app/views/assets/new.html.erb index 8a7a6094..7bb8a9ce 100644 --- a/app/views/assets/new.html.erb +++ b/app/views/assets/new.html.erb @@ -1,29 +1,29 @@ -
+

New asset

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

…or drop a file here.

-
<%= f.label :creator %>
-
<%= f.text_field :creator %>
+
<%= f.label :creator %>
+
<%= f.text_field :creator %>
-
<%= f.label :source_url, "Source URL" %>
-
<%= f.text_field :source_url %>
+
<%= f.label :source_url, "Source URL" %>
+
<%= f.text_field :source_url %>
-
<%= f.label :license_key, "License" %>
-
+
<%= f.label :license_key, "License" %>
+
<%= f.select :license_key, options_for_select( [["— none —", ""]] + AssetLicense.keys.map { |key| [t("asset_licenses.#{key}"), key] }, @@ -31,8 +31,8 @@ ) %>
-
attach to page
-
+
attach to page
+
<%= text_field_tag :asset_node_search_term, @attach_node&.title, :placeholder => "Search for a page…", :autocomplete => "off" %> @@ -42,17 +42,17 @@ Optional — attaches this asset to that page, all pending versions included.
-
-
+
+
Applies only if the page has no headline yet.
-
Actions
-
-
-
<%= f.submit 'Create' %>
-
<%= link_to 'Back', assets_path %>
+
Actions
+
+
+
<%= f.submit 'Create' %>
+
<%= link_to 'Back', assets_path %>
diff --git a/app/views/assets/show.html.erb b/app/views/assets/show.html.erb index 122b44e4..4ec77dff 100644 --- a/app/views/assets/show.html.erb +++ b/app/views/assets/show.html.erb @@ -1,16 +1,16 @@ -
+

<%= @asset.name %>

-
Actions
-
-
-
+
Actions
+
+
+
<%= link_to edit_asset_path(@asset), class: 'action_button' do %> <%= icon("edit", library: "tabler", "aria-hidden": true) %> Edit <% end %>
-
+
<%= link_to 'Back', assets_path %>
<%= link_to admin_log_path(:asset_id => @asset.id), :class => "action_button" do %> @@ -20,12 +20,12 @@
<% if @asset.has_variant?(:medium) %> -
Thumbnail
-
<%= image_tag @asset.upload.url(:medium), style: "max-width: 300px; max-height: 300px;" %>
+
Thumbnail
+
<%= image_tag @asset.upload.url(:medium), style: "max-width: 300px; max-height: 300px;" %>
<% end %> -
Attached to
-
+
Attached to
+
<% nodes = @asset.attached_nodes %> <% if nodes.any? %>
    @@ -49,8 +49,8 @@ <% end %>
-
Public Path
-
+
Public Path
+
<% public_path = @asset.upload.url.sub(/\?\d+$/, "") %> <%= link_to public_path, public_path, target: "_blank", rel: "noopener" %>
-
Creator
-
<%= @asset.creator.presence || "—" %>
+
Creator
+
<%= @asset.creator.presence || "—" %>
-
Source
-
+
Source
+
<% if @asset.source_url.present? %> <%= link_to @asset.source_url, @asset.source_url %> <% else %> @@ -72,8 +72,8 @@ <% end %>
-
License
-
+
License
+
<% if (license = AssetLicense.find(@asset.license_key)) %> <%= t("asset_licenses.#{license.key}") %> <% else %> @@ -81,10 +81,10 @@ <% end %>
-
Content Type
-
<%= @asset.upload.content_type %>
+
Content Type
+
<%= @asset.upload.content_type %>
-
Size
-
<%= "#{@asset.upload.size/1024} KB" %>
+
Size
+
<%= "#{@asset.upload.size/1024} KB" %>
-- cgit v1.3