mirror of
https://github.com/wekan/wekan.git
synced 2025-12-18 00:10: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")
|
||||
.setting-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
|
||||
.attachment-settings-content
|
||||
if loading.get
|
||||
+spinner
|
||||
else if showStorageSettings.get
|
||||
|
|
|
|||
|
|
@ -59,6 +59,11 @@ BlazeComponent.extendComponent({
|
|||
this.showMigration = attachmentSettings.showMigration;
|
||||
this.showMonitoring = attachmentSettings.showMonitoring;
|
||||
|
||||
// Set default sub-menu state
|
||||
this.showStorageSettings.set(true);
|
||||
this.showMigration.set(false);
|
||||
this.showMonitoring.set(false);
|
||||
|
||||
// Load initial data
|
||||
this.loadStorageConfiguration();
|
||||
this.loadMigrationSettings();
|
||||
|
|
|
|||
|
|
@ -1,29 +1,5 @@
|
|||
template(name="cronSettings")
|
||||
.setting-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
|
||||
.cron-settings-content
|
||||
if loading.get
|
||||
+spinner
|
||||
else if showMigrations.get
|
||||
|
|
|
|||
|
|
@ -8,6 +8,47 @@ template(name="setting")
|
|||
span {{_ 'settings'}}
|
||||
.content-body
|
||||
.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
|
||||
li.active
|
||||
a.js-setting-menu(data-id="registration-setting")
|
||||
|
|
@ -53,6 +94,10 @@ template(name="setting")
|
|||
.main-body
|
||||
if loading.get
|
||||
+spinner
|
||||
else if attachmentSettings.get
|
||||
+attachmentSettings
|
||||
else if cronSettings.get
|
||||
+cronSettings
|
||||
else if generalSetting.get
|
||||
+general
|
||||
else if emailSetting.get
|
||||
|
|
@ -70,10 +115,6 @@ template(name="setting")
|
|||
+layoutSettings
|
||||
else if webhookSetting.get
|
||||
+webhookSettings
|
||||
else if attachmentSettings.get
|
||||
+attachmentSettings
|
||||
else if cronSettings.get
|
||||
+cronSettings
|
||||
|
||||
template(name="webhookSettings")
|
||||
span
|
||||
|
|
|
|||
|
|
@ -101,6 +101,69 @@ BlazeComponent.extendComponent({
|
|||
toggleDisplayAuthenticationMethod() {
|
||||
$('#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) {
|
||||
const target = $(event.target);
|
||||
if (!target.hasClass('active')) {
|
||||
|
|
@ -117,6 +180,13 @@ BlazeComponent.extendComponent({
|
|||
this.webhookSetting.set('webhook-setting' === targetID);
|
||||
this.attachmentSettings.set('attachment-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);
|
||||
}
|
||||
},
|
||||
|
|
@ -285,6 +355,14 @@ BlazeComponent.extendComponent({
|
|||
'click button.js-save-layout': this.saveLayout,
|
||||
'click a.js-toggle-display-authentication-method': this
|
||||
.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-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",
|
||||
"back-to-settings": "Back to Settings",
|
||||
"cron-migrations": "Database Migrations",
|
||||
"cron-jobs": "Cron Jobs",
|
||||
"add-cron-job": "Add Cron Job",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue