From 0c95dbad1fe5901d7490bc7ea0e320810b94373f Mon Sep 17 00:00:00 2001 From: SimonGschnell Date: Tue, 22 Apr 2025 11:40:58 +0200 Subject: [PATCH] update(Dashboard Section description): adds phrases for the description of general/custom/other sections --- .../libraries/dashboard/DashboardLib.php | 2 +- public/js/components/Dashboard/Dashboard.js | 3 +- public/js/components/Dashboard/Section.js | 27 ++++- system/phrasesupdate.php | 104 +++++++++++++++++- 4 files changed, 130 insertions(+), 6 deletions(-) diff --git a/application/libraries/dashboard/DashboardLib.php b/application/libraries/dashboard/DashboardLib.php index 72072f657..7aab6b949 100644 --- a/application/libraries/dashboard/DashboardLib.php +++ b/application/libraries/dashboard/DashboardLib.php @@ -127,7 +127,7 @@ class DashboardLib $emptypreset->dashboard_id = $dashboard->dashboard_id; $emptypreset->funktion_kurzbz = $funktion_kurzbz; $section = ($funktion_kurzbz !== null) ? $funktion_kurzbz : self::SECTION_IF_FUNKTION_KURZBZ_IS_NULL; - $emptypreset->preset = '{"' . $section . '": { "widgets" : {}}}'; + $emptypreset->preset = '{"' . $section . '": { "widgets" : {}},"custom": { "widgets" : {}}}'; return $emptypreset; } diff --git a/public/js/components/Dashboard/Dashboard.js b/public/js/components/Dashboard/Dashboard.js index 046edf920..005551570 100644 --- a/public/js/components/Dashboard/Dashboard.js +++ b/public/js/components/Dashboard/Dashboard.js @@ -143,7 +143,7 @@ export default { } }, created() { - + this.$p.loadCategory('dashboard'); axios.get(this.apiurl + '/Widget/getWidgetsForDashboard', { params: { db: this.dashboard @@ -175,6 +175,7 @@ export default { }); remove.forEach(wid => this.widgetRemove(name, wid)); } + this.sections = this.sections.sort((section1, section2) => section2.widgets.length - section1.widgets.length); }).catch(err => console.error('ERROR:', err)); }, async beforeMount() { diff --git a/public/js/components/Dashboard/Section.js b/public/js/components/Dashboard/Section.js index 5c4b82206..17c2ac004 100644 --- a/public/js/components/Dashboard/Section.js +++ b/public/js/components/Dashboard/Section.js @@ -93,8 +93,29 @@ export default { }, methods: { + sectionNameTranslation(){ + switch(this.name){ + case "general": + return this.$p.t('dashboard',this.name); + break; + case "custom": + return this.$p.t('dashboard',this.name); + break; + default: + return this.name; + break; + } + }, showSectionInformation(){ - SectionModal.popup(`this is the information for the section ${name}`); + if (this.name == "general"){ + SectionModal.popup(this.$p.t('dashboard', 'dashboardGeneralSectionDescription')); + } + else if(this.name == "custom"){ + SectionModal.popup(this.$p.t('dashboard', 'dashboardCustomSectionDescription')); + } + else{ + SectionModal.popup(this.$p.t('dashboard', 'dashboardSectionDescription', [this.name])); + } }, handleConfigOpened() { this.configOpened = true @@ -188,9 +209,9 @@ export default { }); }, template: ` -

+

- {{name}}: + {{sectionNameTranslation()}}:

diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index 01f0427b6..dd874ddff 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -38354,6 +38354,106 @@ array( ) ), // ### STUDIENGANG_INFORMATIONEN PHRASEN ENDE + array( + 'app' => 'core', + 'category' => 'dashboard', + 'phrase' => 'general', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Allgemein', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'General', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'dashboard', + 'phrase' => 'custom', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Benutzerdefiniert', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Custom', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'dashboard', + 'phrase' => 'dashboardGeneralSectionDescription', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Hier befinden sich die vordefinierten Widgets', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Here are the predefined widgets', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'dashboard', + 'phrase' => 'dashboardCustomSectionDescription', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Hier befinden sich die Widgets Ihrer persönlichen Anpassungen', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Here are the widgets of your personal cutomizations', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'dashboard', + 'phrase' => 'dashboardSectionDescription', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Hier befinden sich die Widgets der {0} Funktion', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Here are the widgets of the {0} function', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), // CIS4 phrases from legacy code end array( 'app' => 'core', @@ -38414,7 +38514,9 @@ array( 'insertvon' => 'system' ) ) - ) + ), + + );