Opened 17 years ago

Closed 11 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: dev
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 15 years ago.
See comment 6.

Download all attachments as: .zip

Change History (14)

comment:1 by Marc Garcia, 17 years ago

milestone: post-1.0
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 by Eric Holscher, 16 years ago

Triage Stage: UnreviewedDesign decision needed

comment:3 by (none), 16 years ago

milestone: post-1.0

Milestone post-1.0 deleted

comment:4 by Vlada Macek, 15 years ago

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

Cc: t.django@… added

comment:6 by Tay Ray Chuan, 15 years ago

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.

by Tay Ray Chuan, 15 years ago

Attachment: ticket-7467-01.diff added

See comment 6.

comment:7 by Tay Ray Chuan, 15 years ago

Has patch: set

comment:8 by Luke Plant, 14 years ago

Severity: Normal
Type: New feature

comment:9 by Alex Gaynor, 13 years ago

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

comment:10 by Kamu, 12 years ago

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

comment:11 by Kamu, 12 years ago

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

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

comment:12 by Russell Keith-Magee, 12 years ago

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

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