The next generation of the Teknik Services. Written in ASP.NET. https://www.teknik.io/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

_LoginPartial.cshtml 3.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. @if (Config.UserConfig.RegistrationEnabled || Config.UserConfig.LoginEnabled)
  2. {
  3. <div class="nav navbar-nav navbar-right">
  4. @if (User.Identity.IsAuthenticated)
  5. {
  6. <li class="dropdown">
  7. <a href="#" id="user_menu" class="dropdown-toggle" data-toggle="dropdown">@User.Identity.Name <strong class="caret"></strong></a>
  8. <ul class="dropdown-menu dropdown-left-manual" role="menu" aria-labelledby="user_menu">
  9. <li class="text-center text-uppercase dropdown__username">Signed in as @User.Identity.Name</li>
  10. <li role="separator" class="divider"></li>
  11. <li is-active-route asp-controller="User" asp-action="ViewProfile">
  12. <a href="@Url.SubRouteUrl("user", "User.ViewProfile", new { username = User.Identity.Name })"><i class="fa fa-user fa-fw"></i>&nbsp;&nbsp;Profile</a>
  13. </li>
  14. <li is-active-route asp-controller="Blog" asp-action="Blog" asp-route-username="@User.Identity.Name">
  15. <a href="@Url.SubRouteUrl("blog", "Blog.Blog", new { username = User.Identity.Name })"><i class="fa fa-book fa-fw"></i>&nbsp;&nbsp;View Blog</a>
  16. </li>
  17. <li is-active-route asp-controller="User" asp-action="ViewServiceData">
  18. <a href="@Url.SubRouteUrl("account", "User.ViewServiceData")"><i class="fa fa-database fa-fw"></i>&nbsp;&nbsp;Service Data</a>
  19. </li>
  20. <li is-active-route asp-controller="User" asp-action="Settings">
  21. <a href="@Url.SubRouteUrl("account", "User.Settings")"><i class="fa fa-sliders fa-fw"></i>&nbsp;&nbsp;Settings</a>
  22. </li>
  23. @if (User.IsInRole("Admin"))
  24. {
  25. <li role="separator" class="divider"></li>
  26. <li is-active-route asp-controller="Admin" asp-action="Dashboard">
  27. <a href="@Url.SubRouteUrl("admin", "Admin.Dashboard")"><i class="fa fa-cogs fa-fw"></i>&nbsp;&nbsp;Administration</a>
  28. </li>
  29. }
  30. <li role="separator" class="divider"></li>
  31. <li>
  32. <a href="@Url.SubRouteUrl("account", "User.Logout")"><i class="fa fa-sign-out fa-fw"></i>&nbsp;&nbsp;Log Out</a>
  33. </li>
  34. </ul>
  35. </li>
  36. }
  37. else
  38. {
  39. if (Config.UserConfig.RegistrationEnabled)
  40. {
  41. <button id="registerButton" data-toggle="modal" data-target="#registerModal" class="btn btn-default navbar-btn hide">Register</button>
  42. <noscript>
  43. <a href="@Url.SubRouteUrl("account", "User.Register")" class="btn btn-default navbar-btn">Register</a>
  44. </noscript>
  45. }
  46. if (Config.UserConfig.LoginEnabled)
  47. {
  48. @*<button id="loginButton" data-toggle="modal" data-target="#loginModal" class="btn btn-default navbar-btn hide">Log In</button>*@
  49. <a href="@Url.SubRouteUrl("account", "User.Login", new { returnUrl = @Context.Request.GetDisplayUrl() })" class="btn btn-default navbar-btn">Log In</a>
  50. }
  51. }
  52. </div>
  53. }