base.html 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <META http-equiv="Content-Type" content="text/html; charset=utf-8">
  5. <META http-equiv="Content-Style-Type" content="text/css">
  6. <meta name="viewport" content="width=device-width, initial-scale=1">
  7. <link rel="icon" type="image/x-icon" sizes="32x32" href="{{ url_for("static", filename="cv_db/favicon.ico") }}">
  8. {% if js %}
  9. <script type="text/javascript" src="{{ url_for("static", filename="cv_db/js/jquery.js") }}"></script>
  10. <script type="text/javascript">
  11. var do_alert;
  12. $(document).ready( function() {
  13. try {
  14. do_alert = function(s_in) {
  15. s_in = String(s_in).replace("\n", "<br />");
  16. $("#div_alert").show();
  17. //document.getElementById("div_alert").innerHTML = s_in;
  18. $("#div_alert").html(s_in);
  19. }//end of do_alert function
  20. $.fn.redraw =function(){
  21. $(this).each(function(){var redraw =this.offsetHeight;});
  22. };//end of $.fn.redraw function
  23. var s_server_url = "{{ url }}";
  24. $.each($("ul.nav").find("a"), function(ix, a) {
  25. if (s_server_url.endsWith($(a).attr("href"))) { $(a).attr("aria-current", "true"); } else { $(a).attr("aria-current", ""); }
  26. });// end of .each on nav links
  27. // alert([s_url, s_server_url]);
  28. var s_msg = "";
  29. {% with messages = get_flashed_messages() %}
  30. {% if messages %}
  31. s_msg = "{{ messages[-1] }}";
  32. {% endif %}
  33. {% endwith %}
  34. if (String(s_msg).length>0) {
  35. window.setTimeout( function() {
  36. $("#div_alert").toggleClass("warning");
  37. do_alert(s_msg);
  38. }, 300);
  39. }
  40. } catch(e) {
  41. var s_err = String(e.name) + "\nmessage:" + String(e.message);
  42. s_err = (typeof(e.lineNumber)!="undefined") ? s_err + "\nline:" + String(e.lineNumber) : s_err;
  43. alert("Error! " + s_err);
  44. }//end of catch
  45. });//end of document ready
  46. </script>
  47. {% endif %}{# end of js check #}
  48. <title>C.V. Database - {% block title %}{% endblock %}</title>
  49. <link type="text/css" rel="stylesheet" href="{{ url_for("static", filename="cv_db/css/styles.css") }}" />
  50. <link type="text/css" rel="stylesheet" href="{{ url_for("static", filename="cv_db/css/alteram/styles_1.css") }}" />
  51. <link type="text/css" rel="stylesheet" href="{{ url_for("static", filename="cv_db/css/alteram/styles_2.css") }}" />
  52. <style>
  53. .data-table th {
  54. color: white;
  55. }
  56. </style>
  57. {% block head_extra %}{% endblock head_extra %}
  58. </head>
  59. <body>
  60. {% from "macros/console.html" import console_replacement %}
  61. {# { console_replacement() } #}
  62. <header>
  63. <div class="header-container">
  64. <div class="logo-area"></div>
  65. <nav>
  66. <ul class="nav" role="navigation">
  67. {% if current_user %}
  68. <li><a href="{{ url_for("main.index") }}">Landing page</a></li>
  69. {% if current_user.bl_admin %}
  70. <li><a href="{{ url_for("main.qualifications") }}">Qualifications</a></li>
  71. <li><a href="{{ url_for("main.roles") }}">Positions | Roles</a></li>
  72. <li><a href="{{ url_for("main.users") }}">Access User Profiles</a></li>
  73. {% endif %}{# end of checking for bl_admin #}
  74. {% if current_user.bl_capture or current_user.bl_admin %}
  75. <li><a href="{{ url_for("main.capture_record") }}">Capture record</a></li>
  76. {% endif %}{# end of checking if either bl_capture or bl_admin #}
  77. <li><a href="{{ url_for("auth.logout") }}">Logout</a></li>
  78. {% else %}
  79. <li><a href="{{ url_for("auth.login") }}">Login</a></li>
  80. {% endif %}
  81. </ul>
  82. </nav>
  83. </div><!-- end of div.header-container -->
  84. </header>
  85. <main>
  86. <div class="background-container"></div>
  87. <div class="content-container content">
  88. <div id="div_alert" style="text-align: center;" aria-live="assertive">&nbsp;</div>
  89. {% block content %}{% endblock %}
  90. </div><!-- end of div.content -->
  91. </main>
  92. </body>
  93. </html>