From 7ec93825b6e92667b345463d8d42e66764a83a57 Mon Sep 17 00:00:00 2001 From: Cadence Ember Date: Thu, 24 Jun 2021 21:05:06 +1200 Subject: Change description-box from flex to block I also make minor changes to the surroundings so that the same layout and functionality as before is preserved. --- src/invidious/views/watch.ecr | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/invidious/views/watch.ecr b/src/invidious/views/watch.ecr index 91e03725..8ea83384 100644 --- a/src/invidious/views/watch.ecr +++ b/src/invidious/views/watch.ecr @@ -30,11 +30,11 @@ we're going to need to do it here in order to allow for translations. --> @@ -249,12 +249,12 @@ we're going to need to do it here in order to allow for translations. <%= video.description_html %> <% else %> -
<%= video.description_html %>
+ <% end %> -- cgit v1.2.3 From d16a748f37c6ca034480693ddb7433f351241cf6 Mon Sep 17 00:00:00 2001 From: Mostafa Ahangarha Date: Thu, 24 Jun 2021 17:08:40 +0430 Subject: set alignment for feed link --- src/invidious/views/channel.ecr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/invidious/views/channel.ecr b/src/invidious/views/channel.ecr index 21038394..2f734b2c 100644 --- a/src/invidious/views/channel.ecr +++ b/src/invidious/views/channel.ecr @@ -21,7 +21,7 @@
-

+

-- cgit v1.2.3 From 9e4fd193c6f8a8a00243d04abba0ea4393ad10b7 Mon Sep 17 00:00:00 2001 From: Samantaz Fox Date: Thu, 24 Jun 2021 15:00:55 +0200 Subject: Limit descriptions width to ease mixed LTR/RTL text reading This will prevent, on large pages, the LTR and RTL text to be far away, on each side of the page. This could happen on channel and playlists descriptions, when the page is displayed on a large screen. --- assets/css/default.css | 4 ++++ src/invidious/views/channel.ecr | 4 +++- src/invidious/views/community.ecr | 4 +++- src/invidious/views/playlist.ecr | 4 +++- src/invidious/views/playlists.ecr | 4 +++- src/invidious/views/watch.ecr | 4 +++- 6 files changed, 19 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/assets/css/default.css b/assets/css/default.css index 808df295..1df63412 100644 --- a/assets/css/default.css +++ b/assets/css/default.css @@ -523,3 +523,7 @@ p, unicode-bidi: plaintext; text-align: start; } + +#descriptionWrapper { + max-width: 600px; +} diff --git a/src/invidious/views/channel.ecr b/src/invidious/views/channel.ecr index 2f734b2c..dd2807de 100644 --- a/src/invidious/views/channel.ecr +++ b/src/invidious/views/channel.ecr @@ -28,7 +28,9 @@
-

<%= channel.description_html %>

+
+

<%= channel.description_html %>

+
diff --git a/src/invidious/views/community.ecr b/src/invidious/views/community.ecr index b0092e5f..bc6fb631 100644 --- a/src/invidious/views/community.ecr +++ b/src/invidious/views/community.ecr @@ -27,7 +27,9 @@
-

