protected override void Render(HtmlTextWriter writer)
        {
            if (this.Page.User.Identity.IsAuthenticated) {
                writer.WriteLine(@"<div class=""EditableTagList Hidden"" id=""{0}_EditableTagList"">", this._storyID);
                UserEditableTagList userTagList = new UserEditableTagList();
                userTagList.DataBind(this._tags, this._storyID, this._username);
                userTagList.RenderControl(writer);
                writer.WriteLine("</div>");

                writer.WriteLine(@"<br /><input id=""{0}_TagInput"" type=""text"" />
                <input id=""{0}_SubmitNewTags"" type=""button"" value=""Add Tag"" onclick=""AddUserStoryTags({0});"" />",
                    this._storyID);
            } else {
                //TODO: GJ: add a login control here
                writer.WriteLine(@"<table width=""200""><tr><td>");
                LoginOrCreateAccount loginOrCreateAccount = new LoginOrCreateAccount();
                loginOrCreateAccount.RenderControl(writer);
                writer.WriteLine(@"</td></tr></table>");
            }
        }
Example #2
0
        protected override void Render(HtmlTextWriter writer)
        {
            if (this.Page.User.Identity.IsAuthenticated)
            {
                writer.WriteLine(@"<div class=""EditableTagList Hidden"" id=""{0}_EditableTagList"">", this._storyID);
                UserEditableTagList userTagList = new UserEditableTagList();
                userTagList.DataBind(this._tags, this._storyID, this._username);
                userTagList.RenderControl(writer);
                writer.WriteLine("</div>");


                writer.WriteLine(@"<br /><input id=""{0}_TagInput"" type=""text"" />
                <input id=""{0}_SubmitNewTags"" type=""button"" value=""Add Tag"" onclick=""AddUserStoryTags({0});"" />",
                                 this._storyID);
            }
            else
            {
                //TODO: GJ: add a login control here
                writer.WriteLine(@"<table width=""200""><tr><td>");
                LoginOrCreateAccount loginOrCreateAccount = new LoginOrCreateAccount();
                loginOrCreateAccount.RenderControl(writer);
                writer.WriteLine(@"</td></tr></table>");
            }
        }
 public string TagStory(int storyID, string tagString)
 {
     DemandUserAuthentication();
     WeightedTagList tags = TagBR.AddUserStoryTags(tagString, KickUserProfile, storyID, HostProfile.HostID);
     UserEditableTagList userTagList = new UserEditableTagList();
     userTagList.DataBind(tags, storyID, KickUserProfile.Username);
     return ControlHelper.RenderControl(userTagList);
 }
 public string GetUserStoryTags(int storyID)
 {
     DemandUserAuthentication();
     WeightedTagList tags = Tag.FetchUserStoryTags(KickUserProfile.UserID, storyID).ToWeightedTagList();
     UserEditableTagList userTagList = new UserEditableTagList();
     userTagList.DataBind(tags, storyID, KickUserProfile.Username);
     return ControlHelper.RenderControl(userTagList);
 }