Opened 7 years ago

Closed 2 years ago

#7467 closed New feature (fixed)

[Improvement] Easier way to overwite the admin welcome message

Reported by: Jeff Kowalczyk <jtk@…> Owned by: rctay
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


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 rctay 6 years ago.
See comment 6.

Download all attachments as: .zip

Change History (14)

comment:1 Changed 7 years ago by garcia_marc

  • milestone set to post-1.0
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Summary changed from admin/base.html needs block userwelcome for customization without copying to [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 7 years ago by ericholscher

  • Triage Stage changed from Unreviewed to Design decision needed

comment:3 Changed 7 years ago by anonymous

  • milestone post-1.0 deleted

Milestone post-1.0 deleted

comment:4 Changed 6 years ago by Tuttle

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 6 years ago by anonymous

  • Cc t.django@… added

comment:6 Changed 6 years ago by rctay

  • Owner changed from nobody to rctay
  • Status changed from new to assigned

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 6 years ago by rctay

See comment 6.

comment:7 Changed 6 years ago by rctay

  • Has patch set

comment:8 Changed 5 years ago by lukeplant

  • Severity set to Normal
  • Type set to New feature

comment:9 Changed 4 years ago by Alex

  • Easy pickings unset
  • Triage Stage changed from Design decision needed to Accepted
  • UI/UX unset

comment:10 Changed 2 years ago by Kamu

  • Easy pickings set
  • Patch needs improvement set
  • Triage Stage changed from Accepted to Unreviewed

comment:11 Changed 2 years ago by Kamu

Changing to unreviewed as there seems to be no comments by others [in a while, and based on the new version].

Last edited 2 years ago by Kamu (previous) (diff)

comment:12 Changed 2 years ago by russellm

  • Triage Stage changed from Unreviewed to Accepted

@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 2 years ago by Tim Graham <timograham@…>

  • Resolution set to fixed
  • Status changed from assigned to closed

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