Giter VIP home page Giter VIP logo

Comments (8)

ramanieto avatar ramanieto commented on April 28, 2024 4

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 &nbsp;
            <i class="fa fa-arrow-circle-right"></i>
          </a>  
        </li>
      <% } %>  
      </ul>      
    </div>
  <% } %>

from express-paginate.

ultimate-tester avatar ultimate-tester commented on April 28, 2024 2

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.

ultimate-tester avatar ultimate-tester commented on April 28, 2024 1

I'll create a PR later (in 2 weeks), am on holiday now ;)

from express-paginate.

niftylettuce avatar niftylettuce commented on April 28, 2024

@ultimate-tester can you submit a PR to the Readme with this example you crafted?

from express-paginate.

TenzenIga avatar TenzenIga commented on April 28, 2024

@ultimate-tester
Nice.
What about sorting? Is there is a way to port it to ejs?

from express-paginate.

niftylettuce avatar niftylettuce commented on April 28, 2024

Great - please submit PR @ultimate-tester , tyvm!

from express-paginate.

yogeshfgiet avatar yogeshfgiet commented on April 28, 2024

Great it working for me !

from express-paginate.

niftylettuce avatar niftylettuce commented on April 28, 2024

PR welcome

from express-paginate.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.