{# Resource upload form field that allows switching between: URL <-> Unset <-> File upload (when enabled) The "url" field is New uploaded files are saved as "upload", and "name" field is updated with the file name if not already set. When removing a file upload a special "clear_upload" field is passed data - resource form data fields errors - errors on resource form fields is_url - true if resource using url (not file upload) is_upload - true if resource using file upload (not url) is_upload_enabled - true if site supports file uploads url_label - label for URL field (default: "URL") upload_label - label for upload field (default: "File") menu_label - label for button menu (default: "Data") placeholder - placeholder text for url field #} {% import "macros/form.html" as form %} {% set first_button = 'resource-upload-button' if is_upload_enabled else 'resource-link-button' %} {% macro remove_button(js='') %} {% endmacro %}