Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 3 additions & 0 deletions website/_includes/github.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

<script src="/assets/js/third-party/jquery/jquery-3.3.1.js"></script>
<script src="/assets/js/github/github.js"></script>
23 changes: 23 additions & 0 deletions website/_layouts/github.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
layout: default
---

{% include github.html %}

<article class="post">

<header class="post-header">
<h1 class="post-title">{{ page.title | escape }}</h1>
</header>

<div class="post-content">
{{ content }}
</div>

<h3>Open challenge ideas</h3>
<div id="github-open-challenge-ideas-table">Loading...</div>

<h3>Implemented challenge ideas</h3>
<div id="github-implemented-challenge-ideas-table">Loading...</div>

</article>
5 changes: 5 additions & 0 deletions website/_pages/github.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
layout: github
title: Github
permalink: /github/
---
36 changes: 36 additions & 0 deletions website/assets/js/github/github.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@

function create_issue_table(div_id, issues) {
// Find the appropriate div in the DOM
issues_table_div = $("div[id='"+div_id+"']").first()
// Create a table object to construct
issues_table = $("<table/>")

// Iterate over each issue returned, and create a row for it
$.each(issues, function (index, github_issue) {
console.log(github_issue)
console.log(github_issue.reactions)
issue_row = $('<tr/>')
issue_row.append($('<td/>').append($('<a/>').attr('href', github_issue.html_url).html(github_issue.title)))
issues_table.append(issue_row)
})

// Create some data there
issues_table_div.empty()
issues_table_div.append(issues_table)
}


$.ajax({
// Fetch the open, unimplemented challenge ideas
url: "https://api.github.com/repos/fraz3alpha/running-challenges/issues?labels=new-challenge&state=open",
}).then((result) => {
// Populate a table with these issues
create_issue_table("github-open-challenge-ideas-table", result)
// Fetch the implemented challenges
return $.ajax({
url: "https://api.github.com/repos/fraz3alpha/running-challenges/issues?labels=new-challenge,added&state=closed"
})
}).then((result) => {
// Populate a table with these issues
create_issue_table("github-implemented-challenge-ideas-table", result)
})
20 changes: 20 additions & 0 deletions website/assets/js/third-party/jquery/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Copyright JS Foundation and other contributors, https://js.foundation/

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
6 changes: 6 additions & 0 deletions website/assets/js/third-party/jquery/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

Project website: https://github.com/jquery/jquery

Downloaded from: https://github.com/jquery/jquery/releases

2018-01-10: Version 3.3.1 - https://github.com/jquery/jquery/archive/3.3.1.zip
Loading