{% extends "_layouts/cp" %} {% set centered = true %} {% includeCssResource "css/entry.css" %} {% includeJsResource "lib/jquery-ui-1.8.23.custom.min.js" %} {% import "_includes/forms" as forms %} {% if blx.hasPackage('PublishPro') %} {% set section = blx.sections.handle(sectionHandle).first %} {% if not section %}{% exit 404 %}{% endif %} {% endif %} {% if entry is not defined and entryId is defined %} {% if draftId is defined %} {% set entry = blx.entryRevisions.getDraftById(draftId) %} {% elseif versionId is defined %} {% set entry = blx.entryRevisions.getVersionById(versionId) %} {% else %} {% set entry = blx.entries.id(entryId).status('*').first %} {% endif %} {% if not entry %}{% exit 404 %}{% endif %} {% endif %} {% set isNewEntry = (entry is not defined or not entry.id) %} {% if not isNewEntry and entry.classHandle == 'EntryDraft' %} {% set revisionLabel = "Draft {id}"|t({ id: draftId }) %} {% elseif not isNewEntry and entry.classHandle == 'EntryVersion' %} {% set revisionLabel = "Version {id}"|t({ id: versionId }) %} {% else %} {% set revisionLabel = "Current"|t %} {% endif %} {% if blx.hasPackage('PublishPro') %} {% set blocks = blx.entryBlocks.getBlocksBySectionId(section.id) %} {% else %} {% set blocks = blx.entryBlocks.getAllBlocks %} {% endif %} {% if isNewEntry %} {% set title = "Create a new entry"|t %} {% else %} {% set title = "Editing “{title}”"|t({ title: entry.title|t }) %} {% if entry is defined and entry.classHandle != 'Entry' %} {% set title = title ~ ' ' ~ revisionLabel ~ '' %} {% endif %} {% endif %} {% set header %}

{{ title|raw }}

{% if not isNewEntry and blx.hasPackage('PublishPro') %} {% endif %} {% endset %} {% set tabs %}
  • {{ "Content"|t }}
  • {{ "Settings"|t }}
  • {% endset %} {% set content %}
    {% if blx.hasPackage('PublishPro') %} {% endif %} {% if not isNewEntry %} {% endif %}
    {{ forms.textField({ label: "Title"|t, id: 'title', name: 'title', value: (entry is defined ? entry.title : null), errors: (entry is defined ? entry.getErrors('title') : null), required: true }) }} {% include "_includes/blockfields" with { blocks: blocks, entity: (entry is defined ? entry : null) } only %}

    {% if not isNewEntry and entry.classHandle == 'EntryDraft' %} {% elseif not isNewEntry and entry.classHandle == 'EntryVersion' %} {% else %} {% if blx.hasPackage('PublishPro') %} {% else %} {% endif %} {% if not isNewEntry and blx.hasPackage('PublishPro') %} {% endif %} {% endif %}
    {% endset %} {% if entry is not defined or not entry.slug %} {% includeJs "new Blocks.ui.SlugGenerator('#title', '#slug');" %} {% endif %}