private FlowComponent getCommentFooter(CommentsTableRetrieval.Row comment, UsersTableRetrieval.Row author, UpdateRegionSet deleteUpdateRegions) => new GenericFlowContainer( new GenericFlowContainer( new GenericPhrasingContainer( new EwfHyperlink( Profile.GetInfo(comment.AuthorId), new ImageHyperlinkStyle( new ExternalResource( author.ProfilePictureUrl.Any() ? author.ProfilePictureUrl : "https://static.productionready.io/images/smiley-cyrus.jpg"), "")).ToCollection()) .Append( new GenericPhrasingContainer( new EwfHyperlink(Profile.GetInfo(comment.AuthorId), new StandardHyperlinkStyle(author.Username)).ToCollection())) .Append(new GenericPhrasingContainer(comment.CreationDateAndTime.ToDayMonthYearString(false).ToComponents())) .Materialize()).Concat <FlowComponent>( comment.AuthorId == AppTools.User?.UserId ? new EwfButton( new StandardButtonStyle("Delete", icon: new ActionComponentIcon(new FontAwesomeIcon("fa-trash"))), behavior: new PostBackBehavior( postBack: PostBack.CreateIntermediate( deleteUpdateRegions.ToCollection(), id: PostBack.GetCompositeId("delete", comment.CommentId.ToString()), modificationMethod: () => CommentsModification.DeleteRows(new CommentsTableEqualityConditions.CommentId(comment.CommentId))))) .ToCollection() : Enumerable.Empty <PhrasingComponent>()) .Materialize());
private FormsAuthCapableUser getUserObject(UsersTableRetrieval.Row user) { return(user == null ? null : new FormsAuthCapableUser( user.UserId, user.EmailAddress, getRole(), null, user.Salt, user.SaltedPassword, false, friendlyName: user.Username)); }
protected override void init() { user = UsersTableRetrieval.GetRowMatchingId(UserId); }
internal static IReadOnlyCollection <FlowComponent> GetAuthorDisplay(ArticlesRetrieval.Row article, UsersTableRetrieval.Row author) => new GenericFlowContainer( new EwfHyperlink( Profile.GetInfo(article.AuthorId), new ImageHyperlinkStyle( new ExternalResource(author.ProfilePictureUrl.Any() ? author.ProfilePictureUrl : "https://static.productionready.io/images/smiley-cyrus.jpg"), "")).Append <PhrasingComponent>( new GenericPhrasingContainer( new EwfHyperlink(Profile.GetInfo(article.AuthorId), new StandardHyperlinkStyle(author.Username)) .Append <PhrasingComponent>(new LineBreak()) .Append( new GenericPhrasingContainer(article.CreationDateAndTime.ToDayMonthYearString(false).ToComponents(), classes: ElementClasses.Date)) .Materialize())) .Materialize(), classes: ElementClasses.Author).ToCollection();