Git Product home page Git Product logo

django-endless-pagination's People

Contributors

artscoop avatar bertrandbordage avatar frankban avatar iepathos avatar jezdez avatar jnns avatar mozillazg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

django-endless-pagination's Issues

Endless pagination loading entire page on second page after scroll

Hi,

i am using twitter style django end less pagination on my website.
On the homepage, the endless pagination works fine and no problems there.
But on the different category page, it is loading the entire page on the second page just with second page items. I am clueless why it is happening only on the category pages and not on the homepage.
It looks like request.is_ajax() is not working when i scroll to second page and reloading the entire page.

Can anyone help?

Thanks

Dealing with URL containing space characters

Reported by yiipeng, Jul 28, 2012

What steps will reproduce the problem?

  1. Set up Digg-style AJAX pagination
  2. Create URL containing space. For example, http://localhost/myurl/foo bar/end.
  3. When clicking on each page link, URL requested from web server becomes "/myurl/foo?page=2&querystring_key=page"

What is the expected output? What do you see instead?

The expected URL is "/myurl/foo bar/end?page=2&querystring_key=page"

What version of the product are you using? On what operating system?

Django version 1.2.1
django-endless-pagination 1.1
jQuery 1.6.3 http://ajax.googleapis.com/ajax/libs/jquery/1.6.3/jquery.js
Firefox 14.0.1
Windows 7

Please provide any additional information below.

The problem lies in endless.js at line: page_template.load($(this).attr("href"), data);

If I change to page_template.load(encodeURI($(this).attr("href")), data); it can work. The URL string becomes "/myurl/foo%20bar/end?page=2&querystring_key=page" However, I don't know if this is the correct fix.

I think the proper way may be creating URL in URI format. I looked a little bit into Django code. My URL with space is created using HttpResponseRedirect. Within HttpResponseRedirect, the url is encoded into URI format using iri_to_uri(). I also tried to encode it before constructing HttpResponseRedirect. It didn't change any. The URL string showing up in Firefox still contains spaces, instead of %20.

Twitter pagination - tables

Does endless pagination support pagination for tables? It generates the code outside of the tables.

{% include page_template %}
</tbody>

{% load endless %}
{% paginate object_list %}

{% for obj in object_list %}
<tr>
</tr>
{% endfor %}

{% show_more %}

Problem with using django variables as url

This works,
{% paginate 10 comment_list with "/firsat/comments/objectid/135/" %}
but, not this,
{% paginate 10 comment_list with "/firsat/comments/objectid/{{ firsatObject.id }}/" %}

I have to pass the current objects comments to the view so have to construct url dinamically,
thx

Disabling endless-pagination programmatically via Javascript

I haven't found a way to do this, so it would be great to have a way to programmatically disable endless pagination on a certain element.

In my use-case, I have several things that use endless-pagination on the same page, but since it's a tabbed interface, they're not all visible at the same time.

Since I'm using automatic pagination on scroll, I want to disable this feature for the paginated elements that are currently not visible.

Is there a way to do this?
Thanks!

endless pagination, multiple requests

I could use endless pagination but the thing I want is more complicated.
www.zergnet.com has an example of it.
There are 5 columns and everytime 15 records loaded and they are distrubuted among columns, I cant seem to be able to do that with django-endless-pagination.
Since I return a template which iterates all the records,

{% include "article/util/single-article-thumbnail-new.html" %}
{% include "article/util/single-article-thumbnail-new.html" %}
{% include "article/util/single-article-thumbnail-new.html" %}
{% include "article/util/single-article-thumbnail-new.html" %}
{% include "article/util/single-article-thumbnail-new.html" %}

I need this template to iterate over 3 item and next iteration should be without those 3. This might be established with multiple requests or something? If my template was like https://dpaste.de/IrSD this one, there would be no problem at all, but this one more complicated.
thx

Paginate starting from last page

Hi,
I can't find a way to make the pagination default to the last page.
The {% paginate items starting from n %} is good but does not allow a simple way to get the last page.

A hint on this ?
Thanks.

python 2.6 does not support keywords arguments as unicode

match.groupdict() in endless_pagination/templatetags/endless.py returns keys as unicode and python 2.6 does not support keywords arguments as unicode.

this line:
kwargs = match.groupdict()
should be like this(it converts key to str):
kwargs = dict([(str(key), value) for key, value in match.groupdict().items()])

pip install version 1.1 instead of 2.0

Hi,

When i tried to install via pip, installs the incorrect version.

$pip install django-endless-pagination
Downloading/unpacking django-endless-pagination
  Downloading django-endless-pagination-1.1.tar.gz
  Running setup.py egg_info for package django-endless-pagination

