Make clickable area of object links larger

10 views
Skip to first unread message

Ben Spaulding

unread,
Jul 11, 2008, 1:11:00 PM7/11/08
to Django developers
There are many cases where the clickable text of objects listed on a
change-list page is only a few characters. I propose making the entire
cell containing the link clickable.

- http://junkdrawer.benspaulding.com/img/change_list-object_link-proposed.png

This is easily achieved with a few minor CSS changes. I have already
written the patch which I use for myself.

Is this worth submitting as a ticket/patch?

J Meier

unread,
Jul 11, 2008, 7:43:08 PM7/11/08
to Django developers
For me, yes it is. My users would appreciate it greatly. Even if it
doesn't go into Django, having a patch available on a ticket lets all
us others out here know about it.

My CSS-fu is weak: How do you make the whole area clickable with just
style rules?

-Jim

On Jul 11, 11:11 am, Ben Spaulding <ben.spauld...@gmail.com> wrote:
> There are many cases where the clickable text of objects listed on a
> change-list page is only a few characters. I propose making the entire
> cell containing the link clickable.
>
>  -http://junkdrawer.benspaulding.com/img/change_list-object_link-propos...

Rajeev J Sebastian

unread,
Jul 11, 2008, 7:56:10 PM7/11/08
to django-d...@googlegroups.com
On Sat, Jul 12, 2008 at 2:43 AM, J Meier <jim-g...@dsdd.org> wrote:
>
> For me, yes it is. My users would appreciate it greatly. Even if it
> doesn't go into Django, having a patch available on a ticket lets all
> us others out here know about it.
>
> My CSS-fu is weak: How do you make the whole area clickable with just
> style rules?

I believe you can set the display of the anchor to block. That should
fill the outer block.

Regards
Rajeev J Sebastian

Yuri Baburov

unread,
Jul 12, 2008, 5:05:06 AM7/12/08
to django-d...@googlegroups.com
Hi Ben,

Yes, it's worth it. Or alternatively you can blog this.

--
Best regards, Yuri V. Baburov, ICQ# 99934676, Skype: yuri.baburov,
MSN: bu...@live.com

Tai Lee

unread,
Jul 12, 2008, 8:26:30 AM7/12/08
to Django developers
Even better, make the entire row the link (like trac). I don't see why
only the value of the first field should be the link.

Malcolm Tredinnick

unread,
Jul 12, 2008, 8:43:11 AM7/12/08
to django-d...@googlegroups.com

On Sat, 2008-07-12 at 05:26 -0700, Tai Lee wrote:
> Even better, make the entire row the link (like trac). I don't see why
> only the value of the first field should be the link.

That's a usability disaster. You accidentally click anywhere to give
focus to the window and it runs off to some random link. It's just one
more thing that Trac gets completely wrong.

Malcolm


Mikhail Gusarov

unread,
Jul 12, 2008, 8:51:41 AM7/12/08
to django-d...@googlegroups.com
Twas brillig at 22:43:11 12.07.2008 UTC+10 when mal...@pointy-stick.com did gyre and gimble:

>> Even better, make the entire row the link (like trac). I don't see
>> why only the value of the first field should be the link.

MT> That's a usability disaster. You accidentally click anywhere to
MT> give focus to the window

Click-to-focus *IS* a usability disaster.

P.S.: Fitt's law.

--

Malcolm Tredinnick

unread,
Jul 12, 2008, 8:53:31 AM7/12/08
to django-d...@googlegroups.com

Click to raise is not, however, and that's when this is applicable.

Regards,
Malcolm


Ben Spaulding

unread,
Jul 12, 2008, 9:34:53 AM7/12/08
to Django developers
I agree with Malcolm that making the whole row clickable is not a good
idea. However, that will effectively be the case for models that do
not have the list_display or filter options in their inner Admin class
(or the equivalent in newforms-admin) because the one link will be as
wide as the whole page. I do find this acceptable because those items
are generally not managed heavily with the admin. For example,
TaggedItems:

- http://junkdrawer.benspaulding.com/img/change_liist-no_list_display_or_filter.png

I think I will wait another day or so before submitting a ticket. The
discussion has been constructive so far, and I think that more will be
valuable.

Ben Spaulding

Michael

unread,
Jul 12, 2008, 12:06:51 PM7/12/08
to django-d...@googlegroups.com
Ben et al;

