diff --git a/src/invidious/comments.cr b/src/invidious/comments.cr index 81d6ac2b..8877f52b 100644 --- a/src/invidious/comments.cr +++ b/src/invidious/comments.cr @@ -312,6 +312,8 @@ def template_youtube_comments(comments, locale, thin_mode, is_replies = false) author_thumbnail = "" end + author_name = HTML.escape(child["author"].as_s) + html << <<-END_HTML
@@ -320,7 +322,7 @@ def template_youtube_comments(comments, locale, thin_mode, is_replies = false)

- #{child["author"]} + #{author_name}

#{child["contentHtml"]}

END_HTML diff --git a/src/invidious/views/authorize_token.ecr b/src/invidious/views/authorize_token.ecr index 8ea99010..2dc948d9 100644 --- a/src/invidious/views/authorize_token.ecr +++ b/src/invidious/views/authorize_token.ecr @@ -9,13 +9,13 @@ <%= translate(locale, "Token") %>
-
-

+ -
-

+ diff --git a/src/invidious/views/channel.ecr b/src/invidious/views/channel.ecr index dd2807de..09cfb76e 100644 --- a/src/invidious/views/channel.ecr +++ b/src/invidious/views/channel.ecr @@ -1,6 +1,9 @@ +<% ucid = channel.ucid %> +<% author = HTML.escape(channel.author) %> + <% content_for "header" do %> -<%= channel.author %> - Invidious - +<%= author %> - Invidious + <% end %> <% if channel.banner %> @@ -17,12 +20,12 @@
- <%= channel.author %> + <%= author %>
-
+

- +

@@ -34,15 +37,13 @@

- <% ucid = channel.ucid %> - <% author = channel.author %> <% sub_count_text = number_to_short_text(channel.sub_count) %> <%= rendered "components/subscribe_widget" %>
@@ -72,7 +73,7 @@ <% if sort_by == sort %> <%= translate(locale, sort) %> <% else %> - + <%= translate(locale, sort) %> <% end %> @@ -87,17 +88,15 @@

- <% items.each_slice(4) do |slice| %> - <% slice.each do |item| %> - <%= rendered "components/item" %> - <% end %> - <% end %> +<% items.each do |item| %> + <%= rendered "components/item" %> +<% end %>
<% if page > 1 %> - &sort_by=<%= HTML.escape(sort_by) %><% end %>"> + &sort_by=<%= HTML.escape(sort_by) %><% end %>"> <%= translate(locale, "Previous page") %> <% end %> @@ -105,7 +104,7 @@
<% if count == 60 %> - &sort_by=<%= HTML.escape(sort_by) %><% end %>"> + &sort_by=<%= HTML.escape(sort_by) %><% end %>"> <%= translate(locale, "Next page") %> <% end %> diff --git a/src/invidious/views/community.ecr b/src/invidious/views/community.ecr index 96976271..15d8ed1e 100644 --- a/src/invidious/views/community.ecr +++ b/src/invidious/views/community.ecr @@ -1,5 +1,8 @@ +<% ucid = channel.ucid %> +<% author = HTML.escape(channel.author) %> + <% content_for "header" do %> -<%= channel.author %> - Invidious +<%= author %> - Invidious <% end %> <% if channel.banner %> @@ -16,7 +19,7 @@
- <%= channel.author %> + <%= author %>
@@ -33,8 +36,6 @@
- <% ucid = channel.ucid %> - <% author = channel.author %> <% sub_count_text = number_to_short_text(channel.sub_count) %> <%= rendered "components/subscribe_widget" %>
@@ -79,7 +80,7 @@
- <% watched.each_slice(4) do |slice| %> - <% slice.each do |item| %> - - <% end %> + <% watched.each do |item| %> + <% end %>
diff --git a/src/invidious/views/login.ecr b/src/invidious/views/login.ecr index b6e8117b..1f6618e8 100644 --- a/src/invidious/views/login.ecr +++ b/src/invidious/views/login.ecr @@ -26,7 +26,7 @@
<% if email %> - + <% else %> "> @@ -62,7 +62,7 @@
<% if email %> - + <% else %> "> diff --git a/src/invidious/views/mix.ecr b/src/invidious/views/mix.ecr index e9c0dcbc..e55b00f8 100644 --- a/src/invidious/views/mix.ecr +++ b/src/invidious/views/mix.ecr @@ -1,22 +1,20 @@ <% content_for "header" do %> -<%= mix.title %> - Invidious +<%= HTML.escape(mix.title) %> - Invidious <% end %>
-

