Multi-images component, refactoring medias functions

This commit is contained in:
Ludovic CANDELLIER
2022-04-16 19:33:17 +02:00
parent 4d31b1682c
commit f460865a57
16 changed files with 559 additions and 9192 deletions

View File

@@ -76,10 +76,13 @@ class ArticlesDataTable extends DataTable
->editColumn('tags2', function (Article $article) {
$html = '';
foreach ($article->tags as $tag) {
$html .= '<span class="btn btn-xs btn-success pb-2">' . Tags::getFullnameByTag($tag) . '</span> ';
$html .= '<span class="btn btn-xs btn-success pb-2 mb-1" style="font-size: 0.8em;">' . Tags::getFullnameByTag($tag) . '</span> ';
}
return $html;
})
->editColumn('images_count2', function (Article $article) {
return Articles::countFullImagesByArticle($article);
})
->rawColumns(['tags2', 'thumb', 'action']);
return parent::modifier($datatables);
}
@@ -97,6 +100,7 @@ class ArticlesDataTable extends DataTable
Column::make('categories_count')->title('#Ray')->class('text-right')->searchable(false)->width(40),
Column::make('offers_count')->title('#Ofr')->class('text-right')->searchable(false)->width(40),
Column::make('images_count')->title('#Pho')->class('text-right')->searchable(false)->width(40),
Column::make('images_count2')->title('#PhoH')->class('text-right')->searchable(false)->orderable(false)->width(40),
$this->makeColumnButtons(),
];
}