Code

Opened 5 years ago

Last modified 5 weeks ago

#10191 new New feature

Fix / Add support for radiobuttons after adding item with popup in Django Admin

Reported by: trbs Owned by: bodiddlie
Component: contrib.admin Version: master
Severity: Normal Keywords: admin, radio, radiolist, dismissAddAnotherPopup, popup
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: yes Patch needs improvement: yes
Easy pickings: no UI/UX: yes

Description

The following patch adds support for dynamically adding radiobutton items to the admin page.

Without this patch the newly added item through the popup menu does not get added to the page and
the user must reload the page before being able to select the new item.

The patch adds an extra case to dismissAddAnotherPopup in RelatedObjectsLookup.js which creates and appends the necessary html to the list of radiobuttons on the page.

Tested with django.contrib.redirects and a slightly modified version of django-podcast.
Works (for me) on Firefox, IE and Opera.

Attachments (2)

RelatedObjectLookups.js.patch (1.5 KB) - added by trbs 5 years ago.
RelatedObjectLookups-updated.js.patch (1.9 KB) - added by bodiddlie 5 years ago.
Fixes some errors in previous patch and updates to work with latest svn

Download all attachments as: .zip

Change History (19)

Changed 5 years ago by trbs

comment:1 Changed 5 years ago by anonymous

  • milestone post-1.0 deleted

Milestone post-1.0 deleted

comment:2 Changed 5 years ago by jacob

  • milestone set to 1.1
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

comment:3 Changed 5 years ago by jacob

  • Triage Stage changed from Accepted to Design decision needed

comment:4 Changed 5 years ago by jacob

  • milestone changed from 1.1 to 1.2
  • Triage Stage changed from Design decision needed to Accepted

Changed 5 years ago by bodiddlie

Fixes some errors in previous patch and updates to work with latest svn

comment:5 Changed 5 years ago by bodiddlie

  • Owner changed from nobody to bodiddlie
  • Status changed from new to assigned

Made some changes to the patch to make it work properly with IE and to correctly check for the radiolist class whether it's inline or not. Also checks whether added content is a tag or not since I've been using it to render a list of images as radio buttons so the user doesn't have to remember file names.

comment:6 Changed 5 years ago by bodiddlie

  • Version changed from 1.0 to SVN

comment:7 Changed 5 years ago by bodiddlie

  • Resolution set to worksforme
  • Status changed from assigned to closed

comment:8 follow-up: Changed 5 years ago by trbs

For clarity / future reference; What was the reason for resolution: worksforme ?

comment:9 in reply to: ↑ 8 Changed 5 years ago by kmtracey

  • Resolution worksforme deleted
  • Status changed from closed to reopened

Replying to trbs:

For clarity / future reference; What was the reason for resolution: worksforme ?

Reopening as it doesn't appear that it should have been closed. There's a recently updated patch so that implies something needs to be changed in the code base -- until this code is actually committed in the SVN repository the ticket state should not be set to closed. Presence of a working patch is not enough as work still needs to be done to make the fix or new function available in general.

If it was closed "worksforme" because further investigation revealed no changes were needed in the code base, then that needs to be made clear by a comment on the close. As it is this looks to have been closed prematurely.

comment:10 Changed 5 years ago by trbs

Thanks kmtracey.

I imaging admin-ui branch impacting on this ticket as well.

Since they appear to use JQuery and thus all those dom-operations, like adding entries to radiobuttons, comboboxes, etc
could hopefully be done much cleaner by using the js framework.

comment:11 Changed 5 years ago by bodiddlie

Doh, that was a total misread on how the ticket system works on my part. First time I've ever submitted patch for anything. My bad. :( Definitely not meant to be closed yet.

comment:12 Changed 4 years ago by ubernostrum

  • milestone 1.2 deleted

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

comment:13 Changed 3 years ago by julien

This is probably related to #14660 (which also has a patch).

comment:14 Changed 3 years ago by SmileyChris

  • Severity set to Normal
  • Type set to New feature

comment:15 Changed 3 years ago by julien

  • Easy pickings unset
  • UI/UX set

comment:16 Changed 16 months ago by aaugustin

  • Status changed from reopened to new

comment:17 Changed 5 weeks ago by timo

  • Needs tests set
  • Patch needs improvement set

Patch will need to be updated to apply cleanly + tests.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as new
The owner will be changed from bodiddlie to anonymous. Next status will be 'assigned'
as The resolution will be set. Next status will be 'closed'
Author


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

 
Note: See TracTickets for help on using tickets.