Multiple front-end fixes (#2247)

Fixes:
* Sanitize user-provided content in HTML (Fixes #2193)
* Fix encoding of search query in prev/next pages (Fixes #2229)
* Fix some issues introduced with #2196:
   - Fix alignment of all <h3> elements (Move the inline style from the parent to the <h3> element)
   - Add missing comma on 'dir' HTML attribute (Typo introduced by PR #2196)

Code cleaning:
* Remove unnecessary 'each_sclice' + 'each' double loop in ECR files
* Clean the player's <source> list generation code (in player.ecr)
This commit is contained in:
Samantaz Fox
2021-07-15 23:01:36 +02:00
committed by GitHub
parent 3e5c353298
commit 56ebef4352
19 changed files with 161 additions and 169 deletions

View File

@@ -1,5 +1,8 @@
<% ucid = channel.ucid %>
<% author = HTML.escape(channel.author) %>
<% content_for "header" do %>
<title><%= channel.author %> - Invidious</title>
<title><%= author %> - Invidious</title>
<% end %>
<% if channel.banner %>
@@ -16,7 +19,7 @@
<div class="pure-u-2-3">
<div class="channel-profile">
<img src="/ggpht<%= URI.parse(channel.author_thumbnail).request_target %>">
<span><%= channel.author %></span>
<span><%= author %></span>
</div>
</div>
<div class="pure-u-1-3" style="text-align:right">
@@ -33,8 +36,6 @@
</div>
<div class="h-box">
<% ucid = channel.ucid %>
<% author = channel.author %>
<% sub_count_text = number_to_short_text(channel.sub_count) %>
<%= rendered "components/subscribe_widget" %>
</div>
@@ -79,7 +80,7 @@
<script id="community_data" type="application/json">
<%=
{
"ucid" => channel.ucid,
"ucid" => ucid,
"youtube_comments_text" => HTML.escape(translate(locale, "View YouTube comments")),
"comments_text" => HTML.escape(translate(locale, "View `x` comments", "{commentCount}")),
"hide_replies_text" => HTML.escape(translate(locale, "Hide replies")),