<commit_before>{#
/*
 * 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 "Schedule Event" %}
{% endblock %}

{% block callBack %}setupScheduleForm{% endblock %}

{% block formButtons %}
    {% trans "Help" %}, XiboHelpRender("{{ help }}")
    {% trans "Cancel" %}, XiboDialogClose()
    {% trans "Next" %}, XiboDialogApply("#scheduleAddForm")
    {% trans "Save" %}, beforeSubmitScheduleForm($("#scheduleAddForm"))
{% endblock %}

{% block formHtml %}
    <div class="row">
        <div class="col-md-12">
            <ul class="nav nav-tabs" role="tablist">
                <li class="active"><a href="#general" role="tab" data-toggle="tab"><span>{% trans "General" %}</span></a></li>
                <li class="repeats"><a href="#repeats" role="tab" data-toggle="tab"><span>{% trans "Repeats" %}</span></a></li>
                <li class="reminders"><a href="#reminders" role="tab" data-toggle="tab"><span>{% trans "Reminder" %}</span></a></li>
                <li class="geoSchedule"><a href="#geoSchedule" role="tab" data-toggle="tab"><span>{% trans "Geo Location" %}</span></a></li>
            </ul>
            {% set dayPartMessage %}{% trans "Select the start time for this event" %}{% endset %}
            {% set notDayPartMessage %}{% trans "Start and end time will be defined by the daypart's configuration for this day of the week. Use a repeating schedule to apply this event over multiple days" %}{% endset %}
            <form id="scheduleAddForm" autocomplete="off" class="form-horizontal" method="post" action="{{ urlFor("schedule.add") }}" data-daypart-message="{{ dayPartMessage }}" data-not-daypart-message="{{ notDayPartMessage }}" data-default-lat="{{ defaultLat }}" data-default-long = "{{ defaultLong }}">
                <div class="tab-content">
                    <div class="tab-pane active" id="general">

                        {% set title %}{% trans "Event Type" %}{% endset %}
                        {% set helpText %}{% trans "Select the type of event to schedule" %}{% endset %}
                        {% set layoutEventType %}{% trans "Layout" %}{% endset %}
                        {% set campaignEventType %}{% trans "Campaign" %}{% endset %}
                        {% set commandEventType %}{% trans "Command" %}{% endset %}
                        {% set overlayEventType %}{% trans "Overlay Layout" %}{% endset %}
                        {% set interruptEventType %}{% trans "Interrupt Layout" %}{% endset %}
                        {% set eventTypes = [
                        {id: 1, label: layoutEventType},
                        {id: 5, label: campaignEventType},
                        {id: 2, label: commandEventType},
                        {id: 3, label: overlayEventType},
                        {id: 4, label: interruptEventType}
                        ] %}
                        {{ forms.dropdown("eventTypeId", "single", title, "", eventTypes, "id", "label", helpText) }}

                        {% set title %}{% trans "Display" %}{% endset %}
                        {% set helpText %}{% trans "Please select one or more displays / groups for this event to be shown on." %}{% endset %}
                        {% set attributes = [
                            { name: "data-search-url", value:  urlFor("schedule.displayGroup.search") },
                            { name: "data-trans-groups", value:  "Groups"|trans },
                            { name: "data-trans-display", value:  "Display"|trans }
                        ] %}
                        {{ forms.dropdown("displayGroupIds[]", "dropdownmulti", title, displayGroupIds, displayGroups, "displayGroupId", "displayGroup", helpText, "", "", "", "", attributes) }}

                        {% set title %}{% trans "Dayparting" %}{% endset %}
                        {% set helpText %}{% trans "Select the dayparting information for this event. To set your own times select custom and to have the event run constantly select Always." %}{% endset %}
                        <div class="form-group day-part-control">
                            <label class="col-sm-2 control-label" for="dayPartId">{{ title }}</label>
                            <div class="col-sm-10">
                                <select class="form-control" name="dayPartId" id="dayPartId">
                                    {% for dayPart in dayParts %}
                                        <option {% if dayPart.isCustom == 1 %}selected{% endif %}
                                                value="{{ dayPart.dayPartId }}"
                                                data-is-always="{{ dayPart.isAlways }}"
                                                data-is-custom="{{ dayPart.isCustom }}">{{ dayPart.name }}</option>
                                    {% endfor %}
                                </select>
                                <span class="help-block">{{ helpText }}</span>
                            </div>
                        </div>

                        {% set title %}{% trans "Start Time" %}{% endset %}
                        {% set helpText %}{% trans "Select the start time for this event" %}{% endset %}
                        {{ forms.dateTime("fromDt", title, "", helpText, "starttime-control", "required") }}

                        {% set title %}{% trans "End Time" %}{% endset %}
                        {% set helpText %}{% trans "Select the end time for this event" %}{% endset %}
                        {{ forms.dateTime("toDt", title, "", helpText, "endtime-control", "required") }}

                        {# Campaign / Layout list. We want to build two arrays for us to use. #}
                        {% set attributes = [
                            { name: "data-search-url", value:  urlFor("schedule.campaign.search") },
                            { name: "data-search-is-layout-specific", value: -1 },
                            { name: "data-trans-layout", value: "Layout"|trans },
                            { name: "data-trans-layout-help-text", value: "Please select a Layout for this Event to show"|trans },
                            { name: "data-trans-layout", value: "Campaign"|trans },
                            { name: "data-trans-layout-help-text", value: "Please select a Campaign for this Event to show"|trans },
                        ] %}

                        {% set title %}{% trans "Layout" %}{% endset %}
                        {% set helpText %}{% trans "Please select a Layout for this Event to show" %}{% endset %}
                        {{ forms.dropdown("campaignId", "single", title, "", null, "id", "value", helpText, "layout-control", "", "", "", attributes) }}

                        <div class="form-group preview-button-container">
                            <div class="col-md-offset-2 col-md-10">
                                <a id="previewButton" class="btn btn-success" target="_blank" data-url="{{ urlFor("campaign.preview") }}">{% trans "Preview" %} <span class="fa fa-tablet"></span></a>
                                <span class="help-block">{% trans "Preview your selection in a new tab" %}</span>
                            </div>
                        </div>

                        <div class="form-group interrupt-control" style="display: block;">
                            <label class="col-sm-2 control-label" for="shareOfVoice" accesskey="">{% trans "Share of Voice" %}</label>
                            <div class="col-sm-5">
                                <input class="form-control" name="shareOfVoice" type="number" id="shareOfVoice" value="0">
                                <span class="help-block">{% trans "The amount of time this Layout should be shown, in seconds per hour." %}</span>
                            </div>

                            <div class="col-sm-5">
                                <input class="form-control" name="shareOfVoicePercentage" type="number" id="shareOfVoicePercentage" value="">
                                <span class="help-block">{% trans "As a percentage" %}</span>
                            </div>
                        </div>

                        {% set title %}{% trans "Command" %}{% endset %}
                        {% set helpText %}{% trans "Please select a command for this Event." %}{% endset %}
                        {{ forms.dropdown("commandId", "single", title, "", [{commandId: "", command: ""}]|merge(commands), "commandId", "command", helpText, "command-control") }}

                        {% set title %}{% trans "Display Order" %}{% endset %}
                        {% set helpText %}{% trans "Please select the order this event should appear in relation to others when there is more than one event scheduled" %}{% endset %}
                        {{ forms.number("displayOrder", title, "", helpText, 'displayOrder-control') }}

                        {% set title %}{% trans "Priority" %}{% endset %}
                        {% set helpText %}{% trans "Sets the event priority - events with the highest priority play in preference to lower priority events." %}{% endset %}
                        {{ forms.number("isPriority", title, "", helpText, 'priority-control') }}

                        {% set title %}{% trans "Run at CMS Time?" %}{% endset %}
                        {% set helpText %}{% trans "When selected, your event will run according to the timezone set on the CMS, otherwise the event will run at Display local time" %}{% endset %}
                        {{ forms.checkbox("syncTimezone", title, 0, helpText) }}

                        {% if settings.EVENT_SYNC == 1 %}
                            {% set title %}{% trans "Synchronise this event?" %}{% endset %}
                            {% set helpText %}{% trans "When selected, all selected players will attempt to synchronise the output (Supported on Android player only)" %}{% endset %}
                            {{ forms.checkbox("syncEvent", title, 0, helpText, "sync-schedule-control") }}
                        {% endif %}

                    </div>
                    
                    <div class="tab-pane" id="repeats">
                        {% set title %}{% trans "Repeats" %}{% endset %}
                        {% set helpText %}{% trans "Select the type of Repeat required for this Event." %}{% endset %}
                        {% set noneOption %}{% trans "None" %}{% endset %}
                        {% set minute %}{% trans "Per Minute" %}{% endset %}
                        {% set hourly %}{% trans "Hourly" %}{% endset %}
                        {% set daily %}{% trans "Daily" %}{% endset %}
                        {% set weekly %}{% trans "Weekly" %}{% endset %}
                        {% set monthly %}{% trans "Monthly" %}{% endset %}
                        {% set yearly %}{% trans "Yearly" %}{% endset %}
                        {% set options = [
                        { id: "", name: noneOption },
                        { id: "Minute", name: minute },
                        { id: "Hour", name: hourly},
                        { id: "Day", name: daily},
                        { id: "Week", name: weekly},
                        { id: "Month", name: monthly},
                        { id: "Year", name: yearly}
                        ] %}
                        {{ forms.dropdown("recurrenceType", "single", title, "", options, "id", "name", helpText) }}

                        {% set helpText %}{% trans "Use the drop-down to select which days of the week this Event should be repeated." %}{% endset %}
                        {% set monday %}{% trans "Monday" %}{% endset %}
                        {% set tuesday %}{% trans "Tuesday" %}{% endset %}
                        {% set wednesday %}{% trans "Wednesday" %}{% endset %}
                        {% set thursday %}{% trans "Thursday" %}{% endset %}
                        {% set friday %}{% trans "Friday" %}{% endset %}
                        {% set saturday %}{% trans "Saturday" %}{% endset %}
                        {% set sunday %}{% trans "Sunday" %}{% endset %}
                        {% set options = [
                        { id: 1, name: monday },
                        { id: 2, name: tuesday },
                        { id: 3, name: wednesday },
                        { id: 4, name: thursday },
                        { id: 5, name: friday },
                        { id: 6, name: saturday },
                        { id: 7, name: sunday },
                        ] %}
                        {{ forms.dropdown("recurrenceRepeatsOn[]", "dropdownmulti", "", event.recurrenceRepeatsOn, options, "id", "name", helpText, "repeat-weekly-control-group") }}

                        {% set helpText %}{% trans "Should this Event Repeat by Day of the month (eg. Monthly on Day 21) or by a Weekday in the month (eg. Monthly on the third Thursday)." %}{% endset %}
                        {% set attributes = [
                            { name: "data-trans-day", value: "on the [DAY] day"|trans },
                            { name: "data-trans-weekday", value: "on the [POSITION] [WEEKDAY]"|trans }
                        ] %}
                        {{ forms.dropdown("recurrenceMonthlyRepeatsOn", "single", "", 0, [], "id", "name", helpText, "repeat-monthly-control-group", "", "", "", attributes) }}

                        {% set title %}{% trans "Every" %}{% endset %}
                        {% set helpText %}{% trans "Include a number to determine the Repeat frequency required for this Event." %}{% endset %}
                        {{ forms.number("recurrenceDetail", title, recurrenceDetail, helpText, "repeat-control-group") }}

                        {% set title %}{% trans "Until" %}{% endset %}
                        {% set helpText %}{% trans "Provide a date and time to end the Repeat for this Event. Leave empty to Repeat indefinitely." %}{% endset %}
                        {{ forms.dateTime("recurrenceRange", title, "", helpText, "repeat-control-group", "", "") }}
                    </div>

                    <div class="tab-pane" id="reminders">
                        {% set message %}{% trans "Use the form fields below to create a set of reminders for this event. New fields can be added by clicking on the + icon at the end of the row. Use the tick box to receive a notification by email alternatively reminders will be shown in the message center." %}{% endset %}
                        {{ forms.message(message) }}
                        <div id="reminderFields" data-reminders="{{ reminders|json_encode }}"></div>
                    </div>

                    <div class="tab-pane" id="geoSchedule">
                        {% set title %}{% trans "Geo Schedule?" %}{% endset %}
                        {% set helpText %}{% trans "Should this event be location aware? Enable this checkbox and select an area by drawing a polygon or rectangle layer on the map below." %}{% endset %}
                        {{ forms.checkbox("isGeoAware", title, 0, helpText, "") }}

                        <div id="geoScheduleMap" style="height: 500px; width: 100%" class="hidden"></div>

                        {{ forms.hidden("geoLocation", "") }}
                    </div>
                </div>
            </form>
        </div>
    </div>
{% endblock %}<commit_msg>Missing change from add form. xibosignage/xibo#2466<commit_after>{#
/*
 * 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 "Schedule Event" %}
{% endblock %}

{% block callBack %}setupScheduleForm{% endblock %}

{% block formButtons %}
    {% trans "Help" %}, XiboHelpRender("{{ help }}")
    {% trans "Cancel" %}, XiboDialogClose()
    {% trans "Next" %}, XiboDialogApply("#scheduleAddForm")
    {% trans "Save" %}, beforeSubmitScheduleForm($("#scheduleAddForm"))
{% endblock %}

{% block formHtml %}
    <div class="row">
        <div class="col-md-12">
            <ul class="nav nav-tabs" role="tablist">
                <li class="active"><a href="#general" role="tab" data-toggle="tab"><span>{% trans "General" %}</span></a></li>
                <li class="repeats"><a href="#repeats" role="tab" data-toggle="tab"><span>{% trans "Repeats" %}</span></a></li>
                <li class="reminders"><a href="#reminders" role="tab" data-toggle="tab"><span>{% trans "Reminder" %}</span></a></li>
                <li class="geoSchedule"><a href="#geoSchedule" role="tab" data-toggle="tab"><span>{% trans "Geo Location" %}</span></a></li>
            </ul>
            {% set dayPartMessage %}{% trans "Select the start time for this event" %}{% endset %}
            {% set notDayPartMessage %}{% trans "Start and end time will be defined by the daypart's configuration for this day of the week. Use a repeating schedule to apply this event over multiple days" %}{% endset %}
            <form id="scheduleAddForm" autocomplete="off" class="form-horizontal" method="post" action="{{ urlFor("schedule.add") }}" data-daypart-message="{{ dayPartMessage }}" data-not-daypart-message="{{ notDayPartMessage }}" data-default-lat="{{ defaultLat }}" data-default-long = "{{ defaultLong }}">
                <div class="tab-content">
                    <div class="tab-pane active" id="general">

                        {% set title %}{% trans "Event Type" %}{% endset %}
                        {% set helpText %}{% trans "Select the type of event to schedule" %}{% endset %}
                        {% set layoutEventType %}{% trans "Layout" %}{% endset %}
                        {% set campaignEventType %}{% trans "Campaign" %}{% endset %}
                        {% set commandEventType %}{% trans "Command" %}{% endset %}
                        {% set overlayEventType %}{% trans "Overlay Layout" %}{% endset %}
                        {% set interruptEventType %}{% trans "Interrupt Layout" %}{% endset %}
                        {% set eventTypes = [
                        {id: 1, label: layoutEventType},
                        {id: 5, label: campaignEventType},
                        {id: 2, label: commandEventType},
                        {id: 3, label: overlayEventType},
                        {id: 4, label: interruptEventType}
                        ] %}
                        {{ forms.dropdown("eventTypeId", "single", title, "", eventTypes, "id", "label", helpText) }}

                        {% set title %}{% trans "Display" %}{% endset %}
                        {% set helpText %}{% trans "Please select one or more displays / groups for this event to be shown on." %}{% endset %}
                        {% set attributes = [
                            { name: "data-search-url", value:  urlFor("schedule.displayGroup.search") },
                            { name: "data-trans-groups", value:  "Groups"|trans },
                            { name: "data-trans-display", value:  "Display"|trans }
                        ] %}
                        {{ forms.dropdown("displayGroupIds[]", "dropdownmulti", title, displayGroupIds, displayGroups, "displayGroupId", "displayGroup", helpText, "", "", "", "", attributes) }}

                        {% set title %}{% trans "Dayparting" %}{% endset %}
                        {% set helpText %}{% trans "Select the dayparting information for this event. To set your own times select custom and to have the event run constantly select Always." %}{% endset %}
                        <div class="form-group day-part-control">
                            <label class="col-sm-2 control-label" for="dayPartId">{{ title }}</label>
                            <div class="col-sm-10">
                                <select class="form-control" name="dayPartId" id="dayPartId">
                                    {% for dayPart in dayParts %}
                                        <option {% if dayPart.isCustom == 1 %}selected{% endif %}
                                                value="{{ dayPart.dayPartId }}"
                                                data-is-always="{{ dayPart.isAlways }}"
                                                data-is-custom="{{ dayPart.isCustom }}">{{ dayPart.name }}</option>
                                    {% endfor %}
                                </select>
                                <span class="help-block">{{ helpText }}</span>
                            </div>
                        </div>

                        {% set title %}{% trans "Start Time" %}{% endset %}
                        {% set helpText %}{% trans "Select the start time for this event" %}{% endset %}
                        {{ forms.dateTime("fromDt", title, "", helpText, "starttime-control", "required") }}

                        {% set title %}{% trans "End Time" %}{% endset %}
                        {% set helpText %}{% trans "Select the end time for this event" %}{% endset %}
                        {{ forms.dateTime("toDt", title, "", helpText, "endtime-control", "required") }}

                        {# Campaign / Layout list. We want to build two arrays for us to use. #}
                        {% set attributes = [
                            { name: "data-search-url", value:  urlFor("schedule.campaign.search") },
                            { name: "data-search-is-layout-specific", value: -1 },
                            { name: "data-trans-layout", value: "Layout"|trans },
                            { name: "data-trans-layout-help-text", value: "Please select a Layout for this Event to show"|trans },
                            { name: "data-trans-layout", value: "Campaign"|trans },
                            { name: "data-trans-layout-help-text", value: "Please select a Campaign for this Event to show"|trans },
                        ] %}

                        {% set title %}{% trans "Layout" %}{% endset %}
                        {% set helpText %}{% trans "Please select a Layout for this Event to show" %}{% endset %}
                        {{ forms.dropdown("campaignId", "single", title, "", null, "id", "value", helpText, "layout-control", "", "", "", attributes) }}

                        <div class="form-group preview-button-container">
                            <div class="col-md-offset-2 col-md-10">
                                <a id="previewButton" class="btn btn-success" target="_blank" data-url="{{ urlFor("campaign.preview") }}">{% trans "Preview" %} <span class="fa fa-tablet"></span></a>
                                <span class="help-block">{% trans "Preview your selection in a new tab" %}</span>
                            </div>
                        </div>

                        <div class="form-group interrupt-control" style="display: block;">
                            <label class="col-sm-2 control-label" for="shareOfVoice" accesskey="">{% trans "Share of Voice" %}</label>
                            <div class="col-sm-5">
                                <input class="form-control" name="shareOfVoice" type="number" id="shareOfVoice" value="0">
                                <span class="help-block">{% trans "The amount of time this Layout should be shown, in seconds per hour." %}</span>
                            </div>

                            <div class="col-sm-5">
                                <input class="form-control" name="shareOfVoicePercentage" type="number" id="shareOfVoicePercentage" value="">
                                <span class="help-block">{% trans "As a percentage" %}</span>
                            </div>
                        </div>

                        {% set title %}{% trans "Command" %}{% endset %}
                        {% set helpText %}{% trans "Please select a command for this Event." %}{% endset %}
                        {{ forms.dropdown("commandId", "single", title, "", [{commandId: "", command: ""}]|merge(commands), "commandId", "command", helpText, "command-control") }}

                        {% set title %}{% trans "Display Order" %}{% endset %}
                        {% set helpText %}{% trans "Please select the order this event should appear in relation to others when there is more than one event scheduled" %}{% endset %}
                        {{ forms.number("displayOrder", title, "", helpText, 'displayOrder-control') }}

                        {% set title %}{% trans "Priority" %}{% endset %}
                        {% set helpText %}{% trans "Sets the event priority - events with the highest priority play in preference to lower priority events." %}{% endset %}
                        {{ forms.number("isPriority", title, "", helpText, 'priority-control') }}

                        {% set title %}{% trans "Run at CMS Time?" %}{% endset %}
                        {% set helpText %}{% trans "When selected, your event will run according to the timezone set on the CMS, otherwise the event will run at Display local time" %}{% endset %}
                        {{ forms.checkbox("syncTimezone", title, 0, helpText) }}

                        {% if settings.EVENT_SYNC == 1 %}
                            {% set title %}{% trans "Synchronise this event?" %}{% endset %}
                            {% set helpText %}{% trans "When selected, all selected players will attempt to synchronise the output (Supported on Android player only)" %}{% endset %}
                            {{ forms.checkbox("syncEvent", title, 0, helpText, "sync-schedule-control") }}
                        {% endif %}

                    </div>
                    
                    <div class="tab-pane" id="repeats">
                        {% set title %}{% trans "Repeats" %}{% endset %}
                        {% set helpText %}{% trans "Select the type of Repeat required for this Event." %}{% endset %}
                        {% set noneOption %}{% trans "None" %}{% endset %}
                        {% set minute %}{% trans "Per Minute" %}{% endset %}
                        {% set hourly %}{% trans "Hourly" %}{% endset %}
                        {% set daily %}{% trans "Daily" %}{% endset %}
                        {% set weekly %}{% trans "Weekly" %}{% endset %}
                        {% set monthly %}{% trans "Monthly" %}{% endset %}
                        {% set yearly %}{% trans "Yearly" %}{% endset %}
                        {% set options = [
                        { id: "", name: noneOption },
                        { id: "Minute", name: minute },
                        { id: "Hour", name: hourly},
                        { id: "Day", name: daily},
                        { id: "Week", name: weekly},
                        { id: "Month", name: monthly},
                        { id: "Year", name: yearly}
                        ] %}
                        {{ forms.dropdown("recurrenceType", "single", title, "", options, "id", "name", helpText) }}

                        {% set helpText %}{% trans "Use the drop-down to select which days of the week this Event should be repeated." %}{% endset %}
                        {% set monday %}{% trans "Monday" %}{% endset %}
                        {% set tuesday %}{% trans "Tuesday" %}{% endset %}
                        {% set wednesday %}{% trans "Wednesday" %}{% endset %}
                        {% set thursday %}{% trans "Thursday" %}{% endset %}
                        {% set friday %}{% trans "Friday" %}{% endset %}
                        {% set saturday %}{% trans "Saturday" %}{% endset %}
                        {% set sunday %}{% trans "Sunday" %}{% endset %}
                        {% set options = [
                        { id: 1, name: monday },
                        { id: 2, name: tuesday },
                        { id: 3, name: wednesday },
                        { id: 4, name: thursday },
                        { id: 5, name: friday },
                        { id: 6, name: saturday },
                        { id: 7, name: sunday },
                        ] %}
                        {{ forms.dropdown("recurrenceRepeatsOn[]", "dropdownmulti", "", event.recurrenceRepeatsOn, options, "id", "name", helpText, "repeat-weekly-control-group") }}

                        {% set helpText %}{% trans "Should this Event Repeat by Day of the month (eg. Monthly on Day 21) or by a Weekday in the month (eg. Monthly on the third Thursday)." %}{% endset %}
                        {% set attributes = [
                            { name: "data-trans-day", value: "on the [DAY] day"|trans },
                            { name: "data-trans-weekday", value: "on the [POSITION] [WEEKDAY]"|trans }
                        ] %}
                        {{ forms.dropdown("recurrenceMonthlyRepeatsOn", "single", "", 0, [], "id", "name", helpText, "repeat-monthly-control-group", "", "", "", attributes) }}

                        {% set title %}{% trans "Every" %}{% endset %}
                        {% set helpText %}{% trans "Include a number to determine the Repeat frequency required for this Event." %}{% endset %}
                        <div class="form-group repeat-control-group">
                            <label class="col-sm-2 control-label" for="recurrenceDetail">{{ title }}</label>
                            <div class="col-sm-10">
                                <div class="input-group">
                                    <input class="form-control" name="recurrenceDetail" type="number" id="recurrenceDetail" value="{{ event.recurrenceDetail }}" />
                                    <div class="input-group-addon"></div>
                                </div>
                                <span class="help-block">{{ helpText }}</span>
                            </div>
                        </div>

                        {% set title %}{% trans "Until" %}{% endset %}
                        {% set helpText %}{% trans "Provide a date and time to end the Repeat for this Event. Leave empty to Repeat indefinitely." %}{% endset %}
                        {{ forms.dateTime("recurrenceRange", title, "", helpText, "repeat-control-group", "", "") }}
                    </div>

                    <div class="tab-pane" id="reminders">
                        {% set message %}{% trans "Use the form fields below to create a set of reminders for this event. New fields can be added by clicking on the + icon at the end of the row. Use the tick box to receive a notification by email alternatively reminders will be shown in the message center." %}{% endset %}
                        {{ forms.message(message) }}
                        <div id="reminderFields" data-reminders="{{ reminders|json_encode }}"></div>
                    </div>

                    <div class="tab-pane" id="geoSchedule">
                        {% set title %}{% trans "Geo Schedule?" %}{% endset %}
                        {% set helpText %}{% trans "Should this event be location aware? Enable this checkbox and select an area by drawing a polygon or rectangle layer on the map below." %}{% endset %}
                        {{ forms.checkbox("isGeoAware", title, 0, helpText, "") }}

                        <div id="geoScheduleMap" style="height: 500px; width: 100%" class="hidden"></div>

                        {{ forms.hidden("geoLocation", "") }}
                    </div>
                </div>
            </form>
        </div>
    </div>
{% endblock %}
{'fraction_non_alphanumeric': 0.14709540421659337, 'fraction_numerical': 0.002881844380403458, 'mean_word_length': 1.5965658475110271, 'pattern_counts': {'":': 0, '<': 182, '<?xml version=': 0, '>': 182, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 31, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6247757', 'n_tokens_mistral': 8849, 'n_tokens_neox': 7987, 'n_words': 2509}