mirror of
				https://github.com/pierre42100/ComunicWeb
				synced 2025-11-04 04:04:20 +00:00 
			
		
		
		
	Display text posts and images posts
This commit is contained in:
		@@ -134,7 +134,7 @@ ComunicWeb.pages.userPage.main = {
 | 
			
		||||
		var row = createElem2({
 | 
			
		||||
			appendTo: sectionContent,
 | 
			
		||||
			type: "div",
 | 
			
		||||
			class: "row"
 | 
			
		||||
			class: "row page-contener"
 | 
			
		||||
		});
 | 
			
		||||
 | 
			
		||||
		//Create left column
 | 
			
		||||
@@ -151,10 +151,10 @@ ComunicWeb.pages.userPage.main = {
 | 
			
		||||
		var rightColumn = createElem2({
 | 
			
		||||
			appendTo: row,
 | 
			
		||||
			type: "div",
 | 
			
		||||
			class: "col-md-9"
 | 
			
		||||
			class: "col-md-6"
 | 
			
		||||
		});
 | 
			
		||||
 | 
			
		||||
		//Display text
 | 
			
		||||
		//Display posts
 | 
			
		||||
		ComunicWeb.pages.userPage.posts.display(infos, params, rightColumn);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -22,10 +22,48 @@ ComunicWeb.pages.userPage.posts = {
 | 
			
		||||
			class: "box box-primary"
 | 
			
		||||
		});
 | 
			
		||||
 | 
			
		||||
		//Check whether a precise post has to be opened or not
 | 
			
		||||
		//TODO implement
 | 
			
		||||
		var postsBody = createElem2({
 | 
			
		||||
			appendTo: postsBlock,
 | 
			
		||||
			type: "div",
 | 
			
		||||
			class: "box-body"
 | 
			
		||||
		});
 | 
			
		||||
 | 
			
		||||
		//Get the posts from the API
 | 
			
		||||
		ComunicWeb.components.posts.interface.get_user(userInfos.userID, function(result){
 | 
			
		||||
 | 
			
		||||
			//Check for errors
 | 
			
		||||
			if(result.error){
 | 
			
		||||
				//Display notification
 | 
			
		||||
				ComunicWeb.common.notificationSystem.showNotification("Couldn't get user posts!", "danger", 4, "Error");
 | 
			
		||||
			}
 | 
			
		||||
			else {
 | 
			
		||||
 | 
			
		||||
				//Show the posts
 | 
			
		||||
				ComunicWeb.pages.userPage.posts._show(result, postsBody);
 | 
			
		||||
 | 
			
		||||
			}
 | 
			
		||||
		});
 | 
			
		||||
		
 | 
			
		||||
	}
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Show user posts
 | 
			
		||||
	 * 
 | 
			
		||||
	 * @param {Object} posts The list of posts to display
 | 
			
		||||
	 * @param {HMTLElement} target The rendering target
 | 
			
		||||
	 */
 | 
			
		||||
	_show: function(posts, target){
 | 
			
		||||
		
 | 
			
		||||
		//Process each post
 | 
			
		||||
		var i;
 | 
			
		||||
		for(i in posts){
 | 
			
		||||
			
 | 
			
		||||
			//Display post
 | 
			
		||||
			ComunicWeb.components.posts.ui.display_post(posts[i], target);
 | 
			
		||||
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user