forked from stringer-rss/stringer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstarred.erb
More file actions
53 lines (42 loc) · 1.38 KB
/
starred.erb
File metadata and controls
53 lines (42 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<div id="action-bar">
<%= render_partial :feed_action_bar %>
</div>
<% unless @starred_stories.empty? %>
<%= render_js :stories, { stories: @starred_stories } %>
<div id="stories">
<ul id="story-list">
</ul>
</div>
<div id="pagination">
<% if @starred_stories.previous_page %>
<a id="prev_page" href="?page=<%= @starred_stories.previous_page %>"><%= t('starred.previous') %></a>
<% end %>
<% if @starred_stories.total_pages > 1 %>
<%= @starred_stories.current_page %> <%= t('starred.of') %> <%= @starred_stories.total_pages %>
<% end %>
<% if @starred_stories.next_page %>
<a id="next_page" href="?page=<%= @starred_stories.next_page %>"><%= t('starred.next') %></a>
<% end %>
</div>
<script>
$(document).ready(function() {
var stripQuerystring = function(full_url) {
return full_url.split("?")[0];
};
Mousetrap.bind("left", function() {
var pageNumber = $("#prev_page").attr("href");
if (pageNumber)
location.href = stripQuerystring(location.href) + pageNumber;
});
Mousetrap.bind("right", function() {
var pageNumber = $("#next_page").attr("href");
if (pageNumber)
location.href = stripQuerystring(location.href) + pageNumber;
});
});
</script>
<% else %>
<div id="sorry">
<p><%= t('starred.sorry') %></p>
</div>
<% end %>