From 9042f9b83bc323d873c3eda2617d0b68fc56d4ac Mon Sep 17 00:00:00 2001 From: Johann Hoffmann Date: Wed, 13 Nov 2024 17:27:50 +0100 Subject: [PATCH] change fh logo visibility breakpoint class md -> sm; editable flag in profile based on looking at own profile or being an admin; scrollbar calc in profil app; --- application/controllers/api/frontend/v1/Profil.php | 7 ++++++- public/js/apps/Cis/Profil.js | 3 ++- public/js/components/Cis/Menu.js | 2 +- public/js/components/Cis/Profil/MitarbeiterProfil.js | 5 ++++- public/js/components/Cis/Profil/MitarbeiterViewProfil.js | 6 +++++- .../Cis/Profil/ProfilComponents/ProfilInformation.js | 8 ++++++-- public/js/components/Cis/Profil/StudentProfil.js | 9 ++++++--- public/js/components/Cis/Profil/StudentViewProfil.js | 5 ++++- 8 files changed, 34 insertions(+), 11 deletions(-) diff --git a/application/controllers/api/frontend/v1/Profil.php b/application/controllers/api/frontend/v1/Profil.php index 63e86d1b2..a82b3ddfc 100644 --- a/application/controllers/api/frontend/v1/Profil.php +++ b/application/controllers/api/frontend/v1/Profil.php @@ -34,7 +34,8 @@ class Profil extends FHCAPI_Controller 'isMitarbeiter' => self::PERM_LOGGED, ]); - + + $this->load->library('PermissionLib'); $this->load->model('ressource/mitarbeiter_model', 'MitarbeiterModel'); $this->load->model('crm/Student_model', 'StudentModel'); @@ -69,6 +70,7 @@ class Profil extends FHCAPI_Controller public function getView($uid) { $res = new stdClass(); + $editAllowed = getAuthUID() == $uid || $this->permissionlib->isBerechtigt('admin'); // if parsing the URL did not found a UID then the UID of the logged in user is used if ($uid == "Profil" || $uid == $this->uid) { @@ -86,6 +88,8 @@ class Profil extends FHCAPI_Controller $res->data = $this->studentProfil(); $res->data->pid = $this->pid; } + + $editAllowed = true; } // UID is availabe when accessing Profil/View/:uid else { @@ -112,6 +116,7 @@ class Profil extends FHCAPI_Controller $res->data = $this->viewStudentProfil($uid); } } + $res->data->editAllowed = $editAllowed; $this->terminateWithSuccess($res); } diff --git a/public/js/apps/Cis/Profil.js b/public/js/apps/Cis/Profil.js index b19c448ae..592c27a37 100644 --- a/public/js/apps/Cis/Profil.js +++ b/public/js/apps/Cis/Profil.js @@ -4,6 +4,7 @@ import ViewStudentProfil from "../../components/Cis/Profil/StudentViewProfil.js" import ViewMitarbeiterProfil from "../../components/Cis/Profil/MitarbeiterViewProfil.js"; import Loading from "../../components/Loader.js"; import Phrasen from "../../plugin/Phrasen.js"; +import { setScrollbarWidth } from "../../helpers/CssVarCalcHelpers"; Vue.$collapseFormatter = function (data) { @@ -400,7 +401,7 @@ const profilApp = Vue.createApp({ `, }); - +setScrollbarWidth() profilApp .use(primevue.config.default, { zIndex: { overlay: 9999 } }) .use(Phrasen) diff --git a/public/js/components/Cis/Menu.js b/public/js/components/Cis/Menu.js index b3547e30a..35fe847a3 100644 --- a/public/js/components/Cis/Menu.js +++ b/public/js/components/Cis/Menu.js @@ -124,7 +124,7 @@ export default { - diff --git a/public/js/components/Cis/Profil/ProfilComponents/ProfilInformation.js b/public/js/components/Cis/Profil/ProfilComponents/ProfilInformation.js index f37c38be4..46b0b2eda 100644 --- a/public/js/components/Cis/Profil/ProfilComponents/ProfilInformation.js +++ b/public/js/components/Cis/Profil/ProfilComponents/ProfilInformation.js @@ -6,6 +6,10 @@ export default { data: { type: Object, }, + editable: { + type: Boolean, + default: false + } }, data() { return { @@ -56,7 +60,7 @@ export default {
-
+
@@ -77,7 +81,7 @@ export default { -
+
diff --git a/public/js/components/Cis/Profil/StudentProfil.js b/public/js/components/Cis/Profil/StudentProfil.js index 66d33efca..40ee7985f 100644 --- a/public/js/components/Cis/Profil/StudentProfil.js +++ b/public/js/components/Cis/Profil/StudentProfil.js @@ -139,6 +139,10 @@ export default { }, computed: { + editable() { + return this.data?.editAllowed ?? false; + }, + filteredEditData() { return this.editDataFilter ? this.editData.data[this.editDataFilter] @@ -204,8 +208,7 @@ export default {
- -
+