mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-20 00:12:15 +00:00
Hide Noten Tab from non-Students
This commit is contained in:
@@ -93,7 +93,8 @@ class Config extends FHCAPI_Controller
|
||||
];
|
||||
$result['grades'] = [
|
||||
'title' => $this->p->t('stv', 'tab_grades'),
|
||||
'component' => './Stv/Studentenverwaltung/Details/Noten.js'
|
||||
'component' => './Stv/Studentenverwaltung/Details/Noten.js',
|
||||
'showOnlyWithUid' => true
|
||||
];
|
||||
|
||||
|
||||
|
||||
@@ -9,8 +9,8 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
configStudent: null,
|
||||
configStudents: null
|
||||
configStudent: {},
|
||||
configStudents: {}
|
||||
};
|
||||
},
|
||||
props: {
|
||||
@@ -19,6 +19,17 @@ export default {
|
||||
computed: {
|
||||
appRoot() {
|
||||
return FHC_JS_DATA_STORAGE_OBJECT.app_root;
|
||||
},
|
||||
config() {
|
||||
if (!this.students.length)
|
||||
return {};
|
||||
if (this.students.length == 1) {
|
||||
const student = this.students[0];
|
||||
if (student.uid)
|
||||
return Object.fromEntries(Object.entries(this.configStudent).filter(([key, value]) => !value.showOnlyWithoutUid));
|
||||
return Object.fromEntries(Object.entries(this.configStudent).filter(([key, value]) => !value.showOnlyWithUid));
|
||||
}
|
||||
return this.configStudents;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -53,8 +64,11 @@ export default {
|
||||
<h2 class="h4">{{students[0].titlepre}} {{students[0].vorname}} {{students[0].nachname}} {{students[0].titlepost}}</h2>
|
||||
</div>
|
||||
</div>
|
||||
<fhc-tabs v-if="students.length == 1" ref="tabs" :modelValue="students[0]" :config="configStudent" :default="$route.params.tab" style="flex: 1 1 0%; height: 0%" @changed="reload"></fhc-tabs>
|
||||
<fhc-tabs v-else ref="tabs" :modelValue="students" :config="configStudents" :default="$route.params.tab" style="flex: 1 1 0%; height: 0%" @changed="reload"></fhc-tabs>
|
||||
<fhc-tabs v-if="students.length == 1" ref="tabs" :modelValue="students[0]" :config="config" :default="$route.params.tab" style="flex: 1 1 0%; height: 0%" @changed="reload"></fhc-tabs>
|
||||
<fhc-tabs v-else ref="tabs" :modelValue="students" :config="config" :default="$route.params.tab" style="flex: 1 1 0%; height: 0%" @changed="reload"></fhc-tabs>
|
||||
</div>
|
||||
<div v-else>
|
||||
Loading...
|
||||
</div>
|
||||
</div>`
|
||||
};
|
||||
@@ -12,7 +12,6 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
validStudent: true,
|
||||
tabulatorEvents: [],
|
||||
stdsem: ''
|
||||
};
|
||||
@@ -31,10 +30,6 @@ export default {
|
||||
};
|
||||
},
|
||||
ajaxResponse: (url, params, response) => {
|
||||
if (!response.data)
|
||||
this.validStudent = false;
|
||||
else
|
||||
this.validStudent = true;
|
||||
return response.data || [];
|
||||
},
|
||||
columns: [
|
||||
@@ -85,22 +80,19 @@ export default {
|
||||
// TODO(chris): phrasen
|
||||
template: `
|
||||
<div class="stv-details-noten-zeugnis h-100 d-flex flex-column">
|
||||
<div v-if="!validStudent">Kein Student</div>
|
||||
<template v-else>
|
||||
<!-- TODO(chris): phrase -->
|
||||
<core-filter-cmpt
|
||||
ref="table"
|
||||
title="Certificate"
|
||||
:tabulator-options="tabulatorOptions"
|
||||
:tabulator-events="tabulatorEvents"
|
||||
table-only
|
||||
:side-menu="false"
|
||||
reload
|
||||
>
|
||||
<template #actions="{selected}">
|
||||
<zeugnis-actions :selected="selected" @set-grades="setGrades"></zeugnis-actions>
|
||||
</template>
|
||||
</core-filter-cmpt>
|
||||
</template>
|
||||
<!-- TODO(chris): phrase -->
|
||||
<core-filter-cmpt
|
||||
ref="table"
|
||||
title="Certificate"
|
||||
:tabulator-options="tabulatorOptions"
|
||||
:tabulator-events="tabulatorEvents"
|
||||
table-only
|
||||
:side-menu="false"
|
||||
reload
|
||||
>
|
||||
<template #actions="{selected}">
|
||||
<zeugnis-actions :selected="selected" @set-grades="setGrades"></zeugnis-actions>
|
||||
</template>
|
||||
</core-filter-cmpt>
|
||||
</div>`
|
||||
};
|
||||
Reference in New Issue
Block a user