<!DOCTYPE html>
<html lang="en">
<head>
<META http-equiv="Content-Type" content="text/html; charset=utf-8">
<META http-equiv="Content-Style-Type" content="text/css">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" sizes="32x32" href="{{ url_for("static", filename="cv_db/favicon.ico") }}">
{% if js %}
<script type="text/javascript" src="{{ url_for("static", filename="cv_db/js/jquery.js") }}"></script>
<script type="text/javascript">
var do_alert;

$(document).ready( function() {
try {

do_alert = function(s_in) {
	s_in = String(s_in).replace("\n", "<br />");
	$("#div_alert").show();
	//document.getElementById("div_alert").innerHTML = s_in;
	$("#div_alert").html(s_in);
}//end of do_alert function

$.fn.redraw =function(){
	$(this).each(function(){var redraw =this.offsetHeight;});
};//end of $.fn.redraw function

var s_server_url = "{{ url }}";
$.each($("nav").find("a"), function(ix, a) {
    if (s_server_url.endsWith($(a).attr("href"))) { $(a).attr("aria-current", "true"); } else { $(a).attr("aria-current", ""); }
});// end of .each on nav links
// alert([s_url, s_server_url]);


var s_msg = "";
{% with messages = get_flashed_messages() %}
{% if messages %}
s_msg = "{{ messages[-1] }}";
{% endif %}
{% endwith %}
if (String(s_msg).length>0) {
    window.setTimeout( function() {
    $("#div_alert").toggleClass("warning");
    do_alert(s_msg);
    }, 300);
}

} catch(e) {
    var s_err = String(e.name) + "\nmessage:" + String(e.message);
    s_err = (typeof(e.lineNumber)!="undefined") ? s_err + "\nline:" + String(e.lineNumber) : s_err;
    alert("Error! " + s_err);
}//end of catch
});//end of document ready
</script>
{% endif %}{# end of js check #}
<title>C.V. Database - {% block title %}{% endblock %}</title>
<link type="text/css" rel="stylesheet" href="{{ url_for("static", filename="cv_db/css/styles.css") }}" />
<link type="text/css" rel="stylesheet" href="{{ url_for("static", filename="cv_db/css/bootstrap.min.css") }}" />
{% block head_extra %}{% endblock head_extra %}
</head>
<body>
{% from "macros/console.html" import console_replacement %}
{{ console_replacement() }}
<!-- bootstrap nav? -->
<nav class="navbar navbar-expand-lg bg-body-tertiary">
<div class="container">
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
{% if current_user %}
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
<li class="nav-item"><a class="nav-link" aria-current="page" href="{{ url_for("main.index") }}">Landing page</a></li>
<li class="nav-item"><a class="nav-link" aria-current="page" href="{{ url_for("auth.logout") }}">Logout</a></li>
</ul>
{% if current_user.bl_capture or current_user.bl_admin %}
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
{% if current_user.bl_admin %}
<li class="nav-item"><a class="nav-link" aria-current="page" href="{{ url_for("main.qualifications") }}">Qualifications</a></li>
<li class="nav-item"><a class="nav-link" aria-current="page" href="{{ url_for("main.roles") }}">Positions | Roles</a></li>
<li class="nav-item"><a class="nav-link" aria-current="page" href="{{ url_for("main.users") }}">Access User Profiles</a></li>
{% endif %}{# end of checking for bl_admin #}
<li class="nav-item"><a class="nav-link" aria-current="page" href="{{ url_for("main.capture_record") }}">Capture record</a></li>
</ul>
{% endif %}{# end of checking if either bl_capture or bl_admin #}
{% else %}
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
<li class="nav-item"><a class="nav-link" aria-current="page" href="{{ url_for("auth.login") }}">Login</a></li>
</ul>
{% endif %}{# end of checking if logged in at all #}
</div>
</div>
</nav>
<!-- end bootstrap nav? -->
<div class="container">
<div id="div_alert" style="text-align: center;" aria-live="assertive">&nbsp;</div>
{% block content %}{% endblock %}
</div><!-- end of div.container -->
<script type="text/javascript" src="{{ url_for("static", filename="cv_db/js/bootstrap.bundle.min.js") }}"></script>
</body>
</html>