base.html 4.0 KB

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