Skip to content
This repository has been archived by the owner on Jun 14, 2020. It is now read-only.

Improve Profile Pages #158

Merged
merged 87 commits into from
Sep 26, 2018
Merged
Show file tree
Hide file tree
Changes from 81 commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
83f1607
[ui] make avatar adder and avatar same width
brillout Sep 12, 2018
a8ccc01
improve ui
brillout Sep 12, 2018
365d00e
improve ui
brillout Sep 12, 2018
381a990
improve ui
brillout Sep 12, 2018
4b5fb40
improve ui
brillout Sep 12, 2018
fc7c164
improve ui
brillout Sep 12, 2018
40af5ee
improve ui
brillout Sep 12, 2018
57e6852
improve ui
brillout Sep 12, 2018
d0e426d
improve ui
brillout Sep 12, 2018
6eea7d3
improve ui
brillout Sep 12, 2018
3c3a351
improve ui
brillout Sep 13, 2018
2c40c5b
improve ui
brillout Sep 13, 2018
4f6f561
improve ui
brillout Sep 13, 2018
510d5c7
improve ui
brillout Sep 13, 2018
5a42b4e
improve ui
brillout Sep 13, 2018
5bc6a5c
improve ui
brillout Sep 13, 2018
ad94f9c
improve ui
brillout Sep 13, 2018
6b76dab
improve ui
brillout Sep 13, 2018
77f2595
improve ui
brillout Sep 13, 2018
099f0fb
improve ui
brillout Sep 13, 2018
c797af8
improve ui
brillout Sep 13, 2018
6ce5d9c
improve ui
brillout Sep 13, 2018
9f8be5e
improve ui
brillout Sep 13, 2018
09290b5
improve ui
brillout Sep 13, 2018
445cb53
improve ui
brillout Sep 14, 2018
02e0a84
improve ui
brillout Sep 14, 2018
1d81664
improve ui
brillout Sep 14, 2018
ac97d0b
improve ui
brillout Sep 14, 2018
c1655c0
improve ui
brillout Sep 14, 2018
b71564f
improve ui
brillout Sep 15, 2018
0168e21
improve ui
brillout Sep 15, 2018
8b340e5
improve ui
brillout Sep 15, 2018
39e9378
improve ui
brillout Sep 15, 2018
1c1d334
improve ui
brillout Sep 15, 2018
f7c34b7
improve ui
brillout Sep 15, 2018
d4d7354
feedback
lourot Sep 16, 2018
4ee6b25
improve ui
brillout Sep 17, 2018
7203e65
improve ui
brillout Sep 17, 2018
9737c50
improve ui
brillout Sep 17, 2018
37fabba
improve ui
brillout Sep 17, 2018
34eddea
improve ui
brillout Sep 17, 2018
70c6182
improve ui
brillout Sep 17, 2018
c81a299
improve ui
brillout Sep 18, 2018
79eb28a
improve ui
brillout Sep 18, 2018
08867de
improve ui
brillout Sep 18, 2018
6bbcd38
improve ui
brillout Sep 19, 2018
6ff8d25
improve ui
brillout Sep 19, 2018
73223be
improve ui
brillout Sep 19, 2018
70be556
improve ui
brillout Sep 19, 2018
d719508
improve ui
brillout Sep 19, 2018
bed8712
improve ui
brillout Sep 19, 2018
6079d7e
improve ui
brillout Sep 19, 2018
ee1f417
improve ui - new ranking calculation
brillout Sep 20, 2018
f2df734
improve ui - new ranking calculation
brillout Sep 20, 2018
6aa393e
improve ui - new ranking calculation
brillout Sep 20, 2018
61ad6d4
feedback
lourot Sep 20, 2018
b830def
minor link hovering improvement
lourot Sep 20, 2018
9fe8213
feedback
lourot Sep 20, 2018
a9baa86
improve ui - new ranking calculation
brillout Sep 20, 2018
574444a
improve ui - new ranking calculation
brillout Sep 20, 2018
c975bd8
improve ui -- add collapsible icon
brillout Sep 20, 2018
fefc66e
feedback
lourot Sep 21, 2018
57e661f
improve ui
brillout Sep 21, 2018
6a6b265
improve ui
brillout Sep 21, 2018
a469869
improve ui
brillout Sep 21, 2018
568601c
improve ui
brillout Sep 21, 2018
9782d1c
improve ui
brillout Sep 21, 2018
d2f9297
improve ui
brillout Sep 21, 2018
daa1867
feedback
lourot Sep 21, 2018
a0af80c
improve ui
brillout Sep 24, 2018
48597cd
improve ui
brillout Sep 24, 2018
390ed1e
improve ui - clean code
brillout Sep 24, 2018
79b4bff
improve ui - clean code
brillout Sep 24, 2018
38d60d5
improve ui - clean code
brillout Sep 24, 2018
131713c
improve ui - clean code
brillout Sep 24, 2018
0e6331f
improve ui - clean code
brillout Sep 24, 2018
de5fbaa
improve ui - clean code
brillout Sep 24, 2018
b3a998b
improve ui - clean code
brillout Sep 24, 2018
cb711b0
improve ui - clean code
brillout Sep 24, 2018
8eeeb7a
improve ui -- updated screenshots
brillout Sep 24, 2018
695fe26
improve ui -- updated screenshots
brillout Sep 24, 2018
e616d9a
Cleaned up spelling dictionary.
lourot Sep 25, 2018
adfb957
Adapted markdown to screenshot.
lourot Sep 25, 2018
0766a69
Fixed typo.
lourot Sep 25, 2018
6d6dda5
Simplified CSS.
lourot Sep 25, 2018
3314a3c
[ui] minor
brillout Sep 26, 2018
35f0bde
[ui] fallback to org avatar when no repo avatar set for one-liner con…
brillout Sep 26, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .spelling
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,13 @@ Ruf
Weisz
Mehtab
2018-09-14
ballot_box_with_check
black_square_button
tooltips
readme
yay
tooltip
ghuser
reframe-on-up
myberl.in
mybeir.ut
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ We love the default GitHub profiles and we want to enhance them:
GitHub. We are showing them **all**, even those you don't own and those owned by organizations
you're not in.<sup>[1](#footnote1)</sup>
* The GitHub profiles are listing all the repos you own but they sort them only by age of the
latest commit. We prefer to **sort repos** by a combination of how active they are, how much you
have contributed to them, how popular they are, etc. For each user we want to see first the latest
greatest repos they have most contributed to.
* On GitHub only repos earn stars. We push it one step further by transferring these **stars to
users**. If you have built 23% of a 145 stars repo, you deserve 33 stars for that contribution. We
add all these stars and clearly show how many of them you earned in total.
latest commit. We prefer to **sort repos** by a combination of how much you
have contributed to them, their size, how popular they are, etc. For each user we want to see
first the latest greatest repos they have most contributed to.
* On GitHub only repos earn stars. We push it one step further by having **users earn stars**:
You earn stars when you contribute to a repo.
We add all these earned stars and show how many you've earned in total.
* The GitHub profiles don't clearly show how big your contribution to a repo was, when you don't own
it. Maybe you wrote 5%. Maybe 90%. We **make it clear**.
* GitHub detects programming languages. We want to also know about
Expand Down
Binary file modified docs/repo-settings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/screenshot-data-age.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions reframe/views/All.css
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ a:hover
display: inline-block;
color: #bcc0c4;
}
/* avoid external link icon above to be shown in a new line */
.external {
white-space: nowrap;
}

