{% extends "freeform/_layouts/settings" %} {% import "_includes/forms" as forms %} {% set title = "Statuses"|t('freeform') %} {% set selectedSubnavItem = "statuses" %} {% set saveShortcutRedirect = 'freeform/settings/statuses/{id}' %} {% set fullPageForm = true %} {% block actionButton %}
{% endblock %} {% block content %} {{ redirectInput('freeform/settings/statuses') }} {% if status.id %}{% endif %} {{ csrfInput() }} {{ forms.textField({ first: true, label: "Name"|t('freeform'), instructions: "The name of the status."|t('freeform'), id: 'name', name: 'name', value: status.name, errors: status.getErrors('name'), autofocus: true, required: true, translatable: true }) }} {{ forms.textField({ label: "Handle"|t('freeform'), instructions: "How you’ll refer to this status in the templates."|t('freeform'), id: 'handle', class: 'code', name: 'handle', value: status.handle, errors: status.getErrors('handle'), required: true }) }}
{{ forms.hidden({ id: "color", name: "color", value: status.color, errors: status.getErrors("color"), required: true }) }} {% set colorField %}
{{ status.color|t('freeform')|title }}
{% endset %} {{ forms.field({ label: 'Color'|t('freeform'), instructions: 'The color of the status circle when viewing inside CP.'|t('freeform') },colorField) }} {{ forms.lightswitchField({ label: "Is Default"|t('freeform'), instructions: "Set this status to be selected by default when creating new forms?"|t('freeform'), name: "isDefault", on: status.isDefault, disabled: status.isDefault, errors: status.errors("isDefault"), }) }} {% endblock %} {% js %} {% if not status.handle %}new Craft.HandleGenerator('#name', '#handle');{% endif %} $(function () { $colorSelect = $('#color-menu-btn'); new Garnish.MenuBtn($colorSelect, { onOptionSelect: function(data) { var val = $(data).data('val'); $('#color').val(val); var html = ""+Craft.uppercaseFirst(val); $colorSelect.html(html); } }); }); {% endjs %}