From fffdaa60ac77a66fe61ad62a99e6dc53af930f26 Mon Sep 17 00:00:00 2001 From: Roscoe Date: Wed, 10 Sep 2025 04:00:09 +0100 Subject: [PATCH] Improve clips page formatting --- app/views/clips/_form.html.erb | 32 +++++++++++++++++++++----------- app/views/clips/show.html.erb | 9 ++++----- 2 files changed, 25 insertions(+), 16 deletions(-) diff --git a/app/views/clips/_form.html.erb b/app/views/clips/_form.html.erb index b0aa46b..c0fa7cb 100644 --- a/app/views/clips/_form.html.erb +++ b/app/views/clips/_form.html.erb @@ -1,13 +1,23 @@ <%= form_with model: clip do |form| %> -
- <%= form.label :title %> - <%= form.text_field :title %> - <%= form.file_field :video, :accept => 'video/quicktime,video/mp4' %> - <%= form.select :category_id, Category.all.collect{ |t| [ t.name, t.id ] }%> - <%= collection_select(:clip, :tag_ids, Tag.all, :id, :name, {}, { :multiple => true } )%> -
- -
- <%= form.submit %> -
+ + + + + + + + + + + + + + + + + + + + +
<%= form.label :title %><%= form.text_field :title %>
<%= form.label :video %><%= form.file_field :video, :accept => 'video/quicktime,video/mp4' %>
<%= form.label :category %><%= form.select :category_id, Category.all.collect{ |t| [ t.name, t.id ] }%>
<%= form.label :tag %><%= collection_select(:clip, :tag_ids, Tag.all, :id, :name, {}, { :multiple => true } )%>
<%= form.submit %>
<% end %> \ No newline at end of file diff --git a/app/views/clips/show.html.erb b/app/views/clips/show.html.erb index 7bd66ef..daeb28c 100644 --- a/app/views/clips/show.html.erb +++ b/app/views/clips/show.html.erb @@ -1,13 +1,12 @@ <% cache @clip do %>

<%= @clip.title %>

<% end %> +<% if @clip.video.attached? %> +<%= video_tag @clip.video, :controls => true%>
+<% end %> Category: <%= link_to @clip.category.name, @clip.category %>
Tags: <%= @clip.tags.map(&:name).join(', ') %>
-<% if @clip.video.attached? %> -<%= video_tag @clip.video, :controls => true%> -<% end %> -<%= link_to "Back", clips_path%> <% if authenticated? %> - <%= link_to "Edit", edit_clip_path(@clip) %> + <%= button_to "Edit", edit_clip_path(@clip), :method => "get" %> <%= button_to "Delete", @clip, method: :delete, data: { turbo_confirm: "Are you sure?" } %> <% end %> \ No newline at end of file