mirror of
				https://github.com/pierre42100/ComunicWeb
				synced 2025-11-03 19:54:14 +00:00 
			
		
		
		
	Can respond to group invitation from sidebar
This commit is contained in:
		@@ -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
 | 
			
		||||
 */
 | 
			
		||||
 
 | 
			
		||||
@@ -4,7 +4,7 @@
 | 
			
		||||
 * @author Pierre HUBERT
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
ComunicWeb.components.groups.interface = {
 | 
			
		||||
const GroupsInterface = {
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Create a group
 | 
			
		||||
@@ -374,3 +374,5 @@ ComunicWeb.components.groups.interface = {
 | 
			
		||||
		ComunicWeb.common.api.makeAPIrequest(apiURI, params, true, callback);
 | 
			
		||||
	}
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
ComunicWeb.components.groups.interface = GroupsInterface;
 | 
			
		||||
@@ -521,6 +521,30 @@ const SidebarMain = {
 | 
			
		||||
			// Show invited state
 | 
			
		||||
			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
 | 
			
		||||
			// Group last activity
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user