Skip to content

Commit

Permalink
- Fix sort link URLs on manage_main (fixes #748)
Browse files Browse the repository at this point in the history
  • Loading branch information
dataflake committed Feb 7, 2020
1 parent bef06a5 commit 07e0478
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
3 changes: 3 additions & 0 deletions CHANGES.rst
Expand Up @@ -10,6 +10,9 @@ https://zope.readthedocs.io/en/2.13/CHANGES.html
4.1.4 (unreleased)
------------------

- Fix sort link URLs on ``manage_main``
(`#748 <https://github.com/zopefoundation/Zope/issues/748>`_)

- Fix longstanding test bug by forcing the page template engine.
Many tests in ``Products.PageTemplates`` used the old Zope page template
engine because the correct one was not registered during setup.
Expand Down
27 changes: 15 additions & 12 deletions src/OFS/zpt/main.zpt
Expand Up @@ -10,7 +10,9 @@
skey python:request.get('skey',default_sort);
rkey python:request.get('rkey','asc');
rkey_alt python:'desc' if rkey=='asc' else 'asc';
rkey_alt_up rkey_alt/upper;
obs python: here.manage_get_sortedObjects(sortkey = skey, revkey = rkey);
my_url string:${context/absolute_url}/manage_main;
"
tal:attributes="action string:${request/URL1}/">

Expand All @@ -24,19 +26,19 @@
<th scope="col" class="zmi-object-type">
<a title="Sort Ascending by Meta-Type"
href="?skey=meta_type&rkey=asc"
tal:attributes="title python:'Sort %s by Meta-Type'%( rkey_alt.upper() );
href python:'?skey=meta_type&rkey=%s'%( rkey_alt );
class python:request.get('skey',None)=='meta_type' and 'zmi-sort_key' or None;
tal:attributes="title string:Sort ${rkey_alt_up} by meta-type;
href string:${my_url}?skey=meta_type&rkey=${rkey_alt};
class python:skey=='meta_type' and 'zmi-sort_key' or None;
">
<i class="fa fa-sort"></i>
</a>
</th>
<th scope="col" class="zmi-object-id">
<a title="Sort Ascending by Name"
href="?skey=id&rkey=asc"
tal:attributes="title python:'Sort %s by Name'%( rkey_alt.upper() );
href python:'?skey=id&rkey=%s'%( rkey_alt );
class python:request.get('skey',None)=='id' and 'zmi-sort_key' or None;
tal:attributes="title string:Sort ${rkey_alt_up} by name;
href string:${my_url}?skey=id&rkey=${rkey_alt};
class python:skey=='id' and 'zmi-sort_key' or None;
">
Name
<i class="fa fa-sort"></i>
Expand All @@ -47,9 +49,9 @@
<th scope="col" class="zmi-object-size text-right hidden-xs">
<a title="Sort Ascending by File-Size"
href="?skey=get_size&rkey=asc"
tal:attributes="title python:'Sort %s by File-Size'%( rkey_alt.upper() );
href python:'?skey=get_size&rkey=%s'%( rkey_alt );
class python:request.get('skey',None)=='get_size' and 'zmi-sort_key' or None;
tal:attributes="title string:Sort ${rkey_alt_up} by size;
href string:${my_url}?skey=get_size&rkey=${rkey_alt};
class python:skey=='get_size' and 'zmi-sort_key' or None;
">
Size
<i class="fa fa-sort"></i>
Expand All @@ -58,9 +60,9 @@
<th scope="col" class="zmi-object-date text-right hidden-xs">
<a title="Sort Ascending by Modification Date"
href="?skey=_p_mtime&rkey=asc"
tal:attributes="title python:'Sort %s by Modification Date'%( rkey_alt.upper() );
href python:'?skey=_p_mtime&rkey=%s'%( rkey_alt );
class python:request.get('skey',None)=='_p_mtime' and 'zmi-sort_key' or None;
tal:attributes="title string:Sort ${rkey_alt_up} by modification date;
href string:${my_url}?skey=_p_mtime&rkey=${rkey_alt};
class python:skey=='_p_mtime' and 'zmi-sort_key' or None;
">
Last Modified
<i class="fa fa-sort"></i>
Expand Down Expand Up @@ -153,6 +155,7 @@
</div>
</tal:empty>
</form>

</main>


Expand Down

0 comments on commit 07e0478

Please sign in to comment.