misadventure/app/views/clips/show.html.erb
2025-09-10 04:19:01 +01:00

44 lines
1.2 KiB
Text

<% cache @clip do %>
<h1><%= @clip.title %></h1>
<% end %>
<table>
<tr>
<% if @clip.video.attached? %>
<td>
<%= video_tag @clip.video, :controls => true%>
</td>
<% end %>
<td valign="top">
<table border="1">
<tr>
<td valign="top"><b>Category:</b></td>
<td><%= link_to @clip.category.name, @clip.category %></td>
</tr>
<tr>
<td valign="top"><b>Tags:</b></td>
<td><%= @clip.tags.map(&:name).join(', ') %></td>
</tr>
<tr>
<td valign="top"><b>Length:</b></td>
<td><%= seconds_to_time(@clip.video.metadata["duration"]) %></td>
</tr>
<tr>
<td valign="top"><b>Last Updated:</b></td>
<td><%= @clip.updated_at %></td>
</tr>
<tr>
<td valign="top"><b>Created:</b></td>
<td><%= @clip.created_at %></td>
</tr>
<tr>
<td colspan="2">
<% if authenticated? %>
<%= button_to "Edit", edit_clip_path(@clip), :method => "get" %>
<%= button_to "Delete", @clip, method: :delete, data: { turbo_confirm: "Are you sure?" } %>
<% end %>
</td>
</tr>
</table>
</td>
</tr>
</table>