mirror of
https://github.com/pierre42100/ComunicWeb
synced 2025-06-19 04:15:17 +00:00
Show group basic information
This commit is contained in:
@ -183,4 +183,15 @@ function getInfoGroup(id, callback){
|
||||
*/
|
||||
function getInfoMultipleGroups(IDs, callback, force){
|
||||
ComunicWeb.components.groups.info.getInfoMultiple(IDs, callback, force);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the difference of time from now to a specified
|
||||
* timestamp and return it as a string
|
||||
*
|
||||
* @param {Integer} time The base time
|
||||
* @return {String} Computed difference
|
||||
*/
|
||||
function timeDiffToStr(time) {
|
||||
return ComunicWeb.common.date.timeDiffToStr(time);
|
||||
}
|
@ -254,5 +254,27 @@ ComunicWeb.components.sideBar.main = {
|
||||
innerHTML: group.name
|
||||
});
|
||||
|
||||
let subInfoEl = createElem2({
|
||||
appendTo: a,
|
||||
type: "div",
|
||||
class: "subinfo",
|
||||
onclick: (e) => e.stopImmediatePropagation()
|
||||
});
|
||||
|
||||
if(group.membership == "pending") {
|
||||
|
||||
// Show requested state
|
||||
subInfoEl.innerHTML = "Requested";
|
||||
}
|
||||
else if(group.membership == "invited") {
|
||||
|
||||
// Show invited state
|
||||
subInfoEl.innerHTML = "<i class='fa fa-question'></i> Invited";
|
||||
|
||||
}
|
||||
else
|
||||
// Group last activity
|
||||
subInfoEl.innerHTML = timeDiffToStr(lastactive);
|
||||
|
||||
},
|
||||
}
|
Reference in New Issue
Block a user