invidious-experimenting/src/invidious/views/history.ecr

74 lines
3.2 KiB
Plaintext
Raw Normal View History

<% content_for "header" do %>
2018-12-21 03:02:09 +05:30
<title><%= translate(locale, "History") %> - Invidious</title>
<% end %>
<div class="pure-g h-box">
2019-04-10 04:11:25 +05:30
<div class="pure-u-1-3">
2018-12-21 03:02:09 +05:30
<h3><%= translate(locale, "`x` videos", %(<span id="count">#{user.watched.size}</span>)) %></h3>
</div>
2019-05-02 06:33:39 +05:30
<div class="pure-u-1-3" style="text-align:center">
2019-04-10 04:11:25 +05:30
<h3>
<a href="/feed/subscriptions"><%= translate(locale, "`x` subscriptions", %(<span id="count">#{user.subscriptions.size}</span>)) %></a>
</h3>
</div>
2019-05-02 06:33:39 +05:30
<div class="pure-u-1-3" style="text-align:right">
<h3>
2018-12-21 03:02:09 +05:30
<a href="/clear_watch_history"><%= translate(locale, "Clear watch history") %></a>
</h3>
</div>
</div>
<script id="watched_data" type="application/json">
{
"csrf_token": "<%= URI.encode_www_form(env.get?("csrf_token").try &.as(String) || "") %>"
2019-05-16 00:00:30 +05:30
}
</script>
<script src="/js/watched_widget.js"></script>
<div class="pure-g">
2019-08-06 05:25:23 +05:30
<% watched.each_slice(4) do |slice| %>
<% slice.each do |item| %>
<div class="pure-u-1 pure-u-md-1-4">
<div class="h-box">
<a style="width:100%" href="/watch?v=<%= item %>">
<% if !env.get("preferences").as(Preferences).thin_mode %>
<div class="thumbnail">
<img class="thumbnail" src="/vi/<%= item %>/mqdefault.jpg"/>
<form data-onsubmit="return_false" action="/watch_ajax?action_mark_unwatched=1&id=<%= item %>&referer=<%= env.get("current_page") %>" method="post">
<input type="hidden" name="csrf_token" value="<%= URI.encode_www_form(env.get?("csrf_token").try &.as(String) || "") %>">
2019-08-06 05:25:23 +05:30
<p class="watched">
<a data-onclick="mark_unwatched" data-id="<%= item %>" href="javascript:void(0)">
2019-08-06 05:25:23 +05:30
<button type="submit" style="all:unset">
<i class="icon ion-md-trash"></i>
</button>
</a>
</p>
</form>
</div>
<p></p>
<% end %>
</a>
</div>
2019-05-02 06:33:39 +05:30
</div>
2019-08-06 05:25:23 +05:30
<% end %>
<% end %>
</div>
<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 %>
<a href="/feed/history?page=<%= page - 1 %><% if env.params.query["max_results"]? %>&max_results=<%= max_results %><% end %>">
2019-05-02 06:33:39 +05:30
<%= translate(locale, "Previous page") %>
</a>
<% end %>
</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">
2019-06-09 02:34:55 +05:30
<% if watched.size >= max_results %>
<a href="/feed/history?page=<%= page + 1 %><% if env.params.query["max_results"]? %>&max_results=<%= max_results %><% end %>">
2019-05-02 06:33:39 +05:30
<%= translate(locale, "Next page") %>
</a>
<% end %>
</div>
</div>