diff options
Diffstat (limited to 'Project-Unite/ACL.cs')
| -rw-r--r-- | Project-Unite/ACL.cs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Project-Unite/ACL.cs b/Project-Unite/ACL.cs index c0a0894..4b4e6b0 100644 --- a/Project-Unite/ACL.cs +++ b/Project-Unite/ACL.cs @@ -13,6 +13,16 @@ namespace Project_Unite { public static class ACL { + public static IHtmlString NewestUser(this HtmlHelper hpr) + { + var db = new ApplicationDbContext(); + var user = db.Users.OrderByDescending(x => x.JoinedAt).FirstOrDefault(); + if (user == null) + return hpr.Raw(@"<a href=""#"">No new users</a>"); + else + return hpr.Raw("<a href=\"/Profiles/ViewProfile/" + user.DisplayName + "\">Our newest user, <strong>" + user.DisplayName + "</strong></a>"); + } + public static IHtmlString Markdown(this HtmlHelper hpr, string md) { return hpr.Raw(CommonMark.CommonMarkConverter.Convert(hpr.Encode(md))); |
