base.html 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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=0.8">
  7. <link rel="icon" type="image/x-icon" sizes="32x32" href="{{ url_for("static", filename=static_prefix+"favicon.ico") }}">
  8. {% if js %}
  9. <script type="text/javascript" src="{{ url_for("static", filename=static_prefix+"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. <style>
  50. {% include("combined_styles.css") %}
  51. </style>
  52. {% block head_extra %}{% endblock head_extra %}
  53. </head>
  54. <body>
  55. {% from "macros/console.html" import console_replacement %}
  56. {# { console_replacement() } #}
  57. <header>
  58. <div class="header-container">
  59. <div class="logo-area"></div>
  60. <nav>
  61. <ul class="nav" role="navigation">
  62. {% if current_user.id %}
  63. <li><a href="{{ url_for("main.index") }}">Landing page</a></li>
  64. {% if current_user.bl_admin %}
  65. <li><a href="{{ url_for("main.qualifications") }}">Qualifications</a></li>
  66. <li><a href="{{ url_for("main.roles") }}">Positions | Roles</a></li>
  67. <li><a href="{{ url_for("main.users") }}">Access User Profiles</a></li>
  68. <li><a href="{{ url_for("main.tenders") }}">Tenders</a></li>
  69. {% endif %}{# end of checking for bl_admin #}
  70. {% if current_user.bl_capture or current_user.bl_admin %}
  71. <li><a href="{{ url_for("main.capture_record") }}">Capture record</a></li>
  72. {% endif %}{# end of checking if either bl_capture or bl_admin #}
  73. <li><a href="{{ url_for("auth.logout") }}">Logout</a></li>
  74. {% else %}
  75. <li><a href="{{ url_for("auth.login") }}">Login</a></li>
  76. {% endif %}
  77. </ul>
  78. </nav>
  79. </div><!-- end of div.header-container -->
  80. </header>
  81. <!-- Wrapper for the entire content to provide spacing from navbar -->
  82. <div style="padding: 100px 20px 20px 20px; font-family: CaviarDreams, Arial, sans-serif; background: #f0f0f0; min-height: 100vh;">
  83. <div id="div_alert" style="text-align: center;" aria-live="assertive">&nbsp;</div>
  84. {% block content %}{% endblock %}
  85. </div><!-- end of wrapper for the entire content -->
  86. </body>
  87. </html>