{#
/**
 * Copyright (C) 2020 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 %}
{% import "inline.twig" as inline %}

{% block formTitle %}
    {% trans "Assign a Layout" %}
{% endblock %}

{% block formButtons %}
    {% trans "Cancel" %}, XiboDialogClose()
    {% trans "Save" %}, forms.layoutAssignSubmit()
{% endblock %}

{% block callBack %}forms.layoutFormCallBack{% endblock %}

{% block formHtml %}
    <div class="row">
        <div class="col-md-12">
            <div class="alert alert-warning">
                {% trans "Assigning a Layout to a Display/DisplayGroup does NOT schedule that Layout to be shown. Please use the Schedule to show Layouts." %}
            </div>
            <div id="FileAssociationsAssign" class="card p-3 mb-3 bg-light" data-url="{{ url_for("displayGroup.assign.layout", {id: displayGroup.displayGroupId}) }}">
                <div>
                    <ul id="FileAssociationsSortable">
                        {% for item in layouts %}
                        <li data-layout-id="{{ item.layoutId }}" class="btn btn-sm btn-white">{{ item.layout }}<span class="fa fa-minus"></span></li>
                        {% endfor %}
                    </ul>
                </div>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-md-12">
            <div class="XiboGrid" id="{{ random() }}">
                <div class="FilterDiv card-body">
                    <form onsubmit="false">

                    </form>
                </div>
                <div class="XiboData card pt-3">
                    <table id="layoutAssignments" data-url="{{ url_for("layout.search") }}" class="table table-striped" data-state-preference-name="campaignLayoutAssignGrid">
                        <thead>
                        <tr>
                            <th>{% trans "Name" %}</th>
                            <th></th>
                        </tr>
                        </thead>
                        <tbody>

                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
{% endblock %}