diff --git a/controllers/administration.js b/controllers/administration.js index 5ef4130d67..9582be5bb5 100644 --- a/controllers/administration.js +++ b/controllers/administration.js @@ -2393,6 +2393,7 @@ router.all('/courses', (req, res, next) => { roles: ['student'], $limit: 1000, }); + const newRoomViewEnabled = Configuration.get('FEATURE_SHOW_NEW_ROOMS_VIEW_ENABLED'); Promise.all([ coursesPromise, @@ -2415,12 +2416,13 @@ router.all('/courses', (req, res, next) => { (item.teacherIds || []).map((item) => `${item.lastName}${item.outdatedSince ? ' ~~' : ''}`).join(', '), [ { - link: Configuration.get('FEATURE_SHOW_NEW_ROOMS_VIEW_ENABLED') ? `/courses/${item._id}/edit?redirectUrl=/administration/rooms/new` : `/courses/${item._id}/edit?redirectUrl=/administration/courses`, + link: newRoomViewEnabled ? `/courses/${item._id}/edit?redirectUrl=/administration/rooms/new` + : `/courses/${item._id}/edit?redirectUrl=/administration/courses`, icon: 'edit', title: res.$t('administration.controller.link.editEntry'), }, { - link: Configuration.get('FEATURE_SHOW_NEW_ROOMS_VIEW_ENABLED') ? `/courses/${item._id}/edit?redirectUrl=/administration/rooms/new` : `/administration/courses/${item._id}`, + link: `/administration/courses/${item._id}`, class: 'btn-delete', icon: 'trash-o', method: 'delete', diff --git a/helpers/handlebars/middleware.js b/helpers/handlebars/middleware.js index 549addbad0..29c7925af6 100644 --- a/helpers/handlebars/middleware.js +++ b/helpers/handlebars/middleware.js @@ -289,7 +289,7 @@ module.exports = (req, res, next) => { name: res.$t('global.sidebar.link.administrationCourses'), testId: 'Kurse', icon: 'school-outline', - link: newRoomsViewEnabled ? '/administration/rooms/new':'/administration/courses/', + link: '/administration/courses/', }, { name: res.$t('global.sidebar.link.administrationClasses'), @@ -317,6 +317,14 @@ module.exports = (req, res, next) => { }, ]; + if (newRoomsViewEnabled) { + adminChildItems.splice(2, 1, { + name: res.$t('global.sidebar.link.administrationCourses'), + testId: 'Kurse', + icon: 'school-outline', + link: '/administration/rooms/new', + }); + } if (newClassViewEnabled) { adminChildItems.splice(3, 1, { name: res.$t('global.sidebar.link.administrationClasses'), diff --git a/views/administration/dashboard.hbs b/views/administration/dashboard.hbs index b4570f04c1..ec99a43025 100644 --- a/views/administration/dashboard.hbs +++ b/views/administration/dashboard.hbs @@ -36,7 +36,7 @@ {{/userHasPermission}} - {{#userHasPermission 'ADMIN_VIEW'}} + {{#userHasPermission 'COURSE_LIST'}} {{#if (getConfig "FEATURE_SHOW_NEW_ROOMS_VIEW_ENABLED")}}
{{/if}} - {{/userHasPermission}} + {{/userHasPermission}} {{#userHasPermission 'CLASS_LIST'}}
{{#if (getConfig "FEATURE_SHOW_NEW_CLASS_VIEW_ENABLED")}}