saravanan
saravanan

Reputation: 932

Django colors are not overriding in trans tag

I wanted to customize my Django admin base.html

I want to change the color of the div tag called "div user-tools".

So, I changed in admin/base.html.

       <div id="user-tools" style="color:red;">
        {% trans 'Welcome,' %}
        <strong>{% filter force_escape %}{% firstof user.first_name user.username %}{% endfilter %}</strong>.
        {% block userlinks %}
            {% url 'django-admindocs-docroot' as docsroot %}
            {% if docsroot %}
                <a href="{{ docsroot }}">{% trans 'Documentation' %}</a> /
            {% endif %}
            {% url 'admin:password_change' as password_change_url %}
            {% if password_change_url %}
                <a href="{{ password_change_url }}">
            {% else %}
                <a href="{{ root_path }}password_change/">
            {% endif %}
            {% trans 'Change password' %}</a> /
            {% url 'admin:logout' as logout_url %}
            {% if logout_url %}
                <a href="{{ logout_url }}">
            {% else %}
                <a href="{{ root_path }}logout/">
            {% endif %}
            {% trans 'Log out' %}</a>
        {% endblock %}
    </div>

But it is not affecting in the admin page.

Especially inside "trans" variable is not affecting.

I am attaching the screenshot of output.

Could you please suggest this issue in the round corner in the pic? enter image description here

Upvotes: 0

Views: 388

Answers (1)

Nava
Nava

Reputation: 6586

You can override the colors like this way.

{% block extrastyle %}
#user-tools {color:blue;}
#user-tools a:link,#user-tools a:visited {color:blue;}
...
{% endblock %}

Just tried

Upvotes: 1

Related Questions