<%= mix.title %>

+

<%= HTML.escape(mix.title) %>

-
-

+
+

- <% mix.videos.each_slice(4) do |slice| %> - <% slice.each do |item| %> - <%= rendered "components/item" %> - <% end %> - <% end %> +<% mix.videos.each do |item| %> + <%= rendered "components/item" %> +<% end %>
diff --git a/src/invidious/views/playlist.ecr b/src/invidious/views/playlist.ecr index 377da20f..b1fee211 100644 --- a/src/invidious/views/playlist.ecr +++ b/src/invidious/views/playlist.ecr @@ -1,17 +1,20 @@ +<% title = HTML.escape(playlist.title) %> +<% author = HTML.escape(playlist.author) %> + <% content_for "header" do %> -<%= playlist.title %> - Invidious +<%= title %> - Invidious <% end %>
-

<%= playlist.title %>

+

<%= title %>

<% if playlist.is_a? InvidiousPlaylist %> <% if playlist.author == user.try &.email %> - <%= playlist.author %> | + <%= author %> | <% else %> - <%= playlist.author %> | + <%= author %> | <% end %> <%= translate(locale, "`x` videos", "#{playlist.video_count}") %> | <%= translate(locale, "Updated `x` ago", recode_date(playlist.updated, locale)) %> | @@ -26,11 +29,12 @@ <% else %> - <%= playlist.author %> | + <%= author %> | <%= translate(locale, "`x` videos", "#{playlist.video_count}") %> | <%= translate(locale, "Updated `x` ago", recode_date(playlist.updated, locale)) %> <% end %> + <% if !playlist.is_a? InvidiousPlaylist %> <% end %>
@@ -93,11 +96,9 @@ <% end %>
- <% videos.each_slice(4) do |slice| %> - <% slice.each do |item| %> - <%= rendered "components/item" %> - <% end %> - <% end %> +<% videos.each do |item| %> + <%= rendered "components/item" %> +<% end %>
diff --git a/src/invidious/views/playlists.ecr b/src/invidious/views/playlists.ecr index 3f892650..d9a17a9b 100644 --- a/src/invidious/views/playlists.ecr +++ b/src/invidious/views/playlists.ecr @@ -1,5 +1,8 @@ +<% ucid = channel.ucid %> +<% author = HTML.escape(channel.author) %> + <% content_for "header" do %> -<%= channel.author %> - Invidious +<%= author %> - Invidious <% end %> <% if channel.banner %> @@ -16,12 +19,12 @@
- <%= channel.author %> + <%= author %>

- +

@@ -33,8 +36,6 @@
- <% ucid = channel.ucid %> - <% author = channel.author %> <% sub_count_text = number_to_short_text(channel.sub_count) %> <%= rendered "components/subscribe_widget" %>
@@ -42,7 +43,7 @@
@@ -71,7 +72,7 @@ <% if sort_by == sort %> <%= translate(locale, sort) %> <% else %> - + <%= translate(locale, sort) %> <% end %> @@ -86,18 +87,16 @@
- <% items.each_slice(4) do |slice| %> - <% slice.each do |item| %> - <%= rendered "components/item" %> - <% end %> - <% end %> +<% items.each do |item| %> + <%= rendered "components/item" %> +<% end %>
<% if continuation %> - &sort_by=<%= HTML.escape(sort_by) %><% end %>"> + &sort_by=<%= HTML.escape(sort_by) %><% end %>"> <%= translate(locale, "Next page") %> <% end %> diff --git a/src/invidious/views/popular.ecr b/src/invidious/views/popular.ecr index 62abb12a..e77f35b9 100644 --- a/src/invidious/views/popular.ecr +++ b/src/invidious/views/popular.ecr @@ -12,9 +12,7 @@ <%= rendered "components/feed_menu" %>
- <% popular_videos.each_slice(4) do |slice| %> - <% slice.each do |item| %> - <%= rendered "components/item" %> - <% end %> - <% end %> +<% popular_videos.each do |item| %> + <%= rendered "components/item" %> +<% end %>
diff --git a/src/invidious/views/search.ecr b/src/invidious/views/search.ecr index 15389dce..fd176e41 100644 --- a/src/invidious/views/search.ecr +++ b/src/invidious/views/search.ecr @@ -2,6 +2,8 @@ <%= search_query.not_nil!.size > 30 ? HTML.escape(query.not_nil![0,30].rstrip(".") + "...") : HTML.escape(query.not_nil!) %> - Invidious <% end %> +<% search_query_encoded = env.get?("search").try { |x| URI.encode(x.as(String), space_to_plus: true) } %> + <% if count == 0 %>

