_UserMenuHeader.cshtml 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. @using WeApp.Helpers
  2. @model WeApp.Models.Layout.TopBarUserAreaViewModel
  3. @if (Model.UserId != null)
  4. {
  5. var imagePath = string.IsNullOrEmpty(Model.ImagePath) ? "/Content/Image/user.png" : Model.ImagePath;
  6. <li class="nav-item dropdown user-menu">
  7. <a href="#" class="nav-link dropdown-toggle" data-toggle="dropdown">
  8. <img src="@(imagePath)" class="user-image img-circle elevation-2" alt="User Image">
  9. <span class="d-none d-md-inline">@(Model.Name)</span>
  10. </a>
  11. <ul class="dropdown-menu dropdown-menu-lg dropdown-menu-right">
  12. <!-- User image -->
  13. <li class="user-header bg-iwb" title="" style="height: auto; padding: 20px 10px;">
  14. <a href="@Url.Action("UserProfile", "Home", new {area = string.Empty})">
  15. <img src="@(imagePath)" class="img-circle elevation-2" alt="User Image" style="max-height: 100px;max-width: 100px;">
  16. </a>
  17. <p>
  18. @(Model.UserName)
  19. <small>@(Model.Email)</small>
  20. </p>
  21. </li>
  22. <!-- Menu Footer-->
  23. <li class="user-footer">
  24. <a href="@Url.Action("ChangePassword", "Home", new {area = string.Empty})" class="btn btn-outline-iwb"><i class="iconfont icon-lock" style="padding-right: 5px;"></i>@L("ChangePassword")</a>
  25. <a href="javascript:LoginOut()" class="btn btn-iwb float-right"><i class="iconfont icon-poweroff" style="padding-right: 5px;"></i>@L("Logout")</a>
  26. </li>
  27. </ul>
  28. </li>
  29. }
  30. @using (Html.BeginScripts())
  31. {
  32. <script>
  33. function LoginOut() {
  34. if (abp && abp.message) {
  35. abp.message.confirm('@L("LogoutConfirm")', '@L("Logout")',function (isConfirmed) {
  36. if (isConfirmed) {
  37. window.location.href = "/Account/LogOut";
  38. }
  39. });
  40. }
  41. }
  42. </script>
  43. }