torrent detail show tags

This commit is contained in:
xiaomlove
2022-09-17 20:38:54 +08:00
parent 1a0ad86b32
commit cbd6f2c00d
7 changed files with 40 additions and 21 deletions
+7
View File
@@ -126,6 +126,13 @@ if (!$row) {
if ($smalldescription_main == 'yes')
tr($lang_details['row_small_description'],htmlspecialchars(trim($row["small_descr"])),true);
//tag
$torrentTags = \App\Models\TorrentTag::query()->where('torrent_id', $row['id'])->get();
if ($torrentTags->isNotEmpty()) {
$tagRep = new \App\Repositories\TagRepository();
tr($lang_details['row_tags'], $tagRep->renderSpan($torrentTags->pluck('tag_id')->toArray()),true);
}
$size_info = "<b>".$lang_details['text_size']."</b>" . mksize($row["size"]);
$type_info = "&nbsp;&nbsp;&nbsp;<b>".$lang_details['row_type'].":</b>&nbsp;".$row["cat_name"];
$source_info = $medium_info = $codec_info = $audiocodec_info = $standard_info = $processing_info = $team_info = '';
+3 -4
View File
@@ -10,8 +10,7 @@ parked();
* tags
*/
$tagRep = new \App\Repositories\TagRepository();
$tagKeyById = $tagRep->createBasicQuery()->get()->keyBy('id');
$renderKeyArr = $tagKeyById->keys()->toArray();
$allTags = $tagRep->listAll();
$elasticsearchEnabled = nexus_env('ELASTICSEARCH_ENABLED');
//check searchbox
@@ -1143,8 +1142,8 @@ if (!$Cache->get_page()){
}
echo $Cache->next_row();
if ($tagKeyById->isNotEmpty()) {
echo '<tr><td colspan="3" class="embedded" style="padding-top: 4px">' . $tagRep->renderSpan($tagKeyById, $renderKeyArr, true) . '</td></tr>';
if ($allTags->isNotEmpty()) {
echo '<tr><td colspan="3" class="embedded" style="padding-top: 4px">' . $tagRep->renderSpan(['*'], true) . '</td></tr>';
}
?>