<% // Post editor — split into card sections for visual hierarchy: // - Identity : title, slug, excerpt // - Cover : thumbnail + URL + custom upload button // - Content : markdown textarea with attached toolbar // - Meta : status, type, pin, noindex, tags // // All behavior (IDs, names, upload endpoints) is preserved — only layout // and styling changed. const _hasCover = !!post.cover_image_url; // In hub-modus moeten save/create/cancel de /user//-prefix dragen, anders // valt de request terug op de primaire site (siteUrlBase leeg) en rendert de // post na opslaan headerless (bareChrome). In solo is _base leeg. const _base = (typeof siteUrlBase !== 'undefined' && siteUrlBase) ? siteUrlBase : ''; %>

<%= isNew ? t('pedit.title_new') : t('pedit.title_edit') %>

<%# ── IDENTITY ─────────────────────────────────────────────── %>
<%# ── COVER ────────────────────────────────────────────────── %>
<%= t('pedit.s_cover') %>
> > <% if (!_hasCover) { %>🖼<% } %>
<%# ── CONTENT ──────────────────────────────────────────────── %>
<%= t('pedit.s_content') %> <%= t('pedit.content_hint') %>
<%# Sticky "tik om te bewerken"-hint (alleen zichtbaar op touch + niet-fullscreen via CSS). Puur visueel (pointer-events:none); de tik op het veld opent fullscreen. %> <%# Hidden field is what actually submits to the server. The visible contenteditable's serialized HTML is copied here on submit. %> <%# Initial content is injected as a JSON string in a script tag so we can set innerHTML safely from JS. EJS-escaping HTML directly into the editor would render entity-escaped tags as text. %>
0 <%= t('pedit.chars') %>
<%# ── META ─────────────────────────────────────────────────── %>
<%= t('pedit.s_publication') %>
0) ? '' : 'hidden' %>>
<% if (typeof premiumUnlocked === 'undefined' || premiumUnlocked) { %> <% var _scheduled = !!(post.publish_at && (post.status === 'scheduled' || Date.parse(String(post.publish_at).replace(' ', 'T')) > Date.now())); %>
value="<%= post.publish_at ? String(post.publish_at).replace(' ','T').slice(0,16) : '' %>" style="padding:8px 10px;border-radius:8px;border:1px solid var(--rule,rgba(128,128,128,.4));background:transparent;color:inherit"> <% if (post.status === 'scheduled' && post.publish_at) { %>
⏳ <%= t('pedit.scheduled_for', { d: post.publish_at }) %>
<% } %>
<%= t('pedit.schedule_hint') %>
<% } %>
<%# ── ACTIONS (sticky at bottom) ──────────────────────────── %>
<%= t('pedit.cancel') %>
<% if (!isNew && post.status !== 'published') { %> <% } %>
<%# ── Track picker modal (P59). Mobile-first: full-screen sheet on small viewports, centered modal on ≥640px. Populated lazily on first open. %> <% if (typeof user !== 'undefined' && user) { %> <% } %> <%# Playlist editor modal — included so its global window.openPlaylistEditor is available when the toolbar button fires. Only renders if user can post. %> <% if (typeof user !== 'undefined' && user) { %> <%- include('../partials/playlist-editor', { csrfToken: (typeof csrfToken !== 'undefined' ? csrfToken : '') }) %> <% } %>