From c5a17cd0432be87b224fcad2242a68ab922def42 Mon Sep 17 00:00:00 2001 From: Omar Roth Date: Sun, 24 Feb 2019 11:51:33 -0600 Subject: [PATCH] Add subscriptions to feed menu --- src/invidious/views/components/feed_menu.ecr | 19 ++++++++++++++++ src/invidious/views/index.ecr | 24 +------------------- src/invidious/views/popular.ecr | 24 +------------------- src/invidious/views/subscriptions.ecr | 2 ++ src/invidious/views/top.ecr | 24 +------------------- src/invidious/views/trending.ecr | 24 +------------------- 6 files changed, 25 insertions(+), 92 deletions(-) create mode 100644 src/invidious/views/components/feed_menu.ecr diff --git a/src/invidious/views/components/feed_menu.ecr b/src/invidious/views/components/feed_menu.ecr new file mode 100644 index 00000000..5188689a --- /dev/null +++ b/src/invidious/views/components/feed_menu.ecr @@ -0,0 +1,19 @@ +
+
+
+
+ <% feeds = ["Popular", "Top", "Trending"] %> + <% if env.get? "user" %> + <% feeds << "Subscriptions" %> + <% end %> + <% feeds.each do |feed| %> + + <% end %> +
+
+
+
\ No newline at end of file diff --git a/src/invidious/views/index.ecr b/src/invidious/views/index.ecr index a12455b0..6cc978e5 100644 --- a/src/invidious/views/index.ecr +++ b/src/invidious/views/index.ecr @@ -3,29 +3,7 @@ Invidious <% end %> -
-
- -
-
+<%= rendered "components/feed_menu" %>
<% top_videos.each_slice(4) do |slice| %> diff --git a/src/invidious/views/popular.ecr b/src/invidious/views/popular.ecr index 8d67241f..f235aad8 100644 --- a/src/invidious/views/popular.ecr +++ b/src/invidious/views/popular.ecr @@ -3,29 +3,7 @@ <%= translate(locale, "Popular") %> - Invidious <% end %> - +<%= rendered "components/feed_menu" %>
<% popular_videos.each_slice(4) do |slice| %> diff --git a/src/invidious/views/subscriptions.ecr b/src/invidious/views/subscriptions.ecr index 6679cdf9..109da18f 100644 --- a/src/invidious/views/subscriptions.ecr +++ b/src/invidious/views/subscriptions.ecr @@ -2,6 +2,8 @@ <%= translate(locale, "Subscriptions") %> - Invidious <% end %> +<%= rendered "components/feed_menu" %> +

diff --git a/src/invidious/views/top.ecr b/src/invidious/views/top.ecr index ea5679c4..acf122a6 100644 --- a/src/invidious/views/top.ecr +++ b/src/invidious/views/top.ecr @@ -3,29 +3,7 @@ <%= translate(locale, "Top") %> - Invidious <% end %> - +<%= rendered "components/feed_menu" %>
<% top_videos.each_slice(4) do |slice| %> diff --git a/src/invidious/views/trending.ecr b/src/invidious/views/trending.ecr index a3db4de3..617a9a58 100644 --- a/src/invidious/views/trending.ecr +++ b/src/invidious/views/trending.ecr @@ -3,29 +3,7 @@ <%= translate(locale, "Trending") %> - Invidious <% end %> - +<%= rendered "components/feed_menu" %>