mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2023-06-08.git
synced 2024-08-15 00:53:38 +00:00
Add view count to livestreams in search results
This commit is contained in:
parent
6859b85266
commit
f08d53b0c6
1 changed files with 16 additions and 10 deletions
|
@ -68,16 +68,19 @@
|
||||||
<b><a style="width:100%;" href="/channel/<%= item.ucid %>"><%= item.author %></a></b>
|
<b><a style="width:100%;" href="/channel/<%= item.ucid %>"><%= item.author %></a></b>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<% if item.responds_to?(:premiere_timestamp) && item.premiere_timestamp && item.premiere_timestamp.not_nil! > Time.now %>
|
|
||||||
<h5><%= translate(locale, "Premieres in `x`", recode_date((item.premiere_timestamp.as(Time) - Time.now).ago, locale)) %></h5>
|
|
||||||
<% elsif Time.now - item.published > 1.minute %>
|
|
||||||
<h5 class="pure-g">
|
<h5 class="pure-g">
|
||||||
<div class="pure-u-2-3"><%= translate(locale, "Shared `x` ago", recode_date(item.published, locale)) %></div>
|
<% 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)) %></h5>
|
||||||
|
<% elsif Time.now - item.published > 1.minute %>
|
||||||
|
<div class="pure-u-2-3"><%= translate(locale, "Shared `x` ago", recode_date(item.published, locale)) %></div>
|
||||||
|
<% else %>
|
||||||
|
<div class="pure-u-2-3"></div>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<div class="pure-u-1-3" style="text-align: right">
|
<div class="pure-u-1-3" style="text-align: right">
|
||||||
<%= item.responds_to?(:views) ? translate(locale, "`x` views", number_to_short_text(item.views)) : "" %>
|
<%= item.responds_to?(:views) ? translate(locale, "`x` views", number_to_short_text(item.views)) : "" %>
|
||||||
</div>
|
</div>
|
||||||
</h5>
|
</h5>
|
||||||
<% end %>
|
|
||||||
<% else %>
|
<% else %>
|
||||||
<% if env.get("preferences").as(Preferences).thin_mode %>
|
<% if env.get("preferences").as(Preferences).thin_mode %>
|
||||||
<% else %>
|
<% else %>
|
||||||
|
@ -112,16 +115,19 @@
|
||||||
<b><a style="width:100%;" href="/channel/<%= item.ucid %>"><%= item.author %></a></b>
|
<b><a style="width:100%;" href="/channel/<%= item.ucid %>"><%= item.author %></a></b>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<% if item.responds_to?(:premiere_timestamp) && item.premiere_timestamp && item.premiere_timestamp.not_nil! > Time.now %>
|
|
||||||
<h5><%= translate(locale, "Premieres in `x`", recode_date((item.premiere_timestamp.as(Time) - Time.now).ago, locale)) %></h5>
|
|
||||||
<% elsif Time.now - item.published > 1.minute %>
|
|
||||||
<h5 class="pure-g">
|
<h5 class="pure-g">
|
||||||
<div class="pure-u-2-3"><%= translate(locale, "Shared `x` ago", recode_date(item.published, locale)) %></div>
|
<% 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)) %></h5>
|
||||||
|
<% elsif Time.now - item.published > 1.minute %>
|
||||||
|
<div class="pure-u-2-3"><%= translate(locale, "Shared `x` ago", recode_date(item.published, locale)) %></div>
|
||||||
|
<% else %>
|
||||||
|
<div class="pure-u-2-3"></div>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<div class="pure-u-1-3" style="text-align: right">
|
<div class="pure-u-1-3" style="text-align: right">
|
||||||
<%= item.responds_to?(:views) ? translate(locale, "`x` views", number_to_short_text(item.views)) : "" %>
|
<%= item.responds_to?(:views) ? translate(locale, "`x` views", number_to_short_text(item.views)) : "" %>
|
||||||
</div>
|
</div>
|
||||||
</h5>
|
</h5>
|
||||||
<% end %>
|
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue