mirror of
https://github.com/kremalicious/blog.git
synced 2024-11-22 18:00:06 +01:00
paginator fixes with a lot more ifs, needed to make it work on index and category pages
This commit is contained in:
parent
af5d8bb989
commit
03541f98db
@ -1,22 +1,51 @@
|
|||||||
<nav class="row pager pagination">
|
{% if paginator.total_pages > 1 %}
|
||||||
{% if paginator.previous_page %}
|
|
||||||
|
|
||||||
<p class="previous col2 alignleft">
|
<nav class="row paginator">
|
||||||
<i class="icon-arrow-left"></i>
|
|
||||||
{% if paginator.previous_page == 1 %}
|
{% if paginator.previous_page %}
|
||||||
<a href="/" rel="prev">Previous</a>
|
<p class="previous col2">
|
||||||
{% else %}
|
<i class="icon-arrow-left"></i>
|
||||||
<a href="page/{{ paginator.previous_page }}/" rel="prev">Previous</a>
|
|
||||||
{% endif %}
|
{% if page.category %}
|
||||||
|
|
||||||
|
{% if paginator.previous_page == 1 %}
|
||||||
|
<a href="/{{ page.category }}/" rel="prev">Previous</a>
|
||||||
|
{% else %}
|
||||||
|
<a href="/{{ page.category }}/page/{{ paginator.previous_page }}/" rel="prev">Previous</a>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% else %}
|
||||||
|
|
||||||
|
{% if paginator.previous_page == 1 %}
|
||||||
|
<a href="/" rel="prev">Previous</a>
|
||||||
|
{% else %}
|
||||||
|
<a href="/page/{{ paginator.previous_page }}/" rel="prev">Previous</a>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
</p>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<p class="col2 pagenumber textcenter">
|
||||||
|
<span class="page_number ">Page {{ paginator.page }} of {{ paginator.total_pages }}</span>
|
||||||
</p>
|
</p>
|
||||||
{% endif %}
|
|
||||||
<p class="col2 pagenumber textcenter">
|
{% if paginator.next_page %}
|
||||||
<span class="page_number ">Page {{ paginator.page }} of {{ paginator.total_pages }}</span>
|
<p class="next col2">
|
||||||
</p>
|
{% if page.category %}
|
||||||
{% if paginator.next_page %}
|
<a href="/{{ page.category }}/page/{{ paginator.next_page }}/" rel="next">Next</a>
|
||||||
<p class="next col2 alignright">
|
{% else %}
|
||||||
<a href="page/{{ paginator.next_page }}/" rel="next">Next</a>
|
<a href="/page/{{ paginator.next_page }}/" rel="next">Next</a>
|
||||||
<i class="icon-arrow-right"></i>
|
{% endif %}
|
||||||
</p>
|
<i class="icon-arrow-right"></i>
|
||||||
{% endif %}
|
</p>
|
||||||
</nav>
|
{% else %}
|
||||||
|
<p class="next col2">
|
||||||
|
The End
|
||||||
|
</p>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
</nav>
|
||||||
|
|
||||||
|
{% endif %}
|
@ -1,17 +1,3 @@
|
|||||||
/*
|
|
||||||
|
|
||||||
MAIN JS FOR KREMALICIOUS.COM
|
|
||||||
-----------------------------------------------------------------
|
|
||||||
|
|
||||||
Copyright (c) 2013 Matthias Kretschmann | http://mkretschmann.com
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
$(ASAP = function(){
|
$(ASAP = function(){
|
||||||
|
|
||||||
@ -164,7 +150,7 @@ var infiniteScroll = {
|
|||||||
$scrollContent.infinitescroll({
|
$scrollContent.infinitescroll({
|
||||||
itemSelector : items,
|
itemSelector : items,
|
||||||
nextSelector : '.next a',
|
nextSelector : '.next a',
|
||||||
navSelector : '.pagination',
|
navSelector : '.paginator',
|
||||||
binder : $scrollContent,
|
binder : $scrollContent,
|
||||||
behavior : 'krlc3',
|
behavior : 'krlc3',
|
||||||
}, function($scrollContent) {
|
}, function($scrollContent) {
|
||||||
|
@ -151,10 +151,10 @@
|
|||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Pager
|
// Paginator
|
||||||
//
|
//
|
||||||
|
|
||||||
.pager {
|
.paginator {
|
||||||
.clearfix;
|
.clearfix;
|
||||||
|
|
||||||
p { position: relative; }
|
p { position: relative; }
|
||||||
@ -166,20 +166,25 @@
|
|||||||
top: 0;
|
top: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.alignright { text-align: right; }
|
.next {
|
||||||
|
text-align: right;
|
||||||
|
float: right;
|
||||||
|
|
||||||
.alignleft i { margin-right: .5em; }
|
a { margin-right: 1.5em; }
|
||||||
|
|
||||||
.alignright i {
|
i {
|
||||||
margin-left: .5em;
|
margin-left: .5em;
|
||||||
left: auto;
|
left: auto;
|
||||||
right: 0;
|
right: 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.alignleft a { margin-left: 1.5em; }
|
.previous {
|
||||||
.alignright a { margin-right: 1.5em; }
|
float: left;
|
||||||
|
|
||||||
|
|
||||||
|
a { margin-left: 1.5em; }
|
||||||
|
i { margin-right: .5em; }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -190,6 +195,13 @@
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
float: none;
|
float: none;
|
||||||
margin-left: 0;
|
margin-left: 0;
|
||||||
|
|
||||||
|
a {
|
||||||
|
.btn;
|
||||||
|
.aligncenter;
|
||||||
|
padding-top: @line-height-computed/1.5;
|
||||||
|
padding-bottom: @line-height-computed/1.5;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.infiniteLoader .previous,
|
.infiniteLoader .previous,
|
||||||
@ -197,10 +209,3 @@
|
|||||||
.infiniteLoader i {
|
.infiniteLoader i {
|
||||||
.hide;
|
.hide;
|
||||||
}
|
}
|
||||||
|
|
||||||
.infiniteLoader .next a {
|
|
||||||
.btn;
|
|
||||||
.aligncenter;
|
|
||||||
padding-top: @line-height-computed/1.5;
|
|
||||||
padding-bottom: @line-height-computed/1.5;
|
|
||||||
}
|
|
16
package.json
16
package.json
@ -7,15 +7,15 @@
|
|||||||
"dependencies": {},
|
"dependencies": {},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"grunt": "~0.4.1",
|
"grunt": "~0.4.1",
|
||||||
"grunt-contrib-less": "~0.6.4",
|
|
||||||
"grunt-contrib-watch": "~0.5.3",
|
|
||||||
"grunt-contrib-cssmin": "~0.6.2",
|
|
||||||
"grunt-contrib-imagemin": "~0.4.0",
|
|
||||||
"grunt-combine-media-queries": "~1.0.8",
|
|
||||||
"grunt-contrib-uglify": "~0.2.2",
|
|
||||||
"grunt-jekyll": "~0.4.0",
|
|
||||||
"grunt-contrib-connect": "~0.5.0",
|
|
||||||
"grunt-contrib-clean": "~0.5.0",
|
"grunt-contrib-clean": "~0.5.0",
|
||||||
|
"grunt-contrib-connect": "~0.5.0",
|
||||||
|
"grunt-contrib-cssmin": "~0.6.2",
|
||||||
|
"grunt-contrib-less": "~0.6.4",
|
||||||
|
"grunt-contrib-imagemin": "~0.4.0",
|
||||||
|
"grunt-contrib-uglify": "~0.2.2",
|
||||||
|
"grunt-contrib-watch": "~0.5.3",
|
||||||
|
"grunt-combine-media-queries": "~1.0.8",
|
||||||
|
"grunt-jekyll": "~0.4.0",
|
||||||
"grunt-rsync": "~0.2.1"
|
"grunt-rsync": "~0.2.1"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
|
Loading…
Reference in New Issue
Block a user