Browse Source

Update index.html

fee_issues
Arc 5 years ago
committed by GitHub
parent
commit
38c8c7b265
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 45
      lnbits/extensions/events/templates/events/index.html

45
lnbits/extensions/events/templates/events/index.html

@ -53,8 +53,8 @@
<!-- Content Header (Page header) --> <!-- Content Header (Page header) -->
<section class="content-header"> <section class="content-header">
<h1> <h1>
Withdraw link maker Events
<small>powered by LNURL</small> <small>bitcoin tickets</small>
</h1> </h1>
<ol class="breadcrumb"> <ol class="breadcrumb">
@ -111,7 +111,7 @@
<div class="form-group"> <div class="form-group">
<label for="nooftickets">No. of tickets</label> <label for="nooftickets">No. of tickets</label>
<input id="notickets" type="number" class="form-control" placeholder="1" max="86400"></input> <input id="notickets" type="number" class="form-control" placeholder="10" max="86400"></input>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -128,7 +128,7 @@
<div class="form-group"> <div class="form-group">
<label for="prpertick">Price per ticket</label> <label for="prpertick">Price per ticket</label>
<input id="prtickets" type="number" class="form-control" placeholder="1"></input> <input id="prtickets" type="number" class="form-control" placeholder="10"></input>
</div> </div>
@ -240,7 +240,7 @@ function postev(){
cldate = document.getElementById('datepicker').value cldate = document.getElementById('datepicker').value
notickets = document.getElementById('notickets').value notickets = document.getElementById('notickets').value
prtickets = document.getElementById('prtickets').value prtickets = document.getElementById('prtickets').value
alert(cldate)
if (tit == "") { if (tit == "") {
document.getElementById("error").innerHTML = "Only use letters in title" document.getElementById("error").innerHTML = "Only use letters in title"
return amt return amt
@ -330,7 +330,7 @@ document.getElementById('editlink').innerHTML = "<div class='row'>"+
"<div class='form-group'>"+ "<div class='form-group'>"+
"<label for='exampleInputEmail1'>Price per ticket:</label>"+ "<label for='exampleInputEmail1'>Price per ticket:</label>"+
" <input id='editprtick' type='number' class='form-control' placeholder='1' value='"+ " <input id='editprtick' type='number' class='form-control' placeholder='1' value='"+
evdetails.prtickets + evdetails.prtick +
"'></input>"+ "'></input>"+
" </div></div>"+ " </div></div>"+
" <div class='col-sm-3 col-md-4'>"+ " <div class='col-sm-3 col-md-4'>"+
@ -344,7 +344,7 @@ document.getElementById('editlink').innerHTML = "<div class='row'>"+
"</div><!-- /.box-body -->"+ "</div><!-- /.box-body -->"+
" </div><br/>"+ " </div><br/>"+
" <div class='box-footer'>"+ " <div class='box-footer'>"+
" <button onclick='editlinkcont()' type='button' class='btn btn-info'>Edit link(s)</button><p style='color:red;' id='error2'></p>"+ " <button onclick='editlinkcont()' type='button' style='margin: 24px;' class='btn btn-info'>Edit link(s)</button><p style='color:red;' id='error2'></p>"+
" </div></form></div><!-- /.box --></div></div>" " </div></form></div><!-- /.box --></div></div>"
@ -362,10 +362,8 @@ function editlinkcont(){
tit = document.getElementById('edittit').value tit = document.getElementById('edittit').value
nooftickets = document.getElementById('editnooftickets').value nooftickets = document.getElementById('editnooftickets').value
prtick = document.getElementById('editprtick').value prtick = document.getElementById('editprtick').value
cldate = document.getElementById('datepicker').value cldate = document.getElementById('datepicker2').value
tme = document.getElementById('edittme').value uni = unid.split("-")[1]
uniq = document.getElementById('edituniq').checked
if (tit == "") { if (tit == "") {
document.getElementById("error2").innerHTML = "Only use letters in title" document.getElementById("error2").innerHTML = "Only use letters in title"
@ -376,32 +374,23 @@ function editlinkcont(){
return amt return amt
} }
if (isNaN(maxamt) || maxamt < 10 || maxamt > 1000000) { if (isNaN(nooftickets) || nooftickets < 1 || nooftickets > 1000000) {
document.getElementById("error2").innerHTML = "Max 10 - 1000000 and must be higher than min" document.getElementById("error2").innerHTML = "No. of tickets must be between 1 - 1000000"
return amt return amt
} }
if (isNaN(minamt) || minamt < 1 || minamt > 1000000 || minamt > maxamt) { if (isNaN(prtick) || prtick < 10 ) {
document.getElementById("error2").innerHTML = "Min 1 - 1000000 and must be lower than max" document.getElementById("error2").innerHTML = "Ticket pricket must be higher than 10"
return amt
}
if (isNaN(amt) || amt < 1 || amt > 1000) {
document.getElementById("error2").innerHTML = "Amount of uses must be between 1 - 1000"
return amt
}
if (isNaN(tme) || tme < 1 || tme > 86400) {
document.getElementById("error2").innerHTML = "Max waiting time 1 day (86400 secs)"
return amt return amt
} }
postAjax( postAjax(
"{{ url_for('withdraw.create') }}", "{{ url_for('events.create') }}",
JSON.stringify({"id": unid, "tit": tit, "amt": amt, "maxamt": maxamt, "minamt": minamt, "tme": tme, "wal": wal, "usr": user, "uniq": uniq}), JSON.stringify({"tit": tit, "usr": user, "wal": wal, "notickets": nooftickets,"cldate": cldate, "prtickets": prtick, "id": unid}),
"filla", "filla",
function(data) { location.replace("{{ url_for('withdraw.index') }}?usr=" + user) function(data) { location.replace("{{ url_for('events.index') }}?usr=" + user)
}) })
} }

Loading…
Cancel
Save