{% extends "content/_layout" %} {% set tab = 'entries' %} {% set title = "Entries"|t %} {% if blx.hasPackage('PublishPro') %} {% set sections = blx.sections.editable(true).indexBy('id').find %} {% set sectionHandles = [] %} {% set newEntrySections = [] %} {% for section in sections %} {% set sectionHandles = sectionHandles|merge([section.handle]) %} {% if user.can('createEntriesInSection'~section.id) %} {% set newEntrySections = newEntrySections|merge([section]) %} {% endif %} {% endfor %} {% set showSection = true %} {% else %} {% set showSection = false %} {% endif %} {% set statuses = { live: 'on', pending: 'pending', disabled: '', expired: 'off' } %} {% set showStatus = true %} {% if filter is not defined %} {% set filter = null %} {% set params = { status: '*' } %} {% elseif filter in statuses|keys %} {% set params = { status: filter } %} {% set showStatus = false %} {% elseif filter == 'archived' %} {% set params = { archived: true } %} {% set showStatus = false %} {% elseif blx.hasPackage('PublishPro') and filter in sectionHandles %} {% set params = { section: filter, status: '*' } %} {% set showSection = false %} {% else %} {% exit 404 %} {% endif %} {% if showSection %} {% set params = params|merge({ sectionId: sections|keys }) %} {% endif %} {% set content %} {% if not blx.hasPackage('PublishPro') or sections|length %}
{{ "No entries exist yet."|t }}
{% if entries|length %} {% include "_includes/paginatelinks" with { type: "entries"|t } %} {% set totalCols = 2 + (showStatus ? 1 : 0) + (showSection ? 1 : 0) %} {% set colWidth = round(100 / totalCols) %}{{ "Title"|t }} | {{ "Slug"|t }} | {% if showSection %}{{ "Section"|t }} | {% endif %} {% if showStatus %}{{ "Status"|t }} | {% endif %}{% for entry in entries %} {% if blx.hasPackage('PublishPro') %} {% set entrySection = sections[entry.sectionId] %} {% endif %} |
---|---|---|---|---|
{{ entry.title }} | {{ entry.slug }} | {% if showSection %}{{ entrySection.name }}{% endif %} {% if showStatus %} | {{ entry.status|ucfirst|t }} | {% endif %}{% if entry.authorId == user.id or user.can('deletePeerEntries'~(blx.hasPackage('PublishPro') ? 'InSection'~entry.sectionId : '')) %} {% endif %} |
{{ "No sections exist yet."|t }} {% if user.admin %} {{ "Create the first one"|t }} {% endif %}
{% endif %} {% endset %} {% set js %} new Blocks.ui.AdminTable({ tableSelector: '#entries', noObjectsSelector: '#noentries', deleteAction: 'entries/deleteEntry' }); {% endset %} {% includeJs js %}