Merge pull request #143 from openclassify/dia

#137 Show ad cover photo, Fixed cover photo not showing if it was saved localy.
This commit is contained in:
Fatih Alp 2019-11-13 12:19:15 +03:00 committed by GitHub
commit b20549ef68
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -83,8 +83,14 @@ class AdvsController extends AdminController
$table->setColumns([ $table->setColumns([
'cover_photo' => [ 'cover_photo' => [
'wrapper' => '<img width="64" src="{value.cover_photo}">', 'wrapper' => function (EntryInterface $entry, Request $request) {
'value' => ['cover_photo' => 'entry.cover_photo'] if (strpos($entry->cover_photo, 'http') === 0) {
$wrapper = '<img width="64" src="'.$entry->cover_photo.'">';
} else {
$wrapper = '<img width="64" src="'.$request->root().$entry->cover_photo.'">';
}
return $wrapper;
},
], ],
'entry.id', 'entry.id',
'name' => [ 'name' => [