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-1318 replace classes with new classes in administration and sidebar #3341

Merged
merged 5 commits into from
Nov 5, 2023
Merged
Show file tree
Hide file tree
Changes from 3 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
2 changes: 1 addition & 1 deletion controllers/administration.js
Original file line number Diff line number Diff line change
Expand Up @@ -1955,7 +1955,7 @@ router.post(
'ADMIN_VIEW',
);
if (isAdmin) {
res.redirect('/administration/classes/');
Configuration.get('FEATURE_SHOW_NEW_CLASS_VIEW_ENABLED') ? res.redirect('/administration/groups/classes/') : res.redirect('/administration/classes/');
} else {
res.redirect(`/administration/classes/${data._id}/manage`);
}
Expand Down
12 changes: 6 additions & 6 deletions helpers/handlebars/middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,17 +209,17 @@ module.exports = (req, res, next) => {
];

if (newClassViewEnabled) {
teacherChildren.splice(3, 0, {
name: res.$t('global.sidebar.link.administrationClassesNew'),
teacherChildren.splice(2, 1, {
name: res.$t('global.sidebar.link.administrationClasses'),
testId: 'Klassen (neu)',
IgorCapCoder marked this conversation as resolved.
Show resolved Hide resolved
icon: // eslint-disable-next-line max-len
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M4 4H20V15.1648C20.7778 15.62 21.3824 16.1788 21.8399 16.7855C21.9429 16.5443 22 16.2788 22 16V4C22 2.89543 21.1046 2 20 2H4C2.89543 2 2 2.89543 2 4V16C2 16.6043 2.26802 17.146 2.69168 17.5128C2.81915 17.279 2.97043 17.0394 3.15 16.8C3.39346 16.4754 3.67575 16.1677 4 15.8832V4ZM11.6667 12.4944C11.1734 12.8241 10.5933 13 10 13C9.20435 13 8.44129 12.6839 7.87868 12.1213C7.31607 11.5587 7 10.7957 7 10C7 9.40666 7.17595 8.82664 7.50559 8.33329C7.83524 7.83994 8.30377 7.45543 8.85195 7.22836C9.40013 7.0013 10.0033 6.94189 10.5853 7.05765C11.1672 7.1734 11.7018 7.45912 12.1213 7.87868C12.5409 8.29824 12.8266 8.83279 12.9424 9.41473C13.0581 9.99667 12.9987 10.5999 12.7716 11.1481C12.5446 11.6962 12.1601 12.1648 11.6667 12.4944ZM10.5556 9.16853C10.3911 9.05865 10.1978 9 10 9C9.73478 9 9.48043 9.10536 9.29289 9.29289C9.10536 9.48043 9 9.73478 9 10C9 10.1978 9.05865 10.3911 9.16853 10.5556C9.27841 10.72 9.43459 10.8482 9.61732 10.9239C9.80004 10.9996 10.0011 11.0194 10.1951 10.9808C10.3891 10.9422 10.5673 10.847 10.7071 10.7071C10.847 10.5673 10.9422 10.3891 10.9808 10.1951C11.0194 10.0011 10.9996 9.80004 10.9239 9.61732C10.8482 9.43459 10.72 9.27841 10.5556 9.16853ZM15.0087 10C15.0087 11.0228 14.6951 12.021 14.11 12.86C14.3976 12.9526 14.6979 12.9998 15 13C15.7956 13 16.5587 12.6839 17.1213 12.1213C17.6839 11.5587 18 10.7957 18 10C18 9.20435 17.6839 8.44129 17.1213 7.87868C16.5587 7.31607 15.7956 7 15 7C14.6979 7.00018 14.3976 7.04741 14.11 7.14C14.6951 7.97897 15.0087 8.97718 15.0087 10ZM4 19C4 19 4 15 10 15C16 15 16 19 16 19V21H4V19ZM10 17C6.32 17 6 18.71 6 19H14C13.94 18.56 13.5 17 10 17ZM21 21V19C21 19 21 15.55 16.2 15.06C16.7466 15.5643 17.1873 16.1724 17.4964 16.8489C17.8054 17.5254 17.9766 18.2566 18 19V21H21Z"/></svg>',
isExternalIcon: true,
link: '/administration/groups/classes',
});

teacherChildrenWithoutStudents.splice(2, 0, {
name: res.$t('global.sidebar.link.administrationClassesNew'),
teacherChildrenWithoutStudents.splice(1, 1, {
name: res.$t('global.sidebar.link.administrationClasses'),
testId: 'Klassen (neu)',
icon: // eslint-disable-next-line max-len
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M4 4H20V15.1648C20.7778 15.62 21.3824 16.1788 21.8399 16.7855C21.9429 16.5443 22 16.2788 22 16V4C22 2.89543 21.1046 2 20 2H4C2.89543 2 2 2.89543 2 4V16C2 16.6043 2.26802 17.146 2.69168 17.5128C2.81915 17.279 2.97043 17.0394 3.15 16.8C3.39346 16.4754 3.67575 16.1677 4 15.8832V4ZM11.6667 12.4944C11.1734 12.8241 10.5933 13 10 13C9.20435 13 8.44129 12.6839 7.87868 12.1213C7.31607 11.5587 7 10.7957 7 10C7 9.40666 7.17595 8.82664 7.50559 8.33329C7.83524 7.83994 8.30377 7.45543 8.85195 7.22836C9.40013 7.0013 10.0033 6.94189 10.5853 7.05765C11.1672 7.1734 11.7018 7.45912 12.1213 7.87868C12.5409 8.29824 12.8266 8.83279 12.9424 9.41473C13.0581 9.99667 12.9987 10.5999 12.7716 11.1481C12.5446 11.6962 12.1601 12.1648 11.6667 12.4944ZM10.5556 9.16853C10.3911 9.05865 10.1978 9 10 9C9.73478 9 9.48043 9.10536 9.29289 9.29289C9.10536 9.48043 9 9.73478 9 10C9 10.1978 9.05865 10.3911 9.16853 10.5556C9.27841 10.72 9.43459 10.8482 9.61732 10.9239C9.80004 10.9996 10.0011 11.0194 10.1951 10.9808C10.3891 10.9422 10.5673 10.847 10.7071 10.7071C10.847 10.5673 10.9422 10.3891 10.9808 10.1951C11.0194 10.0011 10.9996 9.80004 10.9239 9.61732C10.8482 9.43459 10.72 9.27841 10.5556 9.16853ZM15.0087 10C15.0087 11.0228 14.6951 12.021 14.11 12.86C14.3976 12.9526 14.6979 12.9998 15 13C15.7956 13 16.5587 12.6839 17.1213 12.1213C17.6839 11.5587 18 10.7957 18 10C18 9.20435 17.6839 8.44129 17.1213 7.87868C16.5587 7.31607 15.7956 7 15 7C14.6979 7.00018 14.3976 7.04741 14.11 7.14C14.6951 7.97897 15.0087 8.97718 15.0087 10ZM4 19C4 19 4 15 10 15C16 15 16 19 16 19V21H4V19ZM10 17C6.32 17 6 18.71 6 19H14C13.94 18.56 13.5 17 10 17ZM21 21V19C21 19 21 15.55 16.2 15.06C16.7466 15.5643 17.1873 16.1724 17.4964 16.8489C17.8054 17.5254 17.9766 18.2566 18 19V21H21Z"/></svg>',
Expand Down Expand Up @@ -298,8 +298,8 @@ module.exports = (req, res, next) => {
];

if (newClassViewEnabled) {
adminChildItems.splice(4, 0, {
name: res.$t('global.sidebar.link.administrationClassesNew'),
adminChildItems.splice(3, 1, {
name: res.$t('global.sidebar.link.administrationClasses'),
testId: 'Klassen (neu)',
icon: // eslint-disable-next-line max-len
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M4 4H20V15.1648C20.7778 15.62 21.3824 16.1788 21.8399 16.7855C21.9429 16.5443 22 16.2788 22 16V4C22 2.89543 21.1046 2 20 2H4C2.89543 2 2 2.89543 2 4V16C2 16.6043 2.26802 17.146 2.69168 17.5128C2.81915 17.279 2.97043 17.0394 3.15 16.8C3.39346 16.4754 3.67575 16.1677 4 15.8832V4ZM11.6667 12.4944C11.1734 12.8241 10.5933 13 10 13C9.20435 13 8.44129 12.6839 7.87868 12.1213C7.31607 11.5587 7 10.7957 7 10C7 9.40666 7.17595 8.82664 7.50559 8.33329C7.83524 7.83994 8.30377 7.45543 8.85195 7.22836C9.40013 7.0013 10.0033 6.94189 10.5853 7.05765C11.1672 7.1734 11.7018 7.45912 12.1213 7.87868C12.5409 8.29824 12.8266 8.83279 12.9424 9.41473C13.0581 9.99667 12.9987 10.5999 12.7716 11.1481C12.5446 11.6962 12.1601 12.1648 11.6667 12.4944ZM10.5556 9.16853C10.3911 9.05865 10.1978 9 10 9C9.73478 9 9.48043 9.10536 9.29289 9.29289C9.10536 9.48043 9 9.73478 9 10C9 10.1978 9.05865 10.3911 9.16853 10.5556C9.27841 10.72 9.43459 10.8482 9.61732 10.9239C9.80004 10.9996 10.0011 11.0194 10.1951 10.9808C10.3891 10.9422 10.5673 10.847 10.7071 10.7071C10.847 10.5673 10.9422 10.3891 10.9808 10.1951C11.0194 10.0011 10.9996 9.80004 10.9239 9.61732C10.8482 9.43459 10.72 9.27841 10.5556 9.16853ZM15.0087 10C15.0087 11.0228 14.6951 12.021 14.11 12.86C14.3976 12.9526 14.6979 12.9998 15 13C15.7956 13 16.5587 12.6839 17.1213 12.1213C17.6839 11.5587 18 10.7957 18 10C18 9.20435 17.6839 8.44129 17.1213 7.87868C16.5587 7.31607 15.7956 7 15 7C14.6979 7.00018 14.3976 7.04741 14.11 7.14C14.6951 7.97897 15.0087 8.97718 15.0087 10ZM4 19C4 19 4 15 10 15C16 15 16 19 16 19V21H4V19ZM10 17C6.32 17 6 18.71 6 19H14C13.94 18.56 13.5 17 10 17ZM21 21V19C21 19 21 15.55 16.2 15.06C16.7466 15.5643 17.1873 16.1724 17.4964 16.8489C17.8054 17.5254 17.9766 18.2566 18 19V21H21Z"/></svg>',
Expand Down
1 change: 0 additions & 1 deletion locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -1751,7 +1751,6 @@
"addons": "Add-ons",
"administration": "Administration",
"administrationClasses": "Klassen",
"administrationClassesNew": "Klassen (neu)",
"administrationCourses": "Kurse"
}
},
Expand Down
1 change: 0 additions & 1 deletion locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1751,7 +1751,6 @@
"addons": "Add-ons",
"administration": "Administration",
"administrationClasses": "Classes",
"administrationClassesNew": "Classes (new)",
"administrationCourses": "Courses"
}
},
Expand Down
1 change: 0 additions & 1 deletion locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -1751,7 +1751,6 @@
"addons": "Complementos",
"administration": "Administración",
"administrationClasses": "Clases",
"administrationClassesNew": "Clases (nuevo)",
"administrationCourses": "Cursos"
}
},
Expand Down
1 change: 0 additions & 1 deletion locales/uk.json
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,6 @@
"link": {
"addons": "Доповнення",
"administrationClasses": "Класи",
"administrationClassesNew": "Класи (новий)",
"administrationCourses": "Курси",
"administration": "Адміністрація"
}
Expand Down
4 changes: 3 additions & 1 deletion views/administration/dashboard.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
</div>
{{/userHasPermission}}
{{#userHasPermission 'CLASS_LIST'}}
{{#unless (getConfig "FEATURE_SHOW_NEW_CLASS_VIEW_ENABLED")}}
<div class="col-md-6 col-sm-6 col-xs-12">
<div class="card h-100 teacher-option locationlink" data-loclink="/administration/classes" data-testid="administrate_classes">
<div class="card-block homework">
Expand All @@ -57,14 +58,15 @@
</div>
</div>
</div>
{{/unless}}
{{/userHasPermission}}
{{#userHasPermission 'CLASS_LIST'}}
IgorCapCoder marked this conversation as resolved.
Show resolved Hide resolved
{{#if (getConfig "FEATURE_SHOW_NEW_CLASS_VIEW_ENABLED")}}
<div class="col-md-6 col-sm-6 col-xs-12">
<div class="card h-100 teacher-option locationlink" data-loclink="/administration/groups/classes" data-testid="administrate_classes_new">
IgorCapCoder marked this conversation as resolved.
Show resolved Hide resolved
<div class="card-block homework">
<div class="card-text">
<h2 class="h4"><i class="fa fa-users"></i> {{$t "administration.dashboard.headline.manageClassesNew" }}</h2>
<h2 class="h4"><i class="fa fa-users"></i> {{$t "administration.dashboard.headline.manageClasses" }}</h2>
</div>
</div>
</div>
Expand Down
Loading