mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Refactor language selection
This commit is contained in:
parent
b7b0574a44
commit
3349e9ff6c
@ -37,6 +37,10 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class='panel-heading'>
|
||||
<h4>{% trans "Language Settings" %}</h4>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<form action="{% url 'set_language' %}" method="post">{% csrf_token %}
|
||||
<input name="next" type="hidden" value="{% url 'settings-appearance' %}">
|
||||
|
@ -15,7 +15,6 @@
|
||||
{% block content %}
|
||||
|
||||
{% include "InvenTree/settings/user.html" %}
|
||||
{% include "InvenTree/settings/appearance.html" %}
|
||||
{% include "InvenTree/settings/user_settings.html" %}
|
||||
|
||||
{% if user.is_staff %}
|
||||
|
@ -1,6 +1,7 @@
|
||||
{% extends "panel.html" %}
|
||||
|
||||
{% load i18n %}
|
||||
{% load inventree_extras %}
|
||||
|
||||
{% block label %}account{% endblock %}
|
||||
|
||||
@ -36,4 +37,30 @@
|
||||
<td>{{ user.email }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class='panel-heading'>
|
||||
<h4>{% trans "Language Settings" %}</h4>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<form action="{% url 'set_language' %}" method="post">
|
||||
{% csrf_token %}
|
||||
<input name="next" type="hidden" value="{% url 'settings' %}">
|
||||
<div class="col-sm-6" style="width: 200px;"><div id="div_id_name" class="form-group"><div class="controls ">
|
||||
<select name="language" class="select form-control">
|
||||
{% get_current_language as LANGUAGE_CODE %}
|
||||
{% get_available_languages as LANGUAGES %}
|
||||
{% get_language_info_list for LANGUAGES as languages %}
|
||||
{% for language in languages %}
|
||||
<option value="{{ language.code }}"{% if language.code == LANGUAGE_CODE %} selected{% endif %}>
|
||||
{{ language.name_local }} ({{ language.code }})
|
||||
</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div></div></div>
|
||||
<div class="col-sm-6" style="width: auto;">
|
||||
<input type="submit" value="{% trans 'Set Language' %}" class="btn btn btn-primary">
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
Loading…
Reference in New Issue
Block a user