show tags in places

This commit is contained in:
Roscoe 2026-01-30 02:21:01 +00:00
commit 47c71a3935
Signed by: RoscoeDaWah
SSH key fingerprint: SHA256:Hqn452XQ1ETzUt/FthJu6+OFkS4NBxCv5VQSEvuk7CE
2 changed files with 30 additions and 12 deletions

View file

@ -10,6 +10,7 @@
<th>Category</th> <th>Category</th>
<th>Updated at</th> <th>Updated at</th>
<th>Created at</th> <th>Created at</th>
<th>Tags</th>
</tr> </tr>
<% @clips.each do |clip| %> <% @clips.each do |clip| %>
<tr> <tr>
@ -31,6 +32,11 @@
<td> <td>
<%= clip.created_at %> <%= clip.created_at %>
</td> </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>
<% end %> <% end %>
</table> </table>

View file

@ -1,7 +1,7 @@
<% cache @clip do %> <% cache @clip do %>
<h1><%= @clip.title %></h1> <h1><%= @clip.title %></h1>
<% end %> <% end %>
<table> <table cellpadding="10">
<tr> <tr>
<% if @clip.video.attached? %> <% if @clip.video.attached? %>
<td> <td>
@ -9,19 +9,31 @@
</td> </td>
<% end %> <% end %>
<td valign="top"> <td valign="top">
<table border="1"> <table class="metatable" cellpadding="5" cellspacing="0">
<tr>
<td valign="top"><b>Clip ID:</b></td>
<td><%= @clip.id %></td>
</tr>
<tr> <tr>
<td valign="top"><b>Category:</b></td> <td valign="top"><b>Category:</b></td>
<td><%= link_to @clip.category.name, @clip.category %></td> <td><%= link_to @clip.category.name, @clip.category %></td>
</tr> </tr>
<tr> <tr>
<td valign="top"><b>Tags:</b></td> <td valign="top"><b>Tags:</b></td>
<td><%= @clip.tags.map(&:name).join(', ') %></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>
<tr> <tr>
<td valign="top"><b>Length:</b></td> <td valign="top"><b>Length:</b></td>
<td><%= seconds_to_time(@clip.video.metadata["duration"]) %></td> <td><%= seconds_to_time(@clip.video.metadata["duration"]) %></td>
</tr> </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> <tr>
<td valign="top"><b>Last Updated:</b></td> <td valign="top"><b>Last Updated:</b></td>
<td><%= @clip.updated_at %></td> <td><%= @clip.updated_at %></td>
@ -30,14 +42,14 @@
<td valign="top"><b>Created:</b></td> <td valign="top"><b>Created:</b></td>
<td><%= @clip.created_at %></td> <td><%= @clip.created_at %></td>
</tr> </tr>
<tr> <% if authenticated? %>
<td colspan="2"> <tr>
<% if authenticated? %> <td colspan="2" class="editcontrols">
<%= button_to "Edit", edit_clip_path(@clip), :method => "get" %> <%= button_to "Edit", edit_clip_path(@clip), :method => "get" %>
<%= button_to "Delete", @clip, method: :delete, data: { turbo_confirm: "Are you sure?" } %> <%= button_to "Delete", @clip, method: :delete, data: { turbo_confirm: "Are you sure?" } %>
<% end %> </td>
</td> </tr>
</tr> <% end %>
</table> </table>
</td> </td>
</tr> </tr>