Implimented proper template setup

This commit is contained in:
Maxim Stewart 2019-12-14 17:03:06 -06:00
parent c3401a80eb
commit 042c32a7cd
3 changed files with 56 additions and 55 deletions

View File

@ -1,15 +1,5 @@
<!DOCTYPE html> {% extends "layout.html" %}
<html lang="en" dir="ltr"> {% block content %}
<head>
<meta charset="utf-8">
<title>{{title}}</title>
<link rel="shortcut icon" href="{{ url_for('static', filename="faveicon.png")}}">
<link rel="stylesheet" href="{{ url_for('static', filename="css/bootstrap/bootstrap.min.css")}}">
<link rel="stylesheet" href="{{ url_for('static', filename="css/bootstrap/bootstrap-datepicker.css")}}">
<link rel="stylesheet" href="{{ url_for('static', filename="css/main.css")}}">
</head>
<body>
<div class="container"> <div class="container">
<div class="row"> <div class="row">
<div class="col justify-content-center text-center"> <div class="col justify-content-center text-center">
@ -19,11 +9,8 @@
</div> </div>
</div> </div>
</div> </div>
{% endblock content %}
{% block scripts %}
<!-- For Bootstrap in this exact order... --> <!-- Created scripts -->
<script src="{{ url_for('static', filename="js/bootstrap/jquery-3.3.1.slim.min.js")}}"></script> {% endblock scripts %}
<script src="{{ url_for('static', filename="js/bootstrap/popper.min.js")}}"></script>
<script src="{{ url_for('static', filename="js/bootstrap/bootstrap.min.js")}}"></script>
</body>
</html>

View File

@ -1,39 +1,16 @@
<!DOCTYPE html> {% extends "layout.html" %}
<html lang="en" dir="ltr"> {% block content %}
<head> <div class="container">
<meta charset="utf-8"> <div class="row">
<title>{{title}}</title> <div class="col justify-content-center text-center">
<link rel="shortcut icon" href="{{ url_for('static', filename="faveicon.png")}}"> <h1>Hello World!</h1>
<link rel="stylesheet" href="{{ url_for('static', filename="css/bootstrap/bootstrap.min.css")}}"> <p>Using dark themed Bootstrap 4 css files...</p>
<link rel="stylesheet" href="{{ url_for('static', filename="css/bootstrap/bootstrap-datepicker.css")}}"> <p>Themes:&nbsp;<a href="https://bootswatch.com/" target="_blank">Bootswatch</a></p>
<link rel="stylesheet" href="{{ url_for('static', filename="css/main.css")}}"> </div>
</head>
<body>
<div class="container">
<div class="row">
<div class="col justify-content-center text-center">
<h1>Hello World!</h1>
<p>Using dark themed Bootstrap 4 css files...</p>
<p>Themes:&nbsp;<a href="https://bootswatch.com/" target="_blank">Bootswatch</a></p>
</div> </div>
</div> </div>
</div> {% endblock content %}
{% block scripts %}
<!-- Created scripts -->
<!-- For Bootstrap in this exact order... --> {% endblock scripts %}
<script src="{{ url_for('static', filename="js/bootstrap/jquery-3.3.1.slim.min.js")}}"></script>
<script src="{{ url_for('static', filename="js/bootstrap/popper.min.js")}}"></script>
<script src="{{ url_for('static', filename="js/bootstrap/bootstrap.min.js")}}"></script>
<!-- For DatePicker -->
<script src="{{ url_for('static', filename="js/bootstrap/moment.min.js")}}"></script>
<script src="{{ url_for('static', filename="js/bootstrap/bootstrap-datepicker.min.js")}}"></script>
<!-- Created scripts -->
</body>
</html>

37
src/templates/layout.html Normal file
View File

@ -0,0 +1,37 @@
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
{% if title %}
<title>{{title}}</title>
{% else %}
<title>Home</title>
{% endif %}
<link rel="shortcut icon" href="{{ url_for('static', filename='faveicon.png') }}">
<link rel="stylesheet" href="{{ url_for('static', filename='css/bootstrap/bootstrap.min.css')}}">
<link rel="stylesheet" href="{{ url_for('static', filename='css/bootstrap/bootstrap-datepicker.css')}}">
<link rel="stylesheet" href="{{ url_for('static', filename='css/main.css')}}">
</head>
<body>
{% block content %}
{% endblock %}
<!-- For Bootstrap in this exact order... -->
<script src="{{ url_for('static', filename='js/bootstrap/jquery-3.3.1.slim.min.js')}}"></script>
<script src="{{ url_for('static', filename='js/bootstrap/popper.min.js')}}"></script>
<script src="{{ url_for('static', filename='js/bootstrap/bootstrap.min.js')}}"></script>
<!-- For DatePicker -->
<script src="{{ url_for('static', filename='js/bootstrap/moment.min.js')}}"></script>
<script src="{{ url_for('static', filename='js/bootstrap/bootstrap-datepicker.min.js')}}"></script>
{% block scripts %}
{% endblock %}
</body>
</html>