mirror of
				https://github.com/pierre42100/ComunicWeb
				synced 2025-11-03 19:54:14 +00:00 
			
		
		
		
	Can choose movie on post form
This commit is contained in:
		@@ -48,6 +48,10 @@
 | 
				
			|||||||
	display: none;
 | 
						display: none;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					.post-form .post-movie button {
 | 
				
			||||||
 | 
						margin-right: 5px;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 * Visibility choice
 | 
					 * Visibility choice
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -75,6 +75,7 @@ ComunicWeb.components.posts.form = {
 | 
				
			|||||||
		var surveyType = this._add_post_type(postTypesContener, "survey", "<i class='fa fa-pie-chart'></i> <span class='hidden-xs'>Survey</span>");
 | 
							var surveyType = this._add_post_type(postTypesContener, "survey", "<i class='fa fa-pie-chart'></i> <span class='hidden-xs'>Survey</span>");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		//Add image upload form
 | 
							//Add image upload form
 | 
				
			||||||
		var imgUploadForm = createElem2({
 | 
							var imgUploadForm = createElem2({
 | 
				
			||||||
			appendTo: boxBody,
 | 
								appendTo: boxBody,
 | 
				
			||||||
@@ -87,6 +88,7 @@ ComunicWeb.components.posts.form = {
 | 
				
			|||||||
			type: "input",
 | 
								type: "input",
 | 
				
			||||||
			elemType: "file"
 | 
								elemType: "file"
 | 
				
			||||||
		});
 | 
							});
 | 
				
			||||||
 | 
							//End : image
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		//Add Youtube input form
 | 
							//Add Youtube input form
 | 
				
			||||||
@@ -101,16 +103,50 @@ ComunicWeb.components.posts.form = {
 | 
				
			|||||||
			label: "Youtube video link",
 | 
								label: "Youtube video link",
 | 
				
			||||||
			placeholder: "https://youtube.com/watch?v=",
 | 
								placeholder: "https://youtube.com/watch?v=",
 | 
				
			||||||
			type: "text"
 | 
								type: "text"
 | 
				
			||||||
		})
 | 
							});
 | 
				
			||||||
 | 
							//End : Youtube
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		//Add movie input form
 | 
							//Add movie input form
 | 
				
			||||||
		var movieInputForm = createElem2({
 | 
							var movieInputForm = createElem2({
 | 
				
			||||||
			appendTo: boxBody,
 | 
								appendTo: boxBody,
 | 
				
			||||||
			type: "div",
 | 
								type: "div",
 | 
				
			||||||
			class: "post-movie",
 | 
								class: "post-movie",
 | 
				
			||||||
			innerHTML: "<p>Not implemented yet.</p>"
 | 
					 | 
				
			||||||
		});
 | 
							});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							//Add choose button
 | 
				
			||||||
 | 
							var movieChooseButton = createElem2({
 | 
				
			||||||
 | 
								appendTo: movieInputForm,
 | 
				
			||||||
 | 
								type: "button",
 | 
				
			||||||
 | 
								class: "btn btn-primary",
 | 
				
			||||||
 | 
								innerHTML: "Choose"
 | 
				
			||||||
 | 
							});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							var movieIDInput = createElem2({
 | 
				
			||||||
 | 
								appendTo: movieInputForm,
 | 
				
			||||||
 | 
								type: "input",
 | 
				
			||||||
 | 
								elemType: "hidden",
 | 
				
			||||||
 | 
								value: 0
 | 
				
			||||||
 | 
							});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							var movieName = createElem2({
 | 
				
			||||||
 | 
								appendTo: movieInputForm,
 | 
				
			||||||
 | 
								type: "span",
 | 
				
			||||||
 | 
								innerHTML: "No movie selected."
 | 
				
			||||||
 | 
							});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							//Make movie choose button lives
 | 
				
			||||||
 | 
							movieChooseButton.onclick = function(){
 | 
				
			||||||
 | 
								ComunicWeb.components.movies.picker.pick(function(movie){
 | 
				
			||||||
 | 
									//Set movie ID and name
 | 
				
			||||||
 | 
									movieIDInput.value = movie.id;
 | 
				
			||||||
 | 
									movieName.innerHTML = movie.name;
 | 
				
			||||||
 | 
								});
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							//End : movie
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		//Create post type change handler
 | 
							//Create post type change handler
 | 
				
			||||||
		var changesHandler = function(){
 | 
							var changesHandler = function(){
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user