diff --git a/application/controllers/api/frontend/v1/stv/Config.php b/application/controllers/api/frontend/v1/stv/Config.php index ca7d3ef3d..3c63c0c17 100644 --- a/application/controllers/api/frontend/v1/stv/Config.php +++ b/application/controllers/api/frontend/v1/stv/Config.php @@ -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 ]; diff --git a/public/js/components/Stv/Studentenverwaltung/Details.js b/public/js/components/Stv/Studentenverwaltung/Details.js index 4df148063..b42611095 100644 --- a/public/js/components/Stv/Studentenverwaltung/Details.js +++ b/public/js/components/Stv/Studentenverwaltung/Details.js @@ -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 {

{{students[0].titlepre}} {{students[0].vorname}} {{students[0].nachname}} {{students[0].titlepost}}

- - + + + +
+ Loading...
` }; \ No newline at end of file diff --git a/public/js/components/Stv/Studentenverwaltung/Details/Noten/Zeugnis.js b/public/js/components/Stv/Studentenverwaltung/Details/Noten/Zeugnis.js index 7745f35ce..bc775cb5c 100644 --- a/public/js/components/Stv/Studentenverwaltung/Details/Noten/Zeugnis.js +++ b/public/js/components/Stv/Studentenverwaltung/Details/Noten/Zeugnis.js @@ -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: `
-
Kein Student
- + + + +
` }; \ No newline at end of file