mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-18 07:23:13 +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);
|
$record = new \record_preview($app, 'RESULT', $pos, '', $app['phraseanet.SE'], $query, $options);
|
||||||
|
|
||||||
|
$index = ($pos - 3) < 0 ? 0 : ($pos - 3);
|
||||||
return $app->json([
|
return $app->json([
|
||||||
'current' => $app['twig']->render('prod/preview/result_train.html.twig', [
|
'current' => $app['twig']->render('prod/preview/result_train.html.twig', [
|
||||||
'records' => $record->get_train(),
|
'records' => $record->get_train(),
|
||||||
|
'index' => $index,
|
||||||
'selected' => $pos
|
'selected' => $pos
|
||||||
])
|
])
|
||||||
]);
|
]);
|
||||||
|
@@ -111,7 +111,6 @@ class record_preview extends record_adapter
|
|||||||
$this->original_item = $record;
|
$this->original_item = $record;
|
||||||
$sbas_id = $record->getDataboxId();
|
$sbas_id = $record->getDataboxId();
|
||||||
$record_id = $record->getRecordId();
|
$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;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -213,11 +212,9 @@ file_put_contents("/tmp/phraseanet_debug", sprintf("%s (%d) pos=%s, rid=%s\n", _
|
|||||||
case 'RESULT':
|
case 'RESULT':
|
||||||
$perPage = 56;
|
$perPage = 56;
|
||||||
$index = ($this->pos - 3) < 0 ? 0 : ($this->pos - 3);
|
$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);
|
$results = $this->searchEngine->query($this->query, $index, $perPage, $this->options);
|
||||||
|
|
||||||
$this->train = $results->getResults()->toArray();
|
$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;
|
break;
|
||||||
case 'BASK':
|
case 'BASK':
|
||||||
$this->train = $this->container->getElements();
|
$this->train = $this->container->getElements();
|
||||||
|
@@ -25,9 +25,9 @@
|
|||||||
{"width":box_w, "height":box_h}
|
{"width":box_w, "height":box_h}
|
||||||
)
|
)
|
||||||
%}
|
%}
|
||||||
|
{% set rec_number = loop.index0 + index %}
|
||||||
<li class="prevTrainCurrent current{{loop.index0}} {% if loop.index0 == selected %}selected{% endif %}">
|
<li class="prevTrainCurrent current{{rec_number}} {% if rec_number == selected %}selected{% endif %}">
|
||||||
<img jsargs="RESULT|{{loop.index0}}|" class="openPreview" src="{{url}}"
|
<img jsargs="RESULT|{{rec_number}}|" class="openPreview" src="{{url}}"
|
||||||
src="{{url}}"
|
src="{{url}}"
|
||||||
style="
|
style="
|
||||||
width:{{fit_size.width}}px;
|
width:{{fit_size.width}}px;
|
||||||
|
Reference in New Issue
Block a user