Skip to content

Commit

Permalink
Populate some bio when available
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroen committed Aug 15, 2024
1 parent 6558e35 commit 01f0e3f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
3 changes: 3 additions & 0 deletions routes/pkginfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,9 @@ router.get('/:package', function(req, res, next) {
pkgdata._lastupdate = pretty_time_diff(pkgdata._commit.time);
pkgdata._releases = filter_releases(pkgdata);
pkgdata._contributions = filter_contributions(pkgdata);
pkgdata._universe_type = pkgdata._userbio.type;
pkgdata._universe_name = pkgdata._userbio.name;
pkgdata._universe_bio = pkgdata._userbio.description;
pkgdata._checks = pkgdata._binaries.filter(x => x.check).sort((x,y) => `${x.r}${x.os}` < `${y.r}${y.os}` ? 1 : -1);
pkgdata._checksummary = summarize_checks(pkgdata);
res.render('pkginfo', pkgdata);
Expand Down
7 changes: 1 addition & 6 deletions static/sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,7 @@ function load_github_user_info(){
if(user.followers){
$("#github-user-followers").toggleClass("d-none").find('.content').text(countstr(user.followers) + " followers");
}
if(user.type == 'User'){
$("#github-user-avatar").addClass("rounded-circle");
} else {
$("#github-user-avatar").removeClass("rounded-circle");
//$("#github-user-avatar").addClass("p-2");
}
$("#github-user-avatar").toggleClass("rounded-circle", user.type == 'User');
}).catch(function(err){
$("#github-user-bio").text(err);
});
Expand Down
6 changes: 3 additions & 3 deletions views/layout.pug
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,17 @@ html
div(style='width:280px;')
.sidebar-metadata
a(href='/')
img#github-user-avatar.rounded.card-img-top.rounded-circle.p-3(src=`https://r-universe.dev/avatars/${universe}.png?size=248` style='min-height: 262px;')
img#github-user-avatar.rounded.card-img-top.p-3(src=`https://r-universe.dev/avatars/${universe}.png?size=248` style='min-height: 262px;' class=`${_universe_type === 'organization' ? '' : 'rounded-circle'}`)
.card-body
h5.card-title
span#github-user-name
span#github-user-name #{_universe_name}
a#github-user-mastodon.float-end.d-none.grow-on-over(target='_blank')
span.fa-brands.fa-mastodon.fa-fw.me-1(style="color: #6364FF;")
a#github-user-twitter.float-end.d-none.grow-on-over(target='_blank')
span.fa-brands.fa-square-x-twitter.fa-fw.me-1
a#github-user-orcid.float-end.d-none.grow-on-over(target='_blank')
span.fa-brands.fa-orcid.fa-fw.me-1.text-success
p#github-user-bio.card-text
p#github-user-bio.card-text #{_universe_bio}
ul.list-group.list-group-flush.pb-2.sidebar-user-details
li#github-user-universe-row.list-group-item.border-light-subtle.text-truncate
span.fa.fa-satellite-dish.fa-fw.me-3
Expand Down

0 comments on commit 01f0e3f

Please sign in to comment.