2021-07-16 02:31:36 +05:30
|
|
|
<% title = HTML.escape(playlist.title) %>
|
|
|
|
<% author = HTML.escape(playlist.author) %>
|
|
|
|
|
2018-08-15 20:52:36 +05:30
|
|
|
<% content_for "header" do %>
|
2021-07-16 02:31:36 +05:30
|
|
|
<title><%= title %> - Invidious</title>
|
2019-03-07 12:56:30 +05:30
|
|
|
<link rel="alternate" type="application/rss+xml" title="RSS" href="/feed/playlist/<%= plid %>" />
|
2018-08-15 20:52:36 +05:30
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<div class="pure-g h-box">
|
|
|
|
<div class="pure-u-2-3">
|
2021-07-16 02:31:36 +05:30
|
|
|
<h3><%= title %></h3>
|
2019-08-06 05:19:13 +05:30
|
|
|
<% if playlist.is_a? InvidiousPlaylist %>
|
|
|
|
<b>
|
|
|
|
<% if playlist.author == user.try &.email %>
|
2021-08-30 20:28:24 +05:30
|
|
|
<a href="/feed/playlists"><%= author %></a> |
|
2019-08-06 05:19:13 +05:30
|
|
|
<% else %>
|
2021-07-16 02:31:36 +05:30
|
|
|
<%= author %> |
|
2019-08-06 05:19:13 +05:30
|
|
|
<% end %>
|
|
|
|
<%= translate(locale, "`x` videos", "#{playlist.video_count}") %> |
|
|
|
|
<%= translate(locale, "Updated `x` ago", recode_date(playlist.updated, locale)) %> |
|
|
|
|
<% case playlist.as(InvidiousPlaylist).privacy when %>
|
|
|
|
<% when PlaylistPrivacy::Public %>
|
|
|
|
<i class="icon ion-md-globe"></i> <%= translate(locale, "Public") %>
|
|
|
|
<% when PlaylistPrivacy::Unlisted %>
|
|
|
|
<i class="icon ion-ios-unlock"></i> <%= translate(locale, "Unlisted") %>
|
|
|
|
<% when PlaylistPrivacy::Private %>
|
|
|
|
<i class="icon ion-ios-lock"></i> <%= translate(locale, "Private") %>
|
|
|
|
<% end %>
|
|
|
|
</b>
|
|
|
|
<% else %>
|
|
|
|
<b>
|
2021-07-16 02:31:36 +05:30
|
|
|
<a href="/channel/<%= playlist.ucid %>"><%= author %></a> |
|
2019-08-06 05:19:13 +05:30
|
|
|
<%= translate(locale, "`x` videos", "#{playlist.video_count}") %> |
|
|
|
|
<%= translate(locale, "Updated `x` ago", recode_date(playlist.updated, locale)) %>
|
|
|
|
</b>
|
|
|
|
<% end %>
|
2021-07-16 02:31:36 +05:30
|
|
|
|
2019-08-06 05:19:13 +05:30
|
|
|
<% if !playlist.is_a? InvidiousPlaylist %>
|
|
|
|
<div class="pure-u-2-3">
|
|
|
|
<a href="https://www.youtube.com/playlist?list=<%= playlist.id %>">
|
|
|
|
<%= translate(locale, "View playlist on YouTube") %>
|
|
|
|
</a>
|
2021-03-29 12:18:45 +05:30
|
|
|
<span> | </span>
|
|
|
|
<a href="/redirect?referer=<%= env.get?("current_page") %>">
|
|
|
|
<%= translate(locale, "Switch Invidious Instance") %>
|
|
|
|
</a>
|
2019-08-06 05:19:13 +05:30
|
|
|
</div>
|
|
|
|
<% end %>
|
2018-08-15 20:52:36 +05:30
|
|
|
</div>
|
2019-05-02 06:33:39 +05:30
|
|
|
<div class="pure-u-1-3" style="text-align:right">
|
2018-09-18 04:43:24 +05:30
|
|
|
<h3>
|
2019-08-06 05:19:13 +05:30
|
|
|
<div class="pure-g user-field">
|
|
|
|
<% if playlist.is_a?(InvidiousPlaylist) && playlist.author == user.try &.email %>
|
|
|
|
<div class="pure-u-1-3"><a href="/edit_playlist?list=<%= plid %>"><i class="icon ion-md-create"></i></a></div>
|
|
|
|
<div class="pure-u-1-3"><a href="/delete_playlist?list=<%= plid %>"><i class="icon ion-md-trash"></i></a></div>
|
2020-05-17 16:58:00 +05:30
|
|
|
<% else %>
|
|
|
|
<% if PG_DB.query_one?("SELECT id FROM playlists WHERE id = $1", playlist.id, as: String).nil? %>
|
|
|
|
<div class="pure-u-1-3"><a href="/subscribe_playlist?list=<%= plid %>"><i class="icon ion-md-add"></i></a></div>
|
|
|
|
<% else %>
|
|
|
|
<div class="pure-u-1-3"><a href="/delete_playlist?list=<%= plid %>"><i class="icon ion-md-trash"></i></a></div>
|
|
|
|
<% end %>
|
2019-08-06 05:19:13 +05:30
|
|
|
<% end %>
|
|
|
|
<div class="pure-u-1-3"><a href="/feed/playlist/<%= plid %>"><i class="icon ion-logo-rss"></i></a></div>
|
|
|
|
</div>
|
2018-09-18 04:43:24 +05:30
|
|
|
</h3>
|
|
|
|
</div>
|
2018-08-15 20:52:36 +05:30
|
|
|
</div>
|
2019-05-02 06:33:39 +05:30
|
|
|
|
2018-08-15 20:52:36 +05:30
|
|
|
<div class="h-box">
|
2021-06-24 18:30:55 +05:30
|
|
|
<div id="descriptionWrapper">
|
|
|
|
<p><%= playlist.description_html %></p>
|
|
|
|
</div>
|
2018-08-15 20:52:36 +05:30
|
|
|
</div>
|
|
|
|
|
2019-08-06 05:19:13 +05:30
|
|
|
<% if playlist.is_a?(InvidiousPlaylist) && playlist.author == user.try &.email %>
|
|
|
|
<div class="h-box" style="text-align:right">
|
|
|
|
<h3>
|
|
|
|
<a href="/add_playlist_items?list=<%= plid %>"><i class="icon ion-md-add"></i></a>
|
|
|
|
</h3>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
|
2019-05-28 01:24:50 +05:30
|
|
|
<div class="h-box">
|
|
|
|
<hr>
|
|
|
|
</div>
|
|
|
|
|
2019-08-06 05:19:13 +05:30
|
|
|
<% if playlist.is_a?(InvidiousPlaylist) && playlist.author == user.try &.email %>
|
2020-03-16 03:16:08 +05:30
|
|
|
<script id="playlist_data" type="application/json">
|
2020-03-30 03:14:45 +05:30
|
|
|
<%=
|
2020-03-16 03:16:08 +05:30
|
|
|
{
|
2020-03-30 03:14:45 +05:30
|
|
|
"csrf_token" => URI.encode_www_form(env.get?("csrf_token").try &.as(String) || "")
|
|
|
|
}.to_pretty_json
|
|
|
|
%>
|
2019-08-06 05:19:13 +05:30
|
|
|
</script>
|
2020-04-08 00:04:40 +05:30
|
|
|
<script src="/js/playlist_widget.js?v=<%= ASSET_COMMIT %>"></script>
|
2019-08-06 05:19:13 +05:30
|
|
|
<% end %>
|
|
|
|
|
2018-08-15 20:52:36 +05:30
|
|
|
<div class="pure-g">
|
2021-07-16 02:31:36 +05:30
|
|
|
<% videos.each do |item| %>
|
|
|
|
<%= rendered "components/item" %>
|
|
|
|
<% end %>
|
2019-03-24 00:35:13 +05:30
|
|
|
</div>
|
2018-08-15 20:52:36 +05:30
|
|
|
|
|
|
|
<div class="pure-g h-box">
|
2019-04-15 03:34:52 +05:30
|
|
|
<div class="pure-u-1 pure-u-lg-1-5">
|
2019-06-09 02:34:55 +05:30
|
|
|
<% if page > 1 %>
|
2019-05-02 06:33:39 +05:30
|
|
|
<a href="/playlist?list=<%= playlist.id %>&page=<%= page - 1 %>">
|
|
|
|
<%= translate(locale, "Previous page") %>
|
|
|
|
</a>
|
|
|
|
<% end %>
|
2018-08-15 20:52:36 +05:30
|
|
|
</div>
|
2019-04-15 03:34:52 +05:30
|
|
|
<div class="pure-u-1 pure-u-lg-3-5"></div>
|
2019-05-02 06:33:39 +05:30
|
|
|
<div class="pure-u-1 pure-u-lg-1-5" style="text-align:right">
|
2021-03-23 07:55:47 +05:30
|
|
|
<% if page_count != 1 && page < page_count %>
|
2019-05-02 06:33:39 +05:30
|
|
|
<a href="/playlist?list=<%= playlist.id %>&page=<%= page + 1 %>">
|
|
|
|
<%= translate(locale, "Next page") %>
|
|
|
|
</a>
|
|
|
|
<% end %>
|
2018-08-15 20:52:36 +05:30
|
|
|
</div>
|
2018-08-17 21:34:38 +05:30
|
|
|
</div>
|