{% extends "_layouts/cp" %} {% set title = "Fields"|t %} {% set docsUrl = 'http://docs.buildwithcraft.com/cp/settings/fields.html' %} {% includeJsResource "js/fields.js" %} {% includeTranslations "What do you want to name your 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, url: url('settings') } ] %} {% set groups = craft.fields.getAllGroups('id') %} {% if groupId is defined %} {% if groups[groupId] is not defined %} {% exit 404 %} {% endif %} {% set fields = groups[groupId].getFields() %} {% else %} {% set fields = craft.fields.getAllFields() %} {% endif %} {% set sidebar %}
{{ "New Group"|t }}
{% if groupId is defined %} {% endif %}
{% endset %} {% set content %} {% if fields %} {% if groupId is not defined %}{% endif %} {% for field in fields %} {% if groupId is not defined %}{% endif %} {% endfor %}
{{ "Name"|t }} {{ "Handle"|t }} {{ "Type"|t }}{{ "Group"|t }}
{{ field.name|t }} {%- if field.required %} {% endif -%} {{ field.handle }} {% set fieldType = craft.fields.populateFieldType(field) %} {% if fieldType %} {{ fieldType.name }} {% else %} {{ field.type }} {% endif %} {{ field.group.name }}
{% endif %} {% if groups %}
{% set newFieldUrl = url('settings/fields/new', (groupId is defined ? { groupId: groupId } : null)) %} {{ "New Field"|t }}
{% endif %} {% endset %} {% set js %} new Craft.AdminTable({ tableSelector: '#fields', noObjectsSelector: '#nofields', deleteAction: 'fields/deleteField' }); {% endset %} {% includeJs js %}