From cdc61eb4ea5309769ad4db84d92594e4dc3dff67 Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 20 Mar 2017 16:45:17 -0400 Subject: Initial commit (azure deploy test) --- Project-Unite/Views/Shared/Error.cshtml | 9 ++ Project-Unite/Views/Shared/Lockout.cshtml | 10 ++ Project-Unite/Views/Shared/_Layout.cshtml | 162 +++++++++++++++++++++ Project-Unite/Views/Shared/_LoginPartial.cshtml | 40 +++++ Project-Unite/Views/Shared/_ModeratorBar.cshtml | 133 +++++++++++++++++ .../Views/Shared/_PostModerationBar.cshtml | 27 ++++ 6 files changed, 381 insertions(+) create mode 100644 Project-Unite/Views/Shared/Error.cshtml create mode 100644 Project-Unite/Views/Shared/Lockout.cshtml create mode 100644 Project-Unite/Views/Shared/_Layout.cshtml create mode 100644 Project-Unite/Views/Shared/_LoginPartial.cshtml create mode 100644 Project-Unite/Views/Shared/_ModeratorBar.cshtml create mode 100644 Project-Unite/Views/Shared/_PostModerationBar.cshtml (limited to 'Project-Unite/Views/Shared') diff --git a/Project-Unite/Views/Shared/Error.cshtml b/Project-Unite/Views/Shared/Error.cshtml new file mode 100644 index 0000000..be55b17 --- /dev/null +++ b/Project-Unite/Views/Shared/Error.cshtml @@ -0,0 +1,9 @@ +@model System.Web.Mvc.HandleErrorInfo + +@{ + ViewBag.Title = "Error"; +} + +

Error.

+

An error occurred while processing your request.

+ diff --git a/Project-Unite/Views/Shared/Lockout.cshtml b/Project-Unite/Views/Shared/Lockout.cshtml new file mode 100644 index 0000000..8658ff2 --- /dev/null +++ b/Project-Unite/Views/Shared/Lockout.cshtml @@ -0,0 +1,10 @@ +@model System.Web.Mvc.HandleErrorInfo + +@{ + ViewBag.Title = "Locked Out"; +} + +
+

Locked out.

+

This account has been locked out, please try again later.

+
diff --git a/Project-Unite/Views/Shared/_Layout.cshtml b/Project-Unite/Views/Shared/_Layout.cshtml new file mode 100644 index 0000000..0e64010 --- /dev/null +++ b/Project-Unite/Views/Shared/_Layout.cshtml @@ -0,0 +1,162 @@ + + + + + + @ViewBag.Title - My ASP.NET Application + @Styles.Render("~/Content/css") + @Styles.Render("~/Content/bootstrap-theme.css") + @Styles.Render("~/Content/Site.css") + + + @Scripts.Render("~/bundles/modernizr") + + + + @Scripts.Render("~/Scripts/highlight.js") + + + @if (ViewBag.Modals != null) + { + + foreach (var id in ViewBag.Modals) + { + + + } + + } + +
+ @if (!ACL.UserEmailConfirmed(User.Identity.Name)) + { +
+
+ Email address not confirmed! Hi! It appears that your email has not been confirmed. Please check your email. @Html.ActionLink("Resend confirmation link", "ResendConf", "Account") +
+
+ } + + @if (ViewBag.Moderator == true) + { + + @RenderBody(); + } + else if (ACL.Granted(User.Identity.Name, ViewBag.ACLRule)) + { + if (ViewBag.Admin == true) + { + if (ACL.Granted(User.Identity.Name, "CanAccessAdminCP")) + { + + @RenderBody(); + } + else + { +

Access denied.

+

You do not have permission to access this page. Contact an admin if this is in error.

+ } + } + else + { + @RenderBody() + + } + } + else + { +

Access denied.

+

You do not have permission to access this page. Contact an admin if this is in error.

+ + }
+ +
+ +

© @DateTime.Now.Year Michael VanOverbeek and the ShiftOS Dev Team

+ @if (ACL.Granted(User.Identity.Name, "CanAccessAdminCP")) + { +

@Html.ActionLink("Administrator Control Panel", "Index", "Admin")

+ } +
+
+ + @Scripts.Render("~/bundles/jquery") + @Scripts.Render("~/bundles/bootstrap") + @RenderSection("scripts", required: false) + + diff --git a/Project-Unite/Views/Shared/_LoginPartial.cshtml b/Project-Unite/Views/Shared/_LoginPartial.cshtml new file mode 100644 index 0000000..ad6978c --- /dev/null +++ b/Project-Unite/Views/Shared/_LoginPartial.cshtml @@ -0,0 +1,40 @@ +@using Microsoft.AspNet.Identity +@if (Request.IsAuthenticated) +{ + using (Html.BeginForm("LogOff", "Account", FormMethod.Post, new { id = "logoutForm", @class = "navbar-right" })) + { + @Html.AntiForgeryToken() + + + } +} +else +{ + +} diff --git a/Project-Unite/Views/Shared/_ModeratorBar.cshtml b/Project-Unite/Views/Shared/_ModeratorBar.cshtml new file mode 100644 index 0000000..8f8196e --- /dev/null +++ b/Project-Unite/Views/Shared/_ModeratorBar.cshtml @@ -0,0 +1,133 @@ +@using Microsoft.AspNet.Identity +@model Project_Unite.Models.ForumTopic + +@{ + string acl_perm_announce = "CanAnnounceTopics"; + string acl_perm_unlist = "CanUnlistTopics"; + string acl_perm_sticky = "CanStickyTopics"; + string acl_perm_global = "CanGlobalTopics"; + string acl_perm_unlock = "CanUnlockTopics"; + string acl_perm_lock = "CanLockTopics"; + + string like_link = Url.Action("Like", "Forum", new { id = Model.Discriminator }); + string dislike_link = Url.Action("Dislike", "Forum", new { id = Model.Discriminator }); + + if (User.Identity.GetUserId() == Model.AuthorId) + { + acl_perm_announce = "CanAnnounceOwnTopics"; + acl_perm_unlist = "CanUnlistOwnTopics"; + acl_perm_sticky = "CanStickyOwnTopics"; + acl_perm_global = "CanGlobalOwnTopics"; + acl_perm_unlock = "CanUnlockOwnTopics"; + acl_perm_lock = "CanLockOwnTopics"; + } + + +} + + + +
\ No newline at end of file diff --git a/Project-Unite/Views/Shared/_PostModerationBar.cshtml b/Project-Unite/Views/Shared/_PostModerationBar.cshtml new file mode 100644 index 0000000..a647447 --- /dev/null +++ b/Project-Unite/Views/Shared/_PostModerationBar.cshtml @@ -0,0 +1,27 @@ +@using Microsoft.AspNet.Identity +@model Project_Unite.Models.ForumPost + +@{ + string acl_perm_delete = "CanDeletePosts"; + string acl_perm_edit = "CanEditPosts"; + + if (User.Identity.GetUserId() == Model.AuthorId) + { + acl_perm_delete = "CanDeleteOwnPosts"; + acl_perm_edit = "CanEditOwnPosts"; + } +} + + + +
\ No newline at end of file -- cgit v1.2.3