Skip to content

Commit 0cbdd90

Browse files
Cima9642jbampton
andauthored
Add Most/Least Gists sorting filter (#144)
* new branch commit * testing layout * switching branches * updated TODOs * potential fix * fixed 141 completed * updating gitignore * removed venv from repo * Update layout.html --------- Co-authored-by: John Bampton <jbampton@users.noreply.github.com>
1 parent f16932c commit 0cbdd90

3 files changed

Lines changed: 6 additions & 0 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
docs/index.html
55

66
# Python
7+
venv/
78
__pycache__/
89
*.py[cod]
910
*$py.class

docs/script.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ function prepareUserFromJson(user) {
132132
followers: getNum(user.followers),
133133
following: getNum(user.following),
134134
repos: getNum(user.public_repos),
135+
gists: getNum(user.public_gists),
135136
forks: 0,
136137
sponsors: getNum(user.sponsors_count),
137138
sponsoring: getNum(user.sponsoring_count),
@@ -485,6 +486,8 @@ function getSortedUsers(sortBy) {
485486
'following-asc': (a, b) => a.following - b.following,
486487
'repos-desc': (a, b) => b.repos - a.repos,
487488
'repos-asc': (a, b) => a.repos - b.repos,
489+
'gists-desc': (a, b) => b.gists - a.gists,
490+
'gists-asc': (a, b) => a.gists - b.gists,
488491
'forks-desc': (a, b) => b.forks - a.forks,
489492
'forks-asc': (a, b) => a.forks - b.forks,
490493
'sponsors-desc': (a, b) => b.sponsors - a.sponsors,

layouts/layout.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ <h2>🔍 Find Your Favorite Developer</h2>
7171
<option value="following-asc">Least Following</option>
7272
<option value="repos-desc">Most Repos</option>
7373
<option value="repos-asc">Least Repos</option>
74+
<option value="gists-desc">Most Gists</option>
75+
<option value="gists-asc">Least Gists</option>
7476
<option value="forks-desc">Most Forks</option>
7577
<option value="forks-asc">Least Forks</option>
7678
<option value="sponsors-desc">Most Public Sponsors</option>

0 commit comments

Comments
 (0)