Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modernize pagination markup to HTML5 and switches deprecated listingB… #15

Merged
merged 4 commits into from
Jan 21, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,28 @@
Changelog
=========

1.1 (unreleased)
----------------

.. warning:: Upgrade Warning!
If you customized the batchnavigation.pt file or use specific CSS styles for it, you might have to update them to reflect the new HTML structure.

New:

- Refactor batchnavigation HTML layout to use nav/ul/li elements instead of div/span.
[davilima6]

- Switches deprecated ``listingBar`` CSS class to ``pagination``.
[davilima6]

- Make ellipses stylable and provide more CSS hooks to pagination markup.
[davilima6]

Fixes:

- *add item here*


1.0.8 (unreleased)
------------------

Expand Down
151 changes: 76 additions & 75 deletions plone/batching/batchnavigation.pt
Original file line number Diff line number Diff line change
Expand Up @@ -3,90 +3,91 @@
condition="batch"
metal:define-macro="navigation">

<div class="pagination listingBar"
i18n:domain="plone"
tal:condition="batch/multiple_pages">
<nav class="pagination"
i18n:domain="plone"
tal:condition="batch/multiple_pages">

<tal:comment replace="nothing">
<!-- Link to previous page -->
</tal:comment>
<a class="previous"
tal:condition="batch/has_previous"
tal:attributes="href python:view.make_link(batch.previouspage)">
&laquo;
<span i18n:translate="batch_previous_x_items" tal:omit-tag="">
Previous
<span i18n:name="number" tal:omit-tag="" tal:content="batch/pagesize">n</span>
items
</span>
</a>
<ul>

<tal:comment replace="nothing">
<!-- Link to next page -->
</tal:comment>
<a class="next"
tal:condition="batch/has_next"
tal:attributes="href python:view.make_link(batch.nextpage)">
<span i18n:translate="batch_next_x_items" tal:omit-tag="">
Next
<span i18n:name="number" tal:omit-tag="" tal:content="batch/next_item_count">n</span>
items
</span>
&raquo;
</a>
<tal:comment replace="nothing">
<!-- Previous page -->
</tal:comment>
<li class="previous" tal:condition="batch/has_previous">
<a tal:attributes="href python:view.make_link(batch.previouspage)">
&laquo;
<span i18n:translate="batch_previous_x_items" tal:omit-tag="">
Previous <span i18n:name="number" tal:content="batch/pagesize" tal:omit-tag="">n</span> items
</span>
</a>
</li>

<tal:comment replace="nothing">
<!-- First page -->
</tal:comment>
<a class="first"
tal:condition="batch/show_link_to_first"
tal:attributes="href python:view.make_link(1)">1</a>
<tal:comment replace="nothing">
<!-- First page -->
</tal:comment>
<li class="first" tal:condition="batch/show_link_to_first">
<a tal:attributes="href python:view.make_link(1)">1</a>
</li>

<tal:comment replace="nothing">
<!-- Ellipsis after first item -->
</tal:comment>
<span class="disabled"
tal:condition="batch/second_page_not_in_navlist">
...
</span>
<tal:comment replace="nothing">
<!-- Ellipsis after first item -->
</tal:comment>
<li class="disabled" tal:condition="batch/second_page_not_in_navlist">
<span>...</span>
</li>

<tal:comment replace="nothing">
<!-- Pagelist with links to previous pages for quick navigation -->
</tal:comment>
<a tal:repeat="pagenumber batch/previous_pages"
tal:content="pagenumber"
tal:attributes="href python:view.make_link(pagenumber)" />
<tal:comment replace="nothing">
<!-- Pagelist with links to previous pages for quick navigation -->
</tal:comment>
<li tal:repeat="pagenumber batch/previous_pages">
<a tal:content="pagenumber"
tal:attributes="href python:view.make_link(pagenumber)" />
</li>

<tal:comment replace="nothing">
<!-- Current page -->
</tal:comment>
<span class="current"
tal:condition="batch/navlist"
tal:content="batch/pagenumber" />
<tal:comment replace="nothing">
<!-- Active page -->
</tal:comment>
<li class="active" tal:condition="batch/navlist">
<span tal:content="batch/pagenumber" />
</li>

<tal:comment replace="nothing">
<!-- Pagelist with links to next pages for quick navigation -->
</tal:comment>
<a tal:repeat="pagenumber batch/next_pages"
tal:content="pagenumber"
tal:attributes="href python:view.make_link(pagenumber)" />
<tal:comment replace="nothing">
<!-- Pagelist with links to next pages for quick navigation -->
</tal:comment>
<li tal:repeat="pagenumber batch/next_pages">
<a tal:content="pagenumber"
tal:attributes="href python:view.make_link(pagenumber)" />
</li>

<tal:comment replace="nothing">
<!-- Ellipsis before last item -->
</tal:comment>
<span class="disabled"
tal:condition="batch/before_last_page_not_in_navlist">
...
</span>
<tal:comment replace="nothing">
<!-- Ellipsis before last item -->
</tal:comment>
<li class="disabled" tal:condition="batch/before_last_page_not_in_navlist">
<span>...</span>
</li>

<tal:comment replace="nothing">
<!-- Link to last -->
</tal:comment>
<a class="last"
tal:condition="batch/show_link_to_last"
tal:attributes="href python:view.make_link(batch.lastpage)"
tal:content="batch/lastpage" />
<tal:comment replace="nothing">
<!-- Last page -->
</tal:comment>
<li class="last" tal:condition="batch/show_link_to_last">
<a tal:attributes="href python:view.make_link(batch.lastpage)"
tal:content="batch/lastpage" />
</li>

</div>
<tal:comment replace="nothing">
<!-- Next page -->
</tal:comment>
<li class="next" tal:condition="batch/has_next">
<a tal:attributes="href python:view.make_link(batch.nextpage)">
<span i18n:translate="batch_next_x_items" tal:omit-tag="">
Next
<span i18n:name="number" tal:omit-tag="" tal:content="batch/next_item_count">n</span>
items
</span>
&raquo;
</a>
</li>
</ul>

</nav>

</tal:batchnavigation>
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from setuptools import find_packages
from setuptools import setup

version = '1.0.8.dev0'
version = '1.1.dev0'

setup(
name='plone.batching',
Expand Down