diff --git a/backend/i18n/frontend_en.json b/backend/i18n/frontend_en.json index f9c75c249..805ed6543 100644 --- a/backend/i18n/frontend_en.json +++ b/backend/i18n/frontend_en.json @@ -239,6 +239,7 @@ "common.contents": "Contents", "common.continue": "Continue", "common.contributors": "Contributors", + "common.copy": "Copy", "common.create": "Create", "common.created": "Created", "common.daily": "Daily", @@ -278,6 +279,7 @@ "common.filters": "Filters", "common.folder": "Folder", "common.folders": "Folders", + "common.from": "From", "common.generalSettings": "Common", "common.generate": "Generate", "common.github": "Github", @@ -367,6 +369,7 @@ "common.tags": "Tags", "common.tagsAll": "All tags", "common.time": "Time", + "common.to": "To", "common.update": "Update", "common.upload": "Upload", "common.url": "URL", diff --git a/backend/i18n/frontend_it.json b/backend/i18n/frontend_it.json index 7baf0d6cb..33bb9af2f 100644 --- a/backend/i18n/frontend_it.json +++ b/backend/i18n/frontend_it.json @@ -239,6 +239,7 @@ "common.contents": "Contenuti", "common.continue": "Continua", "common.contributors": "Collaboratori", + "common.copy": "Copy", "common.create": "Crea", "common.created": "Creato", "common.daily": "Daily", @@ -278,6 +279,7 @@ "common.filters": "Filtri", "common.folder": "Cartella", "common.folders": "Cartelle", + "common.from": "From", "common.generalSettings": "Impostazioni generali", "common.generate": "Genera", "common.github": "Github", @@ -367,6 +369,7 @@ "common.tags": "Tag", "common.tagsAll": "Tutti i tag", "common.time": "Ora", + "common.to": "To", "common.update": "Aggiorna", "common.upload": "Carica", "common.url": "URL", diff --git a/backend/i18n/frontend_nl.json b/backend/i18n/frontend_nl.json index a8383f776..eba9442c9 100644 --- a/backend/i18n/frontend_nl.json +++ b/backend/i18n/frontend_nl.json @@ -239,6 +239,7 @@ "common.contents": "Inhoud", "common.continue": "Doorgaan", "common.contributors": "Bijdragers", + "common.copy": "Copy", "common.create": "Maken", "common.created": "Gemaakt", "common.daily": "Daily", @@ -278,6 +279,7 @@ "common.filters": "Filters", "common.folder": "Folder", "common.folders": "Mappen", + "common.from": "From", "common.generalSettings": "Algemeen", "common.generate": "Genereren", "common.github": "Github", @@ -367,6 +369,7 @@ "common.tags": "Tags", "common.tagsAll": "Alle tags", "common.time": "Tijd", + "common.to": "To", "common.update": "Update", "common.upload": "Upload", "common.url": "URL", diff --git a/backend/i18n/frontend_zh.json b/backend/i18n/frontend_zh.json index bf349ed5e..149d7e192 100644 --- a/backend/i18n/frontend_zh.json +++ b/backend/i18n/frontend_zh.json @@ -239,6 +239,7 @@ "common.contents": "内容", "common.continue": "继续", "common.contributors": "贡献者", + "common.copy": "Copy", "common.create": "创建", "common.created": "创建", "common.daily": "Daily", @@ -278,6 +279,7 @@ "common.filters": "过滤器", "common.folder": "文件夹", "common.folders": "文件夹", + "common.from": "From", "common.generalSettings": "通用", "common.generate": "生成", "common.github": "Github", @@ -367,6 +369,7 @@ "common.tags": "标签", "common.tagsAll": "所有标签", "common.time": "时间", + "common.to": "To", "common.update": "更新", "common.upload": "上传", "common.url": "URL", diff --git a/backend/i18n/source/frontend_en.json b/backend/i18n/source/frontend_en.json index f9c75c249..805ed6543 100644 --- a/backend/i18n/source/frontend_en.json +++ b/backend/i18n/source/frontend_en.json @@ -239,6 +239,7 @@ "common.contents": "Contents", "common.continue": "Continue", "common.contributors": "Contributors", + "common.copy": "Copy", "common.create": "Create", "common.created": "Created", "common.daily": "Daily", @@ -278,6 +279,7 @@ "common.filters": "Filters", "common.folder": "Folder", "common.folders": "Folders", + "common.from": "From", "common.generalSettings": "Common", "common.generate": "Generate", "common.github": "Github", @@ -367,6 +369,7 @@ "common.tags": "Tags", "common.tagsAll": "All tags", "common.time": "Time", + "common.to": "To", "common.update": "Update", "common.upload": "Upload", "common.url": "URL", diff --git a/backend/src/Squidex/wwwroot/scripts/editor-references.html b/backend/src/Squidex/wwwroot/scripts/editor-references.html new file mode 100644 index 000000000..1fd828f43 --- /dev/null +++ b/backend/src/Squidex/wwwroot/scripts/editor-references.html @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + \ No newline at end of file diff --git a/frontend/app/features/content/pages/content/editor/field-copy-button.component.scss b/frontend/app/features/content/pages/content/editor/field-copy-button.component.scss new file mode 100644 index 000000000..0e4b20578 --- /dev/null +++ b/frontend/app/features/content/pages/content/editor/field-copy-button.component.scss @@ -0,0 +1,3 @@ +.section { + padding: .25rem 1rem; +} \ No newline at end of file diff --git a/frontend/app/features/content/pages/content/editor/field-copy-button.component.ts b/frontend/app/features/content/pages/content/editor/field-copy-button.component.ts new file mode 100644 index 000000000..74064dfb4 --- /dev/null +++ b/frontend/app/features/content/pages/content/editor/field-copy-button.component.ts @@ -0,0 +1,61 @@ +/* + * Squidex Headless CMS + * + * @license + * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. + */ + +import { Component, Input, OnChanges, SimpleChanges } from '@angular/core'; +import { AppLanguageDto, fadeAnimation, FieldForm, ModalModel } from '@app/shared'; + +@Component({ + selector: 'sqx-field-copy-button[formModel][languages]', + styleUrls: ['./field-copy-button.component.scss'], + templateUrl: './field-copy-button.component.html', + animations: [ + fadeAnimation, + ], +}) +export class FieldCopyButtonComponent implements OnChanges { + @Input() + public formModel: FieldForm; + + @Input() + public languages: ReadonlyArray; + + public languageCodes: ReadonlyArray; + + public copySource: string; + public copyTargets: ReadonlyArray; + + public dropdown = new ModalModel(); + + public get isLocalized() { + return this.formModel.field.isLocalizable && this.languages.length > 1; + } + + public ngOnChanges(changes: SimpleChanges) { + if (changes['languages']) { + this.setCopySource(this.languages[0]?.iso2Code); + } + } + + public setCopySource(language: string) { + this.copySource = language; + this.copyTargets = []; + + this.languageCodes = this.languages.map(x => x.iso2Code).filter(x => x !== language); + } + + public copy() { + if (this.copySource && this.copyTargets?.length > 0) { + const source = this.formModel.get(this.copySource).getRawValue(); + + for (const target of this.copyTargets) { + if (target !== this.copySource) { + this.formModel.get(target)?.setValue(source); + } + } + } + } +} diff --git a/frontend/app/features/content/pages/content/inspecting/content-inspection.component.html b/frontend/app/features/content/pages/content/inspecting/content-inspection.component.html index 531fdbbb8..8e8ccf938 100644 --- a/frontend/app/features/content/pages/content/inspecting/content-inspection.component.html +++ b/frontend/app/features/content/pages/content/inspecting/content-inspection.component.html @@ -1,3 +1,5 @@ + +