Opened 8 years ago

Last modified 2 years 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 8 years ago.
RelatedObjectLookups-updated.js.patch (1.9 KB) - added by bodiddlie 7 years ago.
Fixes some errors in previous patch and updates to work with latest svn

Download all attachments as: .zip

Change History (19)

Changed 8 years ago by trbs

comment:1 Changed 8 years ago by (none)

milestone: post-1.0

Milestone post-1.0 deleted

comment:2 Changed 8 years ago by Jacob

milestone: 1.1
Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset
Triage Stage: UnreviewedAccepted

comment:3 Changed 8 years ago by Jacob

Triage Stage: AcceptedDesign decision needed

comment:4 Changed 7 years ago by Jacob

milestone: 1.11.2
Triage Stage: Design decision neededAccepted

Changed 7 years ago by bodiddlie

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

comment:5 Changed 7 years ago by bodiddlie

Owner: changed from nobody to bodiddlie
Status: newassigned

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 7 years ago by bodiddlie

Version: 1.0SVN

comment:7 Changed 7 years ago by bodiddlie

Resolution: worksforme
Status: assignedclosed

comment:8 Changed 7 years ago by trbs

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

comment:9 in reply to:  8 Changed 7 years ago by Karen Tracey

Resolution: worksforme
Status: closedreopened

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 7 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 7 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 7 years ago by James Bennett

milestone: 1.2

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

comment:13 Changed 6 years ago by Julien Phalip

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

comment:14 Changed 5 years ago by Chris Beaven

Severity: Normal
Type: New feature

comment:15 Changed 5 years ago by Julien Phalip

Easy pickings: unset
UI/UX: set

comment:16 Changed 4 years ago by Aymeric Augustin

Status: reopenednew

comment:17 Changed 2 years ago by Tim Graham

Needs tests: set
Patch needs improvement: set

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

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