Add the list of groups of the user

This commit is contained in:
2021-03-08 17:35:59 +01:00
parent 8db5dee1c9
commit f938fd7850
4 changed files with 79 additions and 0 deletions

View File

@@ -31,6 +31,9 @@ h1 {
margin-right: 5px;
}
.group-logo {
width: 50px;
}
/**

View File

@@ -0,0 +1,49 @@
/**
* Groups membership
*
* @author Pierre Hubert
*/
/**
* Apply the list of groups
*/
function ApplyGroups() {
const target = byId("groups-list-table")
data.groups.forEach(group => {
let groupTR = createElem2({
appendTo: target,
type: "tr"
});
const addCell = (content) => createElem2({
appendTo: groupTR,
type: "td",
innerHTML: content,
})
addCell(group.id)
let groupLogoCell = createElem2({
appendTo: groupTR,
type: "td"
});
let groupLogo = createElem2({
appendTo: groupLogoCell,
type: "img",
class: "group-logo",
src: getFilePathFromURL(group.icon_url)
});
addCell(group.name)
addCell(group.number_members)
addCell(group.visibility)
addCell(group.registration_level)
addCell(group.posts_level)
addCell(group.virtual_directory)
addCell(group.membership)
addCell(group.following ? "Yes" : "No")
});
}

View File

@@ -81,6 +81,7 @@ xhr.onload = function(){
ApplySurveyResponses();
ApplyAllConversationMessages();
ApplyConversations();
ApplyGroups();
}
xhr.send(null);