File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,10 +8,10 @@ class Stringer < Sinatra::Base
88 erb :index
99 end
1010
11- get "/read " do
11+ get "/archive " do
1212 @read_stories = StoryRepository . read . page ( params [ :page ] ) . per_page ( 15 )
1313
14- erb :read
14+ erb :archive
1515 end
1616
1717 post "/mark_as_read" do
Original file line number Diff line number Diff line change 1- <% content_for :title do %>
2- <% unless @all_stories.empty? %>
3- <%= "(#{@all_stories.count})" %>
4- <% end %>
5- <% end %>
6-
71< div id ="action-bar ">
82 <%= render_partial :feed_action_bar %>
93</ div >
104
11- <% unless @all_stories . empty? %>
5+ <% unless @read_stories . empty? %>
126< div id ="stories ">
137 < ul id ="story-list ">
14- <% @all_stories . each do |story | %>
8+ <% @read_stories . each do |story | %>
159 <%= render_partial :story , { story : story } %>
1610 <% end %>
1711 </ ul >
1812</ div >
13+ < div id ="pagination ">
14+ <% if @read_stories . previous_page %>
15+ < a href ="?page= <%= @read_stories . previous_page %> "> < i class ="icon-double-angle-left "> </ i > Previous</ a >
16+ <% end %>
17+ Page <%= @read_stories . current_page %> of <%= @read_stories . total_pages %>
18+ <% if @read_stories . next_page %>
19+ < a href ="?page= <%= @read_stories . next_page %> "> Next < i class ="icon-double-angle-right "> </ i > </ a >
20+ <% end %>
21+ </ div >
1922<% else %>
2023 < div id ="add-some-feeds ">
21- < p > Sorry, you don 't have any feeds in your archive yet!</ p >
24+ < p > Sorry, you haven 't read any stories yet!</ p >
2225 </ div >
2326<% end %>
Original file line number Diff line number Diff line change 1111 </ div >
1212
1313 < div class ="pull-right ">
14- < a class ="btn btn-primary " id ="feeds " href ="/read " title ="Read stories ">
14+ < a class ="btn btn-primary " id ="feeds " href ="/archive " title ="Archived stories ">
1515 < i class ="icon-time "> </ i >
1616 </ a >
1717 < a class ="btn btn-primary " id ="feeds " href ="/feeds " title ="<%= t ( 'partials.action_bar.view_feeds' ) %> ">
Original file line number Diff line number Diff line change 66 </ div >
77
88 < div class ="pull-right ">
9- < a class ="btn btn-primary " id ="feeds " href ="/read " title ="Read stories ">
9+ < a class ="btn btn-primary " id ="feeds " href ="/archive " title ="Archived stories ">
1010 < i class ="icon-time "> </ i >
1111 </ a >
1212 < a class ="btn btn-primary " id ="feeds " href ="/feeds " title ="<%= t ( 'partials.feed_action_bar.feeds' ) %> ">
You can’t perform that action at this time.
0 commit comments