Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Merge pull request #14 from nigelbabu/left-right-mixup
Browse files Browse the repository at this point in the history
Actually fix left and right
  • Loading branch information
tofumatt committed Aug 30, 2011
2 parents 41213a1 + 0e442f4 commit 6a07946
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions apps/search/templates/search/search.html
Expand Up @@ -69,23 +69,23 @@ <h2>

{% if page and page.has_other_pages() %}
<div class="pager">
{% with link_txt = _('&laquo; Older Messages')|safe %}
{% with link_txt = _('&laquo; Older Messages')|safe %}
{% if page.has_next() and page.number < settings.SEARCH_MAX_PAGES %}
<a href="{{ search_url(
defaults=form.data, extra={'page': page.next_page_number()})
}}" class="newer">{{ link_txt }}</a>
}}" class="older">{{ link_txt }}</a>
{% else %}
<span class="newer inactive">{{ link_txt }}</span>
<span class="older inactive">{{ link_txt }}</span>
{% endif %}
{% endwith %}

{% with link_txt = _('Newer Messages &raquo;')|safe %}
{% if page.has_previous() %}
<a href="{{ search_url(
defaults=form.data, extra={'page': page.previous_page_number()})
}}" class="older">{{ link_txt }}</a>
}}" class="newer">{{ link_txt }}</a>
{% else %}
<span class="older inactive">{{ link_txt }}</span>
<span class="newer inactive">{{ link_txt }}</span>
{% endif %}
{% endwith %}
</div>
Expand Down
8 changes: 4 additions & 4 deletions apps/search/tests/test_views.py
Expand Up @@ -58,16 +58,16 @@ def compare_2_pages(self, page1, page2):
doc = pq(r.content)
self.assertNotEqual(firstmsg, doc('.message').eq(1).text())

def test_next_page(self):
def test_older_page(self):
r = search_request()
assert pq(r.content)('.pager a.newer')
assert pq(r.content)('.pager a.older')

def test_no_next_page(self):
def test_no_older_page(self):
"""Once we're on page 50, let's not show an older messages link."""
for page in (50, 51, 100, 200):
r = search_request(page=page)
doc = pq(r.content)
assert not doc('.pager a.next')
assert not doc('.pager a.older')

def test_page_0(self):
"""In bug 620296, page 0 led to an AssertionError."""
Expand Down
4 changes: 2 additions & 2 deletions media/css/input.css
Expand Up @@ -657,13 +657,13 @@ background-color: #B6BCC0;
padding: 15px 0 10px 0;
}
.pager .newer {
float: left;
float: right;
}
.html-rtl .pager .newer {
float: left;
}
.pager .older {
float: right;
float: left;
}
.html-rtl .pager .older {
float: none;
Expand Down

0 comments on commit 6a07946

Please sign in to comment.