<commit_before>{#
/*
 * Xibo - Digital Signage - http://www.xibo.org.uk
 * Copyright (C) 2019 Xibo Signage Ltd
 *
 * 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 "Edit Agenda" %}
{% endblock %}

{% block formHtml %}
    <div class="row">
        <ul class="nav nav-tabs" role="tablist">
            <li class="nav-item"><a class="nav-link active" href="#generalTab" role="tab" data-toggle="tab"><span>{% trans "General" %}</span></a></li>
            <li class="nav-item"><a class="nav-link" href="#configurationTab" role="tab" data-toggle="tab"><span>{% trans "Configuration" %}</span></a></li>
            <li class="nav-item"><a class="nav-link" href="#appearanceTab" role="tab" data-toggle="tab"><span>{% trans "Appearance" %}</span></a></li>
            <li class="nav-item dropdown">
                <a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">
                    {% trans "Templates" %}<span class="caret"></span>
                </a>
                <div class="dropdown-menu">
                    <a class="dropdown-item" href="#templateTab" role="tab" data-toggle="tab"><span>{% trans "Main" %}</span></a>
                    <a class="dropdown-item" href="#currentEventTemplateTab" role="tab" data-toggle="tab"><span>{% trans "Current Event" %}</span></a>
                    <a class="dropdown-item" href="#noDataTemplateTab" role="tab" data-toggle="tab"><span>{% trans "No Data" %}</span></a>
                    <a class="dropdown-item" href="#optionalStylesheetTab" role="tab" data-toggle="tab"><span>{% trans "Optional Stylesheet" %}</span></a>
                </div>
            </li>
            <li class="nav-item"><a class="nav-link" href="#cachingTab" role="tab" data-toggle="tab"><span>{% trans "Caching" %}</span></a></li>
            <li class="nav-item"><a class="nav-link" href="#triggerTab" role="tab" data-toggle="tab"><span>{% trans "Trigger" %}</span></a></li>
        </ul>

        <div class="col-md-12">
            <form id="agendaFormEdit" class="XiboForm form-horizontal" method="put" action="{{ url_for("module.widget.edit", {id: module.widget.widgetId}) }}">
                <div class="tab-content">

                    <div class="tab-pane active" id="generalTab">
                        {% set title %}{% trans "Name" %}{% endset %}
                        {% set helpText %}{% trans "An optional name for this widget" %}{% endset %}
                        {{ forms.input("name", title, module.getOption("name"), helpText) }}

                        {% set title %}{% trans "Set a duration?" %}{% endset %}
                        {% set helpText %}{% trans "Select to provide a specific duration for this Widget" %}{% endset %}
                        {{ forms.checkbox("useDuration", title, module.getUseDuration(), helpText) }}

                        {% set title %}{% trans "Duration" %}{% endset %}
                        {% set helpText %}{% trans "The duration in seconds this should be displayed" %}{% endset %}
                        {{ forms.number("duration", title, module.getDuration(), helpText, "duration-fields", "required") }}

                        {% set title %}{% trans "Duration is per item" %}{% endset %}
                        {% set helpText %}{% trans "The duration specified is per item otherwise it is per feed." %}{% endset %}
                        {{ forms.checkbox("durationIsPerItem", title, module.getOption("durationIsPerItem"), helpText) }}

                        {% set title %}{% trans "Enable Stats Collection?" %}{% endset %}
                        {% set helpText %}{% trans "Enable the collection of Proof of Play statistics for this Widget. Ensure that ‘Enable Stats Collection’ is set to ‘On’ in the Display Settings." %}{% endset %}

                        {% set offOption %}{% trans "Off" %}{% endset %}
                        {% set onOption %}{% trans "On" %}{% endset %}
                        {% set inheritOption %}{% trans "Inherit" %}{% endset %}
                        {% set options = [
                            { id: "Off", value: offOption },
                            { id: "On", value: onOption },
                            { id: "Inherit", value: inheritOption }
                        ] %}
                        {{ forms.dropdown("enableStat", "single", title, module.getOption("enableStat", theme.getSetting("WIDGET_STATS_ENABLED_DEFAULT")), options, "id", "value", helpText) }}
                    </div>

                    <div class="tab-pane" id="configurationTab">
                        {% set title %}{% trans "Feed URL" %}{% endset %}
                        {% set helpText %}{% trans "The Link for the iCal Feed" %}{% endset %}
                        {{ forms.input("uri", title, module.getOption("uri")|url_decode, helpText)}}

                        {# What range are we looking to return #}
                        {% set title %}{% trans "Interval" %}{% endset %}
                        {% set helpText %}{% trans "Using natural language enter a string representing the period for which events should be returned, for example 2 days or 1 week." %}{% endset %}
                        {{ forms.input("customInterval", title, module.getOption("customInterval"), helpText, "interval")}}

                        {% set title %}{% trans "Select a Date range to return events instead?" %}{% endset %}
                        {% set helpText %}{% trans "Use the checkbox to return events within defined start and end dates" %}{% endset %}
                        {{ forms.checkbox("useDateRange", title, module.getOption("useDateRange", 0), helpText) }}

                        <div class="date-range" style="display: none">
                            {% set title %}{% trans "Start Date" %}{% endset %}
                            {{ forms.dateTime("rangeStart", title, module.getOption("rangeStart", null), "", "date-range") }}

                            {% set title %}{% trans "End Date" %}{% endset %}
                            {{ forms.dateTime("rangeEnd", title, module.getOption("rangeEnd", null, "", "date-range")) }}
                        </div>

                        {% set title %}{% trans "Number of Items" %}{% endset %}
                        {% set helpText %}{% trans "The Number of items you want to display" %}{% endset %}
                        {{ forms.number("numItems", title, module.getOption("numItems"), helpText) }}

                        {% set title %}{% trans "Exclude all day events?" %}{% endset %}
                        {% set helpText %}{% trans "When all day events are excluded they are removed from the list of events in the feed and wont be shown" %}{% endset %}
                        {{ forms.checkbox("excludeAllDay", title, module.getOption("excludeAllDay"), helpText) }}

                        {% set title %}{% trans "Show only current events?" %}{% endset %}
                        {% set helpText %}{% trans "Show current events and hide all other events from the feed" %}{% endset %}
                        {{ forms.checkbox("excludeOnlyCurrent", title, module.getOption("excludeOnlyCurrent"), helpText) }}

                        {% set title %}{% trans "Exclude current events?" %}{% endset %}
                        {% set helpText %}{% trans "When current events are excluded they are removed from the list of events in the feed and wont be shown" %}{% endset %}
                        {{ forms.checkbox("excludeCurrent", title, module.getOption("excludeCurrent"), helpText, "exclude-current") }}

                        {% set title %}{% trans "Use event timezone?" %}{% endset %}
                        {% set helpText %}{% trans "If an event specifies a timezone, should it be used. Deselection means the CMS timezone will be used." %}{% endset %}
                        {{ forms.checkbox("useEventTimezone", title, module.getOption("useEventTimezone", 1), helpText) }}

                        {% set title %}{% trans "Use calendar timezone?" %}{% endset %}
                        {% set helpText %}{% trans "If use event timezone is selected and your calendar feed specifies its own time zone should this be used? Deselecting means the CMS timezone will be used." %}{% endset %}
                        {{ forms.checkbox("useCalendarTimezone", title, module.getOption("useCalendarTimezone", 1), helpText) }}

                        {% set title %}{% trans "Windows format Calendar?" %}{% endset %}
                        {% set helpText %}{% trans "Does the calendar feed come from Windows - if unsure leave unselected." %}{% endset %}
                        {{ forms.checkbox("windowsFormatCalendar", title, module.getOption("windowsFormatCalendar", 0), helpText) }}

                    </div>

                    <div class="tab-pane" id="appearanceTab">

                        {% set title %}{% trans "Background Color" %}{% endset %}
                        {% set helpText %}{% trans "Select an optional background colour to put behind the agenda, leaving this blank will make the graph transparent." %}{% endset %}
                        {{ forms.input("backgroundColor", title, module.getOption("backgroundColor"), helpText, "background-color-group") }}

                        {% set title %}{% trans "Date Format" %}{% endset %}
                        {% set manualUrl %}{{ helpService.address("media_module_calendar.html") }}{% endset %}
                        {% set helpText %}{% trans %}The format to apply to dates. See the <a href="{{ manualUrl }}">Manual</a> for allowed formats.{% endtrans %}{% endset %}
                        {{ forms.input("dateFormat", title, module.getOption("dateFormat"), helpText) }}

                        {% set title %}{% trans "Show items side by side?" %}{% endset %}
                        {% set helpText %}{% trans "Should items be shown side by side?" %}{% endset %}
                        {{ forms.checkbox("itemsSideBySide", title, module.getOption("itemsSideBySide"), helpText) }}

                        {% set title %}{% trans "Effect" %}{% endset %}
                        {% set helpText %}{% trans "Please select the effect that will be used to transition between items. Marquee effects are CPU intensive and may not be suitable for lower power displays." %}{% endset %}

                        {% set showAll %}{% trans "Show all items" %}{% endset %}
                        {% set showPaged %}{% trans "Paged" %}{% endset %}
                        {% set marqueeLeft %}{% trans "Marquee Left" %}{% endset %}
                        {% set marqueeRight %}{% trans "Marquee Right" %}{% endset %}
                        {% set marqueeUp %}{% trans "Marquee Up" %}{% endset %}
                        {% set marqueeDown %}{% trans "Marquee Down" %}{% endset %}<commit_msg>Widgets: fix agenda background colour help text<commit_after>{#
/*
 * Xibo - Digital Signage - http://www.xibo.org.uk
 * Copyright (C) 2022 Xibo Signage Ltd
 *
 * 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 "Edit Agenda" %}
{% endblock %}

{% block formHtml %}
    <div class="row">
        <ul class="nav nav-tabs" role="tablist">
            <li class="nav-item"><a class="nav-link active" href="#generalTab" role="tab" data-toggle="tab"><span>{% trans "General" %}</span></a></li>
            <li class="nav-item"><a class="nav-link" href="#configurationTab" role="tab" data-toggle="tab"><span>{% trans "Configuration" %}</span></a></li>
            <li class="nav-item"><a class="nav-link" href="#appearanceTab" role="tab" data-toggle="tab"><span>{% trans "Appearance" %}</span></a></li>
            <li class="nav-item dropdown">
                <a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">
                    {% trans "Templates" %}<span class="caret"></span>
                </a>
                <div class="dropdown-menu">
                    <a class="dropdown-item" href="#templateTab" role="tab" data-toggle="tab"><span>{% trans "Main" %}</span></a>
                    <a class="dropdown-item" href="#currentEventTemplateTab" role="tab" data-toggle="tab"><span>{% trans "Current Event" %}</span></a>
                    <a class="dropdown-item" href="#noDataTemplateTab" role="tab" data-toggle="tab"><span>{% trans "No Data" %}</span></a>
                    <a class="dropdown-item" href="#optionalStylesheetTab" role="tab" data-toggle="tab"><span>{% trans "Optional Stylesheet" %}</span></a>
                </div>
            </li>
            <li class="nav-item"><a class="nav-link" href="#cachingTab" role="tab" data-toggle="tab"><span>{% trans "Caching" %}</span></a></li>
            <li class="nav-item"><a class="nav-link" href="#triggerTab" role="tab" data-toggle="tab"><span>{% trans "Trigger" %}</span></a></li>
        </ul>

        <div class="col-md-12">
            <form id="agendaFormEdit" class="XiboForm form-horizontal" method="put" action="{{ url_for("module.widget.edit", {id: module.widget.widgetId}) }}">
                <div class="tab-content">

                    <div class="tab-pane active" id="generalTab">
                        {% set title %}{% trans "Name" %}{% endset %}
                        {% set helpText %}{% trans "An optional name for this widget" %}{% endset %}
                        {{ forms.input("name", title, module.getOption("name"), helpText) }}

                        {% set title %}{% trans "Set a duration?" %}{% endset %}
                        {% set helpText %}{% trans "Select to provide a specific duration for this Widget" %}{% endset %}
                        {{ forms.checkbox("useDuration", title, module.getUseDuration(), helpText) }}

                        {% set title %}{% trans "Duration" %}{% endset %}
                        {% set helpText %}{% trans "The duration in seconds this should be displayed" %}{% endset %}
                        {{ forms.number("duration", title, module.getDuration(), helpText, "duration-fields", "required") }}

                        {% set title %}{% trans "Duration is per item" %}{% endset %}
                        {% set helpText %}{% trans "The duration specified is per item otherwise it is per feed." %}{% endset %}
                        {{ forms.checkbox("durationIsPerItem", title, module.getOption("durationIsPerItem"), helpText) }}

                        {% set title %}{% trans "Enable Stats Collection?" %}{% endset %}
                        {% set helpText %}{% trans "Enable the collection of Proof of Play statistics for this Widget. Ensure that ‘Enable Stats Collection’ is set to ‘On’ in the Display Settings." %}{% endset %}

                        {% set offOption %}{% trans "Off" %}{% endset %}
                        {% set onOption %}{% trans "On" %}{% endset %}
                        {% set inheritOption %}{% trans "Inherit" %}{% endset %}
                        {% set options = [
                            { id: "Off", value: offOption },
                            { id: "On", value: onOption },
                            { id: "Inherit", value: inheritOption }
                        ] %}
                        {{ forms.dropdown("enableStat", "single", title, module.getOption("enableStat", theme.getSetting("WIDGET_STATS_ENABLED_DEFAULT")), options, "id", "value", helpText) }}
                    </div>

                    <div class="tab-pane" id="configurationTab">
                        {% set title %}{% trans "Feed URL" %}{% endset %}
                        {% set helpText %}{% trans "The Link for the iCal Feed" %}{% endset %}
                        {{ forms.input("uri", title, module.getOption("uri")|url_decode, helpText)}}

                        {# What range are we looking to return #}
                        {% set title %}{% trans "Interval" %}{% endset %}
                        {% set helpText %}{% trans "Using natural language enter a string representing the period for which events should be returned, for example 2 days or 1 week." %}{% endset %}
                        {{ forms.input("customInterval", title, module.getOption("customInterval"), helpText, "interval")}}

                        {% set title %}{% trans "Select a Date range to return events instead?" %}{% endset %}
                        {% set helpText %}{% trans "Use the checkbox to return events within defined start and end dates" %}{% endset %}
                        {{ forms.checkbox("useDateRange", title, module.getOption("useDateRange", 0), helpText) }}

                        <div class="date-range" style="display: none">
                            {% set title %}{% trans "Start Date" %}{% endset %}
                            {{ forms.dateTime("rangeStart", title, module.getOption("rangeStart", null), "", "date-range") }}

                            {% set title %}{% trans "End Date" %}{% endset %}
                            {{ forms.dateTime("rangeEnd", title, module.getOption("rangeEnd", null, "", "date-range")) }}
                        </div>

                        {% set title %}{% trans "Number of Items" %}{% endset %}
                        {% set helpText %}{% trans "The Number of items you want to display" %}{% endset %}
                        {{ forms.number("numItems", title, module.getOption("numItems"), helpText) }}

                        {% set title %}{% trans "Exclude all day events?" %}{% endset %}
                        {% set helpText %}{% trans "When all day events are excluded they are removed from the list of events in the feed and wont be shown" %}{% endset %}
                        {{ forms.checkbox("excludeAllDay", title, module.getOption("excludeAllDay"), helpText) }}

                        {% set title %}{% trans "Show only current events?" %}{% endset %}
                        {% set helpText %}{% trans "Show current events and hide all other events from the feed" %}{% endset %}
                        {{ forms.checkbox("excludeOnlyCurrent", title, module.getOption("excludeOnlyCurrent"), helpText) }}

                        {% set title %}{% trans "Exclude current events?" %}{% endset %}
                        {% set helpText %}{% trans "When current events are excluded they are removed from the list of events in the feed and wont be shown" %}{% endset %}
                        {{ forms.checkbox("excludeCurrent", title, module.getOption("excludeCurrent"), helpText, "exclude-current") }}

                        {% set title %}{% trans "Use event timezone?" %}{% endset %}
                        {% set helpText %}{% trans "If an event specifies a timezone, should it be used. Deselection means the CMS timezone will be used." %}{% endset %}
                        {{ forms.checkbox("useEventTimezone", title, module.getOption("useEventTimezone", 1), helpText) }}

                        {% set title %}{% trans "Use calendar timezone?" %}{% endset %}
                        {% set helpText %}{% trans "If use event timezone is selected and your calendar feed specifies its own time zone should this be used? Deselecting means the CMS timezone will be used." %}{% endset %}
                        {{ forms.checkbox("useCalendarTimezone", title, module.getOption("useCalendarTimezone", 1), helpText) }}

                        {% set title %}{% trans "Windows format Calendar?" %}{% endset %}
                        {% set helpText %}{% trans "Does the calendar feed come from Windows - if unsure leave unselected." %}{% endset %}
                        {{ forms.checkbox("windowsFormatCalendar", title, module.getOption("windowsFormatCalendar", 0), helpText) }}

                    </div>

                    <div class="tab-pane" id="appearanceTab">

                        {% set title %}{% trans "Background Color" %}{% endset %}
                        {% set helpText %}{% trans "Select an optional background colour to put behind the agenda, leaving this blank will make the widget transparent." %}{% endset %}
                        {{ forms.input("backgroundColor", title, module.getOption("backgroundColor"), helpText, "background-color-group") }}

                        {% set title %}{% trans "Date Format" %}{% endset %}
                        {% set manualUrl %}{{ helpService.address("media_module_calendar.html") }}{% endset %}
                        {% set helpText %}{% trans %}The format to apply to dates. See the <a href="{{ manualUrl }}">Manual</a> for allowed formats.{% endtrans %}{% endset %}
                        {{ forms.input("dateFormat", title, module.getOption("dateFormat"), helpText) }}

                        {% set title %}{% trans "Show items side by side?" %}{% endset %}
                        {% set helpText %}{% trans "Should items be shown side by side?" %}{% endset %}
                        {{ forms.checkbox("itemsSideBySide", title, module.getOption("itemsSideBySide"), helpText) }}

                        {% set title %}{% trans "Effect" %}{% endset %}
                        {% set helpText %}{% trans "Please select the effect that will be used to transition between items. Marquee effects are CPU intensive and may not be suitable for lower power displays." %}{% endset %}

                        {% set showAll %}{% trans "Show all items" %}{% endset %}
                        {% set showPaged %}{% trans "Paged" %}{% endset %}
                        {% set marqueeLeft %}{% trans "Marquee Left" %}{% endset %}
                        {% set marqueeRight %}{% trans "Marquee Right" %}{% endset %}
                        {% set marqueeUp %}{% trans "Marquee Up" %}{% endset %}
                        {% set marqueeDown %}{% trans "Marquee Down" %}{% endset %}
{'fraction_non_alphanumeric': 0.15172918730350143, 'fraction_numerical': 0.0011197726000258409, 'mean_word_length': 2.0939373750832777, 'pattern_counts': {'":': 0, '<': 143, '<?xml version=': 0, '>': 143, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2467028', 'n_tokens_mistral': 6333, 'n_tokens_neox': 5791, 'n_words': 1882}