From 927bf45addf851448122787b4f43a92789f9c1e3 Mon Sep 17 00:00:00 2001 From: Yoan Le Clanche Date: Tue, 9 Mar 2021 12:05:33 +0100 Subject: [PATCH] Add popup message when user has not spent enough time on a seminar --- .../templates/teleforma/seminar_detail.html | 63 +++++++++++++------ 1 file changed, 45 insertions(+), 18 deletions(-) diff --git a/teleforma/templates/teleforma/seminar_detail.html b/teleforma/templates/teleforma/seminar_detail.html index 0a0f0297..859abf09 100644 --- a/teleforma/templates/teleforma/seminar_detail.html +++ b/teleforma/templates/teleforma/seminar_detail.html @@ -30,32 +30,51 @@ expandText: 'Lire plus', userCollapseText: 'Cacher le texte', }); + + + {% if popup_message %} + // show a warning popup and set a cookie to not display the popup each visit + if(getCookie('time-popup-view') != 1){ + $( "#warning-message" ).dialog({ + modal: true, + buttons: { + Ok: function() { + $( this ).dialog( "close" ); + var expirationDate=new Date(); + expirationDate.setDate(expirationDate.getDate() + 1); + setCookie('time-popup-view', 1 , 1); + } + } + }); + } + {% endif %} }); + +