feat: Rework profile card a bit

This commit is contained in:
moanos [he/him] 2024-06-08 22:23:22 +02:00
parent b16cf76208
commit 1837eca921
3 changed files with 21 additions and 17 deletions

View File

@ -85,7 +85,9 @@ h1, h2 {
border-bottom-right-radius: 15px; border-bottom-right-radius: 15px;
} }
.header a {
.nav-link {
color: var(--text-one); color: var(--text-one);
text-align: center; text-align: center;
text-decoration: none; text-decoration: none;

View File

@ -0,0 +1,17 @@
{% load i18n %}
<form action="{% url 'change-language' %}" method="post" onchange='this.form.submit()'>
{% csrf_token %}
<select name="language" onchange='this.form.submit()'>
{% get_current_language as LANGUAGE_CODE_CURRENT %}
{% get_available_languages as LANGUAGES %}
{% for language in LANGUAGES %}
<option value="{{ language.0 }}" {% if language.0 == LANGUAGE_CODE_CURRENT %} selected{% endif %}>
{{ language.0|language_name_local }}
</option>
<!--<option value="{{ language.0 }}" {% if language.0 == LANGUAGE_CODE %} selected{% endif %}>
{{ language.0|language_name_local }} ({{ language.0 }})
</option>-->
{% endfor %}
</select>
<!--<input type="submit" value={% translate "change" %}>-->
</form>

View File

@ -14,6 +14,7 @@
</nav> </nav>
<div class="header-right"> <div class="header-right">
{% include "fellchensammlung/forms/change_language.html" %}
{% if user.is_authenticated %} {% if user.is_authenticated %}
<div class="profile-card"> <div class="profile-card">
<p><a href="{{ user.get_absolute_url }}">{{ user.username }}</a></p> <p><a href="{{ user.get_absolute_url }}">{{ user.username }}</a></p>
@ -27,21 +28,5 @@
<a href="{% url "login" %}">{% translate "Einloggen" %}</a> <a href="{% url "login" %}">{% translate "Einloggen" %}</a>
{% endif %} {% endif %}
<form action="{% url 'change-language' %}" method="post" onchange='this.form.submit()'>
{% csrf_token %}
<select name="language" onchange='this.form.submit()'>
{% get_current_language as LANGUAGE_CODE_CURRENT %}
{% get_available_languages as LANGUAGES %}
{% for language in LANGUAGES %}
<option value="{{ language.0 }}" {% if language.0 == LANGUAGE_CODE_CURRENT %} selected{% endif %}>
{{ language.0|language_name_local }}
</option>
<!--<option value="{{ language.0 }}" {% if language.0 == LANGUAGE_CODE %} selected{% endif %}>
{{ language.0|language_name_local }} ({{ language.0 }})
</option>-->
{% endfor %}
</select>
<!--<input type="submit" value={% translate "change" %}>-->
</form>
</div> </div>
</div> </div>