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>
<html lang="en" dir="ltr">
<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>
{% extends "layout.html" %}
{% block content %}
<div class="container">
<div class="row">
<div class="col justify-content-center text-center">
@ -19,11 +9,8 @@
</div>
</div>
</div>
{% endblock content %}
<!-- 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>
</body>
</html>
{% block scripts %}
<!-- Created scripts -->
{% endblock scripts %}

View File

@ -1,39 +1,16 @@
<!DOCTYPE html>
<html lang="en" dir="ltr">
<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="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>
{% extends "layout.html" %}
{% block content %}
<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>
{% endblock content %}
<!-- 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>
<!-- Created scripts -->
</body>
</html>
{% block scripts %}
<!-- Created scripts -->
{% endblock scripts %}

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>