Changeset 11b3ba5 in Klonkt
- Timestamp:
- 06/21/2026 03:54:13 PM (3 months ago)
- Branches:
- main
- Children:
- 1664f31
- Parents:
- 5e61b17
- Location:
- src
- Files:
-
- 3 edited
-
routes/posts.js (modified) (2 diffs)
-
services/i18n.js (modified) (3 diffs)
-
views/pages/post-edit.ejs (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/routes/posts.js
r5e61b17 r11b3ba5 186 186 let publishAt = null; 187 187 const pa = Date.parse(req.body.publish_at || ''); 188 if ( finalStatus === 'published' && Number.isFinite(pa) && pa > Date.now()) {188 if (req.body.schedule_enabled && finalStatus === 'published' && Number.isFinite(pa) && pa > Date.now()) { 189 189 finalStatus = 'scheduled'; 190 190 publishAt = new Date(pa).toISOString(); … … 297 297 let publishAt = null; 298 298 const pa = Date.parse(req.body.publish_at || ''); 299 if ( finalStatus === 'published' && Number.isFinite(pa) && pa > Date.now()) {299 if (req.body.schedule_enabled && finalStatus === 'published' && Number.isFinite(pa) && pa > Date.now()) { 300 300 finalStatus = 'scheduled'; 301 301 publishAt = new Date(pa).toISOString(); -
src/services/i18n.js
r5e61b17 r11b3ba5 725 725 'pedit.noindex_label': 'noindex (verberg voor zoekmachines)', 726 726 'pedit.fan_only_label': 'Alleen voor ingelogde fans', 727 'pedit.publish_at_label': 'Publiceren op (laat leeg = direct)', 727 'pedit.schedule_label': 'Publicatie inplannen', 728 'pedit.schedule_hint': 'Staat dit uit, dan gaat je post meteen live. Aan = kies hieronder wanneer \'ie verschijnt.', 729 'pedit.publish_at_label': 'Datum & tijd', 728 730 'pedit.scheduled_for': 'Ingepland voor {d}', 729 731 'pedit.cancel': 'Annuleren', … … 1676 1678 'pedit.noindex_label': 'noindex (hide from search engines)', 1677 1679 'pedit.fan_only_label': 'Logged-in fans only', 1678 'pedit.publish_at_label': 'Publish at (leave empty = immediately)', 1680 'pedit.schedule_label': 'Schedule publication', 1681 'pedit.schedule_hint': 'When off, your post goes live immediately. On = pick below when it appears.', 1682 'pedit.publish_at_label': 'Date & time', 1679 1683 'pedit.scheduled_for': 'Scheduled for {d}', 1680 1684 'pedit.cancel': 'Cancel', … … 2627 2631 'pedit.noindex_label': 'noindex (vor Suchmaschinen verbergen)', 2628 2632 'pedit.fan_only_label': 'Nur für angemeldete Fans', 2629 'pedit.publish_at_label': 'Veröffentlichen am (leer lassen = sofort)', 2633 'pedit.schedule_label': 'Veröffentlichung planen', 2634 'pedit.schedule_hint': 'Wenn aus, geht dein Beitrag sofort live. An = wähle unten, wann er erscheint.', 2635 'pedit.publish_at_label': 'Datum & Uhrzeit', 2630 2636 'pedit.scheduled_for': 'Geplant für {d}', 2631 2637 'pedit.cancel': 'Abbrechen', -
src/views/pages/post-edit.ejs
r5e61b17 r11b3ba5 208 208 <span>🔒 <%= t('pedit.fan_only_label') %></span> 209 209 </label> 210 <div style="margin-top:8px"> 211 <label style="display:block;font-size:12.5px;opacity:.8;margin-bottom:4px">📅 <%= t('pedit.publish_at_label') %></label> 212 <input type="datetime-local" name="publish_at" 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"> 210 <% var _scheduled = !!(post.publish_at && (post.status === 'scheduled' || Date.parse(String(post.publish_at).replace(' ', 'T')) > Date.now())); %> 211 <label class="pe-checkbox" style="margin-top:8px"> 212 <input type="checkbox" name="schedule_enabled" value="1" id="pe-sched-toggle" <%= _scheduled ? 'checked' : '' %>> 213 <span>📅 <%= t('pedit.schedule_label') %></span> 214 </label> 215 <div id="pe-sched-fields" style="margin-top:6px;<%= _scheduled ? '' : 'display:none' %>"> 216 <label style="display:block;font-size:12.5px;opacity:.8;margin-bottom:4px"><%= t('pedit.publish_at_label') %></label> 217 <input type="datetime-local" name="publish_at" <%= _scheduled ? '' : 'disabled' %> 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"> 213 218 <% if (post.status === 'scheduled' && post.publish_at) { %><div style="font-size:12px;opacity:.7;margin-top:4px">⏳ <%= t('pedit.scheduled_for', { d: post.publish_at }) %></div><% } %> 219 <div style="font-size:11.5px;opacity:.65;margin-top:4px"><%= t('pedit.schedule_hint') %></div> 214 220 </div> 221 <script> 222 (function () { 223 var cb = document.getElementById('pe-sched-toggle'); 224 var box = document.getElementById('pe-sched-fields'); 225 if (!cb || !box) return; 226 var inp = box.querySelector('input[name="publish_at"]'); 227 function sync() { box.style.display = cb.checked ? '' : 'none'; if (inp) inp.disabled = !cb.checked; } 228 cb.addEventListener('change', sync); sync(); 229 })(); 230 </script> 215 231 <% } %> 216 232 </div>
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)