From 01e04340cd59950c01924ac90db7b7356a633364 Mon Sep 17 00:00:00 2001 From: syeopite Date: Fri, 16 Apr 2021 01:13:58 -0700 Subject: [PATCH] Add links widget to channel banner + tiny refactor --- assets/css/channel.css | 39 +++++++++++++++++++ src/invidious/views/channel.ecr | 7 +++- src/invidious/views/channel_about.ecr | 5 +++ src/invidious/views/community.ecr | 5 +++ .../views/components/channel-information.ecr | 24 +++++++++--- src/invidious/views/playlists.ecr | 6 ++- 6 files changed, 78 insertions(+), 8 deletions(-) diff --git a/assets/css/channel.css b/assets/css/channel.css index e40dc6aa..057756fc 100644 --- a/assets/css/channel.css +++ b/assets/css/channel.css @@ -11,3 +11,42 @@ background-repeat: no-repeat !important; } +#link-holder { + display: flex; + background: rgba(0, 0, 0, 0.3); + align-self: flex-end; + margin: 15px; + padding: 12px; +} + +@media screen and (max-width: 640px) { + #link-holder { + display: none; + } +} + +#link-widget-primary { + margin-right: 1.5em; +} + +.link-widget-link { + margin-right: 10px; +} + +.link-widget-link:last-child { + margin-right: 0; +} + +.link-widget-link img, #external-links img { + vertical-align: sub; + width: 20px; + height: 20px; +} + +#link-widget-primary a { + color: white !important; +} + +#link-widget-primary a:hover { + color: #e1e1e1 !important; +} diff --git a/src/invidious/views/channel.ecr b/src/invidious/views/channel.ecr index 7e0777fd..c0caa80a 100644 --- a/src/invidious/views/channel.ecr +++ b/src/invidious/views/channel.ecr @@ -1,5 +1,10 @@ -<% content_type = 0 %> +<% content_for "header" do %> +<%= channel.author %> - Invidious + + +<% end %> +<% content_type = 0 %> <%= rendered "components/channel-information" %>
diff --git a/src/invidious/views/channel_about.ecr b/src/invidious/views/channel_about.ecr index e81bd88f..8266eff0 100644 --- a/src/invidious/views/channel_about.ecr +++ b/src/invidious/views/channel_about.ecr @@ -1,3 +1,8 @@ +<% content_for "header" do %> +<%= channel.author %> - Invidious + +<% end %> + <% content_type = 4 %> <% sort_options = Tuple.new %> <%= rendered "components/channel-information" %> diff --git a/src/invidious/views/community.ecr b/src/invidious/views/community.ecr index 68186af5..1b1e8ab2 100644 --- a/src/invidious/views/community.ecr +++ b/src/invidious/views/community.ecr @@ -1,3 +1,8 @@ +<% content_for "header" do %> +<%= channel.author %> - Invidious + +<% end %> + <% content_type = 2 %> <% sort_options = Tuple.new %> <%= rendered "components/channel-information" %> diff --git a/src/invidious/views/components/channel-information.ecr b/src/invidious/views/components/channel-information.ecr index 6d272abc..1c738638 100644 --- a/src/invidious/views/components/channel-information.ecr +++ b/src/invidious/views/components/channel-information.ecr @@ -1,12 +1,24 @@ -<% content_for "header" do %> -<%= channel.author %> - Invidious - - -<% end %> - <% if channel.banner %>
diff --git a/src/invidious/views/playlists.ecr b/src/invidious/views/playlists.ecr index 09bde10c..49dc749e 100644 --- a/src/invidious/views/playlists.ecr +++ b/src/invidious/views/playlists.ecr @@ -1,5 +1,9 @@ -<% content_type = 1 %> +<% content_for "header" do %> +<%= channel.author %> - Invidious + +<% end %> +<% content_type = 1 %> <%= rendered "components/channel-information" %>