diff options
Diffstat (limited to 'Project-Unite/Views/Shared/_LoginPartial.cshtml')
| -rw-r--r-- | Project-Unite/Views/Shared/_LoginPartial.cshtml | 40 |
1 files changed, 40 insertions, 0 deletions
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() + + <ul class="nav navbar-nav navbar-right" style="margin-right:15px;"> + <li class="dropdown"><a href="#" data-toggle="dropdown" class="dropdown-toggle"><span class="glyphicon glyphicon-user"></span> @Html.UserName(User.Identity.GetUserId()) <span class="caret"></span></a> + <ul class="dropdown-menu"> + <li><a href="@Url.Action("ViewProfile", "Profiles", new { name = User.Identity.Name })"><span class="glyphicon glyphicon-user"></span> Profile</a></li> + <li class="divider"></li> + <li class="dropdown-header">Settings</li> + @if(ACL.Granted(User.Identity.Name, "CanAccessAdminCP")) + { + <li><a href="@Url.Action("Index", "Admin")"><span class="glyphicon glyphicon-cog"></span> Admin CP</a></li> + } + @if (ACL.Granted(User.Identity.Name, "CanAccessModCP")) + { + <li><a href="@Url.Action("Index", "Moderator")"><span class="glyphicon glyphicon-warning-sign"></span> Mod CP</a></li> + } + @if (ACL.Granted(User.Identity.Name, "CanAccessDevCP")) + { + <li><a href="@Url.Action("Index", "Developer")"><span class="glyphicon glyphicon-star"></span> Developer CP</a></li> + } + <li><a href="@Url.Action("Index", "Manage")"><span class="glyphicon glyphicon-adjust"></span> Account</a></li> + <li class="divider"></li> + <li><a href="javascript:document.getElementById('logoutForm').submit()"><span class="glyphicon glyphicon-log-out"></span> Log off</a></li> + </ul> + </li> + </ul> + } +} +else +{ + <ul class="nav navbar-nav navbar-right" style="margin-right:15px;"> + <li>@Html.ActionLink("Register", "Register", "Account", routeValues: null, htmlAttributes: new { id = "registerLink" })</li> + <li>@Html.ActionLink("Log in", "Login", "Account", routeValues: null, htmlAttributes: new { id = "loginLink" })</li> + </ul> +} |
