misadventure/app/views/clips/show.html.erb
2026-01-30 02:21:01 +00:00

56 lines
1.8 KiB
Text

<% cache @clip do %>
<h1><%= @clip.title %></h1>
<% end %>
<table cellpadding="10">
<tr>
<% if @clip.video.attached? %>
<td>
<%= video_tag @clip.video, :controls => true%>
</td>
<% end %>
<td valign="top">
<table class="metatable" cellpadding="5" cellspacing="0">
<tr>
<td valign="top"><b>Clip ID:</b></td>
<td><%= @clip.id %></td>
</tr>
<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.each_with_index do |tag, index| %>
<%= link_to tag.name, tag_path(tag) %><% if index < @clip.tags.size - 1 %>, <% end %>
<% end %>
</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>Resolution:</b></td>
<td><%= @clip.video.metadata["width"].round %>x<%= @clip.video.metadata["height"].round %> (<%= get_video_aspect(@clip.video) %>)</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>
<% if authenticated? %>
<tr>
<td colspan="2" class="editcontrols">
<%= button_to "Edit", edit_clip_path(@clip), :method => "get" %>
<%= button_to "Delete", @clip, method: :delete, data: { turbo_confirm: "Are you sure?" } %>
</td>
</tr>
<% end %>
</table>
</td>
</tr>
</table>