beginning of lang flag refacto

This commit is contained in:
Danhia 2022-02-04 15:28:06 +01:00
parent 9d33985fa4
commit 993e1fa998
2 changed files with 14 additions and 16 deletions

View File

@ -55,6 +55,7 @@ pre {
background-color: #1d1d1d; background-color: #1d1d1d;
border: none; border: none;
border-radius: 0; border-radius: 0;
min-width:inherit;
} }
.dropdown-item { .dropdown-item {
color: #d9d9d9; color: #d9d9d9;

View File

@ -65,27 +65,24 @@
</li> </li>
</ul> </ul>
<ul class="navbar-nav "> <ul class="navbar-nav ">
<!-- <li class="nav-item dropdown">
<a href="https://www.patreon.com/42ctf" target="_blank" class="patreon li-patreon"> <li class="dropdown">
<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> -->
{% get_current_language as LANGUAGE_CODE %} {% 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 %} {% get_available_languages as languages %}
{% for lang_code, lang_name in 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 }}"/> <img class="flag_img" src="{% static "img/"|add:lang_code|add:".svg" %}" alt="flag {{ lang_name }}"/>
</a> </a>
</li>
{% endfor %} {% endfor %}
</div>
</li>
{% if request.user.is_authenticated %} {% if request.user.is_authenticated %}
<li class="nav-item dropdown"> <li class="nav-item dropdown">
<a href="{% url 'accounts:edit' %}" class="nav-link">{{ request.user.username }}</a> <a href="{% url 'accounts:edit' %}" class="nav-link">{{ request.user.username }}</a>