mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 15:03:25 +00:00
fix #PHRAS-492
#time 1d
This commit is contained in:
@@ -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
|
||||
])
|
||||
]);
|
||||
|
@@ -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();
|
||||
|
@@ -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;
|
||||
|
Reference in New Issue
Block a user