Opened 15 years ago

Closed 14 years ago

#11695 closed Uncategorized (duplicate)

Modified change list default sort

Reported by: Joshua Russo Owned by: nobody
Component: contrib.admin Version: dev
Severity: Normal Keywords: change list default sort model-sort
Cc: Triage Stage: Design decision needed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

I've tweaked the change list sort handling so that by default it uses the full list of sort columns defined in the model. It sets all of the
headers as unselected and then behaves as it currently does if someone selects a header column to sort by. I've also modified the template to
add a Reset sort (or conditionally Reset sort and filter) button to bring everything back to the original state.

Attachments (5)

main.diff (1.7 KB ) - added by Joshua Russo 15 years ago.
From \contrib\admin\views
admin_list.diff (592 bytes ) - added by Joshua Russo 15 years ago.
From \contrib\admin\templatetags
change_list.diff (630 bytes ) - added by Joshua Russo 15 years ago.
From \contrib\admin\templates\admin - Added the Reset button
change_list_sort.diff (8.4 KB ) - added by Joshua Russo 15 years ago.
with testing and docs
change_list_sort.2.diff (8.4 KB ) - added by Joshua Russo 15 years ago.
Trying upload without replace

Download all attachments as: .zip

Change History (14)

by Joshua Russo, 15 years ago

Attachment: main.diff added

From \contrib\admin\views

by Joshua Russo, 15 years ago

Attachment: admin_list.diff added

From \contrib\admin\templatetags

by Joshua Russo, 15 years ago

Attachment: change_list.diff added

From \contrib\admin\templates\admin - Added the Reset button

comment:1 by Alex Gaynor, 15 years ago

Please provide one diff from the root of the django tree.

comment:2 by Adam Vandenberg, 15 years ago

"if cl.order_field != None..." should be "if cl.order_field is not None..."

comment:3 by dc, 15 years ago

Component: Uncategorizeddjango.contrib.admin
Has patch: set
Needs documentation: set
Needs tests: set
Patch needs improvement: set

Better have two separate messages for i18n than creating message from chunks

<li><a href=".">
    {% if cl.has_filters or cl.date_hierarchy %}
        {% trans 'Reset sorting and filters' %}
    {% else %}
        {% trans 'Reset sorting' %}
    {% endif %}
</a></li>

comment:4 by Joshua Russo, 15 years ago

I've updated the code as suggested in the comments provided. (Diff done from root, IF statement fixed, and Trans split into 2 full phases)

by Joshua Russo, 15 years ago

Attachment: change_list_sort.diff added

with testing and docs

comment:5 by Joshua Russo, 15 years ago

Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset

Well I have all of the regression testing and docs added, but my upload doesn't seem to be working. It reports the correct file size but doesn't display the file when I click the file name after upload.

I also found and fixed a small bug in another of the admin_views tests.

by Joshua Russo, 15 years ago

Attachment: change_list_sort.2.diff added

Trying upload without replace

comment:6 by Joshua Russo, 15 years ago

milestone: 1.2

comment:7 by Cliff Dyer, 15 years ago

Triage Stage: UnreviewedDesign decision needed

comment:8 by James Bennett, 15 years ago

milestone: 1.2

1.2 is feature-frozen, moving this feature request off the milestone.

comment:9 by Julien Phalip, 14 years ago

Resolution: duplicate
Severity: Normal
Status: newclosed
Type: Uncategorized

Closing as a duplicate of #11868 which, although newer, suggests a better approach UI-wise.

Note: See TracTickets for help on using tickets.
Back to Top