From 7ebb5ce8ef276e6d23d818c216be6ef2974369cc Mon Sep 17 00:00:00 2001 From: erdgeist Date: Thu, 23 Jul 2026 19:46:59 +0200 Subject: Turn the asset upload forms into file drop targets Dropped files land in the existing file input and submit through the unchanged form. An empty name field is prefilled from the basename. --- app/views/assets/edit.html.erb | 7 ++++++- app/views/assets/new.html.erb | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/views/assets/edit.html.erb b/app/views/assets/edit.html.erb index 0c1dd8fe..d0a39aa3 100644 --- a/app/views/assets/edit.html.erb +++ b/app/views/assets/edit.html.erb @@ -14,7 +14,12 @@ <% end %>
<%= f.label :upload, "Replace file" %>
-
<%= f.file_field :upload %>
+
+
+ <%= f.file_field :upload %> +

…or drop a file here.

+
+
<%= f.label :creator %>
<%= f.text_field :creator %>
diff --git a/app/views/assets/new.html.erb b/app/views/assets/new.html.erb index 7bded949..8a7a6094 100644 --- a/app/views/assets/new.html.erb +++ b/app/views/assets/new.html.erb @@ -9,7 +9,12 @@
<%= f.text_field :name %>
<%= f.label :upload, "File" %>
-
<%= f.file_field :upload %>
+
+
+ <%= f.file_field :upload %> +

…or drop a file here.

+
+
<%= f.label :creator %>
<%= f.text_field :creator %>
-- cgit v1.3