forked from 42CTF/website
beginning of lang flag refacto
This commit is contained in:
parent
9d33985fa4
commit
993e1fa998
|
@ -55,6 +55,7 @@ pre {
|
|||
background-color: #1d1d1d;
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
min-width:inherit;
|
||||
}
|
||||
.dropdown-item {
|
||||
color: #d9d9d9;
|
||||
|
|
|
@ -65,27 +65,24 @@
|
|||
</li>
|
||||
</ul>
|
||||
<ul class="navbar-nav ">
|
||||
<!-- <li class="nav-item dropdown">
|
||||
<a href="https://www.patreon.com/42ctf" target="_blank" class="patreon li-patreon">
|
||||
<div class="patreon-content">
|
||||
<span class="svg-box">
|
||||
<svg viewBox="0 0 569 546" xmlns="http://www.w3.org/2000/svg"><g><circle cx="362.589996" cy="204.589996" data-fill="1" id="Oval" r="204.589996"></circle><rect data-fill="2" height="545.799988" id="Rectangle" width="100" x="0" y="0"></rect></g></svg>
|
||||
</span>
|
||||
<span class="patreon-text">
|
||||
Patreon
|
||||
</span>
|
||||
</div>
|
||||
</a>
|
||||
</li> -->
|
||||
|
||||
<li class="dropdown">
|
||||
{% get_current_language as LANGUAGE_CODE %}
|
||||
<a class="nav-link" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<img class="flag_img" src="{% static "img/"|add:LANGUAGE_CODE|add:".svg" %}" alt="flag {{ LANGUAGE_CODE }}"/>
|
||||
</a>
|
||||
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
|
||||
{% get_available_languages as languages %}
|
||||
{% for lang_code, lang_name in languages %}
|
||||
<li class="nav-item dropdown">
|
||||
<a class="flag_link" href="{% url 'set_language' lang_code %}?next={{request.path|slice:"3:"}}">
|
||||
|
||||
<a class="flag_link dropdown-item" href="{% url 'set_language' lang_code %}?next={{request.path|slice:"3:"}}">
|
||||
<img class="flag_img" src="{% static "img/"|add:lang_code|add:".svg" %}" alt="flag {{ lang_name }}"/>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
{% endfor %}
|
||||
</div>
|
||||
</li>
|
||||
{% if request.user.is_authenticated %}
|
||||
<li class="nav-item dropdown">
|
||||
<a href="{% url 'accounts:edit' %}" class="nav-link">{{ request.user.username }}</a>
|
||||
|
|
Loading…
Reference in New Issue