There is no reason to sit on this, especially while the sprint is
going. I just wrote up a 2 line patch [1] that changes the display to
block. It is a simple enough change. The next step is getting some
review and committer time. This patch isn't critical for the 1.0
launch, so the later step might be hard, either way it is now in trac
[2] and will get some attention sometime.

[1] http://code.djangoproject.com/attachment/ticket/7733/7733-larger-admin-clickable-area.diff
[2] http://code.djangoproject.com/ticket/7733

Thanks, Michael

J Meier

unread,
Jul 12, 2008, 4:50:23 PM7/12/08
to Django developers
On Jul 12, 6:51 am, Mikhail Gusarov <dotted...@dottedmag.net> wrote:
>  >> Even better, make the entire row the link (like trac). I don't see
>  >> why only the value of the first field should be the link.
>  MT> That's a usability disaster. You accidentally click anywhere to
>  MT> give focus to the window
> Click-to-focus *IS* a usability disaster.
> P.S.: Fitt's law.

I think the bike shed should be teal.

Tai Lee

unread,
Jul 13, 2008, 5:57:21 AM7/13/08
to Django developers
Isn't click to focus a window (or not) an OS decision? E.g. clicking
anywhere in a browser window on a Mac will focus the window but not
send a click to the application.

Even if that weren't the case, making the link area smaller just
reduces the probability for accidental clicks and makes it more
difficult for people actually trying to use the admin for the sake of
people trying to switch to the admin in an OS that sends a click on
focus.

Each row in a change list represents one object, usability suffers by
making only one potentially tiny (an integer primary key) field
clickable.

David Danier

unread,
Jul 13, 2008, 7:44:37 AM7/13/08
to django-d...@googlegroups.com
> Each row in a change list represents one object, usability suffers by
> making only one potentially tiny (an integer primary key) field
> clickable.

What about supporting custom urls for some fields in the future?
(e.g. linking to an foreign object for model.ForeignKey)

I would make the whole field clickable, every other field can be made
clickable by configuration, if someone wants. I don't like the idea of
making the whole row clickable.

Greetings, David Danier

alex....@gmail.com

unread,
Jul 13, 2008, 1:25:21 PM7/13/08
to Django developers
There is already a way to control which fields are links to the change
page: http://www.djangoproject.com/documentation/model-api/#list-display-links

David Danier

unread,
Jul 13, 2008, 3:56:34 PM7/13/08
to django-d...@googlegroups.com
> There is already a way to control which fields are links to the change
> page: http://www.djangoproject.com/documentation/model-api/#list-display-links

I know, thats what I meant. To make the whole row clickable you have to
put all fields which are in list_display into list_display_links, too.
So making the whole field (<td>) clickable should really be enough, the
row itself (everything inside <tr>) does not need to be clickable by
default.

Greetings, David Danier

flo...@gmail.com

unread,
Jul 13, 2008, 4:14:38 PM7/13/08
to Django developers
On Jul 13, 12:56 pm, David Danier <goliath.mailingl...@gmx.de> wrote:
> So making the whole field (<td>) clickable should really be enough, the
> row itself (everything inside <tr>) does not need to be clickable by
> default.

If I'm not mistaken, in NFA, you can create a custom subclass of
ModelAdmin that always sets list_display_links equal to list_display,
and have all of your models inherit from that. This is the most
flexible solution because people who don't want it to default to
clickable get their way, while you can have it your way too with
minimal effort.

-Eric Florenzano

Will Hardy

unread,
Jul 13, 2008, 4:29:22 PM7/13/08
to django-d...@googlegroups.com
I've just submitted an updated patch for this issue to
<http://code.djangoproject.com/ticket/7733>, which does the following:

* standard edit links and fields listed in 'list_display_links' fill
the whole cell
* any other links (eg using 'allow_tags' on a field) are not affected
* The dashboard also has links that fill the whole cell (but not the
edit and delete links)

Anywhere else in admin needing some click-friendly links?

--
Will Hardy
http://www.willhardy.com.au

Tai Lee

unread,
Jul 14, 2008, 7:40:57 AM7/14/08
to Django developers
> If I'm not mistaken, in NFA, you can create a custom subclass of
> ModelAdmin that always sets list_display_links equal to list_display,
> and have all of your models inherit from that.  This is the most
> flexible solution because people who don't want it to default to
> clickable get their way, while you can have it your way too with
> minimal effort.

Win/win! ;)

Reply all
Reply to author
Forward
0 new messages