Skip to content
Next
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
www-gitlab-com
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
1,461
Issues
1,461
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1,272
Merge Requests
1,272
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Security & Compliance
Security & Compliance
Dependency List
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
GitLab.com
www-gitlab-com
Commits
c37fb8da
Commit
c37fb8da
authored
May 24, 2019
by
David Planella
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reworked Hackathon page layout, added MR counter
parent
a327be7c
Pipeline
#63082970
passed with stages
in 26 minutes and 42 seconds
Changes
2
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
112 additions
and
53 deletions
+112
-53
source/community/hackathon/index.html.haml
source/community/hackathon/index.html.haml
+73
-53
source/javascripts/hackathon.js
source/javascripts/hackathon.js
+39
-0
No files found.
source/community/hackathon/index.html.haml
View file @
c37fb8da
This diff is collapsed.
Click to expand it.
source/javascripts/hackathon.js
View file @
c37fb8da
...
...
@@ -10,3 +10,42 @@ function setupHackathonCountdown() {
setupHackathonCountdown
();
})();
// Use the GitLab API to fetch the number of MRs submitted during the Hackathon
// It assumes there is a tracking issue that contains the list of MRs as
// related merge requests
// Hackathon tracker issue. Update the issue ID for each Hackathon
// E.g. on https://gitlab.com/gitlab-com/marketing/community-relations/contributor-program/hackathon/issues/18
// the issue ID is '18'
var
hackathonIssueID
=
'
14
'
;
var
apiHost
=
'
https://gitlab.com/api/v4
'
;
var
gitlabProjectID
=
'
9821951
'
;
var
apiEndpoint
=
'
/projects/
'
+
gitlabProjectID
+
'
/issues/
'
+
hackathonIssueID
+
'
/related_merge_requests
'
;
// TODO: needs pagination
var
apiPagination
=
'
?per_page=100
'
;
var
apiURL
=
apiHost
+
apiEndpoint
+
apiPagination
;
var
request
=
new
XMLHttpRequest
();
request
.
open
(
'
GET
'
,
apiURL
,
true
);
request
.
onload
=
function
()
{
var
data
=
JSON
.
parse
(
this
.
response
);
var
mrCount
=
0
;
var
boxMessage
=
''
;
if
(
request
.
status
>=
200
&&
request
.
status
<
400
)
{
data
.
forEach
(
mr
=>
{
mrCount
+=
1
;
});
boxMessage
=
mrCount
+
'
MRs submitted
'
+
'
at the last Hackathon
'
;
}
else
{
boxMessage
=
'
Error fetching merge requests
'
;
}
document
.
getElementById
(
'
hackathonMRCount
'
).
innerHTML
=
boxMessage
;
}
request
.
send
();
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment