diff --git a/.claude/session-state.json b/.claude/session-state.json index e5ca8ce5..ac648d95 100644 --- a/.claude/session-state.json +++ b/.claude/session-state.json @@ -43,7 +43,7 @@ "last_deliberation": null }, "FileEditHook": { - "timestamp": "2025-10-23T22:09:40.745Z", + "timestamp": "2025-10-23T22:16:58.258Z", "file": "/home/theflow/projects/tractatus/public/js/admin/submission-modal-enhanced.js", "result": "passed" }, @@ -58,25 +58,25 @@ "tokens": 30000 }, "alerts": [], - "last_updated": "2025-10-23T22:16:03.430Z", + "last_updated": "2025-10-23T22:16:58.258Z", "initialized": true, "framework_components": { "CrossReferenceValidator": { "message": 0, "tokens": 0, - "timestamp": "2025-10-23T22:16:30.078Z", - "last_validation": "2025-10-23T22:16:30.078Z", - "validations_performed": 789 + "timestamp": "2025-10-23T22:17:08.165Z", + "last_validation": "2025-10-23T22:17:08.164Z", + "validations_performed": 791 }, "BashCommandValidator": { "message": 0, "tokens": 0, "timestamp": null, - "last_validation": "2025-10-23T22:16:30.079Z", - "validations_performed": 432, + "last_validation": "2025-10-23T22:17:08.165Z", + "validations_performed": 433, "blocks_issued": 38 } }, - "action_count": 432, + "action_count": 433, "auto_compact_events": [] } \ No newline at end of file diff --git a/public/js/admin/submission-modal-enhanced.js b/public/js/admin/submission-modal-enhanced.js index a60654c9..7d3dbbd6 100644 --- a/public/js/admin/submission-modal-enhanced.js +++ b/public/js/admin/submission-modal-enhanced.js @@ -441,7 +441,93 @@ function renderPublicationRequirements(publicationId) { } /** - * Helper: Render document editor + * Helper: Render multilingual document editor + * Supports multiple language versions with translation + */ +function renderMultilingualDocument(docType, title, submission, article, isStandalone) { + const doc = submission.documents?.[docType] || {}; + const versions = doc.versions || []; + const primaryLang = doc.primaryLanguage || 'en'; + + // Get English and French versions + const enVersion = versions.find(v => v.language === 'en'); + const frVersion = versions.find(v => v.language === 'fr'); + + // For main article, use blog content as English version if no submission version exists + let enContent = enVersion?.content || ''; + if (docType === 'mainArticle' && !enContent && article?.content) { + enContent = article.content; + } + + const frContent = frVersion?.content || ''; + + const enWordCount = enContent ? enContent.split(/\s+/).filter(w => w.length > 0).length : 0; + const frWordCount = frContent ? frContent.split(/\s+/).filter(w => w.length > 0).length : 0; + + const readonly = docType === 'mainArticle' && !isStandalone && article; + + return ` +
🔒 Linked from blog post - edit the blog post to change this content
' : ''} +Translated by: ${frVersion.translatedBy}${frVersion.approved ? ' ✓ Approved' : ''}
` : ''} +