-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
-Add _blocks.html.erb view that renders page blocks; -Add _paginator.html.erb view that renders the pagination panel for the current page of a given Model.
- Loading branch information
Showing
2 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<%= | ||
content_tag :li, class: page_item_css do | ||
link_to page, bets_path(page: page), class: 'page-link' | ||
end | ||
%> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<div class="paginator"> | ||
<ol class="pagination"> | ||
<%= | ||
content_tag :li, class: previous_link_css do | ||
link_to bets_path(page: '1'), class: 'page-link' do | ||
content_tag :i, nil, class: 'fa fa-angle-double-left' | ||
end | ||
end | ||
%> | ||
<%= | ||
content_tag :li, class: previous_link_css do | ||
link_to bets_path(page: current_page - 1), class: 'page-link' do | ||
content_tag :i, nil, class: 'fa fa-angle-left' | ||
end | ||
end | ||
%> | ||
|
||
<% blocks.each do |page|%> | ||
<%= render 'shared/blocks', page: page, | ||
page_item_css: page_item_css(page, | ||
current_page) %> | ||
<% end %> | ||
|
||
<%= | ||
content_tag :li, class: next_link_css do | ||
link_to bets_path(page: current_page + 1), class: 'page-link' do | ||
content_tag :i, nil, class: 'fa fa-angle-right' | ||
end | ||
end | ||
%> | ||
<%= | ||
content_tag :li, class: next_link_css do | ||
link_to bets_path(page: last_page), class: 'page-link' do | ||
content_tag :i, nil, class: 'fa fa-angle-double-right' | ||
end | ||
end | ||
%> | ||
</ol> | ||
</div> |