Updated sorting for channel's videos on view page
This commit is contained in:
parent
5ed1771b18
commit
9ab06f0e9c
@ -21,6 +21,10 @@ hr{
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
#main-wrapper{
|
||||
max-width: 1120px;
|
||||
}
|
||||
|
||||
#main-nav{
|
||||
position: fixed;
|
||||
top: 0;
|
||||
|
@ -10,7 +10,7 @@ helpers do
|
||||
|
||||
def date_format(date)
|
||||
dt = date.to_datetime
|
||||
return dt.strftime('%B %d, %Y @ %I:%M:%S %p %Z')
|
||||
return dt.strftime('%B %d, %Y, %I:%M:%S %p')
|
||||
end
|
||||
|
||||
def date_format_input(date)
|
||||
|
@ -31,10 +31,11 @@ namespace '/channel' do
|
||||
|
||||
get '/:channel_id' do
|
||||
channel = Channel.where(id: params[:channel_id]).first()
|
||||
puts "#{channel.name}"
|
||||
channel_videos = channel.videos_dataset.reverse(:updated_at).limit(10).all()
|
||||
erb :'channel/view', :locals => {
|
||||
:title => channel.name,
|
||||
:channel => channel
|
||||
:channel => channel,
|
||||
:channel_videos => channel_videos
|
||||
}
|
||||
end
|
||||
|
||||
|
@ -30,7 +30,7 @@
|
||||
|
||||
<div class="row">
|
||||
<div class="twelve columns">
|
||||
<h3>Channel videos</h3>
|
||||
<h3>Recently updated channel videos:</h3>
|
||||
<% if channel.videos.length > 0 %>
|
||||
<table class="u-full-width">
|
||||
<thead>
|
||||
@ -38,14 +38,16 @@
|
||||
<th>Video name</th>
|
||||
<th>Video serial</th>
|
||||
<th>Video description</th>
|
||||
<th>Last updated</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% channel.videos.each do |v| %>
|
||||
<% channel_videos.each do |v| %>
|
||||
<tr>
|
||||
<td><a href="/video/<%= v.id %>"><%= v.name %></a></td>
|
||||
<td><%= serialize(v.serial) %></td>
|
||||
<td><%= v.description %></td>
|
||||
<td><%= date_format(v.updated_at) %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
|
Loading…
Reference in New Issue
Block a user