          for j, ot in ordering_field_columns.items():
              if j == i: # Same column
                  # We want clicking on this header to bring the ordering to the
                  # front
                  o_list.insert(0, make_qs_param(new_order_type, j))
              else:
                  o_list.append(make_qs_param(ot, j))
  
          if i not in ordering_field_columns:
              o_list.insert(0, make_qs_param(new_order_type, i))
 
</s> remove                 o_list.append(make_qs_param(ot, j))
 </s> add                 param = make_qs_param(ot, j)
                o_list_primary.append(param)
                o_list_toggle.append(param)
                o_list_remove.append(param) </s> remove         o_list = []
 </s> add         o_list_primary = [] # URL for making this field the primary sort
        o_list_remove  = [] # URL for removing this field from sort
        o_list_toggle  = [] # URL for toggling order type for this field </s> remove             o_list.insert(0, make_qs_param(new_order_type, i))
 </s> add             o_list_primary.insert(0, make_qs_param(new_order_type, i)) </s> remove         o_list = '.'.join(o_list)
 </s> add 
                o_list_primary.insert(0, param)
                o_list_toggle.append(param)
                # o_list_remove - omit
          for j, ot in ordering_field_columns.items():
              if j == i: # Same column
                  # We want clicking on this header to bring the ordering to the
                  # front
                o_list_primary.insert(0, param)
                o_list_toggle.append(param)
                # o_list_remove - omit
              else:
                  o_list.append(make_qs_param(ot, j))
  
          if i not in ordering_field_columns:
              o_list.insert(0, make_qs_param(new_order_type, i))
keep keep keep keep replace keep keep keep keep keep
 Improved UI for advanced sorting controls.

Now allows individual fields to be removed/toggled.

Refs #11868

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16320 bcc190cf-cafb-0310-a4f2-bffc1f526a37 
django/contrib/admin/templatetags/admin_list.py