{# Outputs the HTML form element for an image parameter. Param "fields" is the output of ImageAttrs.validators() or TemplateAttrs.validators(). Param "defaults" is a dictionary of default field values. Param "supported_fields" is a dictionary of booleans of supported fields. Param "key" is a key into "fields", "defaults", and "supported_fields". #} {% macro input(fields, defaults, supported_fields, key, placeholder="") -%} {% set validator = fields[key][0] %} {% set web_name = fields[key][1] %} {% set typename = validator.__class__.__name__ %} {% set default = defaults[key] if defaults[key] is not none else '' %} {% set enabled = supported_fields[key] %} {% include ["publish/input_%s.html" % key, "publish/input_%s.html" % typename, "publish/input_default.html"] %} {%- endmacro %} {# Outputs the HTML for a help icon. #} {% macro help(anchor, classes="") -%} {%- endmacro %} {# Outputs HTML attributes for class="disabled_premium", if supported_fields[key] is false or non-existent. Param "supported_fields" is a dictionary of booleans of supported image operations. Param "key" is a key into "supported_fields". #} {% macro disp_class(supported_fields, key) -%} {% if not supported_fields[key] -%} disabled="disabled" class="disabled_premium" title="Requires Premium Edition" {%- endif %} {%- endmacro %} {# As for disp_class() but outputs the HTML attributes if value is not in a_list. #} {% macro disp_class_2(a_list, value) -%} {% if value not in a_list -%} disabled="disabled" class="disabled_premium" title="Requires Premium Edition" {%- endif %} {%- endmacro %}