{% 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 item should be displayed." %}{% endset %}
{{ forms.number("duration", title, module.getDuration(), helpText, "duration-fields", "required") }}
{% 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) }}
{% set title %}{% trans "Use the Display Location" %}{% endset %}
{% set helpText %}{% trans "Use the location configured on the display" %}{% endset %}
{{ forms.checkbox("useDisplayLocation", title, module.getOption("useDisplayLocation", 1), helpText) }}
{% set title %}{% trans "Latitude" %}{% endset %}
{% set helpText %}{% trans "The Latitude for this widget" %}{% endset %}
{{ forms.number("latitude", title, module.getOption("latitude"), helpText, "locationControls") }}
{% set title %}{% trans "Longitude" %}{% endset %}
{% set helpText %}{% trans "The Longitude for this widget" %}{% endset %}
{{ forms.number("longitude", title, module.getOption("longitude"), helpText, "locationControls") }}
{% set title %}{% trans "Units" %}{% endset %}
{% set helpText %}{% trans "Select the units you would like to use." %}{% endset %}
{{ forms.dropdown("units", "single", title, module.getOption("units"), module.unitsAvailable(), "id", "value", helpText) }}
{% set title %}{% trans "Language" %}{% endset %}
{% set helpText %}{% trans "Select the language you would like to use." %}{% endset %}
{{ forms.dropdown("lang", "single", title, module.getOption("lang", "en"), module.supportedLanguages(), "id", "value", helpText) }}
{% set title %}{% trans "Only show Daytime weather conditions" %}{% endset %}
{% set helpText %}{% trans "Tick if you would like to only show the Daytime weather conditions." %}{% endset %}
{{ forms.checkbox("dayConditionsOnly", title, module.getOption("dayConditionsOnly"), helpText) }}
{% set title %}{% trans "Horizontal Align" %}{% endset %}
{% set helpText %}{% trans "How should this widget be aligned?" %}{% endset %}
{% set left %}{% trans "Left" %}{% endset %}
{% set center %}{% trans "Centre" %}{% endset %}
{% set right %}{% trans "Right" %}{% endset %}
{% set options = [
{ alignH: "left", align: left },
{ alignH: "center", align: center },
{ alignH: "right", align: right }
] %}
{{ forms.dropdown("alignH", "single", title, module.getOption("alignH","center"), options, "alignH", "align", helpText, "align-fields") }}
{% set title %}{% trans "Vertical Align" %}{% endset %}
{% set helpText %}{% trans "How should this widget be vertically aligned?" %}{% endset %}
{% set top %}{% trans "Top" %}{% endset %}
{% set middle %}{% trans "Middle" %}{% endset %}
{% set bottom %}{% trans "Bottom" %}{% endset %}
{% set options = [
{ alignV: "top", valign: top },
{ alignV: "middle", valign: middle },
{ alignV: "bottom", valign: bottom }
] %}
{{ forms.dropdown("alignV", "single", title, module.getoption("alignV", "middle"), options, "alignV", "valign", helpText, "align-fields") }}
{% set title %}{% trans "Type" %}{% endset %}
{% set helpText %}{% trans "Choose the type of template" %}{% endset %}
{% set allText %}{% trans "All" %}{% endset %}
{% set currentText %}{% trans "Current" %}{% endset %}
{% set forecastText %}{% trans "Forecast" %}{% endset %}
{% set options = [
{ id: "", value: allText },
{ id: "current", value: currentText },
{ id: "forecast", value: forecastText }
] %}
{{ forms.dropdown("templateType", "single", title, module.getOption("templateType", "all"), options, "id", "value", helpText, "template-selector-control") }}
{% set title %}{% trans "Orientation" %}{% endset %}
{% set helpText %}{% trans "Choose the orientation of template" %}{% endset %}
{% set allText %}{% trans "All" %}{% endset %}
{% set squareText %}{% trans "Square" %}{% endset %}
{% set landscapeText %}{% trans "Landscape" %}{% endset %}
{% set portraitText %}{% trans "Portrait" %}{% endset %}
{% set scaleText %}{% trans "Scale" %}{% endset %}
{% set options = [
{ id: "", value: allText },
{ id: "square", value: squareText },
{ id: "landscape", value: landscapeText },
{ id: "portrait", value: portraitText },
{ id: "scale", value: scaleText }
] %}
{{ forms.dropdown("templateOrientation", "single", title, module.getOption("templateOrientation", "all"), options, "id", "value", helpText, "template-selector-control") }}
{% set title %}{% trans "Template" %}{% endset %}
{% set helpText %}{% trans "Select the template you would like to apply. This can be overridden using the check box below." %}{% endset %}
{{ forms.dropdown("templateId", "single", title, module.getOption("templateId"), templatesAvailable, "id", "value", helpText, "template-selector-control localSelect selectPickerWithImage", null, null, null, [{ name: "data-minimum-results-for-search", value: "Infinity" },{ name: "data-width", value: "100%" }], null, "image", ["type", "orientation"]) }}
{% set title %}{% trans "Override the template?" %}{% endset %}
{% set helpText %}{% trans "Tick if you would like to override the template." %}{% endset %}
{{ forms.checkbox("overrideTemplate", title, module.getOption("overrideTemplate"), helpText) }}
{% set useTemplatesMessage %}
{% trans "With Override the Template selected enter your own text, html and css by using the Templates drop down menu in the tab header above." %}
{% endset %}
{{ forms.message(useTemplatesMessage, 'template-override-controls') }}
{% set title %}{% trans "Original Width" %}{% endset %}
{% set helpText %}{% trans "This is the intended width of the template and is used to scale the Widget within its region when the template is applied." %}{% endset %}
{{ forms.number("widgetOriginalWidth", title, module.getOption("widgetOriginalWidth", undefined), helpText, "template-override-controls", "", "number") }}
{% set title %}{% trans "Original Height" %}{% endset %}
{% set helpText %}{% trans "This is the intended height of the template and is used to scale the Widget within its region when the template is applied." %}{% endset %}
{{ forms.number("widgetOriginalHeight", title, module.getOption("widgetOriginalHeight", undefined), helpText, "template-override-controls", "", "number") }}
{% set useTemplatesOptionsMessage %}
{% trans "You can change the appearance of this template using the options below." %}
{% endset %}
{{ forms.message(useTemplatesOptionsMessage, '') }}
{% set name %}{% trans "Text" %}{% endset %}
{{ forms.colorPicker("text-color", name, module.getOption("text-color"), "", "template-option template-option-text-color d-none") }}
{% set name %}{% trans "Icons" %}{% endset %}
{{ forms.colorPicker("icons-color", name, module.getOption("icons-color"), "", "template-option template-option-icons-color d-none") }}
{% set name %}{% trans "Background" %}{% endset %}
{{ forms.colorPicker("background-color", name, module.getOption("background-color"), "", "template-option template-option-background-color d-none") }}
{% set name %}{% trans "Shadow" %}{% endset %}
{{ forms.colorPicker("shadow-color", name, module.getOption("shadow-color"), "", "template-option template-option-shadow-color d-none") }}
{% set name %}{% trans "Footer Background" %}{% endset %}
{{ forms.colorPicker("footer-color", name, module.getOption("footer-color"), "", "template-option template-option-footer-color d-none") }}
{% set name %}{% trans "Footer Text" %}{% endset %}
{{ forms.colorPicker("footer-text-color", name, module.getOption("footer-text-color"), "", "template-option template-option-footer-text-color d-none") }}
{% set name %}{% trans "Footer Icons" %}{% endset %}
{{ forms.colorPicker("footer-icons-color", name, module.getOption("footer-icons-color"), "", "template-option template-option-footer-icons-color d-none") }}
{% set title %}{% trans "Background Image" %}{% endset %}
{% set noneText %}{% trans "None" %}{% endset %}
{% set centerText %}{% trans "Center" %}{% endset %}
{% set stretchText %}{% trans "Stretch" %}{% endset %}
{% set fitText %}{% trans "Fit" %}{% endset %}
{% set options = [
{ id: "none", value: noneText },
{ id: "fit", value: fitText },
{ id: "stretch", value: stretchText },
{ id: "center", value: centerText }
] %}
{{ forms.dropdown("background-image", "single", title, module.getOption("background-image", "fit"), options, "id", "value", "", "") }}
{% set attributes = [
{ name: "data-allow-clear", value: "true" },
{ name: "data-placeholder--id", value: null },
{ name: "data-placeholder--value", value: "" },
{ name: "data-search-url", value: url_for("library.search") },
{ name: "data-search-term", value: "media" },
{ name: "data-search-term-tags", value: "tags" },
{ name: "data-width", value: "100%" },
{ name: "data-id-property", value: "mediaId" },
{ name: "data-text-property", value: "name" },
{ name: "data-filter-options", value: '{"type":"image"}' }
] %}
{% set backgroundTranslations = {
"cloudy-image": "Cloudy"|trans,
"day-cloudy-image": "Cloudy day"|trans,
"day-sunny-image": "Clear"|trans,
"fog-image": "Fog"|trans,
"hail-image": "Hail"|trans,
"night-clear-image": "Clear night"|trans,
"night-partly-cloudy-image": "Cloudy night"|trans,
"rain-image": "Raining"|trans,
"snow-image": "Snowing"|trans,
"windy-image": "Windy"|trans
} %}
{% set backgroundOptions = [{"mediaId": "", "name": ""}]|merge(module.getBackgroundOptions()) %}
{% set getBackgroundList = module.getBackgroundList() %}
{% set backgroundListMessage %}{% trans "Select images from the media library to replace the default weather backgrounds." %}{% endset %}
{{ forms.message(backgroundListMessage, "") }}
{% for backgroundEl in getBackgroundList %}
{% if module.getOption(backgroundEl) != backgroundEl %}
{% set elOption = module.getOption(backgroundEl) %}
{% else %}
{% set elOption = "" %}
{% endif %}
{% set title = attribute(backgroundTranslations, backgroundEl) %}
{{ forms.dropdown(backgroundEl, "single", title, elOption, backgroundOptions, "mediaId", "name", "", "pagedSelect", "", "", "", attributes) }}
{% endfor %}
{% trans "Current Forecast Template" %}
{% set simpleTextEditorMessage %}
{% trans "Enter text or HTML in the box below." %}
{% endset %}
{{ forms.message(simpleTextEditorMessage) }}
{% set helpText %}{% trans "Enter the template for the current forecast. For a list of substitutions click Get Forecast below." %}{% endset %}
{{ forms.textarea("currentTemplate", "", module.getOption("currentTemplate"), helpText, "template-override-controls", "required", 10) }}
{% trans "Daily Forecast Template" %}
{% set simpleTextEditorMessage %}
{% trans "Enter text or HTML in the box below." %}
{% endset %}
{{ forms.message(simpleTextEditorMessage) }}
{% set helpText %}{% trans "Enter the template for the daily forecast. Replaces [dailyForecast] in main template." %}{% endset %}
{{ forms.textarea("dailyTemplate", "", module.getOption("dailyTemplate"), helpText, "template-override-controls", "", 10) }}
{% trans "CSS Style Sheet" %}
{% set helpText %}{% trans "Enter a CSS style sheet to style the weather widget" %}{% endset %}
{{ forms.textarea("styleSheet", "", module.getOption("styleSheet"), helpText, "template-override-controls", "required", 10) }}
{% trans "Optional JavaScript" %}
{{ forms.textarea("javaScript", "", module.getRawNode("javaScript"), "", "", "", 10) }}
{% set title %}{% trans "Update Interval (mins)" %}{% endset %}
{% set helpText %}{% trans "Please enter the update interval in minutes. This should be kept as high as possible. For example, if the data will only change once per hour this could be set to 60." %}{% endset %}
{{ forms.number("updateInterval", title, module.getOption("updateInterval", 60), helpText, "", "required") }}
{% set message %}{% trans "Please press Get Forecast" %}{% endset %}
{{ forms.message(message) }}
{% if module.getSetting("apiKey") == "" and module.getSetting("owmApiKey") == "" %}
{% set message %}{% trans "The Weather Widget has not been configured yet, please ask your CMS Administrator to look at it for you." %}{% endset %}
{{ forms.message(message, "alert alert-danger") }}
{% endif %}