mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
add name translation wiki-section
This commit is contained in:
@ -136,7 +136,7 @@ class WikiEditor extends TranslationHelper {
|
||||
$('#release-editor').on('click', () => {
|
||||
|
||||
this.editor.save().then(outputData => {
|
||||
alertConfirmAction('Publicar contenido').then(result => {
|
||||
alertConfirmAction(this.get_lang('release_content')).then(result => {
|
||||
if (result.isConfirmed) {
|
||||
this.handlePublishContent(outputData)
|
||||
}
|
||||
|
||||
@ -8,7 +8,9 @@ class WikiSectionForm {
|
||||
this.btnNew = $("#submit-new-section")
|
||||
this.btnUpdate = $("#submit-update-section")
|
||||
this.btnDelete = $("#delete-section")
|
||||
this.name = this.item.find('#section-name')
|
||||
this.nameEs = this.item.find('#section-name-es')
|
||||
this.nameEn = this.item.find('#section-name-en')
|
||||
|
||||
this.icon = this.item.find('#section-icon')
|
||||
this.roles = this.item.find('#section-roles').select2({
|
||||
dropdownParent: this.item.parent()
|
||||
@ -61,7 +63,11 @@ class WikiSectionForm {
|
||||
}
|
||||
getFormData() {
|
||||
return {
|
||||
name: this.name.val(),
|
||||
name: {
|
||||
es : this.nameEs.val(),
|
||||
en : this.nameEn.val(),
|
||||
|
||||
},
|
||||
icon: this.icon.val(),
|
||||
roles: this.roles.val()
|
||||
}
|
||||
@ -128,7 +134,8 @@ class WikiSectionForm {
|
||||
const sectionData = await this.handleShowSection()
|
||||
if (sectionData) {
|
||||
console.log(sectionData)
|
||||
this.name.val(sectionData.data.name)
|
||||
this.nameEs.val(sectionData.data.name?.es)
|
||||
this.nameEn.val(sectionData.data.name?.en)
|
||||
this.icon.val(sectionData.data.icon).trigger('change')
|
||||
this.roles.val(sectionData.data.roles_array).trigger('change')
|
||||
}
|
||||
@ -158,7 +165,8 @@ class WikiSectionForm {
|
||||
})
|
||||
}
|
||||
empty() {
|
||||
this.name.val(null)
|
||||
this.nameEs.val(null)
|
||||
this.nameEn.val(null)
|
||||
this.icon.val("").trigger('change')
|
||||
this.roles.val("").trigger('change')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user