.container-lg {
max-width: 1012px;
Expand All @@ -64,3 +68,22 @@ a:hover
.text-bold {
font-weight: 600;
}

body {
padding-bottom: 90px;
}

.emoji {
height: 1.3em;
width: auto;
}

.icon-vertical-align {
vertical-align: middle !important;
}

/* TODO remove this */
/* this is too global */
.icon {
vertical-align: middle !important;
}
27 changes: 27 additions & 0 deletions reframe/views/profile/Avatar.css
Original file line number Diff line number Diff line change
@@ -1,8 +1,35 @@
.avatar {
max-width: 100%;
height: auto;
display: inline-flex;
align-items: center;
justify-content: center;
}

.avatar-add-sign {
vertical-align: middle;
}

.avatar-small {
float: left;
width: 50px;
height: 50px;
margin-right: .5em;
margin-bottom: -.5em;
}

.avatar-add {
border-width: medium !important;
text-align: center;
opacity: 0.55;
transition: opacity 0.5s;
}
.avatar-add:hover {
opacity: 1;
}
.avatar-add-sign {
display: inline-block;
background-color: #eee;
width: 24px;
margin-top: -5px;
}
11 changes: 3 additions & 8 deletions reframe/views/profile/Avatar.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,8 @@ import React from 'react';

import './Avatar.css';

const Avatar = props => {
if (props.type == "add") { // special button for explaining how to add an avatar
return <div className={`avatar border border-white rounded ${props.classes}`}>
<span className="avatar-add-sign">+</span>
</div>;
}
return <img className={`avatar border border-white rounded ${props.classes}`} src={props.url} />;
};
const Avatar = ({classes, url}) => (
<img className={`avatar border border-white rounded ${classes}`} src={url} />
);

export default Avatar;
11 changes: 11 additions & 0 deletions reframe/views/profile/AvatarAdd.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from 'react';

export default AvatarAdd;

function AvatarAdd() {
return (
<div className="avatar border border-white rounded avatar-small avatar-add">
<span className="avatar-add-sign text-gray">+</span>
</div>
);
}
9 changes: 3 additions & 6 deletions reframe/views/profile/leftpanel/LeftPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,17 @@ import VCardDetails from './VCardDetails';
import './LeftPanel.css';
import Avatar from '../Avatar';
import {urls} from '../../../ghuser';
import {getTotalEarnedStars} from './../rightpanel/contrib/badges/Badges';

const LeftPanel = props => {
let stars = 0;
for (const repo in props.contribs && props.contribs.repos) {
const contrib = props.contribs.repos[repo];
stars += contrib.percentage * contrib.stargazers_count / 100;
}
const totalEarnedStars = getTotalEarnedStars(props.contribs);

return (
<div className="col-3 p-0 pr-4">
<Avatar url={props.user.avatar_url || AvatarUnknown} classes="avatar-user" />
<VCard login={props.user.login}
name={!props.user.ghuser_created_at && 'Your name here' || props.user.name}
url={props.user.html_url} stars={stars} />
url={props.user.html_url} stars={totalEarnedStars} />
<Bio text={
props.user.ghuser_being_created && "This profile is being created..." ||
!props.user.ghuser_created_at && "I love coding and I'm about to create my profile on ghuser.io :)" ||
Expand Down
28 changes: 5 additions & 23 deletions reframe/views/profile/leftpanel/Orgs.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,39 +11,21 @@ const Orgs = props => {
</a>
);

const memberOf = [];
for (const org of props.userOrgs) {
if (props.allOrgs[org]) {
memberOf.push(orgAvatar(org));
}
}
const contributedTo = [];
for (const org of props.contribOrgs) {
if (props.allOrgs[org]) {
contributedTo.push(orgAvatar(org));
}
}

if (!memberOf.length && !contributedTo.length) {
return <div></div>;
}

const sections = [];
let classes = 'mb-1';
if (memberOf.length) {
sections.push(<div key='memberOf'><h4 className={classes}>Member of</h4>{memberOf}</div>);
}
if (contributedTo.length) {
if (memberOf.length) {
classes = `mt-4 ${classes}`;
}
sections.push(
<div key='contributedTo'><h4 className={classes}>Contributed to</h4>{contributedTo}</div>
);
if( contributedTo.length===0 ) {
return null;
}

return (
<div className={withSeparator('top', 3)}>{sections}</div>
<div className={withSeparator('top', 3)}>
<div key='contributedTo'><h4 className="mb-1">Contributed to</h4>{contributedTo}</div>
</div>
);
};

Expand Down
9 changes: 9 additions & 0 deletions reframe/views/profile/leftpanel/VCard.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,13 @@

.vcard-stars {
white-space: nowrap;
position: relative;
border-radius: 5px;
padding-top: 1px;
padding-bottom: 1px;
padding-left: 5px;
padding-right: 7px;

border: 1px solid #e0e0e0;
background-color: #fafafa;
}
34 changes: 22 additions & 12 deletions reframe/views/profile/leftpanel/VCard.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,31 @@
import React from 'react';

import './VCard.css';
import {bigNum} from '../numbers';
import {bigNum} from '../../utils/pretty-numbers';

const VCard = props => {
const stars = Math.round(props.stars);
const VCard = props => (
<div className="py-3">
<h1>
<div className="vcard-fullname">{props.name}</div>
<div className="vcard-username" style={{marginTop: -3, lineHeight: '1.7em'}}>
<a className="vcard-username-login mr-3" href={props.url} target="_blank"><i className="fab fa-github"></i> {props.login}</a>
<Stars {...props}/>
</div>
</h1>
</div>
);

const Stars = ({stars, login}) => {
stars = Math.round(stars);
if( stars < 1 ) {
return null;
}
return (
<div className="py-3">
<h1>
<div className="vcard-fullname">{props.name}</div>
<div className="vcard-username">
<a className="vcard-username-login mr-3" href={props.url} target="_blank"><i className="fab fa-github"></i> {props.login}</a>
{stars >= 1 && <span className="vcard-stars">★ {bigNum(stars)}</span>}
</div>
</h1>
</div>
<span className="vcard-stars" title={login+" has earned a total of "+stars+" stars"}>
<span className="earned-stars-icon-color">★</span>
&nbsp;
<span className="earned-stars-text-color">{bigNum(stars)}</span>
</span>
);
};

Expand Down
49 changes: 0 additions & 49 deletions reframe/views/profile/rightpanel/RightPanel.css

This file was deleted.

42 changes: 16 additions & 26 deletions reframe/views/profile/rightpanel/RightPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import * as Parser from 'html-react-parser';
import {urls} from '../../../ghuser';
import CreateYourProfile from './CreateYourProfile';
import ProfileBeingCreated from './ProfileBeingCreated';
import Contrib from './contrib/Contrib';
import './RightPanel.css';
import {Contrib} from './contrib/Contrib';
import {getContribDisplayOrder} from './contrib/getContribScore';

const RightPanel = props => {
// Use these queues to avoid filling up the event loop:
Expand All @@ -21,24 +21,23 @@ const RightPanel = props => {
);
};

const compare = (a, b) => {
if (a.total_score < b.total_score) {
return 1;
}
if (a.total_score > b.total_score) {
return -1;
}
return 0;
};

const repos = [];

if (props.contribs) {
const contribs = Object.values(props.contribs.repos);
contribs.sort(compare);
contribs.sort(getContribDisplayOrder);

const uniqueNames = [];
for (const contrib of contribs) {
for (const i in contribs) {
const contrib = contribs[i];

// Don't include repos where user has made 0 commits. This happens when a user
lourot marked this conversation as resolved.
Show resolved Hide resolved
// makes a PR that is not merged.
if( contrib.percentage===0 ) {
continue;
}


// We don't want to have two repos with the same name. This happens when a user is
// contributing to a project and has a fork with the same name:
if (uniqueNames.indexOf(contrib.name) > -1) {
Expand All @@ -48,6 +47,7 @@ const RightPanel = props => {

repos.push(
<Contrib key={contrib.full_name} username={props.username} contrib={contrib}
i={i}
pushToFunctionQueue={pushToFunctionQueue} />
);
}
Expand Down Expand Up @@ -93,22 +93,12 @@ const RightPanel = props => {

return (
<div className="col-9 pl-2 pr-0">
<div className="user-profile-nav">
<nav className="UnderlineNav-body">
<a href="javascript:;" className="UnderlineNav-item selected" aria-selected="true" role="tab">
Contributions
</a>
{/*<a href="javascript:;" className="UnderlineNav-item" aria-selected="false" role="tab">
Other tab
</a>*/}
</nav>
</div>
<div className="contribs">
<div className="contribs" style={{fontSize: '14px'}}>
{repos}
</div>
{
props.contribs &&
<div className="updated-hint text-gray">
<div className="text-gray" style={{textAlign: 'right'}}>
<small><i>Updated {moment(props.fetchedat).fromNow()}.</i></small>
</div>
}
Expand Down
7 changes: 0 additions & 7 deletions reframe/views/profile/rightpanel/contrib/Badge.js

This file was deleted.

Loading