diff --git a/application/config/routes.php b/application/config/routes.php index 9fad59d88..15da5698f 100644 --- a/application/config/routes.php +++ b/application/config/routes.php @@ -61,8 +61,6 @@ $route['api/v1/organisation/[O|o]rganisationseinheit/(:any)'] = 'api/v1/organisa $route['api/v1/ressource/[B|b]etriebsmittelperson/(:any)'] = 'api/v1/ressource/betriebsmittelperson2/$1'; $route['api/v1/system/[S|s]prache/(:any)'] = 'api/v1/system/sprache2/$1'; -$route['studentenverwaltung/(:any)/(:any)'] = 'Studentenverwaltung/index'; - // load routes from extensions $subdir = 'application/config/extensions'; $dirlist = scandir($subdir); diff --git a/application/controllers/Studentenverwaltung.php b/application/controllers/Studentenverwaltung.php index f2bb75b71..d2574c500 100644 --- a/application/controllers/Studentenverwaltung.php +++ b/application/controllers/Studentenverwaltung.php @@ -12,7 +12,7 @@ class Studentenverwaltung extends FHC_Controller /** * @return void */ - public function index() + public function _remap() { $this->load->library('AuthLib'); $this->load->library('PermissionLib'); diff --git a/public/js/apps/Studentenverwaltung.js b/public/js/apps/Studentenverwaltung.js index c676011c3..4a8607a42 100644 --- a/public/js/apps/Studentenverwaltung.js +++ b/public/js/apps/Studentenverwaltung.js @@ -29,6 +29,7 @@ const router = VueRouter.createRouter({ routes: [ { path: `/${ciPath}/studentenverwaltung`, component: FhcStudentenverwaltung }, { path: `/${ciPath}/studentenverwaltung/prestudent/:prestudent_id`, component: FhcStudentenverwaltung }, + { path: `/${ciPath}/studentenverwaltung/prestudent/:prestudent_id/:tab`, component: FhcStudentenverwaltung }, { path: `/${ciPath}/studentenverwaltung/student/:id`, component: FhcStudentenverwaltung } ] }); @@ -38,6 +39,5 @@ const app = Vue.createApp(); app .use(router) .use(PvConfig) - .use(ErrorHandling) .mount('#main'); diff --git a/public/js/components/Stv/Studentenverwaltung/Details.js b/public/js/components/Stv/Studentenverwaltung/Details.js index c7338d5af..910a65866 100644 --- a/public/js/components/Stv/Studentenverwaltung/Details.js +++ b/public/js/components/Stv/Studentenverwaltung/Details.js @@ -1,40 +1,50 @@ -import DetailsDetails from './Details/Details.js'; -import DetailsNotizen from './Details/Notizen.js'; - export default { - components: { - DetailsDetails, - DetailsNotizen - }, props: { student: Object }, data() { return { - component: 'DetailsDetails', - tabs: { - DetailsDetails: 'Details', - DetailsNotizen: 'Notizen' - } + current: this.$route.params.tab || 'details', + tabTemplates: { + details: 'Details', + notizen: 'Notizen' + }, + tabs: {} } }, computed: { hasNoStudent() { return !this.student || (Object.keys(this.student).length === 0 && this.student.constructor === Object); + }, + currentComponent() { + return this.tabs[this.current].component; } }, + created() { + this.tabs = Object.fromEntries(Object.entries(this.tabTemplates).map(([key, title]) => { + return [key, { + title, + component: Vue.defineAsyncComponent(() => import("./Details/" + key.charAt(0).toUpperCase() + key.slice(1) + '.js')) + }]; + })); + }, template: `
Bitte StudentIn auswählen!