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 2.9KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. @model Teknik.ViewModels.ViewModelBase
  2. @using Teknik.Utilities
  3. @using Microsoft.AspNet.Identity
  4. @if (Model.Config.UserConfig.RegistrationEnabled || Model.Config.UserConfig.LoginEnabled)
  5. {
  6. <div class="nav navbar-nav pull-right">
  7. @if (Request.IsAuthenticated)
  8. {
  9. <li class="dropdown">
  10. <a href="#" id="user_menu" class="dropdown-toggle" data-toggle="dropdown">@User.Identity.Name <strong class="caret"></strong></a>
  11. <ul class="dropdown-menu" role="menu" aria-labelledby="user_menu">
  12. <li>
  13. <a href="@Url.SubRouteUrl("blog", "Blog.Blog", new { username = User.Identity.Name })">Blog</a>
  14. </li>
  15. <li>
  16. <a href="@Url.SubRouteUrl("user", "User.ViewProfile", new { username = User.Identity.Name })">Profile</a>
  17. </li>
  18. <li>
  19. <a href="@Url.SubRouteUrl("user", "User.Settings")">Settings</a>
  20. </li>
  21. @if (User.IsInRole("Admin"))
  22. {
  23. <li>
  24. <a href="@Url.SubRouteUrl("admin", "Admin.Dashboard")">Administration</a>
  25. </li>
  26. }
  27. <li>
  28. <a href="@Url.SubRouteUrl("user", "User.Logout")">Sign Out</a>
  29. </li>
  30. </ul>
  31. </li>
  32. }
  33. else
  34. {
  35. if (Model.Config.UserConfig.RegistrationEnabled)
  36. {
  37. <button id="registerButton" data-toggle="modal" data-target="#registerModal" class="btn btn-default navbar-btn hide">Sign Up</button>
  38. <noscript>
  39. <a href="@Url.SubRouteUrl("user", "User.Register")" class="btn btn-default navbar-btn">Sign Up</a>
  40. </noscript>
  41. @*<a class="dropdown-toggle" href="#" data-toggle="dropdown" id="reg_dropdown">Sign Up <strong class="caret"></strong></a>
  42. <div class="dropdown-menu" style="padding: 15px; padding-bottom: 0px; min-width: 100px;">
  43. @Html.Partial("../../Areas/User/Views/User/Register", new Teknik.Areas.Users.ViewModels.RegisterViewModel())
  44. </div>*@
  45. }
  46. if (Model.Config.UserConfig.LoginEnabled)
  47. {
  48. if (Model.Config.UserConfig.RegistrationEnabled)
  49. {
  50. }
  51. <button id="loginButton" data-toggle="modal" data-target="#loginModal" class="btn btn-default navbar-btn hide">Sign In</button>
  52. <noscript>
  53. <a href="@Url.SubRouteUrl("user", "User.Login")" class="btn btn-default navbar-btn">Sign In</a>
  54. </noscript>
  55. @*<a class="dropdown-toggle" href="#" data-toggle="dropdown" id="login_dropdown">Sign In <strong class="caret"></strong></a>
  56. <div class="dropdown-menu" style="padding: 15px; padding-bottom: 0px;">
  57. @Html.Partial("../../Areas/User/Views/User/Login", new Teknik.Areas.Users.ViewModels.LoginViewModel())
  58. </div>*@
  59. }
  60. }
  61. </div>
  62. }