base.html 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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.75">
  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. {% 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. {% endif %}{# end of checking for bl_admin #}
  69. {% if current_user.bl_capture or current_user.bl_admin %}
  70. <li><a href="{{ url_for("main.capture_record") }}">Capture record</a></li>
  71. {% endif %}{# end of checking if either bl_capture or bl_admin #}
  72. <li><a href="{{ url_for("auth.logout") }}">Logout</a></li>
  73. {% else %}
  74. <li><a href="{{ url_for("auth.login") }}">Login</a></li>
  75. {% endif %}
  76. </ul>
  77. </nav>
  78. </div><!-- end of div.header-container -->
  79. </header>
  80. <main>
  81. <div class="background-container"></div>
  82. <div class="content-container content">
  83. <div id="div_alert" style="text-align: center;" aria-live="assertive">&nbsp;</div>
  84. {% block content %}{% endblock %}
  85. </div><!-- end of div.content -->
  86. </main>
  87. </body>
  88. </html>