{#
/*
 * Graph Xibo Module
 * Copyright (C) 2018 Lukas Zurschmiede
 *  minor modifications by Spring Signage Ltd to integrate into the core modules
 *
 * This Xibo-Module 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. 
 *
 * This Xibo-Module 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 This Xibo-Module.  If not, see <http://www.gnu.org/licenses/>.
 */
#}

{% extends "form-base.twig" %}
{% import "forms.twig" as forms %}

{% block formTitle %}
    {% trans "Add Chart" %}
{% endblock %}

{% block formButtons %}
    {% trans "Cancel" %}, XiboDialogClose()
    {% trans "Save" %}, $("#graphAddForm").submit()
{% endblock %}

{% block formHtml %}
    <div class="row">
        <div class="col-md-12">
            <form id="graphAddForm" class="XiboForm form-horizontal" method="post" action="{{ urlFor("module.widget.add", {type: module.widget.type, id: playlist.playlistId}) }}"
                  data-next-form-url="{{ urlFor("module.widget.edit.form", {type: module.widget.type}) }}">
                {% set title %}{% trans "DataSet" %}{% endset %}
                {% set helpText %}{% trans "Please select the DataSet to use as a source of data for this view." %}{% endset %}
                {{ forms.dropdown("dataSetId", "single", title, "", module.dataSets(), "dataSetId", "dataSet", helpText, "dataset-fields") }}
            </form>
        </div>
    </div>
{% endblock %}
