mirror of
				https://github.com/pierre42100/ComunicWeb
				synced 2025-11-04 04:04:20 +00:00 
			
		
		
		
	Display user movies.
This commit is contained in:
		@@ -169,8 +169,31 @@
 | 
			
		||||
 | 
			
		||||
		</div>
 | 
			
		||||
		
 | 
			
		||||
		<!-- Entire movies list -->
 | 
			
		||||
		<div id="movies" class="category container">
 | 
			
		||||
			Loading movies
 | 
			
		||||
			
 | 
			
		||||
			<h1>Your movies</h1>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
			<table id="full-movie-list-table">
 | 
			
		||||
 | 
			
		||||
				<thead>
 | 
			
		||||
					<tr>
 | 
			
		||||
						<th>Number</th>
 | 
			
		||||
						<th>Name</th>
 | 
			
		||||
						<th>File type</th>
 | 
			
		||||
						<th>File size</th>
 | 
			
		||||
						<th>Actions</th>
 | 
			
		||||
					</tr>
 | 
			
		||||
				</thead>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
				<tbody>
 | 
			
		||||
					<!-- Movies will go here -->
 | 
			
		||||
				</tbody>
 | 
			
		||||
 | 
			
		||||
			</table>
 | 
			
		||||
 | 
			
		||||
		</div>
 | 
			
		||||
 | 
			
		||||
		<div id="all-conversations-message" class="category container">
 | 
			
		||||
@@ -193,6 +216,7 @@
 | 
			
		||||
	<script src="assets/js/categories/comments.js"></script>
 | 
			
		||||
	<script src="assets/js/categories/likes.js"></script>
 | 
			
		||||
	<script	src="assets/js/categories/survey.js"></script>
 | 
			
		||||
	<script src="assets/js/categories/movies.js"></script>
 | 
			
		||||
	<script src="assets/js/main.js"></script>
 | 
			
		||||
</body>
 | 
			
		||||
</html>
 | 
			
		||||
@@ -0,0 +1,30 @@
 | 
			
		||||
/**
 | 
			
		||||
 * Movies category
 | 
			
		||||
 * 
 | 
			
		||||
 * @author Pierre HUBERT
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Apply the list of movies of the user
 | 
			
		||||
 */
 | 
			
		||||
function ApplyMovies(){
 | 
			
		||||
 | 
			
		||||
    let target = document.querySelector("#full-movie-list-table tbody");
 | 
			
		||||
 | 
			
		||||
    //Process the list of movies
 | 
			
		||||
    data.movies.forEach(movie => {
 | 
			
		||||
 | 
			
		||||
        createElem2({
 | 
			
		||||
            appendTo: target,
 | 
			
		||||
            type: "tr",
 | 
			
		||||
            innerHTML:
 | 
			
		||||
                "<td>" + movie.id + "</td>" +
 | 
			
		||||
                "<td>" + movie.name + "</td>" +
 | 
			
		||||
                "<td>" + movie.file_type + "</td>" +
 | 
			
		||||
                "<td>" + movie.size + "</td>" +
 | 
			
		||||
                "<td> <a href='"+getFilePathFromURL(movie.url)+"'>Open</a></td>"
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@@ -79,6 +79,7 @@ xhr.onload = function(){
 | 
			
		||||
	ApplyCommentsList();
 | 
			
		||||
	ApplyUserLikes();
 | 
			
		||||
	ApplySurveyResponses();
 | 
			
		||||
	ApplyMovies();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
xhr.send(null);
 | 
			
		||||
		Reference in New Issue
	
	Block a user