{% requireAdmin %} {% extends "_layouts/cp" %} {% set title = "Fields"|t('app') %} {% do view.registerAssetBundle("craft\\web\\assets\\fields\\FieldsAsset") %} {% do view.registerTranslations('app', [ "What do you want to name the group?", "Could not create the group:", "Could not create the group:", "Are you sure you want to delete this group and all its fields?", "Could not delete the group.", "Group renamed.", ]) %} {% set crumbs = [ { label: "Settings"|t('app'), url: url('settings') } ] %} {% set groups = craft.app.fields.getAllGroups()|index('id') %} {% if groupId is defined %} {% if groups[groupId] is not defined %} {% exit 404 %} {% endif %} {% set fields = groups[groupId].getFields() %} {% else %} {% set fields = craft.app.fields.getAllFields() %} {% endif %} {% block actionButton %} {% if groups %} {% set newFieldUrl = url('settings/fields/new', (groupId is defined ? { groupId: groupId } : null)) %} {{ "New field"|t('app') }} {% endif %} {% endblock %} {% block sidebar %}
{{ "New group"|t('app') }}
{% if groupId is defined %} {% endif %}
{% endblock %} {% block content %} {% if fields %} {% if groupId is not defined %}{% endif %} {% for field in fields %} {% if groupId is not defined %}{% endif %} {% endfor %}
{{ "Name"|t('app') }} {{ "Handle"|t('app') }} {{ "Type"|t('app') }}{{ "Group"|t('app') }}
{{ field.name|t('site') }} {%- if field.required %} {% endif -%} {{ field.handle }} {% if field is missing %} {{ field.expectedType }} {% else %} {{ field.displayName() }} {% endif %} {{ field.group.name|t('site') }}
{% endif %} {% endblock %} {% js %} new Craft.AdminTable({ tableSelector: '#fields', noItemsSelector: '#nofields', deleteAction: 'fields/delete-field' }); {% endjs %}