diff --git a/views/action-designer-javascript.twig b/views/action-designer-javascript.twig index 3b28263de2..8d0ed6b4ad 100644 --- a/views/action-designer-javascript.twig +++ b/views/action-designer-javascript.twig @@ -35,6 +35,11 @@ $(dialog).find("#actionType").on('change', function () { onActionTypeChange(dialog); }); + + onTriggerChange(dialog); + $(dialog).find("#triggerType").on('change', function() { + onTriggerChange(dialog); + }) } function onTargetChange(dialog) { @@ -80,6 +85,18 @@ } } + function onTriggerChange(dialog) { + let triggerType = $(dialog).find("#triggerType").val(); + let triggerCode = $(dialog).find(".trigger-code-control"); + + if (triggerType === 'webhook') { + triggerCode.removeClass('hidden'); + } else { + triggerCode.addClass('hidden'); + $('#triggerCode').val(''); + } + } + function showActionsGrid(source, sourceId) { // create the table only when we are on Action tab $('.nav-tabs a').on('shown.bs.tab', function(event) { diff --git a/views/action-form-add.twig b/views/action-form-add.twig index bbc8dddb71..19a63fcabd 100644 --- a/views/action-form-add.twig +++ b/views/action-form-add.twig @@ -47,16 +47,21 @@ ] %} {{ forms.dropdown("triggerType", "single", title, "", options, "typeid", "type", helpText) }} - {% if source == 'layout' %} - {% set title %}{% trans "Trigger Code" %}{% endset %} - {% set helpText %}{% trans "If this Action is triggered by a Web Hook then this Trigger Code must be present in the URL `trigger=` parameter." %}{% endset %} - {{ forms.input("triggerCode", title, "", helpText) }} - {% endif %} + {% set title %}{% trans "Trigger Code" %}{% endset %} + {% set helpText %}{% trans "If this Action is triggered by a Web Hook then this Trigger Code must be present in the URL `trigger=` parameter." %}{% endset %} + {{ forms.input("triggerCode", title, "", helpText, 'trigger-code-control') }} {% set title %}{% trans "Action Type" %}{% endset %} {% set helpText %}{% trans "Please select action Type" %}{% endset %} - {% set next %}{% trans "Next" %}{% endset %} - {% set previous %}{% trans "Previous" %}{% endset %} + + {% if source == 'layout' %} + {% set next %}{% trans "Next item in the Schedule" %}{% endset %} + {% set previous %}{% trans "Previous item in the Schedule" %}{% endset %} + {% else %} + {% set next %}{% trans "Next Widget in the Region Timeline" %}{% endset %} + {% set previous %}{% trans "Previous Widget in the Region Timeline" %}{% endset %} + {% endif %} + {% set navLayout %}{% trans "Navigate to Layout" %}{% endset %} {% set navWidget %}{% trans "Navigate to Widget" %}{% endset %} {% set options = [ @@ -72,7 +77,7 @@ {{ forms.dropdown("widgetId", "single", title, "", [{widgetId:null, name:""}]|merge(widgets), "widgetId", "name", helpText, "nav-control-widget") }} {% set title %}{% trans "Layout Code" %}{% endset %} - {% set helpText %}{% trans "Please enter code identifier for the Layout. A Layout can be assigned a Code using Layout Edit." %}{% endset %} + {% set helpText %}{% trans "Please enter the Code identifier for the Layout as assigned in the Add / Edit Layout form." %}{% endset %} {% set attributes = [ { name: "data-width", value: "100%" }, @@ -84,7 +89,7 @@ {{ forms.dropdown("layoutCode", "single", title, "", null, "code", "code", helpText, "pagedSelect nav-control-layout", "", "", "", attributes) }} {% set title %}{% trans "Target" %}{% endset %} - {% set helpText %}{% trans "Where will the Widget be loaded? Usually this will be a Region on this Layout. However if your Widget is a Shell Command you can target the Screen to have the command run without effecting any Regions." %}{% endset %} + {% set helpText %}{% trans "If your Widget is a Shell Command you can select to target 'Screen' to run the command without affecting any Regions. For all other Widgets select 'Region' as target." %}{% endset %} {% set screen %}{% trans "Screen" %}{% endset %} {% set region %}{% trans "Region" %}{% endset %} {% set options = [ @@ -93,8 +98,9 @@ ] %} {{ forms.dropdown("target", "single", title, "region", options, "typeid", "type", helpText, "target-control") }} + {% set title %}{% trans "Target Region" %}{% endset %} {% set helpText %}{% trans "Select the Region this Widget will be loaded into." %}{% endset %} - {{ forms.dropdown("targetId", "single", "", "", [{regionId:null, name:""}]|merge(regions), "regionId", "name", helpText, "targetid-control") }} + {{ forms.dropdown("targetId", "single", title, "", [{regionId:null, name:""}]|merge(regions), "regionId", "name", helpText, "targetid-control") }} diff --git a/views/action-form-edit.twig b/views/action-form-edit.twig index 2985e0a2bb..9590550b03 100644 --- a/views/action-form-edit.twig +++ b/views/action-form-edit.twig @@ -47,16 +47,21 @@ ] %} {{ forms.dropdown("triggerType", "single", title, action.triggerType, options, "typeid", "type", helpText) }} - {% if source == 'layout' %} - {% set title %}{% trans "Trigger Code" %}{% endset %} - {% set helpText %}{% trans "If this Action is triggered by a Web Hook then this Trigger Code must be present in the URL `trigger=` parameter." %}{% endset %} - {{ forms.input("triggerCode", title, action.triggerCode, helpText) }} - {% endif %} + {% set title %}{% trans "Trigger Code" %}{% endset %} + {% set helpText %}{% trans "If this Action is triggered by a Web Hook then this Trigger Code must be present in the URL `trigger=` parameter." %}{% endset %} + {{ forms.input("triggerCode", title, action.triggerCode, helpText, 'trigger-code-control') }} {% set title %}{% trans "Action Type" %}{% endset %} {% set helpText %}{% trans "Please select action Type" %}{% endset %} - {% set next %}{% trans "Next" %}{% endset %} - {% set previous %}{% trans "Previous" %}{% endset %} + + {% if source == 'layout' %} + {% set next %}{% trans "Next item in the Schedule" %}{% endset %} + {% set previous %}{% trans "Previous item in the Schedule" %}{% endset %} + {% else %} + {% set next %}{% trans "Next Widget in the Region Timeline" %}{% endset %} + {% set previous %}{% trans "Previous Widget in the Region Timeline" %}{% endset %} + {% endif %} + {% set navLayout %}{% trans "Navigate to Layout" %}{% endset %} {% set navWidget %}{% trans "Navigate to Widget" %}{% endset %} {% set options = [ @@ -72,7 +77,7 @@ {{ forms.dropdown("widgetId", "single", title, action.widgetId, [{widgetId:null, name:""}]|merge(widgets), "widgetId", "name", helpText, "nav-control-widget") }} {% set title %}{% trans "Layout Code" %}{% endset %} - {% set helpText %}{% trans "Please enter code identifier for the Layout. A Layout can be assigned a Code using Layout Edit." %}{% endset %} + {% set helpText %}{% trans "Please enter the Code identifier for the Layout as assigned in the Add / Edit Layout form." %}{% endset %} {% set attributes = [ { name: "data-width", value: "100%" }, @@ -84,7 +89,7 @@ {{ forms.dropdown("layoutCode", "single", title, action.layoutCode, layout, "code", "code", helpText, "pagedSelect nav-control-layout", "", "", "", attributes) }} {% set title %}{% trans "Target" %}{% endset %} - {% set helpText %}{% trans "Where will the Widget be loaded? Usually this will be a Region on this Layout. However if your Widget is a Shell Command you can target the Screen to have the command run without effecting any Regions." %}{% endset %} + {% set helpText %}{% trans "If your Widget is a Shell Command you can select to target 'Screen' to run the command without affecting any Regions. For all other Widgets select 'Region' as target." %}{% endset %} {% set screen %}{% trans "Screen" %}{% endset %} {% set region %}{% trans "Region" %}{% endset %} {% set options = [ @@ -93,8 +98,9 @@ ] %} {{ forms.dropdown("target", "single", title,action.target, options, "typeid","type", helpText, "target-control") }} + {% set title %}{% trans "Target Region" %}{% endset %} {% set helpText %}{% trans "Select the Region this Widget will be loaded into." %}{% endset %} - {{ forms.dropdown("targetId", "single", "", action.targetId, [{regionId:null, name:""}]|merge(regions), "regionId", "name", helpText, "targetid-control") }} + {{ forms.dropdown("targetId", "single", title, action.targetId, [{regionId:null, name:""}]|merge(regions), "regionId", "name", helpText, "targetid-control") }} diff --git a/views/layout-form-add.twig b/views/layout-form-add.twig index 4daf04e53a..127df42c38 100644 --- a/views/layout-form-add.twig +++ b/views/layout-form-add.twig @@ -98,8 +98,8 @@ {% set helpText %}{% trans "Choose the resolution this Layout should be designed for." %}{% endset %} {{ forms.dropdown("resolutionId", "single", title, "", resolutions, "resolutionId", "resolution", helpText, "resolution-group") }} - {% set title %}{% trans "Code" %}{% endset %} - {% set helpText %}{% trans "The Code identifier for this Layout - used in Interactive Actions" %}{% endset %} + {% set title %}{% trans "Code Identifier" %}{% endset %} + {% set helpText %}{% trans "Enter a string to be used as the Code to identify this Layout when used with Interactive Actions." %}{% endset %} {{ forms.input("code", title, "", helpText) }} {% set title %}{% trans "Enable Stats Collection?" %}{% endset %} diff --git a/views/layout-form-edit.twig b/views/layout-form-edit.twig index e9673a890b..55d5a1fd63 100644 --- a/views/layout-form-edit.twig +++ b/views/layout-form-edit.twig @@ -66,8 +66,8 @@
{% trans "This tag requires a set value, please select one from the Tag value dropdown or provide Tag value in the dedicated field." %}
- {% set title %}{% trans "Code" %}{% endset %} - {% set helpText %}{% trans "The Code identifier for this Layout - used in Interactive Actions" %}{% endset %} + {% set title %}{% trans "Code Identifier" %}{% endset %} + {% set helpText %}{% trans "Enter a string to be used as the Code to identify this Layout when used with Interactive Actions." %}{% endset %} {{ forms.input("code", title, layout.code, helpText) }} {% set title %}{% trans "Retired" %}{% endset %}