[theme] add data-rating attribute to thumbnails
This commit is contained in:
parent
55d5dc0a35
commit
ef3492e9b5
1 changed files with 14 additions and 9 deletions
|
@ -79,16 +79,21 @@ class BaseThemelet
|
|||
}
|
||||
}
|
||||
|
||||
$attrs = [
|
||||
"href" => $view_link,
|
||||
"class" => "thumb shm-thumb shm-thumb-link $custom_classes",
|
||||
"data-tags" => $tags,
|
||||
"data-height" => $image->height,
|
||||
"data-width" => $image->width,
|
||||
"data-mime" => $image->get_mime(),
|
||||
"data-post-id" => $id,
|
||||
];
|
||||
if(Extension::is_enabled(RatingsInfo::KEY)) {
|
||||
$attrs["data-rating"] = $image->rating;
|
||||
}
|
||||
|
||||
return A(
|
||||
[
|
||||
"href" => $view_link,
|
||||
"class" => "thumb shm-thumb shm-thumb-link $custom_classes",
|
||||
"data-tags" => $tags,
|
||||
"data-height" => $image->height,
|
||||
"data-width" => $image->width,
|
||||
"data-mime" => $image->get_mime(),
|
||||
"data-post-id" => $id,
|
||||
],
|
||||
$attrs,
|
||||
IMG(
|
||||
[
|
||||
"id" => "thumb_$id",
|
||||
|
|
Reference in a new issue