Can choose movie on post form

This commit is contained in:
Pierre 2018-01-05 17:03:40 +01:00
parent c1cc62d1bd
commit fb2b9fd1ac
2 changed files with 42 additions and 2 deletions

View File

@ -48,6 +48,10 @@
display: none;
}
.post-form .post-movie button {
margin-right: 5px;
}
/**
* Visibility choice

View File

@ -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>");
//Add image upload form
var imgUploadForm = createElem2({
appendTo: boxBody,
@ -87,6 +88,7 @@ ComunicWeb.components.posts.form = {
type: "input",
elemType: "file"
});
//End : image
//Add Youtube input form
@ -101,16 +103,50 @@ ComunicWeb.components.posts.form = {
label: "Youtube video link",
placeholder: "https://youtube.com/watch?v=",
type: "text"
})
});
//End : Youtube
//Add movie input form
var movieInputForm = createElem2({
appendTo: boxBody,
type: "div",
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
var changesHandler = function(){