Skip to content

Commit

Permalink
Merge pull request #17 from vikingco/CP-125/clean-up-dependencies
Browse files Browse the repository at this point in the history
Remove dependencies
  • Loading branch information
Duologic committed Feb 19, 2016
2 parents 0936621 + b1df0cc commit 3f12c8a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 50 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name = "django-ajax-utilities",
version = '1.2.0',
version = '1.2.1',
url = 'https://github.com/citylive/django-ajax-utilities',
license = 'BSD',
description = "Pagination, xhr and tabbing utilities for the Django framework.",
Expand Down
41 changes: 0 additions & 41 deletions src/django_ajax/preprocessable_template_tags.py

This file was deleted.

16 changes: 8 additions & 8 deletions src/django_ajax/templatetags/pagination.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from django.template.loader import render_to_string
from django.utils.http import urlencode
from django.utils.translation import ugettext as _
from django_template_tags.template_callable import template_callable
from mvne.templatetags.call import template_callable

register = template.Library()

Expand Down Expand Up @@ -88,7 +88,7 @@ def render(self, context):
context.update(self._bootstrap_style_context(
page.number,
page.paginator.num_pages))

return render_to_string('pagination/bootstrap-style.html', context)
else:
raise Exception('Unknown pagination style: %s' % style)
Expand All @@ -113,7 +113,7 @@ def _querystring(self, page, page_number):
query_string = '%s&%s' % (query_string, urlencode({k:v2}))

return query_string

def _digg_style_context(self, number, num_pages, determine_leading_and_trailing_range=True):
"""
Additional context to be passed to the pagination template:
Expand Down Expand Up @@ -155,10 +155,10 @@ def _digg_style_context(self, number, num_pages, determine_leading_and_trailing_
# 1 2 3 [4] 5 ... 99 100
# If it were not for this adjustment, both cases would result in the
# first output, regardless of the padding value.


if main_range[0] <= tail+margin:
leading = []
leading = []
main_range = [1, max(body, min(number+padding, main_range[1]))]
main_range[0] = 1
else:
Expand Down Expand Up @@ -196,10 +196,10 @@ def _digg_style_context(self, number, num_pages, determine_leading_and_trailing_
'page_range': reduce(lambda x, y: x+((x and y) and [False])+y,
[leading, main_range, trailing]),
}

def _bootstrap_style_context(self, number, num_pages):
"""
The context to be passed to the bootstrap pagination template:
"""

return self._digg_style_context(number, num_pages, False)

0 comments on commit 3f12c8a

Please sign in to comment.