Improve clips page formatting
This commit is contained in:
parent
29368bfdb9
commit
fffdaa60ac
2 changed files with 25 additions and 16 deletions
|
|
@ -1,13 +1,23 @@
|
||||||
<%= form_with model: clip do |form| %>
|
<%= form_with model: clip do |form| %>
|
||||||
<div>
|
<table border="1">
|
||||||
<%= form.label :title %>
|
<tr>
|
||||||
<%= form.text_field :title %>
|
<td valign="top"><b><%= form.label :title %></b></td>
|
||||||
<%= form.file_field :video, :accept => 'video/quicktime,video/mp4' %>
|
<td valign="top"><%= form.text_field :title %></td>
|
||||||
<%= form.select :category_id, Category.all.collect{ |t| [ t.name, t.id ] }%>
|
</tr>
|
||||||
<%= collection_select(:clip, :tag_ids, Tag.all, :id, :name, {}, { :multiple => true } )%>
|
<tr>
|
||||||
</div>
|
<td valign="top"><b><%= form.label :video %></b></td>
|
||||||
|
<td valign="top"><%= form.file_field :video, :accept => 'video/quicktime,video/mp4' %></td>
|
||||||
<div>
|
</tr>
|
||||||
<%= form.submit %>
|
<tr>
|
||||||
</div>
|
<td valign="top"><b><%= form.label :category %></b></td>
|
||||||
|
<td valign="top"><%= form.select :category_id, Category.all.collect{ |t| [ t.name, t.id ] }%></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td valign="top"><b><%= form.label :tag %></b></td>
|
||||||
|
<td valign="top"><%= collection_select(:clip, :tag_ids, Tag.all, :id, :name, {}, { :multiple => true } )%></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="2"><%= form.submit %></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
@ -1,13 +1,12 @@
|
||||||
<% cache @clip do %>
|
<% cache @clip do %>
|
||||||
<h1><%= @clip.title %></h1>
|
<h1><%= @clip.title %></h1>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<% if @clip.video.attached? %>
|
||||||
|
<%= video_tag @clip.video, :controls => true%><br>
|
||||||
|
<% end %>
|
||||||
<b>Category:</b> <%= link_to @clip.category.name, @clip.category %><br>
|
<b>Category:</b> <%= link_to @clip.category.name, @clip.category %><br>
|
||||||
<b>Tags:</b> <%= @clip.tags.map(&:name).join(', ') %><br>
|
<b>Tags:</b> <%= @clip.tags.map(&:name).join(', ') %><br>
|
||||||
<% if @clip.video.attached? %>
|
|
||||||
<%= video_tag @clip.video, :controls => true%>
|
|
||||||
<% end %>
|
|
||||||
<%= link_to "Back", clips_path%>
|
|
||||||
<% if authenticated? %>
|
<% 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?" } %>
|
<%= button_to "Delete", @clip, method: :delete, data: { turbo_confirm: "Are you sure?" } %>
|
||||||
<% end %>
|
<% end %>
|
||||||
Loading…
Add table
Add a link
Reference in a new issue