fix: add jquery

main
Raphaël Vinot 2024-05-28 10:25:42 +02:00
parent aa5f1c974c
commit cdd8e10635
2 changed files with 21 additions and 15 deletions

View File

@ -6,8 +6,8 @@ import requests
from bgpranking.default import get_homedir from bgpranking.default import get_homedir
d3js_version = '7' d3js_version = '7'
bootstrap_select_version = "1.13.18" bootstrap_select_version = "1.14.0-beta3"
jquery_version = "3.7.1"
if __name__ == '__main__': if __name__ == '__main__':
dest_dir = get_homedir() / 'website' / 'web' / 'static' dest_dir = get_homedir() / 'website' / 'web' / 'static'
@ -27,4 +27,9 @@ if __name__ == '__main__':
f.write(bootstrap_select_css.content) f.write(bootstrap_select_css.content)
print(f'Downloaded bootstrap_select css v{bootstrap_select_version}.') print(f'Downloaded bootstrap_select css v{bootstrap_select_version}.')
jquery = requests.get(f'https://code.jquery.com/jquery-{jquery_version}.min.js')
with (dest_dir / 'jquery.min.js').open('wb') as f:
f.write(jquery.content)
print(f'Downloaded jquery v{jquery_version}.')
print('All 3rd party modules for the website were downloaded.') print('All 3rd party modules for the website were downloaded.')

View File

@ -4,25 +4,26 @@
{% block head %} {% block head %}
<!-- Required meta tags --> <!-- Required meta tags -->
<meta charset="utf-8"> <meta charset="utf-8">
{% block styles %} {% block styles %}
{{ bootstrap.load_css() }} {{ bootstrap.load_css() }}
<link rel="stylesheet" href="{{ url_for('static', filename='bootstrap-select.min.css') }}"> <link rel="stylesheet" href="{{ url_for('static', filename='bootstrap-select.min.css') }}">
{% endblock %} {% endblock %}
{% endblock %} {% endblock %}
</head> </head>
<body> <body>
<div class="container"> <div class="container">
{% block content %}{% endblock%} {% block content %}{% endblock%}
</div> </div>
{% block scripts %} {% block scripts %}
{{ bootstrap.load_js() }} {{ bootstrap.load_js() }}
<script src='{{ url_for('static', filename='bootstrap-select.min.js') }}'></script> <script src='{{ url_for('static', filename='jquery.min.js') }}'></script>
<script src='{{ url_for('static', filename='d3.v7.min.js') }}'></script> <script src='{{ url_for('static', filename='bootstrap-select.min.js') }}'></script>
<script> <script src='{{ url_for('static', filename='d3.v7.min.js') }}'></script>
$(document).ready(function(){ <script>
$('[data-toggle="popover"]').popover(); $(document).ready(function(){
}); $('[data-toggle="popover"]').popover();
</script> });
</script>
{% endblock %} {% endblock %}
</body> </body>
</html> </html>