From 46c8220e169077e9359aa8ba85b4d5d5fba14297 Mon Sep 17 00:00:00 2001 From: Paul van Tilburg Date: Tue, 2 Jan 2018 12:11:26 +0100 Subject: [PATCH] Add a modal error dialog to the home index template and JavaScript --- static/js/wishlists.js | 12 ++++++++++++ templates/index.html.tera | 18 ++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/static/js/wishlists.js b/static/js/wishlists.js index def7137..6b8117b 100644 --- a/static/js/wishlists.js +++ b/static/js/wishlists.js @@ -12,6 +12,18 @@ function getUrlListId() { } } +function showErrorDialog(title, html, buttons) { + var errorDialog = $("#errorDialog"); + errorDialog.find('.modal-title').text(title); + errorDialog.find('.modal-body').html(html); + if (buttons) { + errorDialog.find('.modal-footer').show(); + } else { + errorDialog.find('.modal-footer').hide(); + } + errorDialog.modal(); +} + function initLists() { $.ajax({ url: '/lists', diff --git a/templates/index.html.tera b/templates/index.html.tera index 1372ac4..bcb5a44 100644 --- a/templates/index.html.tera +++ b/templates/index.html.tera @@ -80,6 +80,24 @@ Horizontale lijn
">
   
 {% endfor %}
 
+
 {% endblock content %}
 
 {% block script %}