base.html 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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. </style>
  36. <body>
  37. <nav class="navbar navbar-expand-sm bg-dark navbar-dark">
  38. <a class="navbar-brand" href="/"><img src="static/logo/hometag_logo.png" alt="hometag_logo" id="logo" width="40"/></a></li>
  39. </a>
  40. <ul class="navbar-nav">
  41. {% if user.is_authenticated %} <!-- shows only if user is logged in -->
  42. <li class="nav-item">
  43. <a class="nav-link" href="/create">Create a Bookmark</a>
  44. </li>
  45. <li class="nav-item">
  46. <a class="nav-link" href="/shared">Shared Hometabs</a>
  47. </li>
  48. </ul>
  49. <ul class="navbar-nav-right">
  50. <li class="nav-item">
  51. <a class="navbar-brand" href="/logout"><img src="static/logo/logout_logo.gif" alt="logout_logo" id="logo" width="85"/></a></li>
  52. </li>
  53. </ul>
  54. {% else %}
  55. {% endif %}
  56. </ul>
  57. </nav>
  58. <!-- For Flash Errors to User -->
  59. {% with messages = get_flashed_messages(with_categories=true) %}
  60. {% if messages %}
  61. {% for category, message in messages %}
  62. {% if category == 'error' %}
  63. <div class="alert alert-danger alter-dismissable fade show", role="alert" style="z-index:2;">
  64. {{ message }}
  65. <button type="button" class="close" data-dismiss="alert">
  66. <span aria-hidden="true">&times;</span> <!-- fancy button styling-->
  67. </button>
  68. </div>
  69. {% else %}
  70. <div class="alert alert-success alter-dismissable fade show", role="alert" style="z-index:2;">
  71. {{ message }}
  72. <button type="button" class="close" data-dismiss="alert">
  73. <span aria-hidden="true">&times;</span> <!-- fancy button styling-->
  74. </button>
  75. </div>
  76. {% endif %}
  77. {% endfor %}
  78. {% endif %}
  79. {% endwith %}
  80. <div class="container">
  81. {% block content %}
  82. {% endblock %}
  83. </div>
  84. <script
  85. src="https://code.jquery.com/jquery-3.2.1.slim.min.js"
  86. integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN"
  87. crossorigin="anonymous">
  88. </script>
  89. <script
  90. src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"
  91. integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q"
  92. crossorigin="anonymous">
  93. </script>
  94. <script
  95. src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"
  96. integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl"
  97. crossorigin="anonymous">
  98. </script>
  99. </body>
  100. </html>