Opened 16 years ago

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

Download all attachments as: .zip

Change History (19)

by trbs, 16 years ago

comment:1 by (none), 16 years ago

milestone: post-1.0

Milestone post-1.0 deleted

comment:2 by Jacob, 16 years ago

milestone: 1.1
Triage Stage: UnreviewedAccepted

comment:3 by Jacob, 16 years ago

Triage Stage: AcceptedDesign decision needed

comment:4 by Jacob, 16 years ago

milestone: 1.11.2
Triage Stage: Design decision neededAccepted

by bodiddlie, 15 years ago

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

comment:5 by bodiddlie, 15 years ago

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

Version: 1.0SVN

comment:7 by bodiddlie, 15 years ago

Resolution: worksforme
Status: assignedclosed

comment:8 by trbs, 15 years ago

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

in reply to:  8 comment:9 by Karen Tracey, 15 years ago

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 by trbs, 15 years ago

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

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

milestone: 1.2

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

comment:13 by Julien Phalip, 14 years ago

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

comment:14 by Chris Beaven, 14 years ago

Severity: Normal
Type: New feature

comment:15 by Julien Phalip, 14 years ago

Easy pickings: unset
UI/UX: set

comment:16 by Aymeric Augustin, 12 years ago

Status: reopenednew

comment:17 by Tim Graham, 11 years ago

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