#36080 closed Cleanup/optimization (wontfix)
Cleanup the inline link format.
| Reported by: | Antoliny | Owned by: | Antoliny |
|---|---|---|---|
| Component: | contrib.admin | Version: | dev |
| Severity: | Normal | Keywords: | Inline, Link |
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description (last modified by )
when show_change_link is applied, the icon image appears slightly cropped in TabularInline. Also, the Change and View text is applied depending on the user's permissions, but the permission-related details are already exposed in the form.

Therefore, how about simply adding the link to the object's __str__?

I think it looks cleaner when the link is added to the __str__(removed icon and text).
Additionally, what do you think about changing the default value of show_change_link to True?
Changing it to True could also improve accessibility.
Attachments (5)
Change History (15)
by , 11 months ago
| Attachment: | tabular_inline_object_str_link.png added |
|---|
comment:1 by , 11 months ago
| Owner: | set to |
|---|---|
| Status: | new → assigned |
by , 11 months ago
| Attachment: | inline_object_str_add_link.png added |
|---|
comment:2 by , 11 months ago
| Description: | modified (diff) |
|---|
by , 11 months ago
| Attachment: | image-20250110-114223.png added |
|---|
comment:3 by , 11 months ago
| Resolution: | → invalid |
|---|---|
| Status: | assigned → closed |
by , 11 months ago
| Attachment: | tabular_inline_link.png added |
|---|
by , 11 months ago
| Attachment: | link_change_2.png added |
|---|
comment:4 by , 11 months ago
Ah, this functionality is already provided through the show_change_link attribute! However, when show_change_link is applied, the icon image appears slightly cropped in TabularInline. Also, the Change and View text is applied depending on the user's permissions, but the permission-related details are already exposed in the form.

Therefore, what do you think about simply adding the link to the object's str and change the default value of the show_change_link to True? (This includes StackedInline as well.) I think this approach would be cleaner, more intuitive, and would enhance accessibility without losing any clarity.

comment:5 by , 11 months ago
| Description: | modified (diff) |
|---|---|
| Resolution: | invalid |
| Status: | closed → new |
| Summary: | Add a link to navigate to the object through str in the inline form. → Cleanup the inline link format. |
comment:6 by , 11 months ago
| Status: | new → assigned |
|---|
comment:7 by , 11 months ago
| Type: | New feature → Cleanup/optimization |
|---|
comment:8 by , 11 months ago
| Resolution: | → wontfix |
|---|---|
| Status: | assigned → closed |
Could you raise this on the forum?
I think the change/view link pattern exists in a few places and we should check each of them together to complete the proposal.
We should be clear when that patter should be used vs applying a link to the string. The accessibility team should also consider this. I would say right now the buttons are always the same size regardless of the size of __str__ but this could return "-" or possibly even a blank string which would not be clickable
I also don't like that the stacked inline has the model name prefix but the tabular does not
comment:9 by , 11 months ago
Hmm.. You're right. We need to consider cases where the __str__ method returns elements like "-" or an empty string when applying a link.
I also previously mentioned the difference between Stacked Inline and Tabular Inline headers in another issue.
I don't understand why the headers for these two features are different either. Considering the issue raised in ticket_36079, I feel that changes to the Tabular Inline and Stacked Inline headers are necessary. Thank you, Sarah Boyce! I will write a post about this on the Django forum internals.
This exists already but you need to have the admin registered for that model for the link to be available