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.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. @model Teknik.ViewModels.ViewModelBase
  2. @using Microsoft.AspNet.Identity
  3. @if (Model.Config.UserConfig.RegistrationEnabled || Model.Config.UserConfig.LoginEnabled)
  4. {
  5. <ul 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("profile", "Profile.Index", new { username = User.Identity.Name })">Profile</a>
  13. </li>
  14. <li>
  15. <a href="@Url.SubRouteUrl("blog", "Blog.Blog", new { username = User.Identity.Name })">Blog</a>
  16. </li>
  17. <li>
  18. <a href="@Url.SubRouteUrl("profile", "Profile.Settings")">Settings</a>
  19. </li>
  20. @if (User.IsInRole("Admin"))
  21. {
  22. <li>
  23. <a href="@Url.SubRouteUrl("admin", "Admin.Index")">Administration</a>
  24. </li>
  25. }
  26. <li>
  27. <a href="@Url.SubRouteUrl("profile", "Profile.Logout")">Sign Out</a>
  28. </li>
  29. </ul>
  30. </li>
  31. }
  32. else
  33. {
  34. if (Model.Config.UserConfig.RegistrationEnabled)
  35. {
  36. <li class="dropdown">
  37. <a class="dropdown-toggle" href="#" data-toggle="dropdown" id="reg_dropdown">Sign Up <strong class="caret"></strong></a>
  38. <div class="dropdown-menu" style="padding: 15px; padding-bottom: 0px;">
  39. @Html.Partial("../../Areas/Profile/Views/Profile/Register", new Teknik.Areas.Profile.ViewModels.RegisterViewModel())
  40. </div>
  41. </li>
  42. }
  43. if (Model.Config.UserConfig.LoginEnabled)
  44. {
  45. <li class="dropdown">
  46. <a class="dropdown-toggle" href="#" data-toggle="dropdown" id="login_dropdown">Sign In <strong class="caret"></strong></a>
  47. <div class="dropdown-menu" style="padding: 15px; padding-bottom: 0px;">
  48. @Html.Partial("../../Areas/Profile/Views/Profile/Login", new Teknik.Areas.Profile.ViewModels.LoginViewModel())
  49. </div>
  50. </li>
  51. }
  52. }
  53. </ul>
  54. }