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

Hide all-time contributors 2605 #2967

Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
c437713
Change open-community-survey.md's program-area from 'Vote / Represent…
tamara-snyder Jan 11, 2022
259da12
Merge branch 'hackforla:gh-pages' into gh-pages
tamara-snyder Jan 31, 2022
2af1b9b
Merge branch 'upstream-gh-pages' into gh-pages
tamara-snyder Jan 31, 2022
9287276
Updating local repo
tamara-snyder Jan 31, 2022
b22ebc8
Merge branch 'gh-pages' of https://github.com/tamara-snyder/website i…
tamara-snyder Jan 31, 2022
1c5145a
Merge branch 'hackforla:gh-pages' into gh-pages
tamara-snyder Feb 9, 2022
f89c7b3
Merge branch 'gh-pages' of https://github.com/tamara-snyder/website i…
tamara-snyder Feb 15, 2022
ffecc2c
Merge branch 'upstream-gh-pages' into gh-pages
tamara-snyder Feb 15, 2022
a335839
Merge branch 'hackforla:gh-pages' into gh-pages
tamara-snyder Feb 15, 2022
62e41ff
Merge branch 'hackforla:gh-pages' into gh-pages
tamara-snyder Feb 17, 2022
fdb0c81
Merge branch 'upstream-gh-pages' into gh-pages
tamara-snyder Feb 17, 2022
fdbc412
Merge branch 'gh-pages' of https://github.com/tamara-snyder/website i…
tamara-snyder Feb 17, 2022
6b3ab78
Merge branch 'upstream-gh-pages' into gh-pages
tamara-snyder Feb 18, 2022
58493ac
Merge branch 'upstream-gh-pages' into gh-pages
tamara-snyder Mar 4, 2022
71823a3
Merge branch 'upstream-gh-pages' into gh-pages
tamara-snyder Mar 11, 2022
cb7046c
Hide contributors div if number of all time contributors is less than…
tamara-snyder Mar 11, 2022
ab314af
Add explanatory comment
tamara-snyder Mar 11, 2022
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
50 changes: 29 additions & 21 deletions assets/js/project.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,27 +68,35 @@ if(project != null){
}
}

// Creates DOM elements for contributors
for(let contributor of contributorsArray){
if (contributorsArray.length >= 1) {
let contributorDiv = document.createElement('div');
contributorDiv.classList.add('contributor-div');

let contributorProfile = document.createElement('a');
contributorProfile.classList.add('contributor-link');
contributorProfile.setAttribute('href', contributor.github_url);
contributorProfile.setAttribute('target', '_blank');
let contributorUrl = contributor.github_url.split('/');
let contributorName = contributorUrl.pop();
contributorProfile.setAttribute('title', contributorName);

let contributorImg = document.createElement('img');
contributorImg.style['border-radius'] = '12px';
contributorImg.setAttribute('src', contributor.avatar_url);

contributorProfile.appendChild(contributorImg);
contributorDiv.appendChild(contributorProfile);
contributors.appendChild(contributorDiv);
let projectTeam = document.querySelectorAll('.leader-card')

if (contributorsArray.length < projectTeam.length) {
// Hides all-time contributors if number of contributors is less than size of current project team
let contributorSection = document.getElementById('contributor-header');
contributorSection.style.display = 'none';
} else {
// Creates DOM elements for contributors
for(let contributor of contributorsArray){
if (contributorsArray.length >= 1) {
let contributorDiv = document.createElement('div');
contributorDiv.classList.add('contributor-div');

let contributorProfile = document.createElement('a');
contributorProfile.classList.add('contributor-link');
contributorProfile.setAttribute('href', contributor.github_url);
contributorProfile.setAttribute('target', '_blank');
let contributorUrl = contributor.github_url.split('/');
let contributorName = contributorUrl.pop();
contributorProfile.setAttribute('title', contributorName);

let contributorImg = document.createElement('img');
contributorImg.style['border-radius'] = '12px';
contributorImg.setAttribute('src', contributor.avatar_url);

contributorProfile.appendChild(contributorImg);
contributorDiv.appendChild(contributorProfile);
contributors.appendChild(contributorDiv);
}
}
}
} else {
Expand Down