feat(cms): enhance policy editor with fullscreen mode and date picking

Improve the policy content management experience by adding a dedicated fullscreen editing mode and a structured date picker for effective dates.
- Implement fullscreen toggle in `policies-block-editor.js` with corresponding CSS for an expanded workspace
- Add `date` field type to `sharedFields.js` and integrate it into `policiesConfig.js`
- Implement date parsing and formatting utilities in `editor-script.ejs` to handle "Effective Date" strings
- Update `policiesController.js` to use `updateOne` for more reliable document persistence and state reloading
- Add support for `ICON_OPTIONS` in the policy editor configuration
- Refine editor UI layout and overflow handling for better stability with long content strings
This commit is contained in:
Tống Thành Đạt
2026-04-22 12:02:00 +07:00
parent cdaddddfeb
commit a44d005c13
7 changed files with 620 additions and 25 deletions
+67 -6
View File
@@ -5,7 +5,7 @@
"titlePrefix": "Our Commitment to",
"titleHighlight": "Transparency",
"description": "Review our policies, terms of service, and commitments to privacy and accessibility. We believe in clear, straightforward communication with our academic community.",
"lastUpdated": "Last updated: April 21, 2026"
"lastUpdated": "Last updated: April 22, 2026"
},
"sidebar": {
"heading": "Policies",
@@ -260,13 +260,74 @@
}
},
{
"navLabel": "hehehe",
"title": "hehehe",
"effectiveDate": "hehehe",
"intro": "hehehe",
"navLabel": "hehehehehehehehehehehehehehehehehehehehe",
"title": "hehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehe",
"effectiveDate": "Effective Date: April 22, 2026",
"intro": "hehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehe",
"id": "hehehe",
"content": {
"blocks": []
"blocks": [
{
"id": "block-1776828969787-k3scn",
"type": "heading",
"level": 1,
"html": "<p>hehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehe</p>"
},
{
"id": "block-1776828970153-r5lpx",
"type": "paragraph",
"html": "<p>Paragraph persist QA 2.</p>"
},
{
"id": "block-1776828972201-p2bgf",
"type": "list",
"style": "ordered",
"items": [
{
"id": "block-1776828972201-p2bgf-item-1",
"html": "<p>Item A2</p>"
},
{
"id": "block-1776828972201-p2bgf-item-2",
"html": "<p>hehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehe</p>"
}
]
},
{
"id": "block-1776828974269-s4z7m",
"type": "quote",
"html": "<p>hehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehe</p>",
"caption": "Persist Source 2"
},
{
"id": "block-1776828976335-unxd1",
"type": "callout",
"tone": "success",
"title": "Callout Persist 2",
"icon": "fa-circle-check",
"html": "<p>hehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehe</p>"
},
{
"id": "block-1776828978384-r45ps",
"type": "divider"
},
{
"id": "block-1776829917567-zycm5",
"type": "callout",
"tone": "success",
"title": "Callout save repro",
"icon": "fa-c",
"html": "<p>hehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehehe</p>"
},
{
"id": "block-1776829967348-g03qc",
"type": "callout",
"tone": "warning",
"title": "Callout save fixed",
"icon": "fa-envelope",
"html": "<p>Callout body fixed persist</p>"
}
]
}
}
]