Example #1
0
        public string Render()
        {
            string        followersFeedHtml = FileRead.HtmlDocument("../../Content/myFeed.html");
            StringBuilder pageBuilder       = new StringBuilder();

            foreach (var shoutViewModel in this.Model)
            {
                pageBuilder.Append($@"<form action=""/user/feed"" method=""POST"">
                                        <div class=""thumbnail"">
			                               <h4>
                                            <strong>
                                             <p>{shoutViewModel.Author.Username}</p>
                                            <strong> 
                                            <small>{shoutViewModel.PostedForTime}</small></h4>
			                            <p>{shoutViewModel.Content}</p>
                                         <input type=""hidden"" name=""Content"" value=""{shoutViewModel.Content}"">
                                         <input type=""submit"" class=""btn btn-danger"" value=""Delete""/>
                                    </div>
                                      </form>");
            }

            followersFeedHtml = followersFeedHtml.Replace("##feed##", pageBuilder.ToString());

            return(followersFeedHtml);
        }
Example #2
0
        public string Render()
        {
            string        profileHtml = FileRead.HtmlDocument("../../Content/profile.html");
            StringBuilder pageBuilder = new StringBuilder();

            pageBuilder.Append($@"  <li class=""list-group-item"">
                <form class=""form-group"" action=""/followers/profile"" method=""POST"">
                        <h2>
                            <strong>{Model.Username}</strong></h2>
                        <input type=""submit"" class=""btn btn-{Model.FollowStatus}"" value=""{Model.FollowOption}""/>                       
                </form>
            </li>
            <h3>Shouts:</p>");

            foreach (var shoutViewModel in Model.Shouts)
            {
                pageBuilder.Append($@"<div class=""thumbnail"">
			                               <h4>
                                            <strong>
                                             <a href=""/followers/profile?id={shoutViewModel.Author.Id}"">{shoutViewModel.Author.Username}</a>
                                            <strong> 
                                            <small>{shoutViewModel.PostedForTime}</small></h4>
			                            <p>{shoutViewModel.Content}</p>
		                            </div>"        );
            }

            profileHtml = profileHtml.Replace("##profile##", pageBuilder.ToString());

            return(profileHtml);
        }
Example #3
0
        public string Render()
        {
            string        followersHtml = FileRead.HtmlDocument("../../Content/following.html");
            StringBuilder pageBuilder   = new StringBuilder();

            foreach (var userViewModel in Model)
            {
                pageBuilder.Append(
                    $@"<li><h4><strong><a href=""/followers/profile?id={userViewModel.Id}"">{userViewModel.Username}</a></strong> </h4></li>");
            }
            followersHtml = followersHtml.Replace("##followers##", pageBuilder.ToString());
            return(followersHtml);
        }
Example #4
0
        public string Render()
        {
            string page = FileRead.HtmlDocument("../../Content/register.html");

            if (Model.Message == null)
            {
                page = page.Replace("##Message##", "");
            }
            else
            {
                page = page.Replace("##Message##", $"<div class=\"thumbnail\"><p class=\"text-danger\">{Model.Message}</p></div>");
            }

            return(page);
        }
        public string Render()
        {
            string        notificationsHtml = FileRead.HtmlDocument("../../Content/notifications.html");
            StringBuilder pageBuilder       = new StringBuilder();

            foreach (var notificationViewModel in Model)
            {
                pageBuilder.Append(
                    $@"<li><h4><strong><a href=""/followers/profile?id={notificationViewModel.UserId}"">{notificationViewModel
                        .Username}</a></strong> posted a shout</h4></li>");
            }

            notificationsHtml = notificationsHtml.Replace("##notifications##", pageBuilder.ToString());

            return(notificationsHtml);
        }
Example #6
0
        public string Render()
        {
            string        feedHtml    = FileRead.HtmlDocument("../../Content/feed.html");
            StringBuilder pageBuilder = new StringBuilder();

            foreach (var shoutViewModel in this.Model)
            {
                pageBuilder.Append($@"<div class=""thumbnail"">
			                               <h4>
                                            <strong>
                                             <a href=""/followers/profile?id={shoutViewModel.Author.Id}"">{shoutViewModel.Author.Username}</a>
                                            <strong> 
                                            <small>{shoutViewModel.PostedForTime}</small></h4>
			                            <p>{shoutViewModel.Content}</p>
		                            </div>"        );
            }
            feedHtml = feedHtml.Replace("##feed##", pageBuilder.ToString());
            return(feedHtml);
        }
Example #7
0
        public string Render()
        {
            string        followersHtml = FileRead.HtmlDocument("../../Content/followers.html");
            StringBuilder pageBuilder   = new StringBuilder();

            foreach (var followerViewModel in this.Model)
            {
                string template = $@"<li class=""list-group-item"">
                <form class=""form-group"" action=""/followers/all"" method=""POST"">
                        <h4>
                        <input type=""hidden"" name=""Id"" value=""{followerViewModel.Id}""</input>
                            <strong><a class=""col-md-8""href=""/followers/profile?id={followerViewModel.Id}"">{followerViewModel.Username}</a></strong>
                        <input type=""submit"" class=""btn btn-{followerViewModel.FollowStatus}"" value=""{followerViewModel.FollowOption}""/>
                        </h4>
                </form>
            </li>";
                pageBuilder.Append(template);
            }

            followersHtml = followersHtml.Replace("##following##", pageBuilder.ToString());

            return(followersHtml);
        }
Example #8
0
        public string Render()
        {
            string page = FileRead.HtmlDocument("../../Content/home.html");

            return(page);
        }
Example #9
0
 public string Render()
 {
     return(FileRead.HtmlDocument("../../Content/login.html"));
 }