Comments (8)
I know this is old, but I thought it might help other people. Let me know if you would like me to submit PR to the Readme.
It contains Bootstrap classes.
<% if (paginate.hasPreviousPages || paginate.hasNextPages(pageCount) ) { %>
<div class="navigation well-sm" id="pagination">
<ul class="pager">
<% if (paginate.hasPreviousPages) { %>
<li class="previous">
<a href="<%= paginate.href(true) %>">
<i class="fa fa-arrow-circle-left"></i>
Previous
</a>
</li>
<% } %>
<% if (pages) { %>
<% pages.forEach(function(page, i){ %>
<a class="btn btn-default" href="<%= page.url %>"><%= page.number %></a>
<% }); %>
<% } %>
<% if (paginate.hasNextPages(pageCount)) { %>
<li class="next">
<a href="<%= paginate.href() %>">
Next
<i class="fa fa-arrow-circle-right"></i>
</a>
</li>
<% } %>
</ul>
</div>
<% } %>
from express-paginate.
This is how I implemented it:
<a href="<%= paginate.href(true) %>">Prev</a>
<% for(var i = 0; i < pages.length;i++) { %>
<% var page = pages[i]; %>
<a href="<%= page.url %>" class="<%= paginate.page == page.number ? 'active' : ''%>"><%= page.number %></a>
<% } %>
<a href="<%= paginate.href() %>">Next</a>
from express-paginate.
I'll create a PR later (in 2 weeks), am on holiday now ;)
from express-paginate.
@ultimate-tester can you submit a PR to the Readme with this example you crafted?
from express-paginate.
@ultimate-tester
Nice.
What about sorting? Is there is a way to port it to ejs?
from express-paginate.
Great - please submit PR @ultimate-tester , tyvm!
from express-paginate.
Great it working for me !
from express-paginate.
PR welcome
from express-paginate.
Related Issues (20)
- implement "promises bluebird" HOT 2
- Something wrong with paginate.getArrayPages HOT 8
- Error: express-paginate: `limit` is not a number >= 0 HOT 1
- Documentation example errors HOT 2
- Update documentation HOT 1
- Page URLs wrong after the first page HOT 1
- Change references from jade to pug HOT 3
- How would I go about using this with mustache HOT 1
- How to send "skip" parameter? HOT 2
- Paginate only show first page HOT 2
- RethinkDB HOT 2
- how to set first and last link? HOT 2
- Handlebars paginate.href true gives weird value HOT 1
- Incompatibility with express 5 HOT 3
- Check integer HOT 1
- Wrong Offset
- Allow specifying minLimit
- @expressjs/triagers lack ability to add labels in express-paginate HOT 2
- how sort is working
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from express-paginate.