From d8af18673c341890163c9da7a35ef1c3e6f4bbd9 Mon Sep 17 00:00:00 2001 From: Johann Hoffmann Date: Tue, 19 Nov 2024 17:07:05 +0100 Subject: [PATCH] always show card header of widgets as in editMode but enable certain tools only when actually in editMode. editMode is active for dashboard not for section; less paddings overall in dashboard; deleted Section headers and put cog besides personal greeting; reformatted name var for greeting into generic viewData property; --- application/controllers/Cis4.php | 5 +++- application/controllers/CisVue/Dashboard.php | 6 +++- application/views/CisVue/Dashboard.php | 4 +-- public/js/components/Calendar/Header.js | 2 +- public/js/components/Dashboard/Dashboard.js | 22 ++++++++++++--- public/js/components/Dashboard/Item.js | 14 +++++----- public/js/components/Dashboard/Section.js | 15 ++++------ public/js/components/DashboardWidget/Ampel.js | 2 +- public/js/components/DashboardWidget/News.js | 28 ++++++++----------- .../components/DashboardWidget/Stundenplan.js | 1 - public/js/components/DashboardWidget/Url.js | 3 +- public/js/components/Drop/Grid.js | 2 +- system/phrasesupdate.php | 20 +++++++++++++ 13 files changed, 77 insertions(+), 47 deletions(-) diff --git a/application/controllers/Cis4.php b/application/controllers/Cis4.php index f82168f83..84aedc5f2 100644 --- a/application/controllers/Cis4.php +++ b/application/controllers/Cis4.php @@ -34,7 +34,10 @@ class Cis4 extends Auth_Controller show_error("name couldn't be loaded for username ".getAuthUID()); } $begruesung = getData($begruesung); + $viewData = array( + 'name' => $begruesung + ); - $this->load->view('CisVue/Dashboard.php',["name"=> $begruesung]); + $this->load->view('CisVue/Dashboard.php',['viewData' => $viewData]); } } \ No newline at end of file diff --git a/application/controllers/CisVue/Dashboard.php b/application/controllers/CisVue/Dashboard.php index 5a0996a96..5cb0d1a9e 100644 --- a/application/controllers/CisVue/Dashboard.php +++ b/application/controllers/CisVue/Dashboard.php @@ -35,7 +35,11 @@ class Dashboard extends Auth_Controller show_error("name couldn't be loaded for username ".getAuthUID()); } $begruesung = getData($begruesung); - $this->load->view('CisVue/Dashboard.php',["name"=> $begruesung]); + $viewData = array( + 'name' => $begruesung + ); + + $this->load->view('CisVue/Dashboard.php', ['viewData' => $viewData]); } } \ No newline at end of file diff --git a/application/views/CisVue/Dashboard.php b/application/views/CisVue/Dashboard.php index 4b10d94cc..2f241af87 100644 --- a/application/views/CisVue/Dashboard.php +++ b/application/views/CisVue/Dashboard.php @@ -13,9 +13,7 @@ $this->load->view('templates/CISVUE-Header', $includesArray); ?>
-

Hallo !

-
- +
load->view('templates/CISVUE-Footer', $includesArray); ?> diff --git a/public/js/components/Calendar/Header.js b/public/js/components/Calendar/Header.js index 8cb047919..a62d68f5c 100644 --- a/public/js/components/Calendar/Header.js +++ b/public/js/components/Calendar/Header.js @@ -48,7 +48,7 @@ export default { template: /*html*/`
-
+
diff --git a/public/js/components/Dashboard/Dashboard.js b/public/js/components/Dashboard/Dashboard.js index 8bf1b9051..d96b20e16 100644 --- a/public/js/components/Dashboard/Dashboard.js +++ b/public/js/components/Dashboard/Dashboard.js @@ -9,11 +9,21 @@ export default { }, props: [ "dashboard", + "viewDataString" ], - data: () => ({ - sections: [], - widgets: null - }), + data() { + return { + sections: [], + widgets: null, + viewData: JSON.parse(this.viewDataString), + editMode: false + } + }, + provide() { + return { + editMode: Vue.computed(()=>this.editMode), + } + }, computed: { apiurl() { return FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router + '/dashboard'; @@ -142,6 +152,10 @@ export default { }, template: `
+

+ {{ $p.t('global/personalGreeting', [ viewData?.name ]) }} + +

` diff --git a/public/js/components/Dashboard/Item.js b/public/js/components/Dashboard/Item.js index deb55ed2b..05f381b43 100644 --- a/public/js/components/Dashboard/Item.js +++ b/public/js/components/Dashboard/Item.js @@ -113,19 +113,19 @@ export default {
-
- - {{ widget.setup.name }} +
+ + {{ widget.setup.name }} - + -
+
-
- +
+
diff --git a/public/js/components/Dashboard/Section.js b/public/js/components/Dashboard/Section.js index 10c2f8f4a..d4ecf9244 100644 --- a/public/js/components/Dashboard/Section.js +++ b/public/js/components/Dashboard/Section.js @@ -12,12 +12,15 @@ export default { adminMode: { type: Boolean, default: false + }, + editMode: { + type: Boolean, + default: false } }, props: [ "name", - "widgets", - "seperator" + "widgets" ], emits: [ "widgetAdd", @@ -29,7 +32,6 @@ export default { configOpened: false, gridWidth: 1, gridHeight: null, - editMode: this.adminMode } }, provide() { @@ -41,7 +43,7 @@ export default { }, computed: { editModeIsActive() { - return this.editMode && !this.configOpened + return (this.editMode || this.adminMode) && !this.configOpened }, getSectionStyle() { return 'margin-bottom: 8px;'; @@ -191,12 +193,7 @@ export default { }); }, template: ` -
-

- {{$p.t('ui/section' + name)}} - -