put back MoveDBox() in, accidentally deleted it

This commit is contained in:
2021-09-05 21:33:46 +10:00
parent 2d4130ed30
commit acd965f5c3

View File

@@ -24,6 +24,54 @@ function RunAIOnSeln(person)
$.ajax({ type: 'POST', data: post_data, url: '/run_ai_on', success: function(data){ window.location='/'; return false; } })
}
function MoveDBox(sps)
{
$('#dbox-title').html('Move Selected File(s) to new directory in Storage Path')
div =`
<div class="form-row col-12">
<p class="col">Moving the following files?</p>
</div>
<form id="mv_fm" class="form form-control-inline col-12" method="POST" action="/move_files">
`
div+=GetSelnAsDiv()
yr=$('.highlight').first().attr('yr')
dt=$('.highlight').first().attr('date')
div+=`
<div class="input-group my-3">
<alert class="alert alert-primary my-auto py-1">
<svg width="20" height="20" fill="currentColor"><use xlink:href="{{url_for('internal', filename='icons.svg')}}#db"/></svg>
`
if( sps.length > 1 ) {
// NB: alert-primary here is a hack to get the bg the same color as the alert primary by
div+= '<select name="storage_rp" class="text-primary alert-primary py-1 border border-primary rounded">'
for(p of sps) {
div+= '<option>'+p+'</option>'
}
div+= '</select>'
} else {
div+= '/'+sps[0]+'/'
div+= '<input type="hidden" name="storage_rp" value="' + sps[0] + '">'
}
div+=`
</alert>
<input id="prefix" type="text" name="prefix" class="text-primary text-right form-control"
`
div+="value="+yr+'/'+dt+"-"
div+=`
"></input>
<input type="text" name="suffix" class="form-control" placeholder="name"> </input>
</div>
<br>
<div class="form-row col-12">
<button onClick="$('#dbox').modal('hide'); return false;" class="btn btn-outline-secondary offset-1 col-2">Cancel</button>
<button onClick="$('#dbox').modal('hide'); $('#mv_fm').submit(); return false;" class="btn btn-outline-primary col-2">Ok</button>
</div>
</form>
`
$('#dbox-content').html(div)
$('#dbox').modal('show')
}
function DelDBox(del_or_undel)
{
to_del = GetSelnAsData()