public static string GetHtml_statusOwner(UserViewModel curUser) { return "<div class='status-owner'>" + " <div class='status-owner-image'>" + " <img src='" + curUser.Avatar + "' class='img-circle img40x40' />" + " </div>" + " <div class='status-owner-name'>" + " <a class='peple-name' href='#'>" + curUser.Displayname + "</a>" + " <br />" + " " + DateTime.Now + " </div>" + " <div class='clear-left'></div>" + "</div>"; }
public static string GetHtml_statusListComment(string statusId, UserViewModel curUser) { return "<hr />" +"<div class='list-comment' id='list-comment-" + statusId + "'>" +"<div class='block-textarea' id='block-txtComment-" + statusId + "'>" +"<div class='comment-user'>" +"<a href='#'>" +"<img src='" + curUser.Avatar + "' class='img-rounded img33x33 cur-user-avatar'>" +"</a>" +"</div>" +"<div class='comment-content'>" +"<textarea data-statusid='" + statusId + "' name='txtComment' rows='1' cols='59' class='form-control txtComment' placeholder='Enter comment...'></textarea>" +"</div>" +"<div class='clear-left'></div>" +"</div>" +"</div>"; }
public static string ProcessNewComment(UserViewModel userComment, string message) { var messageProcessed = Emotions.ReplaceEmotions(message); messageProcessed = Link.ReplaceAllLink(messageProcessed); return "<div class='comment'>" + "<div class='comment-user'>" + "<a href='#'>" + "<img src='" + userComment.Avatar + "' class='img-rounded img33x33'>" + "</a>" + "</div>" + "<div class='comment-content'>" + "<p>" + "<a href='#'>" + userComment.Displayname + "</a>" + " " + messageProcessed + "</p>" + "<p>" + DateTime.Now + " . <a href='#'>like</a></p>" + "</div>" + "<div class='clear-left'></div>" + "</div>"; }
public ActionResult Wall(string userId) { // get current user string curUserId = User.Identity.GetUserId(); this._userRepository = new UserRepository(_dbContext); UserViewModel curUser = new UserViewModel(); if (userId == null) { curUser = this._userRepository.GetUserById(curUserId); } else { curUser = this._userRepository.GetUserById(curUserId); } ViewBag.curUser = curUser; return View(curUser); }
public static string ProcessMessageStatus(string statusId, UserViewModel curUser, string message, string[] imageNames) { // Get first Url Preview var firstLinkPreview = new LinkPreview().GetFirstLinkPreView(message); // Detect Url after replace it Achor tag string messageProcessed = ProcessComment.ProcessMessage(message); string htmlStatus = "<div class='status'>"; htmlStatus += ProcessMessage.GetHtml_statusOwner(curUser); htmlStatus += ProcessMessage.GetHtml_statusContent(messageProcessed); if(firstLinkPreview != null) { htmlStatus += ProcessMessage.GetHtml_statusPreview(firstLinkPreview); } htmlStatus += ProcessMessage.GetHtml_statusBoxLikeShare(statusId, curUser.UserId); htmlStatus += ProcessMessage.GetHtml_statusListComment(statusId, curUser); htmlStatus += "</div>"; return htmlStatus; }