base.html 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta
  6. name="viewport"
  7. content="width=device-width, initial-scale=1"
  8. >
  9. <link
  10. rel="stylesheet"
  11. href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css"
  12. integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh"
  13. crossorigin="anonymous"
  14. />
  15. <link
  16. rel="stylesheet"
  17. href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"
  18. crossorigin="anonymous"
  19. />
  20. <script
  21. src="https://code.jquery.com/jquery-3.2.1.slim.min.js"
  22. integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN"
  23. crossorigin="anonymous">
  24. </script>
  25. <script
  26. src="https://cdn.jsdelivr.net/npm/popper.js@1.12.9/dist/umd/popper.min.js"
  27. integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q"
  28. crossorigin="anonymous">
  29. </script>
  30. <script
  31. src="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/js/bootstrap.min.js"
  32. integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl"
  33. crossorigin="anonymous">
  34. </script>
  35. <title>
  36. {% block title %}Hometab{% endblock %}
  37. </title>
  38. <link
  39. rel = "icon"
  40. href = "static/logo/hometag_logo.png"
  41. type = "image/x-icon"
  42. >
  43. </head>
  44. <style>
  45. .navbar-nav-right {
  46. margin-left: auto;
  47. }
  48. a {
  49. font-size: 18px;
  50. }
  51. .navbar-nav > li{
  52. padding-left:30px;
  53. }
  54. body {
  55. font: 400 15px/1.8 "Lato", sans-serif;
  56. }
  57. </style>
  58. <body>
  59. <nav class="navbar fixed-top navbar-expand-sm bg-dark navbar-dark">
  60. <a class="navbar-brand" href="/"><img src="static/logo/hometag_logo.png" alt="hometag_logo" id="logo" width="40"/></a></a>
  61. <ul class="navbar-nav">
  62. {% if user.is_authenticated %} <!-- shows only if user is logged in -->
  63. <li class="nav-item">
  64. <a class="nav-link" href="/">Home</a>
  65. </li>
  66. <li class="nav-item">
  67. <a class="nav-link" href="/create">New Bookmark</a>
  68. </li>
  69. <li class="nav-item">
  70. <a class="nav-link" href="/shared">Public Bookmarks</a>
  71. </li>
  72. </ul>
  73. <ul class="navbar-nav-right">
  74. <li class="nav-item">
  75. <a class="navbar-brand" href="/logout"><img src="static/logo/logout_logo.gif" alt="logout_logo" id="logo" width="85"/></a></li>
  76. </li>
  77. </ul>
  78. {% else %}
  79. {% endif %}
  80. </ul>
  81. </nav>
  82. <!-- For Flash Errors to User -->
  83. {% with messages = get_flashed_messages(with_categories=true) %}
  84. {% if messages %}
  85. {% for category, message in messages %}
  86. {% if category == 'error' %}
  87. <div class="alert alert-danger alter-dismissable fade show", role="alert" style="z-index:2;">
  88. {{ message }}
  89. <button type="button" class="close" data-dismiss="alert">
  90. <span aria-hidden="true">&times;</span> <!-- fancy button styling-->
  91. </button>
  92. </div>
  93. {% else %}
  94. <div class="alert alert-success alter-dismissable fade show", role="alert" style="z-index:2;">
  95. {{ message }}
  96. <button type="button" class="close" data-dismiss="alert">
  97. <span aria-hidden="true">&times;</span> <!-- fancy button styling-->
  98. </button>
  99. </div>
  100. {% endif %}
  101. {% endfor %}
  102. {% endif %}
  103. {% endwith %}
  104. <div class="container">
  105. {% block content %}
  106. {% endblock %}
  107. </div>
  108. </body>
  109. </html>