Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various "minor" changes (4) #1435

Merged
merged 21 commits into from
Jun 20, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
Prev Previous commit
Next Next commit
Adjust contributors to not just from Reddit
  • Loading branch information
Hans5958 committed Jun 20, 2023
commit 5dca84020e301b957b0f9410419be325e1a3c472
32 changes: 25 additions & 7 deletions web/_js/about.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,35 @@
* Licensed under AGPL-3.0 (https://place-atlas.stefanocoding.me/license.txt)
*/

const redditWrapperEl = document.querySelector('#reddit-contributors-wrapper')
const contributorsEl = document.querySelector('#contributors-wrapper')

// <i aria-label="GitHub" class="bi bi-github"></i>
const gitHubEl = document.createElement("i")
gitHubEl.ariaLabel = "GitHub:"
gitHubEl.className = "bi bi-github"

fetch('all-authors.txt')
.then(response => response.text())
.then(text => text.trim().split('\n').sort())
.then(text => text.trim().split('\n').sort((a, b) => {
const aSplit = a.split(':')
const bSplit = b.split(':')
return aSplit[aSplit.length - 1] > bSplit[bSplit.length - 1]
}))
.then(contributors => {
document.querySelector('#reddit-contributors-count').textContent = contributors.length
document.querySelector('#contributors-count').textContent = contributors.length
for (const contributor of contributors) {
const userEl = document.createElement('a')
userEl.href = 'https://reddit.com/user/' + contributor
userEl.textContent = contributor
redditWrapperEl.appendChild(userEl)
redditWrapperEl.appendChild(document.createTextNode(' '))
const contributorSplit = contributor.split(':')
if (contributorSplit[0] === "gh") {
const contributor1 = contributorSplit[1]
userEl.href = 'https://github.com/' + contributor1
userEl.appendChild(gitHubEl.cloneNode())
userEl.appendChild(document.createTextNode(' ' + contributor1))
} else {
userEl.href = 'https://reddit.com/user/' + contributor
userEl.textContent = contributor
}
contributorsEl.appendChild(userEl)
contributorsEl.appendChild(document.createTextNode(' '))
}
})
6 changes: 3 additions & 3 deletions web/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,10 @@ <h3>Project Contributors</h3>
</ul>
</li>
</ul>
<h3>Reddit Contributors</h3>
<p>The 2022 Atlas would not have been possible without the help of our <span id="reddit-contributors-count"></span> Reddit contributors.</p>
<h3>Contributors</h3>
<p>The 2022 Atlas would not have been possible without the help of our <span id="contributors-count"></span> contributors.</p>
<p>Thank you to everyone who submitted new entries, amended existing ones, reported bugs and just supported the project in general.</p>
<div id="reddit-contributors-wrapper" style="text-align: justify;"></div>
<div id="contributors-wrapper" style="text-align: justify;"></div>
</div>
</div>
<div class="col-md-5 col-xl-4">
Expand Down