{% extends "InvenTree/settings/settings.html" %}
{% load i18n %}
{% load inventree_extras %}

{% block tabs %}
{% include "InvenTree/settings/tabs.html" with tab='theme' %}
{% endblock %}

{% block subtitle %}
{% trans "Theme Settings" %}
{% endblock %}

{% block settings %}

<div class='row'>
    <div class='col-sm-6'>
        <h4>{% trans "Color Themes" %}</h4>
    </div>
</div>

<form action="{% url 'settings-appearance' %}" method="post">
    {% csrf_token %}
    {% load crispy_forms_tags %}
    {% crispy form %}
</form>

{% if invalid_color_theme %}
    <div class="alert alert-danger alert-block" role="alert" style="display: inline-block;">
    {% blocktrans %}
        The CSS sheet "{{invalid_color_theme}}.css" for the currently selected color theme was not found.<br>
        Please select another color theme :)
    {% endblocktrans %}
    </div>
{% endif %}


<div class='row'>
    <div class='col-sm-6'>
        <h4>{% trans "Language" %}</h4>
    </div>
</div>



<div class="row">
    <form action="{% url 'set_language' %}" method="post">{% csrf_token %}
        <input name="next" type="hidden" value="{% url 'settings-appearance' %}">
        <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 %}
