This commit is contained in:
Marijn Jansen
2019-03-19 10:24:48 +01:00
parent 83f3ee2cb4
commit acbf413107
18 changed files with 248 additions and 59 deletions

View File

@@ -0,0 +1,3 @@
<footer class="small text-center text-muted">
&copy; 2019 Marijn Jansen
</footer>

25
templates/main/index.html Normal file
View File

@@ -0,0 +1,25 @@
{% extends "main/layout.html" %}
{% block title %}Marlous van Leeuwen{% endblock %}
{% block main %}
<main class="container">
<div class="row">
{% for i in range(count) %}
<div class="col-lg-3 col-md-4 col-6">
<a data-toggle="modal" data-target="#detailModal" data-name="{{ i }}">
<div class="card border-light">
<img class="card-img" src="https://placeimg.com/400/400/any" alt="random image">
<div class="card-img-overlay d-flex align-items-center justify-content-center">
<div class="card-title-bg bg-dark w-100 d-flex align-items-center justify-content-center">
<h5 class="card-text text-light">{{ i }}</h5>
</div>
</div>
</div>
</a>
</div>
{% endfor %}
</div>
</main>
{% endblock %}

View File

@@ -0,0 +1,9 @@
{% extends "layout.html" %}
{% block nav %}{% include "main/nav.html" %}{% endblock %}
{% block footer %}
{% include "main/modal.html" %}
{% include "main/footer.html" %}
{% endblock %}

31
templates/main/modal.html Normal file
View File

@@ -0,0 +1,31 @@
<div class="modal fade" id="detailModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title text-center" id="exampleModalLabel">Modal title</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
</p>
<p>Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.
</p>
</div>
</div>
</div>
</div>
<script>
$('#detailModal').on('show.bs.modal', function (event) {
let card = $(event.relatedTarget); // Button that triggered the modal
let name = card.data('name'); // Extract info from data-* attributes
// If necessary, you could initiate an AJAX request here (and then do the updating in a callback).
// Update the modal's content. We'll use jQuery here, but you could use a data binding library or other methods instead.
let modal = $(this);
modal.find('.modal-title').text(name);
{#modal.find('.modal-body input').val(recipient)#}
})
</script>

16
templates/main/nav.html Normal file
View File

@@ -0,0 +1,16 @@
<nav class="navbar navbar-expand-md navbar-light bg-light fixed-top">
<a class="navbar-brand" href="{{ url_for("index") }}">Marlous</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav"
aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav">
<li class="nav-item active">
<a class="nav-link" href="#">Home<span class="sr-only">(current)</span></a>
</li>
</ul>
</div>
</nav>