Skip to content

Commit

Permalink
Remove endless pagination. Fixes #26
Browse files Browse the repository at this point in the history
  • Loading branch information
nlhkabu committed Jun 13, 2015
1 parent e1f8ccf commit 69d0e56
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 37 deletions.
13 changes: 0 additions & 13 deletions bdd/features/steps/view_dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,16 +93,3 @@ def impl(context):
def impl(context):
assert context.browser.is_text_present('Log an abuse report against',
wait_time=DEFAULT_WAIT)


# Unique to Scenario: Many users prompt pagination
@given('there are more than ten users')
def impl(context):
factory.create_batch(UserFactory, 5)

@then('I see that the list of members is paginated')
def impl(context):
assert context.browser.is_element_present_by_css('.pagination')



6 changes: 0 additions & 6 deletions bdd/features/view_dashboard.feature
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,3 @@ Feature: View Dashboard
When I visit the "dashboard" page
And I click on "Report Abuse" on another member's card
Then I am taken to a new page to report that member

Scenario: Many users prompt pagination
Given I am "a logged in user"
And there are more than ten users
When I visit the "dashboard" page
Then I see that the list of members is paginated
8 changes: 1 addition & 7 deletions connect/discover/templates/discover/list.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% extends "discover/dashboard.html" %}
{% load endless gravatar i18n staticfiles %}
{% load gravatar i18n staticfiles %}

{% block page_title %}{% trans "Dashboard" %}{% endblock %}

Expand Down Expand Up @@ -70,7 +70,6 @@
</div>
<div class="twelve columns omega">
{% if listed_users %}
{% paginate listed_users %}
{% for user in listed_users %}
<!-- start card -->
<div class="user-card {% if user != logged_in_user %} not-me{% endif %}">
Expand Down Expand Up @@ -159,11 +158,6 @@ <h3><a href="#" class="toggle-user-expand">
</div>
<!-- end card-->
{% endfor %}

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

{% else %}
<div class="no-results">
<h4>{% trans "Sorry!" %}</h4>
Expand Down
11 changes: 0 additions & 11 deletions connect/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ def INSTALLED_APPS(self):
'django.contrib.humanize',
'django_behave',
'django_gravatar',
'endless_pagination',
'parsley',
'connect',
'connect.config',
Expand Down Expand Up @@ -143,16 +142,6 @@ def MIDDLEWARE_CLASSES(self):

# --- BEGIN CONFIGURATIONS FOR THIRD-PARTY APPS --- #

# ENDLESS PAGINATION
from django.conf.global_settings import TEMPLATE_CONTEXT_PROCESSORS

TEMPLATE_CONTEXT_PROCESSORS += (
'django.core.context_processors.request',
)

ENDLESS_PAGINATION_PREVIOUS_LABEL = '<i class="fa fa-chevron-left"></i>'
ENDLESS_PAGINATION_NEXT_LABEL = '<i class="fa fa-chevron-right"></i>'

# GRAVATAR
# See: https://github.com/twaddington/django-gravatar/#configuring
GRAVATAR_DEFAULT_IMAGE = 'retro'
Expand Down

2 comments on commit 69d0e56

@adrienbrunet
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about the .pagination css? Also, we may wish to limit the queryset to the first 10 or 20 people and warn the user about the limit. I thought that's what we wanted before having geolocalized magic filter stuff. (I had a PR with all that changes you made 😆 I was just to slow to submit it! Sorry, rugby match tonight! )

@nlhkabu
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Adrien - I totally forgot about the CSS. I've now updated the CSS to remove the pagination rules. I also removed endless-pagination from setup.py as I missed this the first time around.

I have not limited the query to 20 results - I think we need more discussion around this. I have repoened #26 to facilitate this :)

Please sign in to comment.