Skip to content
This repository has been archived by the owner on Oct 21, 2022. It is now read-only.

Commit

Permalink
Initial import
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcclell committed Mar 10, 2012
0 parents commit 253e96b
Show file tree
Hide file tree
Showing 9 changed files with 461 additions and 0 deletions.
20 changes: 20 additions & 0 deletions LICENSE
@@ -0,0 +1,20 @@
The MIT License (MIT)
Copyright (c) 2012 Jason McClellan

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.
2 changes: 2 additions & 0 deletions MANIFEST.in
@@ -0,0 +1,2 @@
include LICENSE README.markdown
recursive-include bootstrap-pagination *.py *.html
7 changes: 7 additions & 0 deletions README.markdown
@@ -0,0 +1,7 @@
# Django Bootstrap Pagination

This application serves to make using Twitter's Bootstrap Pagination styles
work seamlessly with Django Page objects.

# Usage

Empty file.
12 changes: 12 additions & 0 deletions bootstrap-pagination/templates/bootstrap-pagination/pager.html
@@ -0,0 +1,12 @@
<ul class="pager">
{% if page.has_previous %}
<li{% if not centered %} class="previous"{% endif %}>
<a title="Previous Page" href="{{ previous_page_url|default:"#" }}">{{previous_label}}</a>
</li>
{% endif %}
{% if page.has_next %}
<li{% if not centered %} class="next"{% endif %}>
<a title="Next Page" href="{{ next_page_url|default:"#" }}">{{next_label}}</a>
</li>
{% endif %}
</ul>
@@ -0,0 +1,36 @@
{% load bootstrap_pagination %}
<div class="pagination {% if alignment == "center" %}pagination-centered{% endif %}{% if alignment == "right" %}pagination-right{% endif %} {% block extra_classes %}{% endblock %}">
<ul>
{% if show_first_last %}
<li {% if not page.has_previous %}class="disabled"{% endif %}>
<a title="First Page" href="{{ first_page_url|default:"#" }}">{{first_label}}</a>
</li>
{% endif %}
{% if show_prev_next %}
<li {% if not page.has_previous %}class="disabled"{% endif %}>
<a title="Previous Page" href="{{ previous_page_url|default:"#" }}">{{ previous_label }}</a>
</li>
{% endif %}
{% for pagenum, url in page_urls.items %}
{% if page.number == pagenum %}
<li class="active">
<a title="Current Page" href="#">{{ pagenum }}</a>
</li>
{% else %}
<li>
<a title="Page {{ pagenum }} of {{ page.paginator.num_pages }}" href="{{ url }}">{{ pagenum }}</a>
</li>
{% endif %}
{% endfor %}
{% if show_prev_next %}
<li {% if not page.has_next %}class="disabled"{% endif %}>
<a title="Next Page" href="{{ next_page_url|default:"#" }}">{{ next_label }}</a>
</li>
{% endif %}
{% if show_first_last %}
<li {% if not page.has_next %}class="disabled"{% endif %}>
<a title="Last Page" href="{{ last_page_url|default:"#" }}">{{last_label}}</a>
</li>
{% endif %}
</ul>
</div>
Empty file.

0 comments on commit 253e96b

Please sign in to comment.