2018-09-20 14:36:09 +00:00
|
|
|
<div class="pure-u-1 pure-u-md-1-4">
|
|
|
|
<div class="h-box">
|
2019-05-02 01:03:39 +00:00
|
|
|
<% case item when %>
|
|
|
|
<% when SearchChannel %>
|
|
|
|
<a style="width:100%" href="/channel/<%= item.ucid %>">
|
|
|
|
<% if !env.get("preferences").as(Preferences).thin_mode %>
|
|
|
|
<center>
|
2021-01-27 17:55:29 +00:00
|
|
|
<img style="width:56.25%" src="/ggpht<%= URI.parse(item.author_thumbnail).request_target.gsub(/=s\d+/, "=s176") %>"/>
|
2019-05-02 01:03:39 +00:00
|
|
|
</center>
|
|
|
|
<% end %>
|
|
|
|
<p><%= item.author %></p>
|
|
|
|
</a>
|
|
|
|
<p><%= translate(locale, "`x` subscribers", number_with_separator(item.subscriber_count)) %></p>
|
2019-09-12 17:11:21 +00:00
|
|
|
<% if !item.auto_generated %><p><%= translate(locale, "`x` videos", number_with_separator(item.video_count)) %></p><% end %>
|
2019-05-02 01:03:39 +00:00
|
|
|
<h5><%= item.description_html %></h5>
|
2019-08-05 23:49:13 +00:00
|
|
|
<% when SearchPlaylist, InvidiousPlaylist %>
|
2019-05-02 01:03:39 +00:00
|
|
|
<% if item.id.starts_with? "RD" %>
|
2021-01-31 18:52:32 +00:00
|
|
|
<% url = "/mix?list=#{item.id}&continuation=#{URI.parse(item.thumbnail || "/vi/-----------").request_target.split("/")[2]}" %>
|
2018-09-20 14:36:09 +00:00
|
|
|
<% else %>
|
2019-05-02 01:03:39 +00:00
|
|
|
<% url = "/playlist?list=#{item.id}" %>
|
2018-09-20 14:36:09 +00:00
|
|
|
<% end %>
|
2019-05-02 01:03:39 +00:00
|
|
|
|
|
|
|
<a style="width:100%" href="<%= url %>">
|
|
|
|
<% if !env.get("preferences").as(Preferences).thin_mode %>
|
|
|
|
<div class="thumbnail">
|
2021-01-31 18:52:32 +00:00
|
|
|
<img class="thumbnail" src="<%= URI.parse(item.thumbnail || "/").request_target %>"/>
|
2019-05-02 01:03:39 +00:00
|
|
|
<p class="length"><%= number_with_separator(item.video_count) %> videos</p>
|
|
|
|
</div>
|
2019-03-22 16:06:58 +00:00
|
|
|
<% end %>
|
2019-05-02 01:03:39 +00:00
|
|
|
<p><%= item.title %></p>
|
|
|
|
</a>
|
|
|
|
<p>
|
|
|
|
<b>
|
|
|
|
<a style="width:100%" href="/channel/<%= item.ucid %>"><%= item.author %></a>
|
|
|
|
</b>
|
|
|
|
</p>
|
|
|
|
<% when MixVideo %>
|
2019-06-08 18:31:41 +00:00
|
|
|
<a style="width:100%" href="/watch?v=<%= item.id %>&list=<%= item.rdid %>">
|
2019-05-02 01:03:39 +00:00
|
|
|
<% if !env.get("preferences").as(Preferences).thin_mode %>
|
|
|
|
<div class="thumbnail">
|
|
|
|
<img class="thumbnail" src="/vi/<%= item.id %>/mqdefault.jpg"/>
|
|
|
|
<% if item.length_seconds != 0 %>
|
|
|
|
<p class="length"><%= recode_length_seconds(item.length_seconds) %></p>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
2019-02-21 20:19:05 +00:00
|
|
|
<% end %>
|
2020-03-04 18:03:14 +00:00
|
|
|
<p><%= HTML.escape(item.title) %></p>
|
2019-05-02 01:03:39 +00:00
|
|
|
</a>
|
|
|
|
<p>
|
|
|
|
<b>
|
|
|
|
<a style="width:100%" href="/channel/<%= item.ucid %>"><%= item.author %></a>
|
|
|
|
</b>
|
|
|
|
</p>
|
|
|
|
<% when PlaylistVideo %>
|
2019-06-08 01:23:37 +00:00
|
|
|
<a style="width:100%" href="/watch?v=<%= item.id %>&list=<%= item.plid %>">
|
2019-05-02 01:03:39 +00:00
|
|
|
<% if !env.get("preferences").as(Preferences).thin_mode %>
|
|
|
|
<div class="thumbnail">
|
|
|
|
<img class="thumbnail" src="/vi/<%= item.id %>/mqdefault.jpg"/>
|
2019-08-05 23:49:13 +00:00
|
|
|
<% if plid = env.get?("remove_playlist_items") %>
|
2020-03-15 21:46:08 +00:00
|
|
|
<form data-onsubmit="return_false" action="/playlist_ajax?action_remove_video=1&set_video_id=<%= item.index %>&playlist_id=<%= plid %>&referer=<%= env.get("current_page") %>" method="post">
|
2019-08-05 23:49:13 +00:00
|
|
|
<input type="hidden" name="csrf_token" value="<%= URI.encode_www_form(env.get?("csrf_token").try &.as(String) || "") %>">
|
|
|
|
<p class="watched">
|
2020-03-15 21:46:08 +00:00
|
|
|
<a data-onclick="remove_playlist_item" data-index="<%= item.index %>" data-plid="<%= plid %>" href="javascript:void(0)">
|
2019-08-05 23:49:13 +00:00
|
|
|
<button type="submit" style="all:unset">
|
|
|
|
<i class="icon ion-md-trash"></i>
|
|
|
|
</button>
|
|
|
|
</a>
|
|
|
|
</p>
|
|
|
|
</form>
|
|
|
|
<% end %>
|
|
|
|
|
2019-05-02 01:03:39 +00:00
|
|
|
<% if item.responds_to?(:live_now) && item.live_now %>
|
|
|
|
<p class="length"><i class="icon ion-ios-play-circle"></i> <%= translate(locale, "LIVE") %></p>
|
|
|
|
<% elsif item.length_seconds != 0 %>
|
|
|
|
<p class="length"><%= recode_length_seconds(item.length_seconds) %></p>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
2020-03-04 18:03:14 +00:00
|
|
|
<p><a href="/watch?v=<%= item.id %>"><%= HTML.escape(item.title) %></a></p>
|
2019-05-02 01:03:39 +00:00
|
|
|
</a>
|
|
|
|
<p>
|
|
|
|
<b>
|
|
|
|
<a style="width:100%" href="/channel/<%= item.ucid %>"><%= item.author %></a>
|
|
|
|
</b>
|
|
|
|
</p>
|
2019-03-22 17:24:47 +00:00
|
|
|
|
2019-05-02 01:03:39 +00:00
|
|
|
<h5 class="pure-g">
|
2020-06-15 22:33:23 +00:00
|
|
|
<% if item.responds_to?(:premiere_timestamp) && item.premiere_timestamp.try &.> Time.utc %>
|
2019-06-08 00:56:41 +00:00
|
|
|
<div class="pure-u-2-3"><%= translate(locale, "Premieres in `x`", recode_date((item.premiere_timestamp.as(Time) - Time.utc).ago, locale)) %></div>
|
|
|
|
<% elsif Time.utc - item.published > 1.minute %>
|
2019-05-02 01:03:39 +00:00
|
|
|
<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 %>
|
2019-04-28 17:57:06 +00:00
|
|
|
|
2019-05-02 01:03:39 +00:00
|
|
|
<div class="pure-u-1-3" style="text-align:right">
|
2019-05-30 20:09:39 +00:00
|
|
|
<%= item.responds_to?(:views) && item.views ? translate(locale, "`x` views", number_to_short_text(item.views || 0)) : "" %>
|
2019-05-02 01:03:39 +00:00
|
|
|
</div>
|
|
|
|
</h5>
|
2018-11-21 04:58:30 +00:00
|
|
|
<% else %>
|
2019-05-02 01:03:39 +00:00
|
|
|
<% if !env.get("preferences").as(Preferences).thin_mode %>
|
|
|
|
<a style="width:100%" href="/watch?v=<%= item.id %>">
|
|
|
|
<div class="thumbnail">
|
|
|
|
<img class="thumbnail" src="/vi/<%= item.id %>/mqdefault.jpg"/>
|
|
|
|
<% if env.get? "show_watched" %>
|
2020-03-15 21:46:08 +00:00
|
|
|
<form data-onsubmit="return_false" action="/watch_ajax?action_mark_watched=1&id=<%= item.id %>&referer=<%= env.get("current_page") %>" method="post">
|
2019-09-24 17:31:33 +00:00
|
|
|
<input type="hidden" name="csrf_token" value="<%= URI.encode_www_form(env.get?("csrf_token").try &.as(String) || "") %>">
|
2019-05-02 01:03:39 +00:00
|
|
|
<p class="watched">
|
2020-03-15 21:46:08 +00:00
|
|
|
<a data-onclick="mark_watched" data-id="<%= item.id %>" href="javascript:void(0)">
|
2019-05-02 01:03:39 +00:00
|
|
|
<button type="submit" style="all:unset">
|
2020-03-15 21:46:08 +00:00
|
|
|
<i data-mouse="switch_classes" data-switch-classes="ion-ios-eye-off,ion-ios-eye"
|
2019-05-02 01:03:39 +00:00
|
|
|
class="icon ion-ios-eye">
|
|
|
|
</i>
|
|
|
|
</button>
|
|
|
|
</a>
|
|
|
|
</p>
|
|
|
|
</form>
|
2019-08-05 23:49:13 +00:00
|
|
|
<% elsif plid = env.get? "add_playlist_items" %>
|
2020-03-15 21:46:08 +00:00
|
|
|
<form data-onsubmit="return_false" action="/playlist_ajax?action_add_video=1&video_id=<%= item.id %>&playlist_id=<%= plid %>&referer=<%= env.get("current_page") %>" method="post">
|
2019-08-05 23:49:13 +00:00
|
|
|
<input type="hidden" name="csrf_token" value="<%= URI.encode_www_form(env.get?("csrf_token").try &.as(String) || "") %>">
|
|
|
|
<p class="watched">
|
2020-03-15 21:46:08 +00:00
|
|
|
<a data-onclick="add_playlist_item" data-id="<%= item.id %>" data-plid="<%= plid %>" href="javascript:void(0)">
|
2019-08-05 23:49:13 +00:00
|
|
|
<button type="submit" style="all:unset">
|
|
|
|
<i class="icon ion-md-add"></i>
|
|
|
|
</button>
|
|
|
|
</a>
|
|
|
|
</p>
|
|
|
|
</form>
|
2019-05-02 01:03:39 +00:00
|
|
|
<% end %>
|
2019-03-22 17:24:47 +00:00
|
|
|
|
2019-05-02 01:03:39 +00:00
|
|
|
<% if item.responds_to?(:live_now) && item.live_now %>
|
|
|
|
<p class="length"><i class="icon ion-ios-play-circle"></i> <%= translate(locale, "LIVE") %></p>
|
|
|
|
<% elsif item.length_seconds != 0 %>
|
|
|
|
<p class="length"><%= recode_length_seconds(item.length_seconds) %></p>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
</a>
|
2019-04-28 17:57:06 +00:00
|
|
|
<% end %>
|
2020-03-04 18:03:14 +00:00
|
|
|
<p><a href="/watch?v=<%= item.id %>"><%= HTML.escape(item.title) %></a></p>
|
2020-01-21 12:36:56 +00:00
|
|
|
<p style="display: flex;">
|
|
|
|
<b style="flex: 1;">
|
2019-05-02 01:03:39 +00:00
|
|
|
<a style="width:100%" href="/channel/<%= item.ucid %>"><%= item.author %></a>
|
|
|
|
</b>
|
2021-03-25 01:34:06 +00:00
|
|
|
<a title="<%=translate(locale, "Watch on YouTube")%>" href="https://youtube.com/watch?v=<%= item.id %>" style="margin-right: 5px;">
|
|
|
|
<i class="icon ion-logo-youtube"></i>
|
|
|
|
</a>
|
2021-03-25 01:07:18 +00:00
|
|
|
<a title="<%=translate(locale, "Audio mode")%>" href="/watch?v=<%= item.id %>&listen=1">
|
2020-01-21 12:36:56 +00:00
|
|
|
<i class="icon ion-md-headset"></i>
|
|
|
|
</a>
|
2019-05-02 01:03:39 +00:00
|
|
|
</p>
|
2019-04-28 17:57:06 +00:00
|
|
|
|
2019-05-02 01:03:39 +00:00
|
|
|
<h5 class="pure-g">
|
2020-06-15 22:33:23 +00:00
|
|
|
<% if item.responds_to?(:premiere_timestamp) && item.premiere_timestamp.try &.> Time.utc %>
|
2019-06-08 00:56:41 +00:00
|
|
|
<div class="pure-u-2-3"><%= translate(locale, "Premieres in `x`", recode_date((item.premiere_timestamp.as(Time) - Time.utc).ago, locale)) %></div>
|
|
|
|
<% elsif Time.utc - item.published > 1.minute %>
|
2019-05-02 01:03:39 +00:00
|
|
|
<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">
|
2019-05-30 20:09:39 +00:00
|
|
|
<%= item.responds_to?(:views) && item.views ? translate(locale, "`x` views", number_to_short_text(item.views || 0)) : "" %>
|
2019-05-02 01:03:39 +00:00
|
|
|
</div>
|
|
|
|
</h5>
|
|
|
|
<% end %>
|
2018-09-20 14:36:09 +00:00
|
|
|
</div>
|
|
|
|
</div>
|