mirror of
https://github.com/documize/community.git
synced 2025-07-19 05:09:42 +02:00
i18n section types
This commit is contained in:
parent
bca7794c00
commit
f735ae1278
11 changed files with 61 additions and 44 deletions
|
@ -15,6 +15,7 @@ export default Component.extend({
|
|||
data: "",
|
||||
|
||||
didReceiveAttrs() {
|
||||
this._super();
|
||||
this.set("data", this.get("meta.rawBody"));
|
||||
},
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ export default Component.extend(Modals, Notifier, {
|
|||
pageTitle: '',
|
||||
|
||||
didReceiveAttrs() {
|
||||
this._super(...arguments);
|
||||
this._super();
|
||||
this.set('pageTitle', this.get('page.title'));
|
||||
},
|
||||
|
||||
|
|
|
@ -21,7 +21,9 @@ export default Component.extend(ModalMixin, {
|
|||
hasNameError: empty('page.title'),
|
||||
hasDescError: empty('page.excerpt'),
|
||||
|
||||
didRender() {
|
||||
didRender(...args) {
|
||||
this._super(...args);
|
||||
|
||||
let self = this;
|
||||
Mousetrap.bind('esc', function () {
|
||||
self.send('onCancel');
|
||||
|
|
|
@ -67,7 +67,8 @@ export default Component.extend({
|
|||
}
|
||||
},
|
||||
|
||||
didInsertElement() {
|
||||
didInsertElement(...args) {
|
||||
this._super(...args);
|
||||
var editor = CodeMirror.fromTextArea(document.getElementById(this.get('editorId')), {
|
||||
theme: "material",
|
||||
lineNumbers: true,
|
||||
|
@ -91,7 +92,8 @@ export default Component.extend({
|
|||
this.set('codeEditor', editor);
|
||||
},
|
||||
|
||||
willDestroyElement() {
|
||||
willDestroyElement(...args) {
|
||||
this._super(...args);
|
||||
let editor = this.get('codeEditor');
|
||||
|
||||
if (!_.isNull(editor)) {
|
||||
|
|
|
@ -17,13 +17,14 @@ import Component from '@ember/component';
|
|||
export default Component.extend({
|
||||
appMeta: service(),
|
||||
sectionSvc: service('section'),
|
||||
i18n: service(),
|
||||
isDirty: false,
|
||||
waiting: false,
|
||||
diagram: '',
|
||||
diagramXML: '',
|
||||
title: '',
|
||||
readyToSave: false,
|
||||
previewButtonCaption: 'Preview',
|
||||
previewButtonCaption: '',
|
||||
flowCallback: null,
|
||||
editorId: computed('page', function () {
|
||||
let page = this.get('page');
|
||||
|
@ -40,6 +41,8 @@ export default Component.extend({
|
|||
|
||||
didInsertElement() {
|
||||
this._super(...arguments);
|
||||
this.previewButtonCaption = this.i18n.localize('preview');
|
||||
|
||||
schedule('afterRender', () => {
|
||||
this.setupEditor();
|
||||
});
|
||||
|
@ -125,7 +128,7 @@ export default Component.extend({
|
|||
action: 'export',
|
||||
format: 'xmlpng',
|
||||
xml: this.get('diagramXML'),
|
||||
spin: 'Updating'
|
||||
spin: this.i18n.localize('updating')
|
||||
}
|
||||
), '*');
|
||||
},
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
{{layout/logo-heading
|
||||
title="Airtable"
|
||||
desc="Part spreadsheet, part database, and entirely flexible (https://airtable.com)"
|
||||
title=(localize 'section_airtable')
|
||||
desc=(localize 'section_airtable_explain')
|
||||
icon=constants.Icon.Integrations}}
|
||||
|
||||
{{#section/base-editor document=document folder=folder page=page isDirty=(action "isDirty") onCancel=(action "onCancel") onAction=(action "onAction")}}
|
||||
<div class="form-group">
|
||||
<label for="airtable-embed-code">Airtable embed code</label>
|
||||
{{textarea value=data rows="3" id="airtable-embed-code" class="form-control mousetrap" placeholder="Enter code" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"}}
|
||||
<small class="form-text text-muted">Paste the Airtable embed code snippet</small>
|
||||
<label for="airtable-embed-code">{{localize 'section_airtable_code'}}</label>
|
||||
{{textarea value=data rows="3" id="airtable-embed-code" class="form-control mousetrap" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"}}
|
||||
</div>
|
||||
{{/section/base-editor}}
|
||||
|
|
|
@ -5,15 +5,15 @@
|
|||
<form>
|
||||
{{#if blockMode}}
|
||||
<div class="form-group">
|
||||
{{focus-input id="page-id-{{pageId}}" value=pageTitle placeholder="Enter name"
|
||||
{{focus-input id="page-id-{{pageId}}" value=pageTitle placeholder=(localize 'name')
|
||||
class=(if hasNameError "form-control mousetrap form-control-lg is-invalid" "form-control form-control-lg mousetrap")}}
|
||||
</div>
|
||||
<div class="form-group">
|
||||
{{textarea id="page-excerpt-{{pageId}}" value=page.excerpt rows="2" class=(if hasDescError "form-control mousetrap form-control-lg is-invalid" "form-control form-control-lg mousetrap") placeholder="Enter description"}}
|
||||
{{textarea id="page-excerpt-{{pageId}}" value=page.excerpt rows="2" class=(if hasDescError "form-control mousetrap form-control-lg is-invalid" "form-control form-control-lg mousetrap") placeholder=(localize 'description')}}
|
||||
</div>
|
||||
{{else}}
|
||||
<div class="form-group">
|
||||
{{focus-input type="text" id=pageId value=pageTitle class=(if hasNameError "form-control mousetrap form-control-lg is-invalid" "form-control form-control-lg mousetrap") placeholder="Enter name"}}
|
||||
{{focus-input type="text" id=pageId value=pageTitle class=(if hasNameError "form-control mousetrap form-control-lg is-invalid" "form-control form-control-lg mousetrap") placeholder=(localize 'name')}}
|
||||
</div>
|
||||
{{/if}}
|
||||
</form>
|
||||
|
@ -25,15 +25,13 @@
|
|||
{{/if}}
|
||||
{{#ui/ui-toolbar dark=false light=true raised=true large=true bordered=true}}
|
||||
{{#if contentLinkerButton}}
|
||||
{{ui/ui-toolbar-icon icon=constants.Icon.Link color=constants.Color.Gray
|
||||
tooltip="Insert Link" onClick=(action "onShowLinkModal")}}
|
||||
{{ui/ui-toolbar-icon icon=constants.Icon.Link color=constants.Color.Gray tooltip=(localize 'link_insert') onClick=(action "onShowLinkModal")}}
|
||||
{{/if}}
|
||||
{{#if previewButton}}
|
||||
{{ui/ui-toolbar-icon icon=previewIcon color=constants.Color.Gray
|
||||
tooltip=previewText onClick=(action "onPreview")}}
|
||||
{{ui/ui-toolbar-icon icon=previewIcon color=constants.Color.Gray tooltip=previewText onClick=(action "onPreview")}}
|
||||
{{/if}}
|
||||
{{ui/ui-toolbar-icon icon=constants.Icon.Tick color=constants.Color.Green tooltip="Save changes" onClick=(action "onAction")}}
|
||||
{{ui/ui-toolbar-icon icon=constants.Icon.Cross color=constants.Color.Red tooltip="Cancel editing" onClick=(action "onCancel")}}
|
||||
{{ui/ui-toolbar-icon icon=constants.Icon.Tick color=constants.Color.Green tooltip=(localize 'save') onClick=(action "onAction")}}
|
||||
{{ui/ui-toolbar-icon icon=constants.Icon.Cross color=constants.Color.Red tooltip=(localize 'cancel') onClick=(action "onCancel")}}
|
||||
{{/ui/ui-toolbar}}
|
||||
</div>
|
||||
</div>
|
||||
|
@ -47,13 +45,13 @@
|
|||
<div id={{concat "discard-modal-" page.id}} class="modal" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">Discard Changes</div>
|
||||
<div class="modal-header">{{localize 'discard_changes'}}</div>
|
||||
<div class="modal-body">
|
||||
<p>You have made changes to the section - continue editing or discard changes?</p>
|
||||
<p>{{localize 'discard_confirm'}}</p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
{{ui/ui-button color=constants.Color.Gray light=true label="Continue editing" dismiss=true}}
|
||||
{{ui/ui-button color=constants.Color.Red light=true label="Discard changes" onClick=(action "onDiscard")}}
|
||||
{{ui/ui-button color=constants.Color.Gray light=true label=(localize 'continue') dismiss=true}}
|
||||
{{ui/ui-button color=constants.Color.Red light=true label=(localize 'discard') onClick=(action "onDiscard")}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
<div class="grid-cell-1 grid-cell-width-100">
|
||||
<div class="section-editor">
|
||||
<div class="form-group">
|
||||
{{focus-input type="text" id="page-title" value=page.title class=(if hasNameError "form-control mousetrap form-control-lg is-invalid" "form-control form-control-lg mousetrap") placeholder="Enter name"}}
|
||||
{{focus-input type="text" id="page-title" value=page.title class=(if hasNameError "form-control mousetrap form-control-lg is-invalid" "form-control form-control-lg mousetrap") placeholder=(localize 'name')}}
|
||||
</div>
|
||||
{{#if hasExcerpt}}
|
||||
<div class="form-group">
|
||||
{{textarea id="page-excerpt" value=page.excerpt rows="2" class=(if hasDescError "form-control mousetrap form-control-lg is-invalid" "form-control form-control-lg mousetrap") placeholder="Enter description"}}
|
||||
{{textarea id="page-excerpt" value=page.excerpt rows="2" class=(if hasDescError "form-control mousetrap form-control-lg is-invalid" "form-control form-control-lg mousetrap") placeholder=(localize 'description')}}
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
|
@ -30,13 +30,13 @@
|
|||
<div id={{concat "discard-modal"}} class="modal" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">Discard Changes</div>
|
||||
<div class="modal-header">{{localize 'discard_changes'}}</div>
|
||||
<div class="modal-body">
|
||||
<p>You have made changes - continue editing or discard changes?</p>
|
||||
<p>{{localize 'discard_confirm'}}</p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
{{ui/ui-button color=constants.Color.Gray light=true label="Continue editing" dismiss=true}}
|
||||
{{ui/ui-button color=constants.Color.Red light=true label="Discard changes" onClick=(action "onDiscard")}}
|
||||
{{ui/ui-button color=constants.Color.Gray light=true label=(localize 'continue') dismiss=true}}
|
||||
{{ui/ui-button color=constants.Color.Red light=true label=(localize 'discard') onClick=(action "onDiscard")}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{{#section/base-editor-inline document=document folder=folder page=page tip="Concise name that describes code snippet" isDirty=(action "isDirty") onCancel=(action "onCancel") onAction=(action "onAction")}}
|
||||
{{#section/base-editor-inline document=document folder=folder page=page tip=(localize 'section_code_tip') isDirty=(action "isDirty") onCancel=(action "onCancel") onAction=(action "onAction")}}
|
||||
<div class="section-code-editor">
|
||||
<div class="syntax-selector">
|
||||
{{ui/ui-select id=syntaxId
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{{layout/logo-heading
|
||||
title="Draw.io"
|
||||
desc="For making flowcharts, process diagrams, org charts, UML, ER diagrams, network diagrams and much more (https://about.draw.io)"
|
||||
title=(localize 'section_drawio')
|
||||
desc=(localize 'section_drawio_explain')
|
||||
icon=constants.Icon.Integrations}}
|
||||
|
||||
{{#section/base-editor document=document folder=folder page=page busy=waiting isDirty=(action "isDirty") onCancel=(action "onCancel") onAction=(action "onAction")}}
|
||||
|
|
|
@ -47,6 +47,8 @@
|
|||
"search": "Search",
|
||||
"send": "Send",
|
||||
"share": "Share",
|
||||
"discard": "Discard",
|
||||
"continue": "Continue",
|
||||
"signin": "Sign In",
|
||||
"sort": "Sort",
|
||||
"sort_ascending": "Ascending",
|
||||
|
@ -56,6 +58,7 @@
|
|||
"sort_by_revised": "Last updated",
|
||||
"unassigned": "Unassigned",
|
||||
"update": "Update",
|
||||
"updating": "Updating",
|
||||
"viewed": "Viewed",
|
||||
"edited": "Edited",
|
||||
"draft": "Draft",
|
||||
|
@ -237,16 +240,6 @@
|
|||
"doc_delete_confirm": "Are you sure you want to delete this document?",
|
||||
"attachment_delete": "Delete Attachment",
|
||||
"attachment_delete_confirm": "Are you sure you want to delete this attachment?",
|
||||
|
||||
"section_insert": "Insert Section",
|
||||
"section_insert_here": "Insert section here",
|
||||
"section_copy_explain": "This section and all nested sections will be copied to the selected document.",
|
||||
"section_move_explain": "This section and all nested sections will be moved to the selected document.",
|
||||
"section_delete": "Are you sure you want to delete this section?",
|
||||
"section_delete_children": "Also delete child sections",
|
||||
"section_publish": "Publish Re-usable Content Block",
|
||||
"section_publish_name_explain": "Provide a short title for the reusable content block",
|
||||
"section_publish_desc_explain": "Short description to help others understand the reusable content block",
|
||||
"link_insert": "Insert Link",
|
||||
"link_type_section": "Section",
|
||||
"link_type_section_explain": "Link to content within this document",
|
||||
|
@ -257,6 +250,8 @@
|
|||
"link_type_network": "Network",
|
||||
"link_type_network_explain": "Specify network drive/share/folder location",
|
||||
"link_type_network_example": "e.g. //share/folder",
|
||||
"discard_changes": "Discard changes",
|
||||
"discard_confirm": "You have made changes - continue editing or discard changes?",
|
||||
|
||||
"space_permissions": "Space Permissions",
|
||||
"space_permissions_explain": "Assign permissions to users or groups and invite new users to this space",
|
||||
|
@ -288,6 +283,23 @@
|
|||
"space_permission_invite_user": "Invite users to this space",
|
||||
"space_permission_invite_explain": "Comma separate multiple email addresses",
|
||||
|
||||
"section_insert": "Insert Section",
|
||||
"section_insert_here": "Insert section here",
|
||||
"section_copy_explain": "This section and all nested sections will be copied to the selected document.",
|
||||
"section_move_explain": "This section and all nested sections will be moved to the selected document.",
|
||||
"section_delete": "Are you sure you want to delete this section?",
|
||||
"section_delete_children": "Also delete child sections",
|
||||
"section_publish": "Publish Re-usable Content Block",
|
||||
"section_publish_name_explain": "Provide a short title for the reusable content block",
|
||||
"section_publish_desc_explain": "Short description to help others understand the reusable content block",
|
||||
|
||||
"section_airtable": "Airtable",
|
||||
"section_airtable_explain": "Part spreadsheet, part database, and entirely flexible (https://airtable.com)",
|
||||
"section_airtable_code": "Airtable embed code",
|
||||
"section_code_tip": "Concise name that describes code snippet",
|
||||
"section_drawio": "Draw.io",
|
||||
"section_drawio_explain": "For making flowcharts, process diagrams, org charts, UML, ER diagrams, network diagrams and much more (https://about.draw.io)",
|
||||
|
||||
"login_cas": "Authenticating with CAS...",
|
||||
"login_cass_error": "CAS authentication failure",
|
||||
"login_keycloak": "Authenticating with Keycloak...",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue