{% extends "_layouts/cp" %} {% import "_includes/forms" as forms %} {% set extraPageHeaderHtml %} {% if entry.id and CraftEdition >= CraftClient %} {% include "entries/_revisions" %} {% endif %} {% endset %} {% set sectionHandle = section.handle %} {% set isVersion = entry.getClassHandle() == 'EntryVersion' %} {% set isDraft = entry.id and entry.getClassHandle() == 'EntryDraft' %} {% block main %}
{% if not isVersion %} {% if entry.id %}{% endif %} {% if craft.isLocalized() %}{% endif %} {% else %} {% endif %}
{% include "_includes/tabs" %} {% include "entries/_fields" with { static: isVersion } %}
{% if showPreviewBtn %} {% if shareUrl is defined %}
{% endif %}
{{ "Live Preview"|t }}
{% if shareUrl is defined %}
{% endif %} {% endif %} {% if craft.isLocalized() and section.getLocales() | length > 1 %}
    {% for localeId in localeIds %} {% set localeName = craft.i18n.getLocaleById(localeId).name %} {%- if localeId == entry.locale -%} {{ localeName }} {{ forms.lightswitch({ name: 'localeEnabled', on: entry.localeEnabled, small: true }) }} {%- else -%} {{ localeName }}
    {%- endif -%} {% endfor %}
{% endif %} {% if section.type != 'single' %}
{% if showEntryTypes %} {{ forms.selectField({ label: "Entry Type"|t, id: 'entryType', name: 'typeId', value: entryType.id, options: entryTypeOptions }) }} {% endif %} {{ forms.textField({ label: "Slug"|t, id: 'slug', name: 'slug', value: entry.slug, errors: (not isVersion ? entry.getErrors('slug')|merge(entry.getErrors('uri'))), disabled: isVersion }) }} {% if section.type == 'structure' and parentOptions|length > 1 %} {{ forms.selectField({ label: "Parent Entry"|t, id: 'parentId', name: 'parentId', options: parentOptions, value: parentId, disabled: isVersion }) }} {% endif %} {% if CraftEdition >= CraftClient %} {{ forms.selectField({ label: "Author"|t, id: 'author', name: 'author', options: authorOptions, value: entry.authorId, disabled: isVersion }) }} {% endif %} {{ forms.dateTimeField({ label: "Post Date"|t, id: 'postDate', name: 'postDate', value: (entry.postDate ? entry.postDate : null), errors: entry.getErrors('postDate'), disabled: isVersion }) }} {{ forms.dateTimeField({ label: "Expiration Date"|t, id: 'expiryDate', name: 'expiryDate', value: (entry.expiryDate ? entry.expiryDate : null), errors: entry.getErrors('expiryDate'), disabled: isVersion }) }} {% set canPublish = currentUser.can('publishEntries'~permissionSuffix) %} {% if canPublish or (not isVersion and canDeleteEntry) %} {% set statusInput %} {% if canPublish %}
{{ forms.lightswitch({ id: 'enabled', name: 'enabled', on: entry.enabled, disabled: isVersion }) }}
{% endif %} {% if not isVersion and canDeleteEntry %}
{% endif %} {% endset %} {{ forms.field({ label: (canPublish ? "Status"|t), id: 'enabled' }, statusInput) }} {% endif %}
{% if isVersion and entry.revisionNotes %}
{{ "Version Notes"|t }}

{{ entry.revisionNotes }}

{% endif %} {% endif %} {# Action buttons #} {% if isDraft %}
{# Are they allowed to publish this draft? #} {% if currentUser.can('publishEntries'~permissionSuffix) and (section.type == 'single' or entry.authorId == currentUser.id or currentUser.can('publishPeerEntries'~permissionSuffix)) and (entry.creatorId == currentUser.id or currentUser.can('publishPeerEntryDrafts'~permissionSuffix)) %} {% endif %} {# Are they allowed to delete this draft? #} {% if entry.creatorId == currentUser.id or currentUser.can('deletePeerEntryDrafts'~permissionSuffix) %} {% endif %}
{% elseif isVersion %} {# Are they allowed to publish changes? #} {% if currentUser.can('publishEntries'~permissionSuffix) and (section.type == 'single' or entry.authorId == currentUser.id or currentUser.can('publishPeerEntries'~permissionSuffix)) %}
{% endif %} {% else %} {# Are they allowed to save this entry? #} {% if (entry.id or currentUser.can('createEntries'~permissionSuffix)) and (not entry.id or not entry.enabled or currentUser.can('publishEntries'~permissionSuffix)) and (section.type == 'single' or entry.authorId == currentUser.id or currentUser.can('publishPeerEntries'~permissionSuffix)) %}
{% if CraftEdition >= CraftClient and section.enableVersioning %} {% endif %}
{% else %} {% if CraftEdition >= CraftClient %}
{% endif %} {% endif %} {% endif %}
{% endblock %} {% if not entry.slug %} {% includeJs "window.slugGenerator = new Craft.SlugGenerator('#title', '#slug');" %} {% endif %}