Skip to content

Commit 5dbbc34

Browse files
author
Jordan Lovett
committed
Add styles to git stars
1 parent 044ea92 commit 5dbbc34

File tree

3 files changed

+30
-7
lines changed

3 files changed

+30
-7
lines changed

lib/MetaCPAN/Web/Model/ReleaseInfo.pm

+3-3
Original file line numberDiff line numberDiff line change
@@ -93,9 +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 );
98-
$data->{github} = $data->{distribution}->{repo}->{github};
96+
$data->{chat} = $self->_get_chat( $release, $dist );
97+
$data->{issues} = $self->_get_issues( $release, $dist );
98+
$data->{github} = $dist->{repo}->{github};
9999
$data->{repository} = $self->_get_repository( $release, $dist );
100100

101101
Future->done($data);

root/inc/favorite.tx

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
</div>
1313
%% if $github && $repository.url {
1414
<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>
15+
<a href="[% $repository.url %]" target="_blank" class="btn btn-primary" title="View on GitHub">
16+
⭐ Starred <span>[% $github.stars %]</span>
1717
<span class="sr-only">GitHub stars</span>
1818
</a>
1919
</div>

root/static/less/global.less

+25-2
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,10 @@ a.favorite {
110110
display: inline-block;
111111
line-height: 1;
112112
text-align: right;
113-
min-width: 25px;
114113
position: relative;
115-
top: -1px;
116114
font-size: @font-size-base;
117115
font-weight: normal;
116+
height: 100%;
118117
min-width: 35px;
119118
cursor: pointer;
120119

@@ -236,6 +235,30 @@ a.ellipsis:hover * {
236235
margin-bottom: 1px;
237236
}
238237

238+
.star-rating {
239+
& a.btn.btn-primary {
240+
padding: 1px 3px;
241+
font-size: 0.9em;
242+
background: #f0f0f0 linear-gradient(to bottom, #fbfbfb, #f0f0f0);
243+
color: #000;
244+
min-width: 25px;
245+
position: relative;
246+
font-size: @font-size-base;
247+
font-weight: normal;
248+
min-width: 35px;
249+
border-color: #e0e0e0;
250+
line-height: 1.54em;
251+
252+
&:hover {
253+
background: #36c linear-gradient(to bottom, #69f, #36c);
254+
color: #fff;
255+
border-color: #36c;
256+
opacity: 1;
257+
text-decoration: none;
258+
}
259+
}
260+
}
261+
239262
/* Contributors list on release pages
240263
* see /release/Plack for example
241264
*/

0 commit comments

Comments
 (0)