Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
dhp-venshop
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Hoang Phuc Do
dhp-venshop
Commits
0f75f6bb
Commit
0f75f6bb
authored
Jun 07, 2017
by
Hoang Phuc Do
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Customize pagination template
parent
7b3c43dc
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
95 additions
and
13 deletions
+95
-13
app/assets/stylesheets/main_style.css
+78
-0
app/views/kaminari/_first_page.html.erb
+2
-2
app/views/kaminari/_gap.html.erb
+3
-1
app/views/kaminari/_last_page.html.erb
+2
-2
app/views/kaminari/_next_page.html.erb
+2
-2
app/views/kaminari/_page.html.erb
+3
-3
app/views/kaminari/_paginator.html.erb
+3
-1
app/views/kaminari/_prev_page.html.erb
+2
-2
No files found.
app/assets/stylesheets/main_style.css
View file @
0f75f6bb
...
...
@@ -154,6 +154,84 @@ blockquote cite {
font-weight
:
400
;
}
/* ----------- 3.Elements -------------
--------------------------------------*/
/* Pagination & Pager */
.pagination
{
margin
:
0
0
50px
;
}
@media
(
min-width
:
768px
)
{
.pagination
{
margin-bottom
:
60px
;
}
}
.pagination
>
li
>
a
,
.pagination
>
li
>
span
{
border
:
1px
solid
transparent
;
border-radius
:
50%
!important
;
transition
:
all
.3s
;
padding
:
0px
3px
;
margin
:
0
6px
0
0
;
min-width
:
36px
;
height
:
36px
;
line-height
:
36px
;
color
:
#717179
;
font-weight
:
500
;
font-size
:
16px
;
text-transform
:
uppercase
;
background
:
transparent
;
text-align
:
center
;
}
@media
(
min-width
:
768px
)
{
.pagination
>
li
>
a
,
.pagination
>
li
>
span
{
margin-right
:
12px
;
}
}
.pagination
>
li
>
a
i
,
.pagination
>
li
>
span
i
{
line-height
:
inherit
;
font-weight
:
500
;
}
.pagination
>
li
>
a
:hover
,
.pagination
>
li
>
a
:focus
,
.pagination
>
li
>
span
:hover
,
.pagination
>
li
>
span
:focus
{
color
:
#dc9831
;
background-color
:
transparent
;
border-color
:
transparent
;
}
.pagination
>
li
:first-child:not
(
.active
)
>
a
,
.pagination
>
li
:first-child:not
(
.active
)
>
span
{
min-width
:
0
;
padding-left
:
0
;
}
.pagination
>
li
.dots
>
span
{
min-width
:
0
;
padding
:
0
;
}
.pagination
>
.active
>
a
,
.pagination
>
.active
>
span
{
color
:
#262634
;
border-color
:
#dc9831
;
}
.pagination
>
.active
>
a
,
.pagination
>
.active
>
a
:focus
,
.pagination
>
.active
>
a
:hover
,
.pagination
>
.active
>
span
,
.pagination
>
.active
>
span
:focus
,
.pagination
>
.active
>
span
:hover
{
background-color
:
transparent
;
color
:
#262634
;
border-color
:
#dc9831
;
}
/* ----------- 7.Category --------------
--------------------------------------*/
.category-header
{
...
...
app/views/kaminari/_first_page.html.erb
View file @
0f75f6bb
...
...
@@ -6,6 +6,6 @@
per_page: number of items to fetch per page
remote: data-remote
-%>
<
span
class="first">
<
li
class="first">
<%= link_to_unless current_page.first?, t('views.pagination.first').html_safe, url, remote: remote %>
</
span
>
</
li
>
app/views/kaminari/_gap.html.erb
View file @
0f75f6bb
...
...
@@ -5,4 +5,6 @@
per_page: number of items to fetch per page
remote: data-remote
-%>
<span class="page gap"><%= t('views.pagination.truncate').html_safe %>
</span>
<li class="dots">
<a href="#"><%= t('views.pagination.truncate').html_safe %>
</a>
</li>
app/views/kaminari/_last_page.html.erb
View file @
0f75f6bb
...
...
@@ -6,6 +6,6 @@
per_page: number of items to fetch per page
remote: data-remote
-%>
<
span
class="last">
<
li
class="last">
<%= link_to_unless current_page.last?, t('views.pagination.last').html_safe, url, remote: remote %>
</
span
>
</
li
>
app/views/kaminari/_next_page.html.erb
View file @
0f75f6bb
...
...
@@ -6,6 +6,6 @@
per_page: number of items to fetch per page
remote: data-remote
-%>
<
span
class="next">
<
li
class="next">
<%= link_to_unless current_page.last?, t('views.pagination.next').html_safe, url, rel: 'next', remote: remote %>
</
span
>
</
li
>
app/views/kaminari/_page.html.erb
View file @
0f75f6bb
...
...
@@ -7,6 +7,6 @@
per_page: number of items to fetch per page
remote: data-remote
-%>
<
span class="page<%= ' current
' if page.current? %>">
<%= link_to
_unless page.current?, page, url, {remote: remote, rel: page.re
l} %>
</
span
>
<
li class="page<%= ' active
' if page.current? %>">
<%= link_to
page, url, opts = {:remote => remote, :class => 'page-link', :rel => page.next? ? 'next' : page.prev? ? 'prev' : ni
l} %>
</
li
>
app/views/kaminari/_paginator.html.erb
View file @
0f75f6bb
...
...
@@ -7,7 +7,8 @@
paginator: the paginator that renders the pagination tags inside
-%>
<%= paginator.render do -%>
<nav class="pagination">
<nav aria-label="Page Navigation">
<ul class="pagination">
<%= first_page_tag unless current_page.first? %>
<%= prev_page_tag unless current_page.first? %>
<% each_page do |page| -%>
...
...
@@ -21,5 +22,6 @@
<%= next_page_tag unless current_page.last? %>
<%= last_page_tag unless current_page.last? %>
<% end %>
</ul>
</nav>
<% end -%>
app/views/kaminari/_prev_page.html.erb
View file @
0f75f6bb
...
...
@@ -6,6 +6,6 @@
per_page: number of items to fetch per page
remote: data-remote
-%>
<
span
class="prev">
<
li
class="prev">
<%= link_to_unless current_page.first?, t('views.pagination.previous').html_safe, url, rel: 'prev', remote: remote %>
</
span
>
</
li
>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment