mirror of
				https://github.com/pierre42100/ComunicWeb
				synced 2025-11-04 04:04:20 +00:00 
			
		
		
		
	Added survey specific post informations
This commit is contained in:
		@@ -47,7 +47,8 @@
 | 
				
			|||||||
.post-form .post-movie,
 | 
					.post-form .post-movie,
 | 
				
			||||||
.post-form .post-weblink,
 | 
					.post-form .post-weblink,
 | 
				
			||||||
.post-form .post-pdf,
 | 
					.post-form .post-pdf,
 | 
				
			||||||
.post-form .post-countdown {
 | 
					.post-form .post-countdown,
 | 
				
			||||||
 | 
					.post-form .post-survey {
 | 
				
			||||||
	display: none;
 | 
						display: none;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -55,6 +56,10 @@
 | 
				
			|||||||
	margin-right: 5px;
 | 
						margin-right: 5px;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					.post-form .post-survey .select2-dropdown {
 | 
				
			||||||
 | 
						/* Hide select2 suggestions*/
 | 
				
			||||||
 | 
						display: none;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 * Visibility choice
 | 
					 * Visibility choice
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -183,7 +183,7 @@ ComunicWeb.components.posts.form = {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
		var timeEndInput = createFormGroup({
 | 
							var timeEndInput = createFormGroup({
 | 
				
			||||||
			target: countdownForm,
 | 
								target: countdownForm,
 | 
				
			||||||
			label: "Date de fin",
 | 
								label: "End date",
 | 
				
			||||||
			placeholder: "dd/mm/yyyy",
 | 
								placeholder: "dd/mm/yyyy",
 | 
				
			||||||
			type: "text"
 | 
								type: "text"
 | 
				
			||||||
		});
 | 
							});
 | 
				
			||||||
@@ -194,7 +194,43 @@ ComunicWeb.components.posts.form = {
 | 
				
			|||||||
		});
 | 
							});
 | 
				
			||||||
		//End : countdown timer
 | 
							//End : countdown timer
 | 
				
			||||||
		
 | 
							
 | 
				
			||||||
 | 
							//Add survey specific informations
 | 
				
			||||||
 | 
							var surveyForm = createElem2({
 | 
				
			||||||
 | 
								appendTo: boxBody,
 | 
				
			||||||
 | 
								type: "div",
 | 
				
			||||||
 | 
								class: "post-survey"
 | 
				
			||||||
 | 
							});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							//Survey question
 | 
				
			||||||
 | 
							var surveyQuestionInput = createFormGroup({
 | 
				
			||||||
 | 
								target: surveyForm,
 | 
				
			||||||
 | 
								label: "Question for the survey",
 | 
				
			||||||
 | 
								placeholder: "Question",
 | 
				
			||||||
 | 
								type: "text"
 | 
				
			||||||
 | 
							});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							//Survey answers
 | 
				
			||||||
 | 
							var surveyAnswerInput = createFormGroup({
 | 
				
			||||||
 | 
								target: surveyForm,
 | 
				
			||||||
 | 
								label: "Answers",
 | 
				
			||||||
 | 
								type: "select2",
 | 
				
			||||||
 | 
								multiple: true,
 | 
				
			||||||
 | 
							});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							//Survey message help
 | 
				
			||||||
 | 
							var surveyAnswerHelper = createElem2({
 | 
				
			||||||
 | 
								appendTo: surveyForm,
 | 
				
			||||||
 | 
								type: "p",
 | 
				
			||||||
 | 
								innerHTML: "Type your answer and then press return (enter) key to confirm it."
 | 
				
			||||||
 | 
							})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							//Enable select2
 | 
				
			||||||
 | 
							$(surveyAnswerInput).select2({
 | 
				
			||||||
 | 
								tags: true,
 | 
				
			||||||
 | 
								tokenSeparators: ['\n'],
 | 
				
			||||||
 | 
								dropdownParent: $(surveyQuestionInput)
 | 
				
			||||||
 | 
							});
 | 
				
			||||||
 | 
							//End: survey specific
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		//Create post type change handler
 | 
							//Create post type change handler
 | 
				
			||||||
		var changesHandler = function(){
 | 
							var changesHandler = function(){
 | 
				
			||||||
@@ -205,6 +241,7 @@ ComunicWeb.components.posts.form = {
 | 
				
			|||||||
			linkChooseForm.style.display = linkType.checked ? "block" : "none";
 | 
								linkChooseForm.style.display = linkType.checked ? "block" : "none";
 | 
				
			||||||
			pdfUploadForm.style.display = pdfType.checked ? "block" : "none";
 | 
								pdfUploadForm.style.display = pdfType.checked ? "block" : "none";
 | 
				
			||||||
			countdownForm.style.display = countdownType.checked ? "block" : "none";
 | 
								countdownForm.style.display = countdownType.checked ? "block" : "none";
 | 
				
			||||||
 | 
								surveyForm.style.display = surveyType.checked ? "block" : "none";
 | 
				
			||||||
		};
 | 
							};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		//Apply changesHandler function to all the data types
 | 
							//Apply changesHandler function to all the data types
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user