base.html 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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. <style>
  51. ul.nav {
  52. text-align: left;
  53. }
  54. ul.nav li {
  55. display: inline-block;
  56. }
  57. </style>
  58. {% block head_extra %}{% endblock head_extra %}
  59. </head>
  60. <body>
  61. {% from "macros/console.html" import console_replacement %}
  62. {{ console_replacement() }}
  63. <div><ul class="nav" role="navigation">
  64. {% if current_user %}
  65. <li><a href="{{ url_for("main.index") }}">Landing page</a></li>
  66. {% if current_user.bl_admin %}
  67. <li><a href="{{ url_for("main.qualifications") }}">Qualifications</a></li>
  68. <li><a href="{{ url_for("main.roles") }}">Positions | Roles</a></li>
  69. <li><a href="{{ url_for("main.users") }}">Access User Profiles</a></li>
  70. {% endif %}{# end of checking for bl_admin #}
  71. {% if current_user.bl_capture or current_user.bl_admin %}
  72. <li><a href="{{ url_for("main.capture_record") }}">Capture record</a></li>
  73. {% endif %}{# end of checking if either bl_capture or bl_admin #}
  74. <li><a href="{{ url_for("auth.logout") }}">Logout</a></li>
  75. {% else %}
  76. <li><a href="{{ url_for("auth.login") }}">Login</a></li>
  77. {% endif %}
  78. </ul></div>
  79. <div class="content">
  80. <div id="div_alert" style="text-align: center;" aria-live="assertive">&nbsp;</div>
  81. {% block content %}{% endblock %}
  82. </div><!-- end of div.content -->
  83. </body>
  84. </html>