summaryrefslogtreecommitdiff
path: root/Project-Unite/ACL.cs
diff options
context:
space:
mode:
authorMichael <[email protected]>2017-03-23 09:47:22 -0400
committerMichael <[email protected]>2017-03-23 09:47:28 -0400
commit8f1fbeadb243a486dce7bbfd9b932a551fd36350 (patch)
tree927829d15e2091dc09d699cba3be7659a800d494 /Project-Unite/ACL.cs
parentb0b5c4163c4317283cbcd4647318907ec823f62f (diff)
downloadproject-unite-8f1fbeadb243a486dce7bbfd9b932a551fd36350.tar.gz
project-unite-8f1fbeadb243a486dce7bbfd9b932a551fd36350.tar.bz2
project-unite-8f1fbeadb243a486dce7bbfd9b932a551fd36350.zip
Display newest user in right navbar
Diffstat (limited to 'Project-Unite/ACL.cs')
-rw-r--r--Project-Unite/ACL.cs10
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)));