<%= XML.parse_html(channel.description_html).xpath_node(%q(.//pre)).try &.content %>

+
+

<%= XML.parse_html(channel.description_html).xpath_node(%q(.//pre)).try &.content %>

+
diff --git a/src/invidious/views/playlist.ecr b/src/invidious/views/playlist.ecr index a19dd182..377da20f 100644 --- a/src/invidious/views/playlist.ecr +++ b/src/invidious/views/playlist.ecr @@ -64,7 +64,9 @@
-

<%= playlist.description_html %>

+
+

<%= playlist.description_html %>

+
<% if playlist.is_a?(InvidiousPlaylist) && playlist.author == user.try &.email %> diff --git a/src/invidious/views/playlists.ecr b/src/invidious/views/playlists.ecr index 975ccd6c..52b79a40 100644 --- a/src/invidious/views/playlists.ecr +++ b/src/invidious/views/playlists.ecr @@ -27,7 +27,9 @@
-

<%= XML.parse_html(channel.description_html).xpath_node(%q(.//pre)).try &.content if !channel.description_html.empty? %>

+
+

<%= XML.parse_html(channel.description_html).xpath_node(%q(.//pre)).try &.content if !channel.description_html.empty? %>

+
diff --git a/src/invidious/views/watch.ecr b/src/invidious/views/watch.ecr index 8ea83384..7ee3fb1a 100644 --- a/src/invidious/views/watch.ecr +++ b/src/invidious/views/watch.ecr @@ -246,7 +246,9 @@ we're going to need to do it here in order to allow for translations.
<% if video.description.size < 200 || params.extend_desc %> - <%= video.description_html %> +
+ <%= video.description_html %> +
<% else %>
-- cgit v1.2.3 From 1b1932f7873fa360b1e66071aa8c79c8702a8a69 Mon Sep 17 00:00:00 2001 From: Mostafa Ahangarha Date: Thu, 24 Jun 2021 17:40:02 +0430 Subject: fix feed alignment on community view --- src/invidious/views/community.ecr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/invidious/views/community.ecr b/src/invidious/views/community.ecr index bc6fb631..96976271 100644 --- a/src/invidious/views/community.ecr +++ b/src/invidious/views/community.ecr @@ -20,7 +20,7 @@
-

+

-- cgit v1.2.3 From 9cef7945c04620eb0b18a200aa0db803dba99c5a Mon Sep 17 00:00:00 2001 From: Samantaz Fox Date: Fri, 25 Jun 2021 02:03:05 +0200 Subject: Fix RTL text in video titles on Firefox The behavior was as follow: on Right-To-Left text (e.g Arabic) that is wrapped (because it's too long to fit on one line), the second row and following rows may or may not be right aligned (as RTL text should be). Opening the devtools fixes that alignement, as consistently as closing the devtool breaks it. This problem seems to arrive only in the following configurations (link nested in a paragraph, both of which may or may not have the dir= attribute): * `

RTL_TEXT

` * `

RTL_TEXT

` * `

RTL_TEXT

` with the following CSS: ``` p { unicode-bidi: plaintext; text-align: start; } ``` Changing the HTML to the following configuration (a paragraph with the dir= attribute, nested in a link) seems to fix it: `

RTL_TEXT

` --- src/invidious/views/components/item.ecr | 49 +++++++++++++++------------------ 1 file changed, 22 insertions(+), 27 deletions(-) (limited to 'src') diff --git a/src/invidious/views/components/item.ecr b/src/invidious/views/components/item.ecr index 6f027bee..85ff53a1 100644 --- a/src/invidious/views/components/item.ecr +++ b/src/invidious/views/components/item.ecr @@ -2,13 +2,13 @@
<% case item when %> <% when SearchChannel %> - + <% if !env.get("preferences").as(Preferences).thin_mode %>
"/>
<% end %> -

<%= item.author %>

+

<%= HTML.escape(item.author) %>

<%= translate(locale, "`x` subscribers", number_with_separator(item.subscriber_count)) %>

<% if !item.auto_generated %>

<%= translate(locale, "`x` videos", number_with_separator(item.video_count)) %>

<% end %> @@ -27,15 +27,13 @@

<%= number_with_separator(item.video_count) %> videos

<% end %> -

<%= item.title %>

+

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

+ + +

<%= HTML.escape(item.author) %>

-

- - <%= item.author %> - -

<% when MixVideo %> - + <% if !env.get("preferences").as(Preferences).thin_mode %>
@@ -44,13 +42,11 @@ <% end %>
<% end %> -

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

+

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

+
+ +

<%= HTML.escape(item.author) %>

-

- - <%= item.author %> - -

<% when PlaylistVideo %> <% if !env.get("preferences").as(Preferences).thin_mode %> @@ -76,13 +72,11 @@ <% end %>
<% end %> -

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

+

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

+ + +

<%= HTML.escape(item.author) %>

-

- - <%= item.author %> - -

<% if item.responds_to?(:premiere_timestamp) && item.premiere_timestamp.try &.> Time.utc %> @@ -98,8 +92,8 @@
<% else %> - <% if !env.get("preferences").as(Preferences).thin_mode %> - + + <% if !env.get("preferences").as(Preferences).thin_mode %>
<% if env.get? "show_watched" %> @@ -134,12 +128,13 @@

<%= recode_length_seconds(item.length_seconds) %>

<% end %>
-
- <% end %> -

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

+ <% end %> +

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

+ +
- <%= item.author %> +

<%= HTML.escape(item.author) %>

-- cgit v1.2.3 From cfcb64c5164816e27496366e0f6fb489dfaa6932 Mon Sep 17 00:00:00 2001 From: Samantaz Fox Date: Fri, 25 Jun 2021 20:47:15 +0200 Subject: Fix layout of video 'card' items Previous changes broke alignment of text and icons --- assets/css/default.css | 15 ++++++ src/invidious/views/components/item.ecr | 89 ++++++++++++++++++--------------- 2 files changed, 64 insertions(+), 40 deletions(-) (limited to 'src') diff --git a/assets/css/default.css b/assets/css/default.css index 1df63412..06a2f07f 100644 --- a/assets/css/default.css +++ b/assets/css/default.css @@ -282,6 +282,21 @@ input[type="search"]::-webkit-search-cancel-button { } } + +/* + * Video "cards" (results/playlist/channel videos) + */ + +.video-card-row { margin: 15px 0; } + +.flexible { display: flex; } +.flex-left { flex: 1 1 100%; flex-wrap: wrap; } +.flex-right { flex: 1 0 max-content; flex-wrap: nowrap; } + +p.channel-name { margin: 0; } +p.video-data { margin: 0; font-weight: bold; font-size: 80%; } + + /* * Footer */ diff --git a/src/invidious/views/components/item.ecr b/src/invidious/views/components/item.ecr index 85ff53a1..7fbefc38 100644 --- a/src/invidious/views/components/item.ecr +++ b/src/invidious/views/components/item.ecr @@ -74,23 +74,28 @@ <% end %>

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

- -

<%= HTML.escape(item.author) %>

-
-
- <% if item.responds_to?(:premiere_timestamp) && item.premiere_timestamp.try &.> Time.utc %> -
<%= translate(locale, "Premieres in `x`", recode_date((item.premiere_timestamp.as(Time) - Time.utc).ago, locale)) %>
- <% elsif Time.utc - item.published > 1.minute %> -
<%= translate(locale, "Shared `x` ago", recode_date(item.published, locale)) %>
- <% else %> -
- <% end %> + + +
+
+ <% if item.responds_to?(:premiere_timestamp) && item.premiere_timestamp.try &.> Time.utc %> +

<%= translate(locale, "Premieres in `x`", recode_date((item.premiere_timestamp.as(Time) - Time.utc).ago, locale)) %>

+ <% elsif Time.utc - item.published > 1.minute %> +

<%= translate(locale, "Shared `x` ago", recode_date(item.published, locale)) %>

+ <% end %> +
-
- <%= item.responds_to?(:views) && item.views ? translate(locale, "`x` views", number_to_short_text(item.views || 0)) : "" %> + <% if item.responds_to?(:views) && item.views %> +
+

<%= translate(locale, "`x` views", number_to_short_text(item.views || 0)) %>

-
+ <% end %> + <% else %> <% if !env.get("preferences").as(Preferences).thin_mode %> @@ -123,7 +128,7 @@ <% end %> <% if item.responds_to?(:live_now) && item.live_now %> -

<%= translate(locale, "LIVE") %>

+

<%= translate(locale, "LIVE") %>

<% elsif item.length_seconds != 0 %>

<%= recode_length_seconds(item.length_seconds) %>

<% end %> @@ -132,36 +137,40 @@

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

-
- -

<%= HTML.escape(item.author) %>

-
-
- " href="https://www.youtube.com/watch?v=<%= item.id %>"> - - - " href="/watch?v=<%= item.id %>&listen=1"> - - - " href="/redirect?referer=<%=HTML.escape("watch?v=#{item.id}")%>"> - - + -
- <% if item.responds_to?(:premiere_timestamp) && item.premiere_timestamp.try &.> Time.utc %> -
<%= translate(locale, "Premieres in `x`", recode_date((item.premiere_timestamp.as(Time) - Time.utc).ago, locale)) %>
- <% elsif Time.utc - item.published > 1.minute %> -
<%= translate(locale, "Shared `x` ago", recode_date(item.published, locale)) %>
- <% else %> -
- <% end %> +
+
+ <% if item.responds_to?(:premiere_timestamp) && item.premiere_timestamp.try &.> Time.utc %> +

<%= translate(locale, "Premieres in `x`", recode_date((item.premiere_timestamp.as(Time) - Time.utc).ago, locale)) %>

+ <% elsif Time.utc - item.published > 1.minute %> +

<%= translate(locale, "Shared `x` ago", recode_date(item.published, locale)) %>

+ <% end %> +
-
- <%= item.responds_to?(:views) && item.views ? translate(locale, "`x` views", number_to_short_text(item.views || 0)) : "" %> + <% if item.responds_to?(:views) && item.views %> +
+

<%= translate(locale, "`x` views", number_to_short_text(item.views || 0)) %>

-
+ <% end %> +
<% end %>
-- cgit v1.2.3