mirror of
https://github.com/pierre42100/ComunicWeb
synced 2024-11-25 21:39:21 +00:00
Can respond to group invitation from sidebar
This commit is contained in:
parent
d61d8d977c
commit
d0812e2d85
@ -104,6 +104,17 @@ body.sidebar-collapse .main-sidebar .memberships-list li:hover .subinfo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.main-sidebar .memberships-list .btn-xs {
|
||||||
|
padding-top: 0px;
|
||||||
|
padding-bottom: 0px;
|
||||||
|
height: 1.35em;
|
||||||
|
width: 3em;
|
||||||
|
line-height: 1;
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Conversations entries
|
* Conversations entries
|
||||||
*/
|
*/
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
* @author Pierre HUBERT
|
* @author Pierre HUBERT
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ComunicWeb.components.groups.interface = {
|
const GroupsInterface = {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a group
|
* Create a group
|
||||||
@ -373,4 +373,6 @@ ComunicWeb.components.groups.interface = {
|
|||||||
};
|
};
|
||||||
ComunicWeb.common.api.makeAPIrequest(apiURI, params, true, callback);
|
ComunicWeb.common.api.makeAPIrequest(apiURI, params, true, callback);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
ComunicWeb.components.groups.interface = GroupsInterface;
|
@ -519,8 +519,32 @@ const SidebarMain = {
|
|||||||
else if(group.membership == "invited") {
|
else if(group.membership == "invited") {
|
||||||
|
|
||||||
// Show invited state
|
// Show invited state
|
||||||
subInfoEl.innerHTML = "<i class='fa fa-question'></i> Invited";
|
subInfoEl.innerHTML = "<i class='fa fa-question'></i> Invited ";
|
||||||
|
|
||||||
|
const respondRequest = (accept) => {
|
||||||
|
GroupsInterface.respondInvitation(group.id, accept);
|
||||||
|
|
||||||
|
subInfoEl.innerHTML = accept ? tr("Accepted") : tr("Rejected");
|
||||||
|
};
|
||||||
|
|
||||||
|
// Offer the user to accept or reject the invitation
|
||||||
|
createElem2({
|
||||||
|
appendTo: subInfoEl,
|
||||||
|
type: "span",
|
||||||
|
class: "btn btn-success btn-xs",
|
||||||
|
innerHTML: "<i class='fa fa-check'></i>",
|
||||||
|
onclick: (e) => respondRequest(true)
|
||||||
|
});
|
||||||
|
|
||||||
|
add_space(subInfoEl);
|
||||||
|
|
||||||
|
createElem2({
|
||||||
|
appendTo: subInfoEl,
|
||||||
|
type: "span",
|
||||||
|
class: "btn btn-danger btn-xs",
|
||||||
|
innerHTML: "<i class='fa fa-close'></i>",
|
||||||
|
onclick: (e) => respondRequest(false)
|
||||||
|
});
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
// Group last activity
|
// Group last activity
|
||||||
|
Loading…
Reference in New Issue
Block a user