Opened 8 years ago

Closed 3 years ago

#7467 closed New feature (fixed)

[Improvement] Easier way to overwite the admin welcome message

Reported by: Jeff Kowalczyk <jtk@…> Owned by: Tay Ray Chuan
Component: contrib.admin Version: master
Severity: Normal Keywords:
Cc: t.django@… Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: yes UI/UX: no

Description

To change the prominent visual welcome in admin/base.html div user-tools, one must copy the entire admin/base.html template and modify just one line. A block containing this welcome i.e. block userwelcome would be useful for customization.

Attachments (1)

ticket-7467-01.diff (791 bytes) - added by Tay Ray Chuan 7 years ago.
See comment 6.

Download all attachments as: .zip

Change History (14)

comment:1 Changed 8 years ago by Marc Garcia

milestone: post-1.0
Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset
Summary: admin/base.html needs block userwelcome for customization without copying[Improvement] Easier way to overwite the admin welcome message

I agree on that, but according to 1.0 policy I think that it will be postponed after Django 1.0 is released.

Changing summary to clarify that this is an improvement.

comment:2 Changed 8 years ago by Eric Holscher

Triage Stage: UnreviewedDesign decision needed

comment:3 Changed 8 years ago by (none)

milestone: post-1.0

Milestone post-1.0 deleted

comment:4 Changed 7 years ago by Vlada Macek

I second this. There are languages that use different form for vocative, thus "Welcome, Vlada" is incorrect. I think this form could fit to the majority:

    {% trans 'User: ' %}
    {% if user.first_name %}<strong>{{ user.first_name }} {{ user.last_name }}</strong>
    {% else %}{{ user.username }}{% endif %}.

It does not matter how to reach it, but currently AFAIK the only way is to override entire admin/base.html, which is complex.

If this applies to your language to, please vote for this.

comment:5 Changed 7 years ago by anonymous

Cc: t.django@… added

comment:6 Changed 7 years ago by Tay Ray Chuan

Owner: changed from nobody to Tay Ray Chuan
Status: newassigned

I'll attach a patch to make it possible to override the default welcome message.

Thus, one could do:

{% extends '/path/to/default/admin/templates/admin/base.html' %}

{% block welcome-msg %}
<strong>{% firstof user.first_name user.username %}</strong>, {% trans 'welcome!' %}
{% endblock %}

That said, I'm not against the "re-phrasing" of the message.

Changed 7 years ago by Tay Ray Chuan

Attachment: ticket-7467-01.diff added

See comment 6.

comment:7 Changed 7 years ago by Tay Ray Chuan

Has patch: set

comment:8 Changed 5 years ago by Luke Plant

Severity: Normal
Type: New feature

comment:9 Changed 5 years ago by Alex Gaynor

Easy pickings: unset
Triage Stage: Design decision neededAccepted
UI/UX: unset

comment:10 Changed 3 years ago by Kamu

Easy pickings: set
Patch needs improvement: set
Triage Stage: AcceptedUnreviewed

comment:11 Changed 3 years ago by Kamu

Changing to unreviewed as there seems to be no comments by others.

Version 1, edited 3 years ago by Kamu (previous) (next) (diff)

comment:12 Changed 3 years ago by Russell Keith-Magee

Triage Stage: UnreviewedAccepted

@kamu - Unreviewed means that nobody has looked at the ticket. Several people *have* looked at this ticket, so it has been accepted.

If you want to know more about the Trac ticket states, see the documentation on contributing.

comment:13 Changed 3 years ago by Tim Graham <timograham@…>

Resolution: fixed
Status: assignedclosed

In 2bc51438664b5ffbbd1430b4f9f3307f18b2b9db:

Fixed #7467 -- Added a template block to override the admin welcome message.

Thanks Jeff Kowalczyk for the suggestion and rctay for the patch.

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