From f08d53b0c6c32bc4a696765d98af3efa3039348a Mon Sep 17 00:00:00 2001
From: Omar Roth
Date: Sun, 28 Apr 2019 12:57:06 -0500
Subject: Add view count to livestreams in search results
---
src/invidious/views/components/item.ecr | 26 ++++++++++++++++----------
1 file changed, 16 insertions(+), 10 deletions(-)
diff --git a/src/invidious/views/components/item.ecr b/src/invidious/views/components/item.ecr
index 469dd230..484a340f 100644
--- a/src/invidious/views/components/item.ecr
+++ b/src/invidious/views/components/item.ecr
@@ -68,16 +68,19 @@
<%= item.author %>
- <% if item.responds_to?(:premiere_timestamp) && item.premiere_timestamp && item.premiere_timestamp.not_nil! > Time.now %>
- <%= translate(locale, "Premieres in `x`", recode_date((item.premiere_timestamp.as(Time) - Time.now).ago, locale)) %>
- <% elsif Time.now - item.published > 1.minute %>
-
<%= translate(locale, "Shared `x` ago", recode_date(item.published, locale)) %>
+ <% if item.responds_to?(:premiere_timestamp) && item.premiere_timestamp && item.premiere_timestamp.not_nil! > Time.now %>
+ <%= translate(locale, "Premieres in `x`", recode_date((item.premiere_timestamp.as(Time) - Time.now).ago, locale)) %>
+ <% elsif Time.now - item.published > 1.minute %>
+ <%= translate(locale, "Shared `x` ago", recode_date(item.published, locale)) %>
+ <% else %>
+
+ <% end %>
+
<%= item.responds_to?(:views) ? translate(locale, "`x` views", number_to_short_text(item.views)) : "" %>
- <% end %>
<% else %>
<% if env.get("preferences").as(Preferences).thin_mode %>
<% else %>
@@ -112,16 +115,19 @@
<%= item.author %>
- <% if item.responds_to?(:premiere_timestamp) && item.premiere_timestamp && item.premiere_timestamp.not_nil! > Time.now %>
- <%= translate(locale, "Premieres in `x`", recode_date((item.premiere_timestamp.as(Time) - Time.now).ago, locale)) %>
- <% elsif Time.now - item.published > 1.minute %>
-
<%= translate(locale, "Shared `x` ago", recode_date(item.published, locale)) %>
+ <% if item.responds_to?(:premiere_timestamp) && item.premiere_timestamp && item.premiere_timestamp.not_nil! > Time.now %>
+ <%= translate(locale, "Premieres in `x`", recode_date((item.premiere_timestamp.as(Time) - Time.now).ago, locale)) %>
+ <% elsif Time.now - item.published > 1.minute %>
+ <%= translate(locale, "Shared `x` ago", recode_date(item.published, locale)) %>
+ <% else %>
+
+ <% end %>
+
<%= item.responds_to?(:views) ? translate(locale, "`x` views", number_to_short_text(item.views)) : "" %>
- <% end %>
<% end %>
--
cgit v1.2.3
e.org>
|
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: xrfmkrh <rF3nMd7sRKezjF2vcEQo@protonmail.com>
|
|
Co-authored-by: Besnik Bleta <besnik@programeshqip.org>
Co-authored-by: Hosted Weblate <hosted@weblate.org>
|
|
Update Serbian translation
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: NEXI <nexiphotographer@gmail.com>
|
|
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: Juli <julimiro@posteo.net>
|
|
Co-authored-by: Danial Behzadi <dani.behzi@ubuntu.com>
Co-authored-by: Hosted Weblate <hosted@weblate.org>
|
|
Update Swedish translation
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: bittin1ddc447d824349b2 <bittin@reimu.nl>
|
|
Co-authored-by: ABCraft19 <lesenfantsbergaoui@gmail.com>
Co-authored-by: Hosted Weblate <hosted@weblate.org>
|
|
Update Spanish translation
Update Spanish translation
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: Jorge Maldonado Ventura <jorgesumle@freakspot.net>
Co-authored-by: gallegonovato <fran-carro@hotmail.es>
|
|
Update Dutch translation
Co-authored-by: Dick Groskamp <dikgro@yahoo.co.uk>
Co-authored-by: Hosted Weblate <hosted@weblate.org>
|
|
Update Arabic translation
Update Arabic translation
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: Rex_sa <rex.sa@pm.me>
|
|
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: Random <random-r@users.noreply.hosted.weblate.org>
|
|
Update Polish translation
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: Matthaiks <kitynska@gmail.com>
|
|
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: Milo Ivir <mail@milotype.de>
|
|
Update Icelandic translation
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: Sveinn í Felli <sv1@fellsnet.is>
|
|
Update Portuguese translation
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: Sergio Marques <so.boston.android@gmail.com>
|
|
Update Czech translation
Co-authored-by: Fjuro <fjuro@alius.cz>
Co-authored-by: Hosted Weblate <hosted@weblate.org>
|
|
Update Japanese translation
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: maboroshin <maboroshin@users.noreply.hosted.weblate.org>
|
|
Update Ukrainian translation
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: Ihor Hordiichuk <igor_ck@outlook.com>
|
|
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: sergio <sergio+it@outerface.net>
|
|
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: hompre <46e989cc@opayq.com>
|
|
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: Sanny Cue <sanny.cue@gmail.com>
|
|
Update Portuguese (Brazil) translation
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: joaooliva <joaooliva@protonmail.com>
|