{#
/*
 * Copyright (C) 2019 Xibo Signage Ltd
 *
 * Xibo - Digital Signage - http://www.xibo.org.uk
 *
 * This file is part of Xibo.
 *
 * Xibo is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * any later version.
 *
 * Xibo is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with Xibo.  If not, see <http://www.gnu.org/licenses/>.
 */
#}
{% extends "form-base.twig" %}
{% import "forms.twig" as forms %}

{% block formTitle %}
    {% trans "Preferences" %}
{% endblock %}

{% block formButtons %}
    {% trans "Cancel" %}, XiboDialogClose()
    {% trans "Save" %}, userPreferencesFormSubmit()
{% endblock %}

{% block formHtml %}
    <div class="row">
        <div class="col-md-12">
            <form id="userPreferences" class="XiboForm form-horizontal" method="put" action="{{ urlFor("user.pref") }}">
                {% if theme.isSettingVisible("NAVIGATION_MENU_POSITION") and theme.isSettingEditable("NAVIGATION_MENU_POSITION") %}
                    {% set title %}{% trans "Navigation Menu" %}{% endset %}
                    {% set helpText %}{% trans "Select where the Navigation Menu should be positioned. Once selected please refresh your browser window to apply changes." %}{% endset %}

                    {% set defaultOption %}{% trans "Use the default configured by your administrator" %}{% endset %}
                    {% set horizontalOption %}{% trans "Horizontal along the top" %}{% endset %}
                    {% set verticalOption %}{% trans "Vertically on the left" %}{% endset %}
                    {% set options = [
                        { id: null, value: defaultOption },
                        { id: "horizontal", value: horizontalOption },
                        { id: "vertical", value: verticalOption }
                    ] %}
                    {{ forms.dropdown("navigationMenuPosition", "single", title, currentUser.getOptionValue("navigationMenuPosition", "default"), options, "id", "value", helpText) }}
                {% endif %}
            
                {% set title %}{% trans "Use Library duration?" %}{% endset %}
                {% set helpText %}{% trans "Assign all Media items based on their Library duration. Leave this option unticked to use the Default Module duration." %}{% endset %}
                {{ forms.checkbox("useLibraryDuration", title, currentUser.getOptionValue("useLibraryDuration", 0), helpText) }}

                {% set title %}{% trans "Auto show thumbnail column?" %}{% endset %}
                {% set helpText %}{% trans "When requesting a screenshot from a display should the Thumbnail column be automatically shown if it's not visible?" %}{% endset %}
                {{ forms.checkbox("showThumbnailColumn", title, currentUser.getOptionValue("showThumbnailColumn", 1), helpText) }}
            </form>
        </div>
    </div>
{% endblock %}