2018-09-20 14:36:09 +00:00
|
|
|
<div class="pure-u-1 pure-u-md-1-4">
|
|
|
|
<div class="h-box">
|
|
|
|
<% case item when %>
|
|
|
|
<% when SearchChannel %>
|
|
|
|
<a style="width:100%;" href="/channel/<%= item.ucid %>">
|
2019-03-27 16:31:05 +00:00
|
|
|
<% if env.get("preferences").as(Preferences).thin_mode %>
|
2018-09-20 14:36:09 +00:00
|
|
|
<% else %>
|
|
|
|
<center>
|
|
|
|
<img style="width:56.25%;" src="/ggpht<%= URI.parse(item.author_thumbnail).full_path %>"/>
|
|
|
|
</center>
|
|
|
|
<% end %>
|
|
|
|
<p><%= item.author %></p>
|
|
|
|
</a>
|
2018-12-20 21:32:09 +00:00
|
|
|
<p><%= translate(locale, "`x` subscribers", number_with_separator(item.subscriber_count)) %></p>
|
|
|
|
<p><%= translate(locale, "`x` videos", number_with_separator(item.video_count)) %></p>
|
2018-09-20 14:36:09 +00:00
|
|
|
<h5><%= item.description_html %></h5>
|
|
|
|
<% when SearchPlaylist %>
|
2018-09-29 04:12:35 +00:00
|
|
|
<% if item.id.starts_with? "RD" %>
|
2019-03-17 14:00:00 +00:00
|
|
|
<% url = "/mix?list=#{item.id}&continuation=#{item.thumbnail_id}" %>
|
2018-09-29 04:12:35 +00:00
|
|
|
<% else %>
|
|
|
|
<% url = "/playlist?list=#{item.id}" %>
|
|
|
|
<% end %>
|
|
|
|
<a style="width:100%;" href="<%= url %>">
|
2019-03-27 16:31:05 +00:00
|
|
|
<% if env.get("preferences").as(Preferences).thin_mode %>
|
2018-09-20 14:36:09 +00:00
|
|
|
<% else %>
|
2018-10-21 01:37:55 +00:00
|
|
|
<div class="thumbnail">
|
2019-03-17 14:00:00 +00:00
|
|
|
<img class="thumbnail" src="/vi/<%= item.thumbnail_id %>/mqdefault.jpg"/>
|
2018-11-19 23:34:33 +00:00
|
|
|
<p class="length"><%= number_with_separator(item.video_count) %> videos</p>
|
2018-10-21 01:37:55 +00:00
|
|
|
</div>
|
2018-09-20 14:36:09 +00:00
|
|
|
<% end %>
|
|
|
|
<p><%= item.title %></p>
|
|
|
|
</a>
|
|
|
|
<p>
|
|
|
|
<b><a style="width:100%;" href="/channel/<%= item.ucid %>"><%= item.author %></a></b>
|
|
|
|
</p>
|
2018-09-29 04:12:35 +00:00
|
|
|
<% when MixVideo %>
|
2018-10-07 03:22:50 +00:00
|
|
|
<a style="width:100%;" href="/watch?v=<%= item.id %>&list=<%= item.mixes[0] %>">
|
2019-03-27 16:31:05 +00:00
|
|
|
<% if env.get("preferences").as(Preferences).thin_mode %>
|
2018-09-29 04:12:35 +00:00
|
|
|
<% else %>
|
2018-10-21 01:37:55 +00:00
|
|
|
<div class="thumbnail">
|
|
|
|
<img class="thumbnail" src="/vi/<%= item.id %>/mqdefault.jpg"/>
|
2019-03-22 16:06:58 +00:00
|
|
|
<% if item.length_seconds != 0 %>
|
2018-10-21 01:37:55 +00:00
|
|
|
<p class="length"><%= recode_length_seconds(item.length_seconds) %></p>
|
2019-03-22 16:06:58 +00:00
|
|
|
<% end %>
|
2018-10-21 01:37:55 +00:00
|
|
|
</div>
|
2018-09-29 04:12:35 +00:00
|
|
|
<% end %>
|
|
|
|
<p><%= item.title %></p>
|
|
|
|
</a>
|
|
|
|
<p>
|
|
|
|
<b><a style="width:100%;" href="/channel/<%= item.ucid %>"><%= item.author %></a></b>
|
|
|
|
</p>
|
2018-10-21 01:37:55 +00:00
|
|
|
<% when PlaylistVideo %>
|
|
|
|
<a style="width:100%;" href="/watch?v=<%= item.id %>&list=<%= item.playlists[0] %>">
|
2019-03-27 16:31:05 +00:00
|
|
|
<% if env.get("preferences").as(Preferences).thin_mode %>
|
2018-10-21 01:37:55 +00:00
|
|
|
<% else %>
|
|
|
|
<div class="thumbnail">
|
|
|
|
<img class="thumbnail" src="/vi/<%= item.id %>/mqdefault.jpg"/>
|
2019-02-21 20:19:05 +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>
|
2019-03-22 16:06:58 +00:00
|
|
|
<% elsif item.length_seconds != 0 %>
|
2018-10-21 01:37:55 +00:00
|
|
|
<p class="length"><%= recode_length_seconds(item.length_seconds) %></p>
|
2019-02-21 20:19:05 +00:00
|
|
|
<% end %>
|
2018-10-21 01:37:55 +00:00
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
<p><%= item.title %></p>
|
|
|
|
</a>
|
|
|
|
<p>
|
|
|
|
<b><a style="width:100%;" href="/channel/<%= item.ucid %>"><%= item.author %></a></b>
|
|
|
|
</p>
|
2019-03-22 17:24:47 +00:00
|
|
|
|
|
|
|
<% 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 %>
|
2019-04-14 22:43:44 +00:00
|
|
|
<h5 class="pure-g">
|
|
|
|
<div class="pure-u-2-3"><%= translate(locale, "Shared `x` ago", recode_date(item.published, locale)) %></div>
|
|
|
|
<div class="pure-u-1-3" style="text-align: right">
|
|
|
|
<%= item.responds_to?(:views) ? translate(locale, "`x` views", number_to_short_text(item.views)) : "" %>
|
|
|
|
</div>
|
|
|
|
</h5>
|
2018-10-21 01:37:55 +00:00
|
|
|
<% end %>
|
|
|
|
<% else %>
|
2019-03-27 16:31:05 +00:00
|
|
|
<% if env.get("preferences").as(Preferences).thin_mode %>
|
2018-11-21 04:58:30 +00:00
|
|
|
<% else %>
|
2018-10-21 01:37:55 +00:00
|
|
|
<a style="width:100%;" href="/watch?v=<%= item.id %>">
|
|
|
|
<div class="thumbnail">
|
|
|
|
<img class="thumbnail" src="/vi/<%= item.id %>/mqdefault.jpg"/>
|
2018-11-20 04:06:59 +00:00
|
|
|
<% if env.get? "show_watched" %>
|
2019-04-16 04:23:40 +00:00
|
|
|
<form onsubmit="return false;" action="/watch_ajax?action_mark_watched=1&id=<%= item.id %>&referer=<%= env.get("current_page") %>" method="post">
|
2019-04-18 21:23:50 +00:00
|
|
|
<input type="hidden" name="csrf_token" value="<%= URI.escape(env.get?("csrf_token").try &.as(String) || "") %>">
|
2019-04-16 04:23:40 +00:00
|
|
|
<p class="watched">
|
|
|
|
<a onclick="mark_watched(this)" data-id="<%= item.id %>" href="#">
|
|
|
|
<button type="submit" style="all:unset">
|
|
|
|
<i onmouseenter='this.setAttribute("class", "icon ion-ios-eye-off")'
|
|
|
|
onmouseleave='this.setAttribute("class", "icon ion-ios-eye")'
|
|
|
|
class="icon ion-ios-eye">
|
|
|
|
</i>
|
|
|
|
</button>
|
|
|
|
</a>
|
|
|
|
</p>
|
|
|
|
</form>
|
2018-11-20 04:06:59 +00:00
|
|
|
<% end %>
|
2019-02-21 20:19:05 +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>
|
2019-03-22 16:06:58 +00:00
|
|
|
<% elsif item.length_seconds != 0 %>
|
2018-10-21 01:37:55 +00:00
|
|
|
<p class="length"><%= recode_length_seconds(item.length_seconds) %></p>
|
2019-02-21 20:19:05 +00:00
|
|
|
<% end %>
|
2018-10-21 01:37:55 +00:00
|
|
|
</div>
|
2018-09-20 14:36:09 +00:00
|
|
|
</a>
|
2018-11-21 04:58:30 +00:00
|
|
|
<% end %>
|
|
|
|
<p><a href="/watch?v=<%= item.id %>"><%= item.title %></a></p>
|
2018-09-20 14:36:09 +00:00
|
|
|
<p>
|
|
|
|
<b><a style="width:100%;" href="/channel/<%= item.ucid %>"><%= item.author %></a></b>
|
|
|
|
</p>
|
2019-03-22 17:24:47 +00:00
|
|
|
|
|
|
|
<% 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 %>
|
2019-04-14 22:43:44 +00:00
|
|
|
<h5 class="pure-g">
|
|
|
|
<div class="pure-u-2-3"><%= translate(locale, "Shared `x` ago", recode_date(item.published, locale)) %></div>
|
|
|
|
<div class="pure-u-1-3" style="text-align: right">
|
|
|
|
<%= item.responds_to?(:views) ? translate(locale, "`x` views", number_to_short_text(item.views)) : "" %>
|
|
|
|
</div>
|
|
|
|
</h5>
|
2018-09-20 14:36:09 +00:00
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
</div>
|