mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2023-06-08.git
synced 2024-08-15 00:53:38 +00:00
HTML: Use the new pagination component for history/subscriptions
This commit is contained in:
parent
30aa2e976d
commit
26da1b4cb6
3 changed files with 23 additions and 34 deletions
|
@ -106,6 +106,10 @@ module Invidious::Routes::Feeds
|
||||||
end
|
end
|
||||||
env.set "user", user
|
env.set "user", user
|
||||||
|
|
||||||
|
# Used for pagination links
|
||||||
|
base_url = "/feed/subscriptions"
|
||||||
|
base_url += "?max_results=#{max_results}" if env.params.query.has_key?("max_results")
|
||||||
|
|
||||||
templated "feeds/subscriptions"
|
templated "feeds/subscriptions"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -133,6 +137,10 @@ module Invidious::Routes::Feeds
|
||||||
end
|
end
|
||||||
watched ||= [] of String
|
watched ||= [] of String
|
||||||
|
|
||||||
|
# Used for pagination links
|
||||||
|
base_url = "/feed/history"
|
||||||
|
base_url += "?max_results=#{max_results}" if env.params.query.has_key?("max_results")
|
||||||
|
|
||||||
templated "feeds/history"
|
templated "feeds/history"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -50,20 +50,10 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="pure-g h-box">
|
<%=
|
||||||
<div class="pure-u-1 pure-u-lg-1-5">
|
IV::Frontend::Pagination.nav_numeric(locale,
|
||||||
<% if page > 1 %>
|
base_url: base_url,
|
||||||
<a href="/feed/history?page=<%= page - 1 %><% if env.params.query["max_results"]? %>&max_results=<%= max_results %><% end %>">
|
current_page: page,
|
||||||
<%= translate(locale, "Previous page") %>
|
show_next: (watched.size >= max_results)
|
||||||
</a>
|
)
|
||||||
<% end %>
|
%>
|
||||||
</div>
|
|
||||||
<div class="pure-u-1 pure-u-lg-3-5"></div>
|
|
||||||
<div class="pure-u-1 pure-u-lg-1-5" style="text-align:right">
|
|
||||||
<% if watched.size >= max_results %>
|
|
||||||
<a href="/feed/history?page=<%= page + 1 %><% if env.params.query["max_results"]? %>&max_results=<%= max_results %><% end %>">
|
|
||||||
<%= translate(locale, "Next page") %>
|
|
||||||
</a>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
|
@ -56,6 +56,7 @@
|
||||||
</script>
|
</script>
|
||||||
<script src="/js/watched_widget.js"></script>
|
<script src="/js/watched_widget.js"></script>
|
||||||
|
|
||||||
|
|
||||||
<div class="pure-g">
|
<div class="pure-g">
|
||||||
<% videos.each do |item| %>
|
<% videos.each do |item| %>
|
||||||
<%= rendered "components/item" %>
|
<%= rendered "components/item" %>
|
||||||
|
@ -64,20 +65,10 @@
|
||||||
|
|
||||||
<script src="/js/watched_indicator.js"></script>
|
<script src="/js/watched_indicator.js"></script>
|
||||||
|
|
||||||
<div class="pure-g h-box">
|
<%=
|
||||||
<div class="pure-u-1 pure-u-lg-1-5">
|
IV::Frontend::Pagination.nav_numeric(locale,
|
||||||
<% if page > 1 %>
|
base_url: base_url,
|
||||||
<a href="/feed/subscriptions?page=<%= page - 1 %><% if env.params.query["max_results"]? %>&max_results=<%= max_results %><% end %>">
|
current_page: page,
|
||||||
<%= translate(locale, "Previous page") %>
|
show_next: ((videos.size + notifications.size) == max_results)
|
||||||
</a>
|
)
|
||||||
<% end %>
|
%>
|
||||||
</div>
|
|
||||||
<div class="pure-u-1 pure-u-lg-3-5"></div>
|
|
||||||
<div class="pure-u-1 pure-u-lg-1-5" style="text-align:right">
|
|
||||||
<% if (videos.size + notifications.size) == max_results %>
|
|
||||||
<a href="/feed/subscriptions?page=<%= page + 1 %><% if env.params.query["max_results"]? %>&max_results=<%= max_results %><% end %>">
|
|
||||||
<%= translate(locale, "Next page") %>
|
|
||||||
</a>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
Loading…
Reference in a new issue