mirror of
https://github.com/pierre42100/ComunicWeb
synced 2025-06-19 12:25:16 +00:00
Created latest posts page.
This commit is contained in:
@ -19,7 +19,7 @@ ComunicWeb.pages.home.home = {
|
||||
if(userLoggedIn){
|
||||
|
||||
//Open current user page
|
||||
openPage("user/me");
|
||||
openPage("latest");
|
||||
|
||||
}
|
||||
else{
|
||||
|
31
assets/js/pages/latestPosts/main.js
Normal file
31
assets/js/pages/latestPosts/main.js
Normal file
@ -0,0 +1,31 @@
|
||||
/**
|
||||
* Latest posts page main script
|
||||
*
|
||||
* @author Pierre HUBERT
|
||||
*/
|
||||
|
||||
ComunicWeb.pages.latestPosts.main = {
|
||||
|
||||
/**
|
||||
* Open latest posts page
|
||||
*
|
||||
* @param {Object} params Parametres required to open the page
|
||||
* @param {HTMLElement} target The target for the user page
|
||||
*/
|
||||
open: function(params, target){
|
||||
|
||||
//Perform a request on the server to get the list of latest posts
|
||||
ComunicWeb.components.posts.interface.get_latest(function(response){
|
||||
|
||||
//Check for errors - display a modal
|
||||
if(response.error){
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//Display the list of posts
|
||||
|
||||
});
|
||||
|
||||
},
|
||||
}
|
Reference in New Issue
Block a user