Skip to content

Commit

Permalink
[ratings] link the rating to the appropriate search, fixes #936
Browse files Browse the repository at this point in the history
  • Loading branch information
shish committed Aug 18, 2023
1 parent 0c014fd commit d9f80b9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ext/rating/theme.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use MicroHTML\HTMLElement;

use function MicroHTML\emptyHTML;
use function MicroHTML\{P,SPAN,TABLE,TD,TH,TR};
use function MicroHTML\{A,P,TABLE,TD,TH,TR};

class RatingsTheme extends Themelet
{
Expand All @@ -18,10 +18,11 @@ public function get_selection_rater_html(string $name = "rating", array $ratings

public function get_rater_html(int $image_id, string $rating, bool $can_rate): HTMLElement
{
$u_rating = url_escape(Tag::caret($rating));
return SHM_POST_INFO(
"Rating",
$can_rate,
Ratings::rating_to_human($rating),
A(["href"=>make_link("post/list/rating=$u_rating/1")], Ratings::rating_to_human($rating)),
$this->get_selection_rater_html("rating", selected_options: [$rating])
);
}
Expand Down

0 comments on commit d9f80b9

Please sign in to comment.