From fb62ebae28611cc93ebf03d8ad13d1187c741801 Mon Sep 17 00:00:00 2001 From: syeopite Date: Sat, 26 Jun 2021 18:54:31 -0700 Subject: [PATCH] Split content sorting bar from channel-information (cherry picked from commit 07d3f6fb122a9a03d61bab72939e423384d523d9) --- src/invidious/views/channel/about.ecr | 5 ++-- src/invidious/views/channel/channel.ecr | 5 ++-- src/invidious/views/channel/community.ecr | 5 ++-- src/invidious/views/channel/playlists.ecr | 5 ++-- .../{ => channels}/channel-information.ecr | 26 ------------------ .../channels/content-sorting-bar.ecr | 27 +++++++++++++++++++ src/invidious/views/search.ecr | 2 +- 7 files changed, 38 insertions(+), 37 deletions(-) rename src/invidious/views/components/{ => channels}/channel-information.ecr (85%) create mode 100644 src/invidious/views/components/channels/content-sorting-bar.ecr diff --git a/src/invidious/views/channel/about.ecr b/src/invidious/views/channel/about.ecr index d4ce827a..1c0331e2 100644 --- a/src/invidious/views/channel/about.ecr +++ b/src/invidious/views/channel/about.ecr @@ -3,9 +3,8 @@ <% end %> -<% content_type = 4 %> -<% sort_options = Tuple.new %> -<%= rendered "components/channel-information" %> +<% content_type = 5 %> +<%= rendered "components/channels/channel-information" %>
<% stats_style_append = ""%> diff --git a/src/invidious/views/channel/channel.ecr b/src/invidious/views/channel/channel.ecr index 7861ae5b..daf4cd60 100644 --- a/src/invidious/views/channel/channel.ecr +++ b/src/invidious/views/channel/channel.ecr @@ -4,8 +4,9 @@ <% end %> -<% content_type = 0 %> -<%= rendered "components/channel-information" %> +<% content_type = 1 %> +<%= rendered "components/channels/channel-information" %> +<%= rendered "components/channels/content-sorting-bar" %>
<% items.each do |item| %> diff --git a/src/invidious/views/channel/community.ecr b/src/invidious/views/channel/community.ecr index 3cbc346a..3bb778e8 100644 --- a/src/invidious/views/channel/community.ecr +++ b/src/invidious/views/channel/community.ecr @@ -3,9 +3,8 @@ <% end %> -<% content_type = 2 %> -<% sort_options = Tuple.new %> -<%= rendered "components/channel-information" %> +<% content_type = 3 %> +<%= rendered "components/channels/channel-information" %> <% if error_message %>
diff --git a/src/invidious/views/channel/playlists.ecr b/src/invidious/views/channel/playlists.ecr index 920b2b15..1dab8f50 100644 --- a/src/invidious/views/channel/playlists.ecr +++ b/src/invidious/views/channel/playlists.ecr @@ -3,8 +3,9 @@ <% end %> -<% content_type = 1 %> -<%= rendered "components/channel-information" %> +<% content_type = 2 %> +<%= rendered "components/channels/channel-information" %> +<%= rendered "components/channels/content-sorting-bar" %>
<% items.each do |item| %> diff --git a/src/invidious/views/components/channel-information.ecr b/src/invidious/views/components/channels/channel-information.ecr similarity index 85% rename from src/invidious/views/components/channel-information.ecr rename to src/invidious/views/components/channels/channel-information.ecr index 1e7a2881..19b24d08 100644 --- a/src/invidious/views/components/channel-information.ecr +++ b/src/invidious/views/components/channels/channel-information.ecr @@ -173,31 +173,5 @@
- <% if content_type == 1 || content_type == 2 %> - <% # We really only need a single
(handled below) outside of content_type 1 or 2 %> -
- <% route = content_type == 1 ? "/videos" : "/playlists" %> - <% url = "/channel/#{channel.ucid + route}" %> - -
- -
- <% end %>
\ No newline at end of file diff --git a/src/invidious/views/components/channels/content-sorting-bar.ecr b/src/invidious/views/components/channels/content-sorting-bar.ecr new file mode 100644 index 00000000..a3a51ab8 --- /dev/null +++ b/src/invidious/views/components/channels/content-sorting-bar.ecr @@ -0,0 +1,27 @@ + +
+ <% route = content_type == 1 ? "/videos" : "/playlists" %> + <% url = "/channel/#{channel.ucid + route}" %> + +
+ +
+ +
+
\ No newline at end of file diff --git a/src/invidious/views/search.ecr b/src/invidious/views/search.ecr index d08395e9..548838b3 100644 --- a/src/invidious/views/search.ecr +++ b/src/invidious/views/search.ecr @@ -13,7 +13,7 @@ <% if is_channel_search && channel.is_a? AboutChannel && !subscriptions.nil? %> <% content_type = 7 %> <% sort_options = Tuple.new %> - <%= rendered "components/channel-information" %> + <%= rendered "components/channels/channel-information" %> <% end %> <% search_query_encoded = env.get?("search").try { |x| URI.encode_www_form(x.as(String), space_to_plus: true) } %>