Skip to content

Commit 83e67ac

Browse files
committed
Add GitHub stars to favorite.tx
1 parent 1294326 commit 83e67ac

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

lib/MetaCPAN/Web/Model/ReleaseInfo.pm

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,9 @@ sub _fetch {
9393
my $release = $data->{release};
9494
my $dist = $data->{distribution};
9595

96-
$data->{chat} = $self->_get_chat( $release, $dist );
97-
$data->{issues} = $self->_get_issues( $release, $dist );
96+
$data->{chat} = $self->_get_chat( $release, $dist );
97+
$data->{issues} = $self->_get_issues( $release, $dist );
98+
$data->{github} = $data->{distribution}->{repo}->{github};
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 $github && $repository.url {
14+
<div class="star-rating">
15+
<a href="[% $repository.url %]" target="_blank" class="btn btn-primary">
16+
⭐ Starred <span class="badge badge-primary">[% $github.stars %]</span>
17+
<span class="sr-only">GitHub stars</span>
18+
</a>
19+
</div>
20+
%% }

0 commit comments

Comments
 (0)