Installing collected packages: django-endless-pagination
  Running setup.py install for django-endless-pagination

Successfully installed django-endless-pagination
Cleaning up...

Why {% show_pages %} is not printing anything?

Pagination is working if I go to some/url?page=X but {% show_pages %} is not doing anything and I am not getting any errors.

I have {% load endless %} and everything as the docs.

Any help would be appreciated.

Javascript refactoring

Must:

  • use $.endlessPaginate syntax;
  • handle onScroll as an option;
  • add ability to attach callbacks;
  • use selectors to decide what elements need to be paginated, and how;
  • maintain backward compatibility.

Check if the pagination is required ala "is_paginated"

Im trying to get all this markup

{% paginate object_list %}
{% for marathon in object_list %}
    <p>
  <h4><a class="link" href="{% url marathon_detail marathon.pk %}">{{ marathon.name }}</a></h4>
        <i>{{ marathon.date }}</i>
        <br/>
        {{ marathon.details }}
    </p>
    {% if not forloop.last %} <hr /> {% endif %}
{% empty %}
    <p>{% trans "No marathons found to display" %}</p>
{% endfor %}

<div class="pagination">
  <ul>
    {% show_pages %}
  </ul>
</div>

to display only if there are pages to be shown

{% if is_paginated %}
<div class="pagination">
  <ul>
    {% show_pages %}
  </ul>
</div>
{% endif %}

any ideas?

thanks in advance

Endless pagination loads entire page contents on scroll

Thank you for the great app!

The initial view of the page works fine, but once scrolled a the entire page contents are loaded into the endless_page_template div.

The relevant parts of my view are below. I'm using a CreateView because I have the comments form on the same page as the paginated comments.

class MyIndex(CreateView):
    form_class = CommentForm
    template_name = 'my/index.html'
    page_template = 'my/comments.html'

    def get_context_data(self, **kwargs):
        context = super(MyIndex, self).get_context_data(**kwargs)
        context.update({
            'comments': Comment.objects.order_by('-id').filter(parent=None),
            'page_template': self.page_template,
        })

        return context

The relevant parts of my/index.html template (main template)

<script src="/static/endless_pagination/js/endless-pagination.js"></script>
<script type="text/javascript">
    $.endlessPaginate({
        paginateOnScroll: true
    });
</script>

<div class="endless_page_template">
    {% include page_template %}
</div>

The relevant parts of my/comments.html (page_template)

{% load endless %}

{% paginate comments %}
{% for comment in comments %}
    <span class="lead">{{ comment.name }}</span>
    {{ comment.message}}

    {% if not forloop.last %}
        <hr />
    {% endif %}
{% endfor %}
<br />

<div class="row-fluid">
    <div class="span8 offset2 pagination-centered">
        {% show_more %}
    </div>
</div>

custom template

hello all, i am using django-endless-pagination

i want to use bootstrap's pagination style, but i can not found how to define html tag

Improve doc to make clear that the request must be provided in the context of custom template tags.

jjgionta wrote:

What steps will reproduce the problem?

  1. create custom template tag for rendering objects
  2. add pagination to template tags
  3. reload page

What is the expected output? What do you see instead?
expected page to render. Key Error for context["request"]

What version of the product are you using? On what operating system?

Please provide any additional information below.
Issue is the endless_pagination seems to rely on context being present and context is not passes to custom template tags.

Since sending the context to registered templates is manually required, simply making this requirement clear in the getting started tutorials would bring clarity to any issues.

passing custom template to show_more template tag

Is there a way to pass custom template to show_more? I basically need it to use ajax pagination on a <table> (adding more and more rows). The things is that show_more tag renders <div> that cannot be inside table. I overrided the template on my project level, which I don't really like because I would like to have an option "how to render show_more".

First and last pages as arrows in the page list callable

Each page list callable should be able to return "first" and "last" as placeholders to the first and last pages of digg pagination, represented as arrows.

This change includes:

  • a change to the PageList model: 2 new methods (first_as_arrow and last_as_arrow)
  • 3 new settings (DISPLAY_FIRST_LAST_ARROW defaulting to False, FIRST_LABEL and LAST_LABEL)
  • a change to the default values of PREVIOUS_LABEL and NEXT_LABEL in settings (they must be single brackets)
  • documentation update

Other jquery plugins gets disabled?

I have in my template_list_page.html; < a href="{% url 'news_detail' news_id=news.id news_title=news.title|slugify %}" class="titled" title="{{ news.title|striptags }}">{{ news.title|truncatechars:50 }}< /a>

The class="titled" is for a tooltip plugin and let's say I have five posts then I press "Show more" and it show five more posts. The first five posts will have the tooltip working as it should but it doesn't work on the other fives.

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.