forked from stringer-rss/stringer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharchive.erb
More file actions
52 lines (42 loc) · 1.35 KB
/
archive.erb
File metadata and controls
52 lines (42 loc) · 1.35 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
<div id="action-bar">
<%= render_partial :feed_action_bar %>
</div>
<% unless @read_stories.empty? %>
<%= render_js :stories, { stories: @read_stories } %>
<div id="stories">
<ul id="story-list">
</ul>
</div>
<div id="pagination">
<% if @read_stories.previous_page %>
<a id="prev_page" href="?page=<%= @read_stories.previous_page %>"><%= t('archive.previous') %></a>
<% end %>
<% if @read_stories.total_pages > 1 %>
<%= @read_stories.current_page %> <%= t('archive.of') %> <%= @read_stories.total_pages %>
<% end %>
<% if @read_stories.next_page %>
<a id="next_page" href="?page=<%= @read_stories.next_page %>"><%= t('archive.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('archive.sorry') %></p>
</div>
<% end %>