public FeatureViewModel(Feature feature) { Text = MarkdownHelper.Markdown(feature.Text); FriendlyTime = FriendlyTimeHelper.Parse(feature.Time); Author = feature.User.UserName; GravatarUrl = (string.IsNullOrEmpty(feature.User.AvatarUrl)) ? feature.User.Email.ToGravatarUrl(40) : feature.User.AvatarUrl; }
public CommentViewModel(Comment comment) { FriendlyTime = FriendlyTimeHelper.Parse(comment.Time).ToHtmlString(); // this is encoding when it shouldn't be Text = comment.Text; Author = comment.User.UserName; GravatarUrl = (string.IsNullOrEmpty(comment.User.AvatarUrl)) ? comment.User.Email.ToGravatarUrl(40) : comment.User.AvatarUrl; }
public GitHubActivityViewModel(GitHubActivity github) { Text = github.Message; AuthorName = github.AuthorName; AuthorUrl = github.AuthorUrl; Sha = github.Sha; ShaShortened = github.Sha.Substring(0, 8); GravatarUrl = github.GravatarUrl; FriendlyTime = FriendlyTimeHelper.Parse(github.Time).ToHtmlString(); CommitUrl = github.CommitUrl; }
public ActivityViewModel(Activity activity) { FriendlyTime = FriendlyTimeHelper.Parse(activity.Time); var comment = activity as Comment; if (comment != null) { Text = MarkdownHelper.Markdown(comment.Text); // TODO: not hard code these Author = activity.User.UserName; GravatarUrl = (string.IsNullOrEmpty(activity.User.AvatarUrl)) ? activity.User.Email.ToGravatarUrl(40) : activity.User.AvatarUrl; } }