Skip to content

Commit

Permalink
Improve New question owner list
Browse files Browse the repository at this point in the history
  • Loading branch information
VirmasaloA committed Dec 19, 2024
1 parent 5629c1d commit db07c49
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 26 deletions.
34 changes: 20 additions & 14 deletions ui/src/app/question/basequestion/question-body.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -155,26 +155,32 @@
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="ms-1 row" [hidden]="currentOwners.length !== 1">
{{ 'i18n_exam_last_owner_info' | translate }}
</div>
<div class="col-md-12 mt-3">
@for (user of currentOwners; track user.id) {
{{ user.firstName }} {{ user.lastName }}
<button
class="btn btn-sm btn-link"
[disabled]="removeOwnerDisabled(user)"
(click)="removeOwner(user)"
title="{{ 'i18n_remove' | translate }}"
>
<i
class="bi bi-x"
[ngClass]="removeOwnerDisabled(user) ? 'text-danger' : 'text-success'"
></i>
</button>
<div class="ms-1 row" [ngClass]="{ 'hover-grey': currentOwners.length !== 1 }">
<div class="row col-8">{{ user.firstName }} {{ user.lastName }} ({{ user.email }})</div>
<!-- Remove button -->
<button
class="btn btn-danger btn-sm ms-1 w-auto m-1"
(click)="removeOwner(user)"
[hidden]="currentOwners.length === 1"
[disabled]="removeOwnerDisabled(user)"
[attr.aria-label]="user.firstName + ' ' + user.lastName"
>
{{ 'i18n_remove' | translate }}
</button>
</div>
}
</div>
</div>
} @else {
@for (user of currentOwners; track user.id) {
<span class="label label-default pe-2">{{ user.firstName }} {{ user.lastName }}</span>
<div class="ms-1 row">
<div class="row col-8">{{ user.firstName }} {{ user.lastName }} ({{ user.email }})</div>
</div>
}
}
</div>
Expand Down
3 changes: 2 additions & 1 deletion ui/src/assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1189,5 +1189,6 @@
"i18n_show_participants": "Show participants",
"i18n_hide_participants": "Hide participants",
"i18n_exam_owner_info": "Exam needs to have at least one examiner.",
"i18n_csv_uploading_cancelled": "CSV file upload cancelled"
"i18n_csv_uploading_cancelled": "CSV file upload cancelled",
"i18n_exam_last_owner_info": "Exam needs to have at least one owner. The last owner can't be removed."
}
3 changes: 2 additions & 1 deletion ui/src/assets/i18n/fi.json
Original file line number Diff line number Diff line change
Expand Up @@ -1189,5 +1189,6 @@
"i18n_show_participants": "Näytä osallistujat",
"i18n_hide_participants": "Piilota osallistujat",
"i18n_exam_owner_info": "Tentissä pitää olla vähintään yksi tentaattori.",
"i18n_csv_uploading_cancelled": "CSV tiedoston tuonti peruutettu"
"i18n_csv_uploading_cancelled": "CSV tiedoston tuonti peruutettu",
"i18n_exam_last_owner_info": "Tentissä pitää olla vähintään yksi omistaja. Viimeistä tentaattoria ei voi poistaa."
}
21 changes: 11 additions & 10 deletions ui/src/assets/i18n/sv.json
Original file line number Diff line number Diff line change
Expand Up @@ -1180,14 +1180,15 @@
"i18n_type_to_start_search": "Skriv för att börja söka",
"i18n_datepicker": "Välj datum",
"i18n_move_question": "Ändra ordningsföljden på frågorna genom att dra",
"i18n_no_maintenance_periods_this_week": "Inga avvikande öppettider denna vecka",
"i18n_no_exceptions_this_week": "Inga avvikande öppettider denna vecka",
"i18n_finished_exam_participants": "Studerande som har avlagt tentamen",
"i18n_maturity_exam_participants_info": "Deltagaren kan tas bort från tentamen endast innan tentamen publiceras.",
"i18n_exam_published": "Tentamen publicerad. SV",
"i18n_exam_not_published": "Tentamen inte publicerad. SV",
"i18n_show_participants": "Visa deltagare",
"i18n_hide_participants": "Dölj deltagare",
"i18n_exam_owner_info": "Tentamen behöver minst en bedömare.SV",
"i18n_csv_uploading_cancelled": "Uppladdning av CSV-fil avbruten"
"i18n_no_maintenance_periods_this_week": "Inga avvikande öppettider denna vecka",
"i18n_no_exceptions_this_week": "Inga avvikande öppettider denna vecka",
"i18n_finished_exam_participants": "Studerande som har avlagt tentamen",
"i18n_maturity_exam_participants_info": "Deltagaren kan tas bort från tentamen endast innan tentamen publiceras.",
"i18n_exam_published": "Tentamen publicerad. SV",
"i18n_exam_not_published": "Tentamen inte publicerad. SV",
"i18n_show_participants": "Visa deltagare",
"i18n_hide_participants": "Dölj deltagare",
"i18n_exam_owner_info": "Tentamen behöver minst en bedömare.SV",
"i18n_csv_uploading_cancelled": "Uppladdning av CSV-fil avbruten",
"i18n_exam_last_owner_info": "Tentissä pitää olla vähintään yksi omistaja. Viimeistä tentaattoria ei voi poistaa. SV"
}

0 comments on commit db07c49

Please sign in to comment.