Skip to content

Commit

Permalink
finish paginator
Browse files Browse the repository at this point in the history
  • Loading branch information
tiepvupsu committed Feb 12, 2017
1 parent f2b2e46 commit 7dda3ef
Showing 2 changed files with 20 additions and 9 deletions.
11 changes: 7 additions & 4 deletions _includes/pagination.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
<!-- <span style="text-align: center"> -->
{% if paginator.total_pages > 1 %}
<div class="pagination" style="align-content: center">

<div class="text-center" >
{% if paginator.previous_page %}
<a href="{{ paginator.previous_page_path | prepend: site.baseurl | replace: '//', '/' }}" class="mypagination" >&laquo; Newer</a>
{% else %}
<span class="mypagination">&laquo; Newer</span>
<span class="myhiddenpagination">&laquo; Newer</span>
{% endif %}

{% for page in (1..paginator.total_pages) %}
{% if page == paginator.page %}
<a href="#" class="mypagination myactive" style="background-color: #014B81; color: #fff; border: 1px solid; padding: 10px 15px 10px 15px ">{{ page }}</a>
<a href="#" class="mypagination mypaginationactive" style = "background-color: #204081;" >{{ page }}</a>
{% elsif page == 1 %}
<a href="{{ paginator.previous_page_path | prepend: site.baseurl | replace: '//', '/' }}" class="mypagination">{{ page }}</a>
{% else %}
@@ -19,7 +21,8 @@
{% if paginator.next_page %}
<a href="{{ paginator.next_page_path | prepend: site.baseurl | replace: '//', '/' }}" class="mypagination">Older &raquo;</a>
{% else %}
<span class="mypagination">Older &raquo;</span>
<span class="myhiddenpagination">Older &raquo;</span>
{% endif %}
</div>
{% endif %}
<!-- </span> -->
18 changes: 13 additions & 5 deletions css/mystyle.css
Original file line number Diff line number Diff line change
@@ -222,16 +222,24 @@ ul.nav li.active a {
}*/

/*.pagination{
background-color: #014B81;
background-color: #204081;
color: #fff;
}*/

.mypagination{
border: 1px solid #014B81;
padding: 10px 15px 10px 15px;
border: 1px solid #204081;
padding: 5px 15px 5px 15px;
}

.mypagination .myactive{
background-color: #014B81;
.mypaginationactive{
padding:5px 15px 5px 15px;
background-color: #204081;
/*background-color: red;*/
border: 1px solid #204081;
color: #fff;
}
.myhiddenpagination{
padding: 5px 15px 5px 15px;
border: 1px solid #fff;
color: #fff;
}

0 comments on commit 7dda3ef

Please sign in to comment.