@@ -105,7 +107,7 @@
<% if page > 1 %> - + <%= translate(locale, "Previous page") %> <% end %> @@ -113,7 +115,7 @@
<% if count >= 20 %> - + <%= translate(locale, "Next page") %> <% end %> @@ -121,17 +123,15 @@
- <% videos.each_slice(4) do |slice| %> - <% slice.each do |item| %> - <%= rendered "components/item" %> - <% end %> + <% videos.each do |item| %> + <%= rendered "components/item" %> <% end %>
<% if page > 1 %> - + <%= translate(locale, "Previous page") %> <% end %> @@ -139,7 +139,7 @@
<% if count >= 20 %> - + <%= translate(locale, "Next page") %> <% end %> diff --git a/src/invidious/views/subscription_manager.ecr b/src/invidious/views/subscription_manager.ecr index 6cddcd6c..acf015f5 100644 --- a/src/invidious/views/subscription_manager.ecr +++ b/src/invidious/views/subscription_manager.ecr @@ -10,15 +10,15 @@

-
-

+ -
-

+
+

<%= translate(locale, "Import/export") %> @@ -31,7 +31,7 @@
diff --git a/src/invidious/views/subscriptions.ecr b/src/invidious/views/subscriptions.ecr index af1d4fbc..97184e2b 100644 --- a/src/invidious/views/subscriptions.ecr +++ b/src/invidious/views/subscriptions.ecr @@ -11,13 +11,13 @@ <%= translate(locale, "Manage subscriptions") %>

-
-

+ -
-

+
+

@@ -34,11 +34,9 @@ <% end %>
- <% notifications.each_slice(4) do |slice| %> - <% slice.each do |item| %> - <%= rendered "components/item" %> - <% end %> - <% end %> +<% notifications.each do |item| %> + <%= rendered "components/item" %> +<% end %>
@@ -55,11 +53,9 @@
- <% videos.each_slice(4) do |slice| %> - <% slice.each do |item| %> - <%= rendered "components/item" %> - <% end %> - <% end %> +<% videos.each do |item| %> + <%= rendered "components/item" %> +<% end %>
diff --git a/src/invidious/views/trending.ecr b/src/invidious/views/trending.ecr index 3ec62555..a35c4ee3 100644 --- a/src/invidious/views/trending.ecr +++ b/src/invidious/views/trending.ecr @@ -41,9 +41,7 @@
- <% trending.each_slice(4) do |slice| %> - <% slice.each do |item| %> - <%= rendered "components/item" %> - <% end %> - <% end %> +<% trending.each do |item| %> + <%= rendered "components/item" %> +<% end %>
diff --git a/src/invidious/views/view_all_playlists.ecr b/src/invidious/views/view_all_playlists.ecr index 5ec6aa31..868cfeda 100644 --- a/src/invidious/views/view_all_playlists.ecr +++ b/src/invidious/views/view_all_playlists.ecr @@ -16,11 +16,9 @@
- <% items_created.each_slice(4) do |slice| %> - <% slice.each do |item| %> - <%= rendered "components/item" %> - <% end %> - <% end %> +<% items_created.each do |item| %> + <%= rendered "components/item" %> +<% end %>
@@ -30,9 +28,7 @@
- <% items_saved.each_slice(4) do |slice| %> - <% slice.each do |item| %> - <%= rendered "components/item" %> - <% end %> - <% end %> +<% items_saved.each do |item| %> + <%= rendered "components/item" %> +<% end %>
diff --git a/src/invidious/views/watch.ecr b/src/invidious/views/watch.ecr index c553dc0e..aeb0f476 100644 --- a/src/invidious/views/watch.ecr +++ b/src/invidious/views/watch.ecr @@ -1,10 +1,15 @@ +<% ucid = video.ucid %> +<% title = HTML.escape(video.title) %> +<% author = HTML.escape(video.author) %> + + <% content_for "header" do %> "> - + @@ -16,7 +21,7 @@ - + @@ -24,7 +29,7 @@ <%= rendered "components/player_sources" %> -<%= HTML.escape(video.title) %> - Invidious +<%= title %> - Invidious