diff --git a/lnbits/extensions/events/templates/events/index.html b/lnbits/extensions/events/templates/events/index.html index 5edbc05f2..6f724f9e0 100644 --- a/lnbits/extensions/events/templates/events/index.html +++ b/lnbits/extensions/events/templates/events/index.html @@ -80,7 +80,7 @@
-

Make a wave

+

Make a eve

@@ -108,9 +108,9 @@
- - -
+ + +
@@ -122,7 +122,7 @@
@@ -136,7 +136,7 @@
-

Ticket waves

+

Ticket Waves

@@ -171,33 +171,33 @@ window.user = {{ user | megajson | safe }} window.user_wallets = {{ user_wallets | megajson | safe }} window.user_ext = {{ user_ext | megajson | safe }} - window.user_wav = {{ user_fau | megajson | safe }} + window.user_ev = {{ user_ev | megajson | safe }} - const user_wav = window.user_wav - console.log(user_wav) + const user_ev = window.user_ev + console.log(user_ev) -function drawChart(user_wav) { +function drawChart(user_ev) { var transactionsHTML = '' - for (var i = 0; i < user_wav.length; i++) { - var wv = user_wav[i] + for (var i = 0; i < user_ev.length; i++) { + var ev = user_ev[i] transactionsHTML = "" + - wv.tit + + ev.tit + '' + - wv.nosold + + ev.nosold + '' + - wv.noavail + + ev.noavail + '' + - wv.prpertick + + ev.prpertick + '' + - "" + wv.uni.substring(0, 4) + "..." + + "" + ev.uni.substring(0, 4) + "..." + '' + "" + '' + - "" + "" + "" + + "" + "" + "" + '' + transactionsHTML document.getElementById('ticketwaves').innerHTML = transactionsHTML @@ -205,10 +205,11 @@ function drawChart(user_wav) { } } -function postwav(){ +function postev(){ wal = document.getElementById('wal').value tit = document.getElementById('tit').value + cldate = document.getElementById('cldate').value nooftickets = document.getElementById('nooftickets').value prtick = document.getElementById('prtick').value @@ -220,6 +221,10 @@ function postwav(){ document.getElementById("error").innerHTML = "No wallet selected" return amt } + if (cldate == "") { + document.getElementById("error").innerHTML = "No date selected" + return amt + } if (isNaN(notickets) || notickets < 1) { document.getElementById("error").innerHTML = "Must be more than 1" @@ -231,25 +236,25 @@ function postwav(){ } postAjax( - "{{ url_for('wave.create') }}", - JSON.stringify({"tit": tit, "nooftickets": nooftickets, "nooftickets": nooftickets, "prtick": prtick}), + "{{ url_for('events.create') }}", + JSON.stringify({"tit": tit, "wal": wal, "nooftickets": nooftickets,"cldate": cldate, "prtick": prtick}), "filla", - function(data) { location.replace("{{ url_for('wav.index') }}?usr=" + user) + function(data) { location.replace("{{ url_for('events.index') }}?usr=" + user) }) } -function editlink(wavnum){ +function editlink(evnum){ -wavdetails = user_wav[wavnum] +evdetails = user_ev[evnum] -console.log(wavdetails) +console.log(evdetails) wallpick = "" checkbox = "" -if (wavdetails.uniq == 1){ +if (evdetails.uniq == 1){ checkbox = "checked"} document.getElementById('editlink').innerHTML = "
"+ @@ -257,7 +262,7 @@ document.getElementById('editlink').innerHTML = "
"+ " "+ "
"+ "
"+ - "

Edit: " + wavdetails.tit + "-" + wavdetails.uni + "

"+ + "

Edit: " + evdetails.tit + "-" + evdetails.uni + "

"+ "
" + "" + "
" + @@ -269,7 +274,7 @@ document.getElementById('editlink').innerHTML = "
"+ "
"+ ""+ "
"+ "
"+ "
"+ @@ -277,7 +282,7 @@ document.getElementById('editlink').innerHTML = "
"+ "
"+ " "+ ""+ "
"+ "
"+ "
"+ ""+ - " "+ "
"+ "
"+ "
"+ " "+ " "+ "
"+ - "
"+ - "
"+ - " "+ - " "+ - "
"+ "
"+ - "
"+ - ""+ - "
"+ + "
"+ "

"+ "