{% 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 actionEventType %}{% trans "Action" %}{% endset %}
{% set eventTypes = [
{id: 1, label: layoutEventType},
{id: 5, label: campaignEventType},
{id: 2, label: commandEventType},
{id: 3, label: overlayEventType},
{id: 4, label: interruptEventType},
{id: 6, label: actionEventType}
] %}
{{ 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: url_for("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 %}
{% 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: url_for("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-campaign", value: "Campaign"|trans },
{ name: "data-trans-campaign-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) }}
{% set title %}{% trans "Action Type" %}{% endset %}
{% set helpText %}{% trans "Please select action Type" %}{% endset %}
{% set navLayout %}{% trans "Navigate to Layout" %}{% endset %}
{% set command %}{% trans "Command" %}{% endset %}
{% set options = [
{ typeid: "navLayout", type: navLayout },
{ typeid: "command", type: command },
] %}
{{ forms.dropdown("actionType", "single", title,"", options, "typeid","type", helpText, 'action-control') }}
{% set title %}{% trans "Trigger Code" %}{% endset %}
{% set helpText %}{% trans "Web hook trigger code for this Action" %}{% endset %}
{{ forms.input("actionTriggerCode", title, "", helpText, 'action-control') }}
{% set title %}{% trans "Layout Code" %}{% endset %}
{% set helpText %}{% trans "Please select the Code identifier for the Layout that Player should navigate to when this Action is triggered." %}{% endset %}
{% set attributes = [
{ name: "data-width", value: "100%" },
{ name: "data-search-url", value: url_for("layout.code.search") },
{ name: "data-search-term", value: "code" },
{ name: "data-id-property", value: "code" },
{ name: "data-text-property", value: "code" }
] %}
{{ forms.dropdown("actionLayoutCode", "single", title, "", null, "code", "code", helpText, "pagedSelect action-control layout-code-control", "", "", "", attributes) }}
{% 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 %}
{% 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", "", "", 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 %}
{% 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", "", "") }}