-
-
Save Kd-Here/59a2863ae0c7c29f983d337a9548fcab to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title> | |
{% block title %} | |
Welcome to KdTuto | |
{% endblock %} | |
</title> | |
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous"/> | |
<link rel="stylesheet"href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"crossorigin="anonymous"/> | |
<!-- This both are cdn content delivery network it will load the file without downloading --> | |
</head> | |
<body> | |
<nav class="navbar navbar-expand-lg navbar-dark bg-warning"> | |
<button class="navbar-toggler bg-primary" type="button" data-toggle="collapse" data-target="#navbar"> | |
<span class="navbar-toggler-icon"></span> | |
</button> | |
<div class="collapse navbar-collapse" id="navbar"> | |
<div class="navbar-nav"> | |
{% if user.is_authenticated %} | |
<a href="/" id="home" class="nav-item nav-link text-primary">Home</a> | |
<a href="/logout" id="logout" class="nav-item nav-link text-primary">Logout</a> | |
{% else %} | |
<a href="/login" id="login" class="nav-item nav-link text-primary">Login</a> | |
<a href="/sign-up" id="signUp" class="nav-item nav-link text-primary">SingUp</a> | |
<!-- No a tag for logout bcoz when we logout we render to some other page thus not to use different page --> | |
{% endif %} | |
</div> | |
</div> | |
</nav> | |
{% with messages = get_flashed_messages(with_categories=true) %} | |
{% if messages %} | |
{% for category, message in messages %} | |
{% if category == 'error' %} | |
<div class="alert alert-danger alter-dismissable fade show" role="alert"> | |
{{ message }} | |
<button type="button"class='close' data-dismiss="alert"> | |
<span aria-hidden="true">×</span> | |
</button> | |
</div> | |
{% else %} | |
<div class="alert alert-success alter-dismissable fade show" role="alert"> | |
{{ message }} | |
<button type="button"class='close' data-dismiss="alert"> | |
<span aria-hidden="true">×</span> | |
</button> | |
</div> | |
{% endif %} | |
{% endfor %} | |
{% endif %} | |
{% endwith %} | |
<div class="container"> | |
{% block content %} | |
{% endblock %} | |
</div> | |
<script | |
src="https://code.jquery.com/jquery-3.2.1.slim.min.js" | |
integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" | |
crossorigin="anonymous" | |
></script> | |
<script | |
src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" | |
integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" | |
crossorigin="anonymous" | |
></script> | |
<script | |
src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" | |
integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" | |
crossorigin="anonymous" | |
></script> | |
{% block javascript %} | |
<script type="text/javascript"> | |
function deleteNote(noteId) { | |
fetch("/delete-note", { | |
method: "POST", | |
body: JSON.stringify({ noteId: noteId }), | |
}).then((_res) => { | |
window.location.href = "/"; | |
}); | |
} | |
</script> | |
{% endblock %} | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment