{% extends "sprout-base-import/_layouts/base" %} {% import "_includes/forms" as forms %} {% import 'sprout-base/_includes/sproutcp' as sprout %} {% set title = 'Seed'|t('sprout-import') %} {% macro errorList(errors) %} {% if errors %} {% endif %} {% endmacro %} {% from _self import errorList %} {% block content %} {% if seedJob.getErrors()|length %}

{{ "Unable to plant seeds."|t('sprout-import') }}

{{ errorList(seedJob.getErrors()) }}

{% endif %}
{{ csrfInput() }} {{ redirectInput('sprout-import/seed') }} {{ forms.textField({ label: 'How many items to seed?'|t('sprout-import'), instructions: 'Total number of content items to import.'|t('sprout-import'), name: 'quantity', placeholder: '11'|t('sprout-import'), value: seedJob.quantity ?? 11, errors: seedJob.getErrors('quantity') ?? null, size: 4, first: true }) }} {{ forms.selectField({ label: "Type of Content"|t('sprout-import'), instructions: "Select the type of content to seed in your database."|t('sprout-import'), id: "elementType", name: "elementType", options: elements, value: seedJob.elementType ?? '', errors: seedJob.getErrors('elementType') ?? null, hasOptgroups: true }) }} {# Output settings for each of our Importers #} {% for key, importer in importers %} {% endfor %}
{% endblock %} {% block details %}

{{ "Generate fake content"|t('sprout-import') }}

{{ "Generate content to work with for front-end prototyping, testing large amounts of content, and more. Any seed data generated will be marked and can later be unmarked or removed using the Weed tab."|t('sprout-import') }}

{{ "Supported Elements"|t('sprout-import') }}
{% set importers = craft.sproutImport.getSproutImportImporters() %}
{{ "Supported Fields"|t('sprout-import') }}
{% set fieldImporters = craft.sproutImport.getSproutImportFieldImporters() %}
{% endblock %} {% do view.registerAssetBundle("barrelstrength\\sproutbase\\app\\import\\web\\assets\\import\\ImportAsset") %} {% js %} Craft.SproutImport.Seed.init(); $selectedElementType = $('#elementType').val(); $selectedElementClass = $selectedElementType.replace(/\\/g, '-'); $('.'+$selectedElementClass).show(); {% endjs %}