/Diary.Web/Views/Shared/_Layout.cshtml

https://gitlab.com/thefancydev/Diary · Razor · 70 lines · 70 code · 0 blank · 0 comment · 3 complexity · 8554fc5eee4340822995ab3add889109 MD5 · raw file

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8" />
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>@ViewBag.Title - Diary</title>
  7. @Styles.Render("~/Content/css")
  8. @Scripts.Render("~/bundles/modernizr")
  9. @Scripts.Render("~/bundles/jquery")
  10. @Scripts.Render("~/bundles/bootstrap")
  11. @RenderSection("scripts", required: false)
  12. </head>
  13. <body>
  14. <div class="navbar navbar-inverse navbar-fixed-top">
  15. <div class="container">
  16. <div class="navbar-header">
  17. <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
  18. <span class="icon-bar"></span>
  19. <span class="icon-bar"></span>
  20. <span class="icon-bar"></span>
  21. </button>
  22. @Html.ActionLink("Diary", "Index", "Home", new { area = "" }, new { @class = "navbar-brand" })
  23. </div>
  24. <div class="navbar-collapse collapse">
  25. <ul class="nav navbar-nav">
  26. <li>@Html.ActionLink("Home", "Index", "Home")</li>
  27. <li>@Html.ActionLink("Create", "createEntry", "Entry")</li>
  28. @if (Authentication.isAuthenticated)
  29. {
  30. if (Authentication.AuthenticatedAs.isAdmin)
  31. {
  32. <li>@Html.ActionLink("Admin", "adminIndex", "AdminControlCentre")</li>
  33. }
  34. }
  35. </ul>
  36. @if (Authentication.isAuthenticated)
  37. {
  38. <ul class="nav navbar-nav navbar-right">
  39. <li><i class="fa fa-user"></i> @Html.ActionLink("Account", "accountIndex", "Account")</li>
  40. <li>@Html.ActionLink("Log Out", "logOut", "Account")</li>
  41. </ul>
  42. }
  43. </div>
  44. </div>
  45. </div>
  46. <div class="container body-content">
  47. @if ((string)TempData["message"] != null)
  48. {
  49. if ((bool)TempData["badAlert"])
  50. {
  51. <div class="alert alert-danger">
  52. @TempData["message"].ToString()
  53. </div>
  54. }
  55. else
  56. {
  57. <div class="alert alert-info">
  58. @TempData["message"].ToString()
  59. </div>
  60. }
  61. <script>$(function(){setTimeout(function(){$(".alert").slideUp(700)},5e3)});</script>
  62. }
  63. @RenderBody()
  64. <hr />
  65. <footer>
  66. <p>&copy; @DateTime.Now.Year - Diary. Designed and Developed by <a href="mailto:rhys.oconnor@outlook.com">Rhys O'Connor</a> 2016</p>
  67. </footer>
  68. </div>
  69. </body>
  70. </html>