Skip to content

Commit

Permalink
SAK-50524 Assignments restore student profile photos in view "Assignm…
Browse files Browse the repository at this point in the history
…ents by Student" (#12904)
  • Loading branch information
hornersa authored Sep 23, 2024
1 parent 7e0991a commit e2581cd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 8 additions & 2 deletions assignment/tool/src/webapp/js/assignmentsByStudent.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,22 +45,28 @@ function parseDataCell(html) {
const expanded = cell.getAttribute("data-expanded") == "true";
const actionLink = cell.getAttribute("data-action-href");
const studentUserId = cell.getAttribute("data-user-id");
const userPhotoLabel = cell.getAttribute("data-user-photo-label");
const studentName = cell.innerText.trim();

return {
actionLink,
expanded,
studentName,
studentUserId,
userPhotoLabel,
};
}

function renderGrouping({ studentName, actionLink, expanded, studentUserId }) {
function renderGrouping({ studentName, actionLink, expanded, studentUserId, userPhotoLabel }) {
const template = document.createElement('template');
template.innerHTML = `
<tr>
<td class="border-0">
<a href="${actionLink}" id="${studentUserId}">
<sakai-user-photo class="mx-2" user-id="${studentUserId}"
label="${userPhotoLabel}"
profile-popup="on"
</sakai-user-photo>
<a href="${actionLink}" id="${studentUserId}" class="d-inline-block mt-1">
<span class="expand-icon si ${expanded ? "si-expanded" : "si-collapsed"}"
aria-hidden="true"></span>
<span>${studentName}</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@
data-action-href='#toolLinkParam("AssignmentAction" "doHide_student_submission" "studentId=$formattedText.escapeUrl($member.Id)")'
#end
data-expanded="$isExpanded"
data-user-photo-label="$tlang.getFormattedMessage("grading.userphoto", $member.displayName)"
>
$submitterName
</span>
Expand Down Expand Up @@ -160,6 +161,7 @@
data-action-href='#toolLinkParam("AssignmentAction" "doHide_student_submission" "studentId=$formattedText.escapeUrl($member.Id)")'
#end
data-expanded="$isExpanded"
data-user-photo-label="$tlang.getFormattedMessage("grading.userphoto", $member.displayName)"
>
$submitterName
</span>
Expand Down

0 comments on commit e2581cd

Please sign in to comment.