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 %>">
|
|
|
|
<% if env.get?("user") && env.get("user").as(User).preferences.thin_mode %>
|
|
|
|
<% else %>
|
|
|
|
<center>
|
|
|
|
<img style="width:56.25%;" src="/ggpht<%= URI.parse(item.author_thumbnail).full_path %>"/>
|
|
|
|
</center>
|
|
|
|
<% end %>
|
|
|
|
<p><%= item.author %></p>
|
|
|
|
</a>
|
|
|
|
<p><%= number_with_separator(item.subscriber_count) %> subscribers</p>
|
2018-11-14 01:16:52 +00:00
|
|
|
<p><%= number_with_separator(item.video_count) %> videos</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" %>
|
|
|
|
<% url = "/mix?list=#{item.id}&continuation=#{item.videos[0]?.try &.id}" %>
|
|
|
|
<% else %>
|
|
|
|
<% url = "/playlist?list=#{item.id}" %>
|
|
|
|
<% end %>
|
|
|
|
<a style="width:100%;" href="<%= url %>">
|
2018-09-20 14:36:09 +00:00
|
|
|
<% if env.get?("user") && env.get("user").as(User).preferences.thin_mode %>
|
|
|
|
<% else %>
|
2018-10-21 01:37:55 +00:00
|
|
|
<div class="thumbnail">
|
|
|
|
<img class="thumbnail" src="/vi/<%= item.videos[0]?.try &.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] %>">
|
2018-09-29 04:12:35 +00:00
|
|
|
<% if env.get?("user") && env.get("user").as(User).preferences.thin_mode %>
|
|
|
|
<% else %>
|
2018-10-21 01:37:55 +00:00
|
|
|
<div class="thumbnail">
|
|
|
|
<img class="thumbnail" src="/vi/<%= item.id %>/mqdefault.jpg"/>
|
|
|
|
<p class="length"><%= recode_length_seconds(item.length_seconds) %></p>
|
|
|
|
</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] %>">
|
|
|
|
<% if env.get?("user") && env.get("user").as(User).preferences.thin_mode %>
|
|
|
|
<% else %>
|
|
|
|
<div class="thumbnail">
|
|
|
|
<img class="thumbnail" src="/vi/<%= item.id %>/mqdefault.jpg"/>
|
|
|
|
<p class="length"><%= recode_length_seconds(item.length_seconds) %></p>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
<p><%= item.title %></p>
|
|
|
|
</a>
|
|
|
|
<% if item.responds_to?(:live_now) && item.live_now %>
|
|
|
|
<p>LIVE</p>
|
2018-09-20 14:36:09 +00:00
|
|
|
<% end %>
|
2018-10-21 01:37:55 +00:00
|
|
|
<p>
|
|
|
|
<b><a style="width:100%;" href="/channel/<%= item.ucid %>"><%= item.author %></a></b>
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<% if Time.now - item.published > 1.minute %>
|
|
|
|
<h5>Shared <%= recode_date(item.published) %> ago</h5>
|
|
|
|
<% end %>
|
|
|
|
<% else %>
|
|
|
|
<a style="width:100%;" href="/watch?v=<%= item.id %>">
|
2018-09-20 14:36:09 +00:00
|
|
|
<% if env.get?("user") && env.get("user").as(User).preferences.thin_mode %>
|
|
|
|
<% else %>
|
2018-10-21 01:37:55 +00:00
|
|
|
<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" %>
|
|
|
|
<p class="watched">
|
|
|
|
<a onclick="mark_watched(this)"
|
|
|
|
data-id="<%= item.id %>"
|
|
|
|
onmouseenter='this["href"]="javascript:void(0)"'
|
|
|
|
href="/mark_watched?id=<%= item.id %>"'
|
|
|
|
>
|
|
|
|
<i onmouseenter='this.setAttribute("class", "icon ion-ios-eye-off")'
|
|
|
|
onmouseleave='this.setAttribute("class", "icon ion-ios-eye")'
|
|
|
|
class="icon ion-ios-eye"
|
|
|
|
>
|
|
|
|
</i>
|
|
|
|
</a>
|
|
|
|
</p>
|
|
|
|
<% end %>
|
2018-10-21 01:37:55 +00:00
|
|
|
<p class="length"><%= recode_length_seconds(item.length_seconds) %></p>
|
|
|
|
</div>
|
2018-09-20 14:36:09 +00:00
|
|
|
<% end %>
|
|
|
|
<p><%= item.title %></p>
|
|
|
|
</a>
|
|
|
|
<% if item.responds_to?(:live_now) && item.live_now %>
|
|
|
|
<p>LIVE</p>
|
|
|
|
<% end %>
|
|
|
|
<p>
|
|
|
|
<b><a style="width:100%;" href="/channel/<%= item.ucid %>"><%= item.author %></a></b>
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<% if Time.now - item.published > 1.minute %>
|
|
|
|
<h5>Shared <%= recode_date(item.published) %> ago</h5>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
</div>
|