can now do an AI search if we add refimg to new/existing person, cleaned up that dialog to look better with buttons for those options rather than a link. Noticed BUG-100, 2 x mich in one image
This commit is contained in:
@@ -309,9 +309,9 @@ function CreatePersonAndRefimg( key )
|
||||
})
|
||||
}
|
||||
|
||||
function AddRefImgTo( person_id, key )
|
||||
function AddRefimgTo( person_id, key, search )
|
||||
{
|
||||
d='&face_id='+item[key].id+'&person_id='+person_id+'&refimg_data='+item[key].refimg_data
|
||||
d='&face_id='+item[key].id+'&person_id='+person_id+'&refimg_data='+item[key].refimg_data+'&search='+search
|
||||
$.ajax({ type: 'POST', data: d, url: '/add_refimg_to_person',
|
||||
success: function(data) {
|
||||
objs[current].faces[item[key].which_face].who=data.who
|
||||
@@ -328,21 +328,30 @@ function AddRefImgTo( person_id, key )
|
||||
// and displays results in #search_person_results
|
||||
function SearchForPerson(content, key, face_id, face_pos, type_id)
|
||||
{
|
||||
console.log( 'type_id=' + item[key].type_id )
|
||||
// make URI safe
|
||||
who = encodeURIComponent( $('#stext').val() )
|
||||
// call ajax to find ppl
|
||||
$.ajax({ type: 'POST', data: null, url: '/find_persons/'+ who,
|
||||
success: function(data) {
|
||||
for( var el in data ) {
|
||||
content+='<div class="row">'
|
||||
var person = data[el];
|
||||
// NMO_1 is a non-match-override type_id==1 (or force match to existing person)
|
||||
if( key == "NMO_1" )
|
||||
content+= '<a role=button class="link link-primary" onClick="OverrideForceMatch('+person.id+',\''+key+'\')">'
|
||||
+person.firstname+' '+person.surname+' ('+person.tag+')</a><br>'
|
||||
{
|
||||
func='OverrideForceMatch('+person.id+',\''+key+'\' )'
|
||||
func_sn=func_func_ao=func
|
||||
}
|
||||
if( key == 'no_match_new_refimg' )
|
||||
content+= '<a role=button class="link link-primary" onClick="AddRefImgTo('+person.id+',\''+key+'\')">'
|
||||
+person.firstname+' '+person.surname+' ('+person.tag+')</a><br>'
|
||||
{
|
||||
func='AddRefimgTo('+person.id+',\''+key+'\''
|
||||
func_sn=func+ ', true )'
|
||||
func_ao=func+ ', false )'
|
||||
}
|
||||
content+= '<div class="col">' + person.tag + ' (' + person.firstname+' '+person.surname+ ') </div><div class="col input-group">'
|
||||
content+= '<button onClick="'+func_sn+'" class="btn btn-success py-1 input-group-prepend">Add & search now</a> '
|
||||
content+= '<button onClick="'+func_ao+'" class="btn btn-outline-success py-1 input-group-append">Add only</a></div>'
|
||||
content+='</div class="row">'
|
||||
}
|
||||
$('#search_person_results').html( content )
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user