Commit 336265e9 authored by Christophe Benz's avatar Christophe Benz

Use macros to control <script> tags order

parent 580c78c8
Pipeline #1014 failed with stage
in 16 seconds
......@@ -67,11 +67,6 @@
{% block content %}{% endblock %}
</div>
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
{% block page_scripts %}{% endblock %}
<footer class="footer hidden-print">
<div>
Le service de validation du <a href="https://www.validata.fr/">projet Validata</a>
......@@ -88,6 +83,11 @@
</ul>
</footer>
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
{% block page_scripts %}{% endblock %}
</body>
</html>
{% macro html(schema_info, schema_versions) %}
<h5 class="card-title">
Schéma
{% if schema_info.title %}
......@@ -44,8 +45,10 @@
{% endfor %}
</select>
</p>
{% endif %}
{% endmacro %}
{% block page_scripts %}
{% macro script() %}
<script>
var vbox = $('#version_select');
vbox.on('change', function() {
......@@ -81,7 +84,4 @@
document.location.href = new_url;
})
</script>
{% endblock %}
{% endif %}
{% endmacro %}
{% extends "base_template.html" %} {% block title %}{{ title }}{% endblock %} {%
block head %}
{{ super() }}
{% endblock %} {% block content %}
{% extends "base_template.html" %}
{% import 'schema_info_part.html' as schema_info_part %}
{% block title %}{{ title }}{% endblock %}
{% block content %}
<h1 class="my-4">{{ title }}</h1>
{% set cols_my_classes = 'my-md-0 my-4' %}
......@@ -9,7 +12,7 @@ block head %}
<div class="col-md-4 {{ cols_my_classes }}">
<div class="card bg-faded">
<div class="card-body">
{% include 'schema_info_part.html' %}
{{ schema_info_part.html(schema_info, schema_versions) }}
</div>
</div>
</div>
......@@ -86,6 +89,10 @@ block head %}
</div>
</div>
</div>
{% endblock %}
{% block page_scripts %}
{% if schema_versions %}
{{ schema_info_part.script() }}
{% endif %}
{% endblock %}
\ No newline at end of file
{% extends "base_template.html" %}
{% import 'schema_info_part.html' as schema_info_part %}
{% block title %}{{ title }}{% endblock %}
{% block head %}
{{ super() }}
<style>
......@@ -19,6 +23,7 @@
}
</style>
{% endblock %}
{% block content %}
{% if print_mode %}
<div class="row">
......@@ -46,7 +51,7 @@
<div class="col-md-{% if print_mode %}12{% else %}5{% endif %} my-4">
<div class="card bg-faded">
<div class="card-body">
{% include 'schema_info_part.html' %}
{{ schema_info_part.html(schema_info, schema_versions) }}
<hr />
<div>
<h5 class="card-title">
......@@ -167,6 +172,10 @@
{% endblock %}
{% block page_scripts %}
{% if schema_versions %}
{{ schema_info_part.script() }}
{% endif %}
<script>
$(function() {
// Errors tooltip activate
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment