Skip to content

Commit 1b8ee0f

Browse files
committed
Add GitHub stars to favorite.tx
1 parent 3ec1713 commit 1b8ee0f

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

lib/MetaCPAN/Web/Model/ReleaseInfo.pm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ sub _fetch {
9595

9696
$data->{chat} = $self->_get_chat( $release, $dist );
9797
$data->{issues} = $self->_get_issues( $release, $dist );
98+
$data->{stars} = $data->{distribution}->{repo}->{github}->{stars} || 0;
9899
$data->{repository} = $self->_get_repository( $release, $dist );
99100

100101
Future->done($data);

root/inc/favorite.tx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,11 @@
1010
<div class="show-logged-out">
1111
<button class="fav-not-logged-in favorite[% if $favorites { %] highlight[% } %]"><span>[% $favorites %]</span> ++</button>
1212
</div>
13+
%% if $stars {
14+
<div class="star-rating">
15+
<button class="btn btn-outline-warning">
16+
<span>⭐</span>
17+
<span>[% $stars %]</span>
18+
</button>
19+
</div>
20+
%% }

0 commit comments

Comments
 (0)