summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Project-Unite/ACL.cs10
-rw-r--r--Project-Unite/Controllers/HomeController.cs1
-rw-r--r--Project-Unite/Models/HomeViewModel.cs12
-rw-r--r--Project-Unite/Project-Unite.csproj1
-rw-r--r--Project-Unite/Views/Shared/_Layout.cshtml8
5 files changed, 31 insertions, 1 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)));
diff --git a/Project-Unite/Controllers/HomeController.cs b/Project-Unite/Controllers/HomeController.cs
index a3a8f7f..5a1553f 100644
--- a/Project-Unite/Controllers/HomeController.cs
+++ b/Project-Unite/Controllers/HomeController.cs
@@ -11,6 +11,7 @@ namespace Project_Unite.Controllers
{
public ActionResult Index()
{
+
return View();
}
diff --git a/Project-Unite/Models/HomeViewModel.cs b/Project-Unite/Models/HomeViewModel.cs
new file mode 100644
index 0000000..d9d98bb
--- /dev/null
+++ b/Project-Unite/Models/HomeViewModel.cs
@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+
+namespace Project_Unite.Models
+{
+ public class HomeViewModel
+ {
+ public ApplicationUser NewestUser { get; set; }
+ }
+} \ No newline at end of file
diff --git a/Project-Unite/Project-Unite.csproj b/Project-Unite/Project-Unite.csproj
index 88d1527..100b767 100644
--- a/Project-Unite/Project-Unite.csproj
+++ b/Project-Unite/Project-Unite.csproj
@@ -405,6 +405,7 @@
<Compile Include="Models\AdminViewModels.cs" />
<Compile Include="Models\ForumCategory.cs" />
<Compile Include="Models\ForumViewModels.cs" />
+ <Compile Include="Models\HomeViewModel.cs" />
<Compile Include="Models\IdentityModels.cs" />
<Compile Include="Models\ManageViewModels.cs" />
<Compile Include="Models\Role.cs" />
diff --git a/Project-Unite/Views/Shared/_Layout.cshtml b/Project-Unite/Views/Shared/_Layout.cshtml
index 0e64010..932593f 100644
--- a/Project-Unite/Views/Shared/_Layout.cshtml
+++ b/Project-Unite/Views/Shared/_Layout.cshtml
@@ -3,7 +3,7 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>@ViewBag.Title - My ASP.NET Application</title>
+ <title>@ViewBag.Title &bull; Project: Unite</title>
@Styles.Render("~/Content/css")
@Styles.Render("~/Content/bootstrap-theme.css")
@Styles.Render("~/Content/Site.css")
@@ -75,6 +75,12 @@
}
<div class="container clearfix body-content">
+ <div class="panel panel-success">
+ <div class="panel-body">
+ <p><span class="glyphicon glyphicon-exclamation-sign"></span> <strong>Welcome to Project: Unite!</strong> Things are a bit barren right now and not a lot of stuff is implemented - but feel free to explore!</p>
+ </div>
+ </div>
+
@if (!ACL.UserEmailConfirmed(User.Identity.Name))
{
<div class="panel panel-warning">