Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

N21 2075 sync existing course #3511

Merged
merged 6 commits into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions config/default.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,11 @@
"default": false,
"description": "Enables the new class list view"
},
"FEATURE_SHOW_NEW_ROOMS_VIEW_ENABLED": {
"type": "boolean",
"default": false,
"description": "Enables the new rooms view"
},
"FEATURE_GROUPS_IN_COURSE_ENABLED": {
"type": "boolean",
"default": false,
Expand Down
4 changes: 3 additions & 1 deletion controllers/administration.js
Original file line number Diff line number Diff line change
Expand Up @@ -2398,6 +2398,7 @@ router.all('/courses', (req, res, next) => {
roles: ['student'],
$limit: 1000,
});
const newRoomViewEnabled = Configuration.get('FEATURE_SHOW_NEW_ROOMS_VIEW_ENABLED');

Promise.all([
coursesPromise,
Expand All @@ -2420,7 +2421,8 @@ router.all('/courses', (req, res, next) => {
(item.teacherIds || []).map((item) => `${item.lastName}${item.outdatedSince ? ' ~~' : ''}`).join(', '),
[
{
link: `/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'),
},
Expand Down
10 changes: 10 additions & 0 deletions helpers/handlebars/middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,8 @@ module.exports = (req, res, next) => {

// admin views
const newSchoolAdminPageAsDefault = Configuration.get('FEATURE_NEW_SCHOOL_ADMINISTRATION_PAGE_AS_DEFAULT_ENABLED');
const newRoomsViewEnabled = Configuration.get('FEATURE_SHOW_NEW_ROOMS_VIEW_ENABLED');

const adminChildItems = [
{
name: res.$t('global.link.administrationStudents'),
Expand Down Expand Up @@ -326,6 +328,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'),
Expand Down
22 changes: 17 additions & 5 deletions views/administration/dashboard.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,18 @@
</div>
</div>
{{/userHasPermission}}
{{#userHasPermission 'ADMIN_VIEW'}}
{{#userHasPermission 'COURSE_ADMINISTRATION'}}
{{#if (getConfig "FEATURE_SHOW_NEW_ROOMS_VIEW_ENABLED")}}
<div class="col-md-6 col-sm-6 col-xs-12">
<div class="card h-100 teacher-option locationlink" data-loclink="/administration/rooms/new">
<div class="card-block homework">
<div class="card-text">
<h2 class="h4"><i class="fa fa-graduation-cap"></i> {{$t "administration.dashboard.headline.manageCourses" }}</h2>
</div>
</div>
</div>
</div>
{{else}}
<div class="col-md-6 col-sm-6 col-xs-12">
<div class="card h-100 teacher-option locationlink" data-loclink="/administration/courses">
<div class="card-block homework">
Expand All @@ -45,10 +56,11 @@
</div>
</div>
</div>
</div>
{{/userHasPermission}}
{{#userHasPermission 'CLASS_LIST'}}
<div class="col-md-6 col-sm-6 col-xs-12">
</div>
{{/if}}
{{/userHasPermission}}
{{#userHasPermission 'CLASS_LIST'}}
<div class="col-md-6 col-sm-6 col-xs-12">
{{#if (getConfig "FEATURE_SHOW_NEW_CLASS_VIEW_ENABLED")}}
<div class="card h-100 teacher-option locationlink" data-loclink="/administration/groups/classes" data-testid="administrate_classes">
<div class="card-block homework">
Expand Down
Loading