{% import "_includes/forms" as forms %} {% set cols = { heading: { type: 'heading', heading: "Site"|t('blitz'), thin: true, }, zoneId: { type: 'singleline', heading: "Zone ID"|t('blitz'), }, } %} {% set rows = [] %} {% for site in craft.app.sites.getAllSites() %} {% set rows = rows|merge({ (site.uid): { heading: site.name, zoneId: purger.zoneIds[site.uid] is defined ? purger.zoneIds[site.uid]['zoneId'], } }) %} {% endfor %} {% set info %} {{ 'The zone ID for each site can be found on the “Overview” screen of your domains in your Cloudflare account. This can be set to an environment variable. Learn more'|t('blitz', {url: 'https://docs.craftcms.com/v3/config/environments.html'})|raw }} {% endset %} {{ forms.editableTableField({ label: "Zone IDs"|t('blitz'), instructions: "Choose which sites should be purged by entering their zone IDs."|t('blitz') ~ info, name: 'zoneIds', id: 'zoneIds', cols: cols, rows: rows, staticRows: true, errors: purger.getErrors('zoneIds'), required: true, }) }} {{ forms.selectField({ label: "Authentication Method"|t('blitz'), instructions: "The authentication method for connecting to the Cloudflare API."|t('blitz'), suggestEnvVars: true, name: 'authenticationMethod', value: purger.authenticationMethod, options: { apiToken: "API Token"|t('blitz'), apiKey: "API Key"|t('blitz'), }, toggle: true, errors: purger.getErrors('authenticationMethod'), required: true, }) }}