{% extends "_layouts/cp" %} {% set title = "Sections"|t('app') %} {% set crumbs = [ { label: "Settings"|t('app'), url: url('settings') } ] %} {% block actionButton %} {{ "New section"|t('app') }} {% endblock %} {% block content %} {% if sections|length %} {% for section in sections %} {% endfor %}
{{ "Name"|t('app') }} {{ "Handle"|t('app') }} {{ "Type"|t('app') }} {{ "Entry Types"|t('app')}}
{{ section.name|t('site') }} {{ section.handle }} {{ section.type|title|t('app') }} {% if section.type == 'single' and section.getEntryTypes()|length == 1 %} {% set entryType = section.getEntryTypes()[0] %} {{ "Edit entry type"|t('app') }} {% else %} {{ "Edit entry types ({count})"|t('app', { count: section.getEntryTypes()|length }) }} {% endif %}
{% endif %} {% endblock %} {% js %} var adminTable = new Craft.AdminTable({ tableSelector: '#sections', noItemsSelector: '#nosections', deleteAction: 'sections/delete-section', confirmDeleteMessage: '{{ "Are you sure you want to delete “{name}” and all its entries?"|t('app') }}', onDeleteItem: function() { // Hide the Entries tab if that was the last one if (adminTable.totalItems == 0) { $('#nav-entries').remove(); } } }); {% endjs %}