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

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