base.html 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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 %}APP{% 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. position: absolute;
  47. top: 2px;
  48. right: 0px;
  49. list-style-type: none;
  50. }
  51. a {
  52. font-size: 18px;
  53. }
  54. .navbar-nav > li{
  55. padding-left:30px;
  56. }
  57. body {
  58. font: 400 15px/1.8 "Lato", sans-serif;
  59. }
  60. </style>
  61. <body>
  62. <nav class="navbar fixed-top navbar-expand-sm bg-dark navbar-dark">
  63. <a class="navbar-brand" href="/"><img src="static/logo/hometag_logo.png" alt="hometag_logo" id="logo" width="40"/></a></a>
  64. <ul class="navbar-nav">
  65. {% if user.is_authenticated %} <!-- shows only if user is logged in -->
  66. <li class="nav-item">
  67. <a class="nav-link" href="/">Home</a>
  68. </li>
  69. </ul>
  70. <ul class="navbar-nav-right">
  71. <li class="nav-item">
  72. <a href="/logout"><img src="static/logo/logout_logo.gif" alt="logout_logo" id="logo" width="86"/></a>
  73. </li>
  74. </ul>
  75. {% else %}
  76. {% endif %}
  77. </ul>
  78. </nav>
  79. <!-- For Flash Errors to User -->
  80. {% with messages = get_flashed_messages(with_categories=true) %}
  81. {% if messages %}
  82. {% for category, message in messages %}
  83. {% if category == 'error' %}
  84. <div class="alert alert-danger alter-dismissable fade show", role="alert" style="z-index:2;">
  85. {{ message }}
  86. <button type="button" class="close" data-dismiss="alert">
  87. <span aria-hidden="true">&times;</span> <!-- fancy button styling-->
  88. </button>
  89. </div>
  90. {% else %}
  91. <div class="alert alert-success alter-dismissable fade show", role="alert" style="z-index:2;">
  92. {{ message }}
  93. <button type="button" class="close" data-dismiss="alert">
  94. <span aria-hidden="true">&times;</span> <!-- fancy button styling-->
  95. </button>
  96. </div>
  97. {% endif %}
  98. {% endfor %}
  99. {% endif %}
  100. {% endwith %}
  101. <div class="container">
  102. {% block content %}
  103. {% endblock %}
  104. </div>
  105. </body>
  106. </html>