Skip to content

Commit

Permalink
Merge branch 'main' into N21-1324-migration-page-buttons-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mrikallab committed Oct 9, 2023
2 parents fd83994 + f768a37 commit 129cdf8
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
4 changes: 3 additions & 1 deletion config/documents.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ const { DOCUMENT_BASE_DIR, SC_THEME } = require('./global');
const specificFiles = {
accessibilityStatement: 'Willkommensordner/Barrierefreiheit/Barrierefreiheitserklaerung.pdf',
privacyExemplary: 'Onlineeinwilligung/Datenschutzerklaerung-Muster-Schulen-Onlineeinwilligung.pdf',
privacy: 'Onlineeinwilligung/Datenschutzerklaerung-Onlineeinwilligung.pdf',
privacy: SC_THEME === 'thr'
? 'Onlineeinwilligung/Datenschutzhinweise.pdf'
: 'Onlineeinwilligung/Datenschutzerklaerung-Onlineeinwilligung.pdf',
termsOfUseExemplary: 'Onlineeinwilligung/Nutzungsordnung-HPI-Schule-Schueler-Onlineeinwilligung.pdf',
termsOfUse: 'Onlineeinwilligung/Nutzungsordnung-Onlineeinwilligung.pdf',
termsOfUseSchool: SC_THEME === 'thr'
Expand Down
7 changes: 7 additions & 0 deletions controllers/administration.js
Original file line number Diff line number Diff line change
Expand Up @@ -2678,6 +2678,13 @@ router.all('/teams', async (req, res, next) => {
baseUrl: `/administration/teams/?p={{page}}${sortQuery}${limitQuery}`,
};

const compare = (a, b) => (a > b) - (a < b);

users.sort((a, b) => (
compare(a.lastName.toLowerCase(), b.lastName.toLowerCase())
|| compare(a.firstName.toLowerCase(), b.firstName.toLowerCase())
));

users = users.filter((user) => !isUserHidden(user, res.locals.currentSchoolData));

res.render('administration/teams', {
Expand Down
2 changes: 1 addition & 1 deletion controllers/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ const FileGetter = (req, res, next) => {
}

const files = result.filter((f) => f).map((file) => {
if (file.permissions[0].refId === userId) {
if (file.permissions[0]?.refId === userId) {
Object.assign(file, {
userIsOwner: true,
});
Expand Down
8 changes: 2 additions & 6 deletions views/administration/forms/form-teams.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,11 @@
<div class="form-group">
<label>{{$t "administration.teams.label.selectAnAdditionalOwner" }}</label>
{{{course.name}}}
<select class="form-control form-control-lg" type="text" name="userId">
<select class="form-control form-control-lg search-enabled" aria-label="{{$t "administration.teams.label.selectAnAdditionalOwner" }}" type="text" name="userId">
<option value="">{{$t "administration.teams.button.addAnotherOwner" }}</option>
{{#each users}}
<option value="{{{this._id}}}">
{{#if this.displayName}}
{{this.displayName}}
{{else}}
{{this.firstName}} {{this.lastName}}
{{/if}}
{{this.lastName}} {{this.firstName}}
</option>
{{/each}}
</select>
Expand Down

0 comments on commit 129cdf8

Please sign in to comment.