File tree Expand file tree Collapse file tree 8 files changed +31
-18
lines changed
Expand file tree Collapse file tree 8 files changed +31
-18
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ class Stringer < Sinatra::Base
99 end
1010
1111 get "/archive" do
12- @read_stories = StoryRepository . read . page ( params [ :page ] ) . per_page ( 15 )
12+ @read_stories = StoryRepository . read ( params [ :page ] )
1313
1414 erb :archive
1515 end
Original file line number Diff line number Diff line change @@ -507,7 +507,14 @@ li.blank {
507507}
508508
509509# zen a {
510- color : # F67100 ;
510+ color : # F59745 ;
511+ font-size : 14px ;
512+ border-bottom : 1px dotted # F59745 ;
513+ text-decoration : none;
514+ }
515+
516+ # zen .view-all {
517+ line-height : 18px ;
511518}
512519
513520# pagination {
@@ -516,4 +523,7 @@ li.blank {
516523
517524# pagination a {
518525 color : # F67100 ;
526+ border-bottom : 1px dotted # F59745 ;
527+ text-decoration : none;
528+ margin : 0 7px ;
519529}
Original file line number Diff line number Diff line change @@ -27,8 +27,8 @@ def self.unread
2727 Story . where ( is_read : false ) . order ( "published desc" )
2828 end
2929
30- def self . read
31- Story . where ( is_read : true ) . order ( "published desc" )
30+ def self . read ( page = 1 )
31+ Story . where ( is_read : true ) . order ( "published desc" ) . page ( page ) . per_page ( 15 )
3232 end
3333
3434 def self . extract_content ( entry )
Original file line number Diff line number Diff line change 1010 <% end %>
1111 </ ul >
1212</ div >
13+
1314< div id ="pagination ">
1415 <% if @read_stories . previous_page %>
15- < a href ="?page= <%= @read_stories . previous_page %> "> < i class ="icon-double-angle-left "> </ i > <%= t ( 'archive.previous' ) %> </ a >
16+ < a href ="?page= <%= @read_stories . previous_page %> "> <%= t ( 'archive.previous' ) %> </ a >
17+ <% end %>
18+
19+ <% if @read_stories . total_pages > 1 %>
20+ <%= @read_stories . current_page %> <%= t ( 'archive.of' ) %> <%= @read_stories . total_pages %>
1621 <% end %>
17- Page <%= @read_stories . current_page %> of <%= @read_stories . total_pages %>
22+
1823 <% if @read_stories . next_page %>
19- < a href ="?page= <%= @read_stories . next_page %> "> <%= t ( 'archive.next' ) %> < i class =" icon-double-angle-right " > </ i > </ a >
24+ < a href ="?page= <%= @read_stories . next_page %> "> <%= t ( 'archive.next' ) %> </ a >
2025 <% end %>
2126</ div >
2227<% else %>
Original file line number Diff line number Diff line change 55 < small >
66 <%= t ( 'partials.zen.gtfo' ) %> < span id ="gtfo "> <%= t ( 'partials.zen.go_make' ) %> </ span > .
77 </ small >
8- < small >
9- < p > <%= t ( 'partials.zen.procrastinate' ) %> < a href =" /archive " > <%= t ( 'partials.zen.archive' ) %> </ a > . </ p >
10- </ small >
8+ </ p >
9+ < p class =" view-all " >
10+ < a href =" /archive " > <%= t ( 'partials.zen.archive' ) %> </ a >
1111 </ p >
1212</ div >
Original file line number Diff line number Diff line change 4343 r : " Refresh"
4444 zen :
4545 zero : " You’ve reached RSS Zero™"
46- gtfo : ' Now stop reading blogs and'
47- go_make : ' go make something'
48- procrastinate : " You can keep procrastinating by viewing your"
49- archive : " archive"
46+ gtfo : " Now stop reading blogs and"
47+ go_make : " go make something"
48+ archive : " view all items"
5049 sessions :
5150 new :
5251 title : ' Stringer speaks'
8786 archive :
8887 next : " Next"
8988 previous : " Previous"
89+ of : " of"
9090 sorry : " Sorry, you haven't read any stories yet!"
Original file line number Diff line number Diff line change 4545 zero : " You’ve reached RSS Zero™"
4646 gtfo : ' Ahora deja de leer blogs y'
4747 go_make : ' ve a hacer algo'
48- procrastinate : " You can keep procrastinating by checking out your"
49- archive : " archive"
48+ archive : " view all items"
5049 sessions :
5150 new :
5251 title : ' Stringer que habla'
Original file line number Diff line number Diff line change 4545 zero : " Você alcançou RSS Zero™"
4646 gtfo : ' Agora pare de ler blogs e'
4747 go_make : ' vá fazer algo'
48- procrastinate : " You can keep procrastinating by checking out your"
49- archive : " archive"
48+ archive : " view all items"
5049 sessions :
5150 new :
5251 title : ' Stringer fala'
You can’t perform that action at this time.
0 commit comments