chore: new loc.l3.siteDeleted and updated loc.l11b.moveSelectHidden

This commit is contained in:
Florian Sylvain committed 2026-11-04 03:06:29 +01:00
1 parent 3e02e14da4
commit 22dd4045df
9 files changed
+33 -16

No files matched your search

+5 -5
View File
@@ -303,10 +303,10 @@ class Component extends DCLogic {
const multi = x !== 'single'
return Dlg({ title: 'New article', desc: x === 'translation' ? 'Create a translation of an article you can read.' : 'Give the article a title. You can write the rest in the editor.' }, [
x === 'translation' ? [D('display:flex;flex-direction:column;gap:8px', Radio('New article', 'Starts an article in this language.', false), Radio('Translation of an existing article', 'Uses the same rules as Add translation.', true)), Fd('Article', 'Roof inspection checklist', { sel: true, help: 'No French version yet.' }), Fd('Language', 'French', { sel: true, help: 'Only enabled languages this article doesn\'t have yet.' }), Fd('Source version', 'English · published', { sel: true, help: 'You choose which version to copy from. It is also the source tracked for review.' }), Fd('Title in French', 'Liste de contrôle pour l\'inspection de la toiture', { focus: true, lang: 'fr' }), D('display:flex;flex-direction:column;gap:8px', S('font-weight:500;' + HL, 'Starting content'), Radio('Start empty', 'Only the title. Freshness shows No source.', false), Radio('Copy from English', 'Copies body, excerpt, search and social text, image alternative text and authors. The version starts as Needs review.', true))] :
[Fd('Title', x === 'sitechange' ? 'Spring newsletter' : 'Title', { val: x === 'sitechange', focus: x !== 'sitechange', help: '0 / 200' }), Fd('Site', x === 'sitechange' ? 'Notes' : x === 'single' ? 'Archive' : 'Journal', { sel: true }),
multi && Fd('Language', 'English', { sel: true, help: x === 'sitechange' ? 'Notes only offers English, so the language was reset from French.' : 'Default language for Journal.' }),
multi && D('display:flex;flex-direction:column;gap:8px', Radio('New article', 'Starts an article in this language.', true), Radio('Translation of an existing article', 'Uses the same rules as Add translation.', false))]
], [Btn('Cancel'), Btn(x === 'translation' ? 'Create French draft' : 'Create article', 'primary')])
[x === 'siteDeleted' && Alert('error', 'circle-x', 'That site was deleted', 'It was deleted while this dialog was open. Nothing was created. Choose another site to continue. Your title is kept.'), Fd('Title', x === 'sitechange' || x === 'siteDeleted' ? 'Spring newsletter' : 'Title', { val: x === 'sitechange' || x === 'siteDeleted', focus: x !== 'sitechange' && x !== 'siteDeleted', help: '0 / 200' }), Fd('Site', x === 'siteDeleted' ? 'Choose a site' : x === 'sitechange' ? 'Notes' : x === 'single' ? 'Archive' : 'Journal', { sel: true, focus: x === 'siteDeleted', err: x === 'siteDeleted' ? 'Choose a site.' : undefined }),
multi && x !== 'siteDeleted' && Fd('Language', 'English', { sel: true, help: x === 'sitechange' ? 'Notes only offers English, so the language was reset from French.' : 'Default language for Journal.' }),
multi && x !== 'siteDeleted' && D('display:flex;flex-direction:column;gap:8px', Radio('New article', 'Starts an article in this language.', true), Radio('Translation of an existing article', 'Uses the same rules as Add translation.', false))]
], [Btn('Cancel'), Btn(x === 'translation' ? 'Create French draft' : 'Create article', 'primary', x === 'siteDeleted' ? { dis: true } : undefined)])
}
// ---- add translation
const FRT = S1.tr.fr, FRT5 = 'Liste de contrôle pour l\'inspection de la toiture'
@@ -358,7 +358,7 @@ class Component extends DCLogic {
const CfOpt = (t, d, b, k = 'secondary', top, ic) => D((top ? '' : 'border-top:1px solid var(--ui-border);padding-top:14px;') + 'display:flex;' + (m ? 'flex-direction:column;gap:8px' : 'align-items:center;gap:16px'), D('flex:1;min-width:0;display:flex;flex-direction:column;gap:2px', D('display:flex;align-items:center;gap:6px', ic && S('color:var(--ui-error)', Ic(ic)), S('font-weight:600;' + HL, t)), S(MU + ';font-size:13px;line-height:19px;text-wrap:pretty', d)), D((m ? '' : 'width:200px;flex-shrink:0;') + 'display:flex', Btn(b, k, { w: '100%', ic })))
const Cf = (o) => Dlg({ title: o.title || 'Someone else saved this version', desc: o.desc || 'Someone else saved this version at ' + (o.t || '14:32') + '. Your changes aren\'t saved. They stay here until you choose.', w: 560, top: 60 }, [o.alert, CfOpt('Keep my changes', 'Nothing is sent. Your changes stay in the editor.', 'Keep my changes', 'primary', 1), ...(o.rc ? [CfOpt('Reload theirs', 'This discards your unsaved changes.', 'Reload and discard my changes')] : [CfOpt('Download my version', 'Saves your title and body as a text file. Nothing is sent.', 'Download my version'), CfOpt('Reload theirs', 'Shows their version. You confirm first.', 'Reload theirs'), CfOpt('Save over theirs', 'Replaces the title, body and search fields of this version only. Other languages are untouched.', 'Save over theirs', 'dangerOutline', 0, 'triangle-alert')])], [])
const VList = [['English', 'Published'], ['French', 'Draft'], ['German', 'Published'], ['Arabic', 'Draft · Read only']]
const moveNote = (hidden) => D('display:flex;flex-direction:column;gap:6px', S('font-weight:500;' + HL, 'Moves all language versions of this article.'), ...VList.filter(r => !(hidden && r[0] === 'Arabic')).map(r => S(TO, r[0] + ' · ' + r[1])), hidden && S(MU + ';font-size:12px', 'Versions you can\'t read aren\'t listed or counted.'))
const moveNote = (hidden, partial = hidden) => D('display:flex;flex-direction:column;gap:6px', S('font-weight:500;' + HL, 'Moves all language versions of this article.'), ...VList.filter(r => !(hidden && r[0] === 'Arabic')).map(r => S(TO, r[0] + ' · ' + r[1])), partial && S(MU + ';font-size:12px', 'Versions you can\'t read aren\'t listed or counted.'))
const mvPanel = (hidden) => D('position:absolute;z-index:40;' + (m ? 'left:0;right:0;bottom:0;border-top:1px solid var(--ui-border)' : 'right:24px;top:215px;width:340px;border:1px solid var(--ui-border)') + ';background:var(--ui-bg);box-shadow:var(--rc-shadow-pop);padding:16px;display:flex;flex-direction:column;gap:12px', S('font-weight:600;' + HL, 'Site'), D('display:flex;flex-direction:column;gap:0;border:1px solid var(--ui-border)', ...['Journal', 'Atelier', 'Archive', 'Notes'].map(k => D('display:flex;align-items:center;gap:8px;min-height:' + (m ? 48 : 36) + 'px;padding:6px 12px;' + (k === 'Journal' ? 'background:var(--rc-sand);color:var(--rc-on-sand);font-weight:600' : HL), S('width:16px', k === 'Journal' && Ic('check')), k))), moveNote(hidden), D('display:flex;gap:8px', Btn('Cancel'), D('flex:1;display:flex', Btn('Move article…', 'primary', { w: '100%' }))))
const mvDlg = (kind) => {
const base = { desc: 'This moves every version together. Nothing is split.' }
+12 -2
View File
@@ -498,6 +498,16 @@ window.LOC = {
"loc.l3.sitechange",
"Journal, Notes",
"loc.l3.sitechange"
],
[
"Site deleted while open",
"409 target_site_deleted on create. Alert \"That site was deleted\" / \"It was deleted while this dialog was open. Nothing was created. Choose another site to continue. Your title is kept.\" Site reset to \"Choose a site\" with error \"Choose a site.\"; Create article disabled until a site is chosen",
"na",
"siteDeleted",
"",
"loc.l3.siteDeleted",
"Journal",
"loc.l3.siteDeleted"
]
]
},
@@ -1810,8 +1820,8 @@ window.LOC = {
"loc.l11b.moveSelect"
],
[
"Site select, hidden version",
"Arabic not readable: not listed or counted",
"Site select, partial read access",
"API sends partial_view: the note \"Versions you can't read aren't listed or counted.\" shows whether or not a version is hidden. Sample hides Arabic; nothing says what or how many",
"pm",
"moveSelectHidden",
"",