Code

Opened 5 years ago

Closed 3 years ago

#11695 closed Uncategorized (duplicate)

Modified change list default sort

Reported by: Rupe Owned by: nobody
Component: contrib.admin Version: master
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: UI/UX:

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 Rupe 5 years ago.
From \contrib\admin\views
admin_list.diff (592 bytes) - added by Rupe 5 years ago.
From \contrib\admin\templatetags
change_list.diff (630 bytes) - added by Rupe 5 years ago.
From \contrib\admin\templates\admin - Added the Reset button
change_list_sort.diff (8.4 KB) - added by Rupe 5 years ago.
with testing and docs
change_list_sort.2.diff (8.4 KB) - added by Rupe 5 years ago.
Trying upload without replace

Download all attachments as: .zip

Change History (14)

Changed 5 years ago by Rupe

From \contrib\admin\views

Changed 5 years ago by Rupe

From \contrib\admin\templatetags

Changed 5 years ago by Rupe

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

comment:1 Changed 5 years ago by Alex

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

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

comment:2 Changed 5 years ago by adamv

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

comment:3 Changed 5 years ago by dc

  • Component changed from Uncategorized to django.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 Changed 5 years ago by Rupe

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)

Changed 5 years ago by Rupe

with testing and docs

comment:5 Changed 5 years ago by Rupe

  • 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.

Changed 5 years ago by Rupe

Trying upload without replace

comment:6 Changed 5 years ago by Rupe

  • milestone set to 1.2

comment:7 Changed 4 years ago by jcd

  • Triage Stage changed from Unreviewed to Design decision needed

comment:8 Changed 4 years ago by ubernostrum

  • milestone 1.2 deleted

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

comment:9 Changed 3 years ago by julien

  • Resolution set to duplicate
  • Severity set to Normal
  • Status changed from new to closed
  • Type set to Uncategorized

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

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.