mirror of
https://github.com/pierre42100/ComunicWeb
synced 2025-10-12 00:44:52 +00:00
Add the list of groups of the user
This commit is contained in:
@@ -31,6 +31,9 @@ h1 {
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.group-logo {
|
||||
width: 50px;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
|
@@ -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")
|
||||
});
|
||||
}
|
@@ -81,6 +81,7 @@ xhr.onload = function(){
|
||||
ApplySurveyResponses();
|
||||
ApplyAllConversationMessages();
|
||||
ApplyConversations();
|
||||
ApplyGroups();
|
||||
}
|
||||
|
||||
xhr.send(null);
|
Reference in New Issue
Block a user