Skip to content

Commit c1acd5b

Browse files
committed
fixed unsupport jinja tags
1 parent a98c615 commit c1acd5b

File tree

1 file changed

+1
-37
lines changed

1 file changed

+1
-37
lines changed

_posts/2020-07-28-how-to-custom-select-language-icon-in-django-administration.md

+1-37
Original file line numberDiff line numberDiff line change
@@ -11,43 +11,7 @@ categories: [python, django]
1111

1212
**1. Add the base_site file inside `templates/admin/base_site.html`.**
1313

14-
```html
15-
[[ extends "admin/base.html" ]] ==> please change [[ ]] to django templatetag, because gh-pages doesn't support it.
16-
{% load static i18n %}
17-
18-
{% block title %}{{ title }} | {{ site_title|default:_('Situs django admin') }}{% endblock %}
19-
20-
{% block branding %}
21-
<h1 id="site-name"><a href="{% url 'admin:index' %}">{{ site_header|default:_('Administrasi django') }}</a></h1>
22-
{% endblock %}
23-
24-
{% block nav-global %}{% endblock %}
25-
26-
{% block welcome-msg %}
27-
28-
{# CUSTOM LANGUAGE ICONS #}
29-
{% get_current_language as LANGUAGE_CODE %}
30-
{% get_available_languages as LANGUAGES %}
31-
{% get_language_info_list for LANGUAGES as languages %}
32-
<span id="language-icons" style="margin: -1px 0 0 -65px; position: absolute;">
33-
{% for language in languages %}
34-
{% if language.code == 'id' %}
35-
<a href="?lang=id" style="margin-right: 3px;border-bottom:none" title="Indonesia">
36-
<img height="15px" src="{% static 'icons/flags/id.svg' %}">
37-
</a>
38-
{% elif language.code == 'en' %}
39-
<a href="?lang=en" style="margin-right: 3px;border-bottom:none" title="English">
40-
<img height="15px" src="{% static 'icons/flags/us.svg' %}">
41-
</a>
42-
{% endif %}
43-
{% endfor %}
44-
</span>
45-
46-
{# DFEAULT WELCOME MESSAGE GOES HERE #}
47-
{{ block.super }}
48-
49-
{% endblock %}
50-
```
14+
<iframe width="100%" height="350" src="//jsfiddle.net/agaust/s6pqknL4/embedded/html/dark/" allowfullscreen="allowfullscreen" allowpaymentrequest frameborder="0"></iframe>
5115

5216

5317
**2. Custom language middleware, in your file `middleware.py`**

0 commit comments

Comments
 (0)