The next generation of the Teknik Services. Written in ASP.NET.
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.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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 })">View 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. }
  42. if (Model.Config.UserConfig.LoginEnabled)
  43. {
  44. <button id="loginButton" data-toggle="modal" data-target="#loginModal" class="btn btn-default navbar-btn hide">Sign In</button>
  45. <noscript>
  46. <a href="@Url.SubRouteUrl("user", "User.Login")" class="btn btn-default navbar-btn">Sign In</a>
  47. </noscript>
  48. }
  49. }
  50. </div>
  51. }