From db74e26124f5b2bc8f3461873c40ad44c3faad01 Mon Sep 17 00:00:00 2001 From: Gregory Ballantine Date: Fri, 3 Mar 2023 15:49:09 -0500 Subject: [PATCH] Updated video view page; added recently updated videos to dashboard --- assets/styles/drake.scss | 9 ++++++--- lib/routes/index.rb | 4 +++- views/index.erb | 21 +++++++++++++++++++++ views/video/view.erb | 25 +++++++++++++++---------- 4 files changed, 45 insertions(+), 14 deletions(-) diff --git a/assets/styles/drake.scss b/assets/styles/drake.scss index 4e5910e..1a3b4ec 100644 --- a/assets/styles/drake.scss +++ b/assets/styles/drake.scss @@ -61,8 +61,10 @@ hr{ margin-bottom: 10px; } -#channel-header{ - .channel-name{ +#channel-header, +#video-header{ + .channel-name, + .video-name{ margin-bottom: 5px; } .channel-created, @@ -75,7 +77,8 @@ hr{ font-style: italic; } - .channel-description{ + .channel-description, + .video-description{ margin-top: 10px; font-size: 1.75rem; } diff --git a/lib/routes/index.rb b/lib/routes/index.rb index 67869c9..f486dbd 100644 --- a/lib/routes/index.rb +++ b/lib/routes/index.rb @@ -2,9 +2,11 @@ namespace '/' do get '' do channels = Channel.reverse(:updated_at).limit(10).all() + videos = Video.reverse(:updated_at).limit(10).all() erb :index, :locals => { :title => 'Dashboard', - :channels => channels + :channels => channels, + :videos => videos } end diff --git a/views/index.erb b/views/index.erb index 904a456..75662e2 100644 --- a/views/index.erb +++ b/views/index.erb @@ -8,6 +8,27 @@
+ + + + + + + + + + + <% videos.each do |v| %> + + + + + + + <% end %> + +
Video nameVideo serialVideo channelLast updated
<%= v.name %><%= serialize(v.serial) %><%= v.channel.name %><%= date_format(v.updated_at) %>
+ diff --git a/views/video/view.erb b/views/video/view.erb index 6f08094..4d59864 100644 --- a/views/video/view.erb +++ b/views/video/view.erb @@ -1,19 +1,24 @@
-
+

<%= video.name %>

-

<%= video.channel.name %> - <%= serialize(video.serial) %>

Item added at: <%= date_format(video.created_at) %>

<% if video.updated_at %>

Last updated at: <%= date_format(video.updated_at) %>

<% end %> -
-
-
-
-

- - -

+

<%= video.description %>

+
+ +