mirror of
https://github.com/wekan/wekan.git
synced 2025-12-20 17:30:13 +01:00
Fix Admin Panel menus "Attachment Settings" and "Cron Settings" and make them translateable.
Thanks to xet7 !
This commit is contained in:
parent
f5d40a0a12
commit
033919a270
6 changed files with 190 additions and 109 deletions
|
|
@ -1,25 +1,5 @@
|
||||||
template(name="attachmentSettings")
|
template(name="attachmentSettings")
|
||||||
.setting-content.attachment-settings-content
|
.attachment-settings-content
|
||||||
unless currentUser.isAdmin
|
|
||||||
| {{_ 'error-notAuthorized'}}
|
|
||||||
else
|
|
||||||
.content-body
|
|
||||||
.side-menu
|
|
||||||
ul
|
|
||||||
li
|
|
||||||
a.js-attachment-storage-settings(data-id="storage-settings")
|
|
||||||
i.fa.fa-cog
|
|
||||||
| {{_ 'attachment-storage-settings'}}
|
|
||||||
li
|
|
||||||
a.js-attachment-migration(data-id="attachment-migration")
|
|
||||||
i.fa.fa-arrow-right
|
|
||||||
| {{_ 'attachment-migration'}}
|
|
||||||
li
|
|
||||||
a.js-attachment-monitoring(data-id="attachment-monitoring")
|
|
||||||
i.fa.fa-chart-line
|
|
||||||
| {{_ 'attachment-monitoring'}}
|
|
||||||
|
|
||||||
.main-body
|
|
||||||
if loading.get
|
if loading.get
|
||||||
+spinner
|
+spinner
|
||||||
else if showStorageSettings.get
|
else if showStorageSettings.get
|
||||||
|
|
|
||||||
|
|
@ -59,6 +59,11 @@ BlazeComponent.extendComponent({
|
||||||
this.showMigration = attachmentSettings.showMigration;
|
this.showMigration = attachmentSettings.showMigration;
|
||||||
this.showMonitoring = attachmentSettings.showMonitoring;
|
this.showMonitoring = attachmentSettings.showMonitoring;
|
||||||
|
|
||||||
|
// Set default sub-menu state
|
||||||
|
this.showStorageSettings.set(true);
|
||||||
|
this.showMigration.set(false);
|
||||||
|
this.showMonitoring.set(false);
|
||||||
|
|
||||||
// Load initial data
|
// Load initial data
|
||||||
this.loadStorageConfiguration();
|
this.loadStorageConfiguration();
|
||||||
this.loadMigrationSettings();
|
this.loadMigrationSettings();
|
||||||
|
|
|
||||||
|
|
@ -1,29 +1,5 @@
|
||||||
template(name="cronSettings")
|
template(name="cronSettings")
|
||||||
.setting-content.cron-settings-content
|
.cron-settings-content
|
||||||
unless currentUser.isAdmin
|
|
||||||
| {{_ 'error-notAuthorized'}}
|
|
||||||
else
|
|
||||||
.content-body
|
|
||||||
.side-menu
|
|
||||||
ul
|
|
||||||
li
|
|
||||||
a.js-cron-migrations(data-id="cron-migrations")
|
|
||||||
i.fa.fa-database
|
|
||||||
| {{_ 'cron-migrations'}}
|
|
||||||
li
|
|
||||||
a.js-cron-board-operations(data-id="cron-board-operations")
|
|
||||||
i.fa.fa-tasks
|
|
||||||
| {{_ 'board-operations'}}
|
|
||||||
li
|
|
||||||
a.js-cron-jobs(data-id="cron-jobs")
|
|
||||||
i.fa.fa-clock-o
|
|
||||||
| {{_ 'cron-jobs'}}
|
|
||||||
li
|
|
||||||
a.js-cron-add(data-id="cron-add")
|
|
||||||
i.fa.fa-plus
|
|
||||||
| {{_ 'add-cron-job'}}
|
|
||||||
|
|
||||||
.main-body
|
|
||||||
if loading.get
|
if loading.get
|
||||||
+spinner
|
+spinner
|
||||||
else if showMigrations.get
|
else if showMigrations.get
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,47 @@ template(name="setting")
|
||||||
span {{_ 'settings'}}
|
span {{_ 'settings'}}
|
||||||
.content-body
|
.content-body
|
||||||
.side-menu
|
.side-menu
|
||||||
|
if attachmentSettings.get
|
||||||
|
ul
|
||||||
|
li
|
||||||
|
a.js-back-to-main-settings
|
||||||
|
i.fa.fa-arrow-left
|
||||||
|
| {{_ 'back-to-settings'}}
|
||||||
|
li
|
||||||
|
a.js-attachment-storage-settings(data-id="storage-settings")
|
||||||
|
i.fa.fa-cog
|
||||||
|
| {{_ 'attachment-storage-settings'}}
|
||||||
|
li
|
||||||
|
a.js-attachment-migration(data-id="attachment-migration")
|
||||||
|
i.fa.fa-arrow-right
|
||||||
|
| {{_ 'attachment-migration'}}
|
||||||
|
li
|
||||||
|
a.js-attachment-monitoring(data-id="attachment-monitoring")
|
||||||
|
i.fa.fa-chart-line
|
||||||
|
| {{_ 'attachment-monitoring'}}
|
||||||
|
else if cronSettings.get
|
||||||
|
ul
|
||||||
|
li
|
||||||
|
a.js-back-to-main-settings
|
||||||
|
i.fa.fa-arrow-left
|
||||||
|
| {{_ 'back-to-settings'}}
|
||||||
|
li
|
||||||
|
a.js-cron-migrations(data-id="cron-migrations")
|
||||||
|
i.fa.fa-database
|
||||||
|
| {{_ 'cron-migrations'}}
|
||||||
|
li
|
||||||
|
a.js-cron-board-operations(data-id="cron-board-operations")
|
||||||
|
i.fa.fa-tasks
|
||||||
|
| {{_ 'board-operations'}}
|
||||||
|
li
|
||||||
|
a.js-cron-jobs(data-id="cron-jobs")
|
||||||
|
i.fa.fa-clock-o
|
||||||
|
| {{_ 'cron-jobs'}}
|
||||||
|
li
|
||||||
|
a.js-cron-add(data-id="cron-add")
|
||||||
|
i.fa.fa-plus
|
||||||
|
| {{_ 'add-cron-job'}}
|
||||||
|
else
|
||||||
ul
|
ul
|
||||||
li.active
|
li.active
|
||||||
a.js-setting-menu(data-id="registration-setting")
|
a.js-setting-menu(data-id="registration-setting")
|
||||||
|
|
@ -53,6 +94,10 @@ template(name="setting")
|
||||||
.main-body
|
.main-body
|
||||||
if loading.get
|
if loading.get
|
||||||
+spinner
|
+spinner
|
||||||
|
else if attachmentSettings.get
|
||||||
|
+attachmentSettings
|
||||||
|
else if cronSettings.get
|
||||||
|
+cronSettings
|
||||||
else if generalSetting.get
|
else if generalSetting.get
|
||||||
+general
|
+general
|
||||||
else if emailSetting.get
|
else if emailSetting.get
|
||||||
|
|
@ -70,10 +115,6 @@ template(name="setting")
|
||||||
+layoutSettings
|
+layoutSettings
|
||||||
else if webhookSetting.get
|
else if webhookSetting.get
|
||||||
+webhookSettings
|
+webhookSettings
|
||||||
else if attachmentSettings.get
|
|
||||||
+attachmentSettings
|
|
||||||
else if cronSettings.get
|
|
||||||
+cronSettings
|
|
||||||
|
|
||||||
template(name="webhookSettings")
|
template(name="webhookSettings")
|
||||||
span
|
span
|
||||||
|
|
|
||||||
|
|
@ -101,6 +101,69 @@ BlazeComponent.extendComponent({
|
||||||
toggleDisplayAuthenticationMethod() {
|
toggleDisplayAuthenticationMethod() {
|
||||||
$('#display-authentication-method').toggleClass('is-checked');
|
$('#display-authentication-method').toggleClass('is-checked');
|
||||||
},
|
},
|
||||||
|
|
||||||
|
backToMainSettings(event) {
|
||||||
|
event.preventDefault();
|
||||||
|
// Reset all settings to false
|
||||||
|
this.forgotPasswordSetting.set(false);
|
||||||
|
this.generalSetting.set(true); // Set registration as default
|
||||||
|
this.emailSetting.set(false);
|
||||||
|
this.accountSetting.set(false);
|
||||||
|
this.announcementSetting.set(false);
|
||||||
|
this.accessibilitySetting.set(false);
|
||||||
|
this.layoutSetting.set(false);
|
||||||
|
this.webhookSetting.set(false);
|
||||||
|
this.attachmentSettings.set(false);
|
||||||
|
this.cronSettings.set(false);
|
||||||
|
this.tableVisibilityModeSetting.set(false);
|
||||||
|
|
||||||
|
// Update active menu item
|
||||||
|
$('.side-menu li.active').removeClass('active');
|
||||||
|
$('.side-menu li:first-child').addClass('active');
|
||||||
|
},
|
||||||
|
|
||||||
|
switchAttachmentMenu(event) {
|
||||||
|
event.preventDefault();
|
||||||
|
const target = $(event.target);
|
||||||
|
const targetID = target.data('id');
|
||||||
|
|
||||||
|
// Update active menu item
|
||||||
|
$('.side-menu li.active').removeClass('active');
|
||||||
|
target.parent().addClass('active');
|
||||||
|
|
||||||
|
// Call the attachment settings component method if available
|
||||||
|
if (window.attachmentSettings && window.attachmentSettings.switchMenu) {
|
||||||
|
window.attachmentSettings.switchMenu(event, targetID);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
switchCronMenu(event) {
|
||||||
|
event.preventDefault();
|
||||||
|
const target = $(event.target);
|
||||||
|
const targetID = target.data('id');
|
||||||
|
|
||||||
|
// Update active menu item
|
||||||
|
$('.side-menu li.active').removeClass('active');
|
||||||
|
target.parent().addClass('active');
|
||||||
|
|
||||||
|
// Call the cron settings template method if available
|
||||||
|
const cronTemplate = Template.instance();
|
||||||
|
if (cronTemplate && cronTemplate.switchMenu) {
|
||||||
|
cronTemplate.switchMenu(event, targetID);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
initializeAttachmentSubMenu() {
|
||||||
|
// Set default sub-menu state for attachment settings
|
||||||
|
// This will be handled by the attachment settings component
|
||||||
|
console.log('Initializing attachment sub-menu');
|
||||||
|
},
|
||||||
|
|
||||||
|
initializeCronSubMenu() {
|
||||||
|
// Set default sub-menu state for cron settings
|
||||||
|
// This will be handled by the cron settings template
|
||||||
|
console.log('Initializing cron sub-menu');
|
||||||
|
},
|
||||||
switchMenu(event) {
|
switchMenu(event) {
|
||||||
const target = $(event.target);
|
const target = $(event.target);
|
||||||
if (!target.hasClass('active')) {
|
if (!target.hasClass('active')) {
|
||||||
|
|
@ -117,6 +180,13 @@ BlazeComponent.extendComponent({
|
||||||
this.webhookSetting.set('webhook-setting' === targetID);
|
this.webhookSetting.set('webhook-setting' === targetID);
|
||||||
this.attachmentSettings.set('attachment-settings' === targetID);
|
this.attachmentSettings.set('attachment-settings' === targetID);
|
||||||
this.cronSettings.set('cron-settings' === targetID);
|
this.cronSettings.set('cron-settings' === targetID);
|
||||||
|
|
||||||
|
// Initialize sub-menu states
|
||||||
|
if ('attachment-settings' === targetID) {
|
||||||
|
this.initializeAttachmentSubMenu();
|
||||||
|
} else if ('cron-settings' === targetID) {
|
||||||
|
this.initializeCronSubMenu();
|
||||||
|
}
|
||||||
this.tableVisibilityModeSetting.set('tableVisibilityMode-setting' === targetID);
|
this.tableVisibilityModeSetting.set('tableVisibilityMode-setting' === targetID);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -285,6 +355,14 @@ BlazeComponent.extendComponent({
|
||||||
'click button.js-save-layout': this.saveLayout,
|
'click button.js-save-layout': this.saveLayout,
|
||||||
'click a.js-toggle-display-authentication-method': this
|
'click a.js-toggle-display-authentication-method': this
|
||||||
.toggleDisplayAuthenticationMethod,
|
.toggleDisplayAuthenticationMethod,
|
||||||
|
'click a.js-back-to-main-settings': this.backToMainSettings,
|
||||||
|
'click a.js-attachment-storage-settings': this.switchAttachmentMenu,
|
||||||
|
'click a.js-attachment-migration': this.switchAttachmentMenu,
|
||||||
|
'click a.js-attachment-monitoring': this.switchAttachmentMenu,
|
||||||
|
'click a.js-cron-migrations': this.switchCronMenu,
|
||||||
|
'click a.js-cron-board-operations': this.switchCronMenu,
|
||||||
|
'click a.js-cron-jobs': this.switchCronMenu,
|
||||||
|
'click a.js-cron-add': this.switchCronMenu,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -98,6 +98,7 @@
|
||||||
"migration-info-text": "Database migrations are performed once and improve system performance. The process continues in the background even if you close your browser.",
|
"migration-info-text": "Database migrations are performed once and improve system performance. The process continues in the background even if you close your browser.",
|
||||||
"migration-warning-text": "Please do not close your browser during migration. The process will continue in the background but may take longer to complete.",
|
"migration-warning-text": "Please do not close your browser during migration. The process will continue in the background but may take longer to complete.",
|
||||||
"cron-settings": "Cron Settings",
|
"cron-settings": "Cron Settings",
|
||||||
|
"back-to-settings": "Back to Settings",
|
||||||
"cron-migrations": "Database Migrations",
|
"cron-migrations": "Database Migrations",
|
||||||
"cron-jobs": "Cron Jobs",
|
"cron-jobs": "Cron Jobs",
|
||||||
"add-cron-job": "Add Cron Job",
|
"add-cron-job": "Add Cron Job",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue