fix #PHRAS-492

#time 1d
This commit is contained in:
Jean-Yves Gaulier
2015-05-04 19:32:25 +02:00
parent 33bf1ba7d5
commit f77a425ae9
3 changed files with 5 additions and 6 deletions

View File

@@ -227,9 +227,11 @@ class Query implements ControllerProviderInterface
$record = new \record_preview($app, 'RESULT', $pos, '', $app['phraseanet.SE'], $query, $options);
$index = ($pos - 3) < 0 ? 0 : ($pos - 3);
return $app->json([
'current' => $app['twig']->render('prod/preview/result_train.html.twig', [
'records' => $record->get_train(),
'index' => $index,
'selected' => $pos
])
]);

View File

@@ -111,7 +111,6 @@ class record_preview extends record_adapter
$this->original_item = $record;
$sbas_id = $record->getDataboxId();
$record_id = $record->getRecordId();
file_put_contents("/tmp/phraseanet_debug", sprintf("%s (%d) pos=%s, rid=%s\n", __FILE__, __LINE__, $pos, $record_id), FILE_APPEND);
break;
}
break;
@@ -213,11 +212,9 @@ file_put_contents("/tmp/phraseanet_debug", sprintf("%s (%d) pos=%s, rid=%s\n", _
case 'RESULT':
$perPage = 56;
$index = ($this->pos - 3) < 0 ? 0 : ($this->pos - 3);
file_put_contents("/tmp/phraseanet_debug", sprintf("%s (%d) pos=%s, index=%s\n", __FILE__, __LINE__, $this->pos, $index), FILE_APPEND);
$results = $this->searchEngine->query($this->query, $index, $perPage, $this->options);
$this->train = $results->getResults()->toArray();
file_put_contents("/tmp/phraseanet_debug", sprintf("%s (%d) train=%s\n", __FILE__, __LINE__, var_export($this->train, true)), FILE_APPEND);
break;
case 'BASK':
$this->train = $this->container->getElements();

View File

@@ -25,9 +25,9 @@
{"width":box_w, "height":box_h}
)
%}
<li class="prevTrainCurrent current{{loop.index0}} {% if loop.index0 == selected %}selected{% endif %}">
<img jsargs="RESULT|{{loop.index0}}|" class="openPreview" src="{{url}}"
{% set rec_number = loop.index0 + index %}
<li class="prevTrainCurrent current{{rec_number}} {% if rec_number == selected %}selected{% endif %}">
<img jsargs="RESULT|{{rec_number}}|" class="openPreview" src="{{url}}"
src="{{url}}"
style="
width:{{fit_size.width}}px;