mirror of
				https://github.com/pierre42100/ComunicWeb
				synced 2025-11-03 19:54:14 +00:00 
			
		
		
		
	Settings now includes group description and URL
This commit is contained in:
		@@ -119,6 +119,14 @@ ComunicWeb.pages.groups.pages.settings = {
 | 
				
			|||||||
			value: settings.name,
 | 
								value: settings.name,
 | 
				
			||||||
		});
 | 
							});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							//Group URL
 | 
				
			||||||
 | 
							var groupURL = createFormGroup({
 | 
				
			||||||
 | 
								target: formContainer,
 | 
				
			||||||
 | 
								type: "text",
 | 
				
			||||||
 | 
								label: "Group URL",
 | 
				
			||||||
 | 
								placeholder: "The URL of the group (optionnal)",
 | 
				
			||||||
 | 
								value: settings.url == "null" ? "" : settings.url
 | 
				
			||||||
 | 
							});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		//Group virtual directory
 | 
							//Group virtual directory
 | 
				
			||||||
@@ -130,7 +138,8 @@ ComunicWeb.pages.groups.pages.settings = {
 | 
				
			|||||||
			value: settings.virtual_directory == "null" ? "" : settings.virtual_directory,
 | 
								value: settings.virtual_directory == "null" ? "" : settings.virtual_directory,
 | 
				
			||||||
		});
 | 
							});
 | 
				
			||||||
		
 | 
							
 | 
				
			||||||
		//Check message target
 | 
					
 | 
				
			||||||
 | 
							//Check virtual directory message target
 | 
				
			||||||
		var checkVirtualDirectoryTarget = createElem2({
 | 
							var checkVirtualDirectoryTarget = createElem2({
 | 
				
			||||||
			appendTo: formContainer,
 | 
								appendTo: formContainer,
 | 
				
			||||||
			type: "small"
 | 
								type: "small"
 | 
				
			||||||
@@ -257,6 +266,16 @@ ComunicWeb.pages.groups.pages.settings = {
 | 
				
			|||||||
		});
 | 
							});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							//Group description
 | 
				
			||||||
 | 
							var groupDescription = createFormGroup({
 | 
				
			||||||
 | 
								target: formContainer,
 | 
				
			||||||
 | 
								label: "Description of your group 255 characters max (optionnal)",
 | 
				
			||||||
 | 
								type: "textarea",
 | 
				
			||||||
 | 
								placeholder: "Description of your group...",
 | 
				
			||||||
 | 
								value: settings.description != "null" ? settings.description : ""
 | 
				
			||||||
 | 
							});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		//Submit button
 | 
							//Submit button
 | 
				
			||||||
		var submitButtonContainer = createElem2({
 | 
							var submitButtonContainer = createElem2({
 | 
				
			||||||
			appendTo: formContainer,
 | 
								appendTo: formContainer,
 | 
				
			||||||
@@ -284,12 +303,20 @@ ComunicWeb.pages.groups.pages.settings = {
 | 
				
			|||||||
			if(groupName.value.length < 4)
 | 
								if(groupName.value.length < 4)
 | 
				
			||||||
				return notify("Please check the name of group !", "danger");
 | 
									return notify("Please check the name of group !", "danger");
 | 
				
			||||||
			
 | 
								
 | 
				
			||||||
 | 
								//Check the given group URL (if any)
 | 
				
			||||||
 | 
								if(groupURL.value.length > 0){
 | 
				
			||||||
 | 
									if(!check_url(groupURL.value))
 | 
				
			||||||
 | 
										return notify("Please check the given URL !", "danger");
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			//Prepare the update request on the server
 | 
								//Prepare the update request on the server
 | 
				
			||||||
			var settings = {
 | 
								var settings = {
 | 
				
			||||||
				name: groupName.value,
 | 
									name: groupName.value,
 | 
				
			||||||
				virtual_directory: virtualDirectory.value,
 | 
									virtual_directory: virtualDirectory.value,
 | 
				
			||||||
				visibility: visibilityForm.elements["group-visibility"].value,
 | 
									visibility: visibilityForm.elements["group-visibility"].value,
 | 
				
			||||||
				registration_level: registrationLevelForm.elements["group-registration-level"].value
 | 
									registration_level: registrationLevelForm.elements["group-registration-level"].value,
 | 
				
			||||||
 | 
									description: groupDescription.value,
 | 
				
			||||||
 | 
									url: groupURL.value
 | 
				
			||||||
			};
 | 
								};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			//Lock the send button
 | 
								//Lock the send button
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user