Skip to content

Commit 7067dc8

Browse files
committed
Add GSoC report link for completed tasks
This commit adds the corresponding GSoC report link for completed tasks. Closes #703
1 parent f287fab commit 7067dc8

File tree

5 files changed

+44
-1
lines changed

5 files changed

+44
-1
lines changed

Diff for: data/projects.liquid

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
{
66
"name" : "{{ post.name }}",
77
"desc" : "{{ post.desc }}",
8+
"report" : "{{ post.report }}",
89
"requirements" : [{% for req in post.requirements %}"{{ req }}"{% unless forloop.last %},{% endunless %}
910
{% endfor %}],
1011
"difficulty" : "{{ post.difficulty }}",

Diff for: data/reports.liquid

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
---
3+
[
4+
{% for report in site.reports %}
5+
{
6+
"categories": [{% for category in report.categories %}"{{ category }}"{% unless forloop.last %},{% endunless %}{% endfor %}],
7+
"date": "{{ report.date }}",
8+
"student": "{{ report.student }}",
9+
"project": "{{ report.project }}",
10+
"project_link": "{{ report.project_link }}",
11+
"url": "{{ report.url }}"
12+
}{% unless forloop.last %},{% endunless %}{% endfor %}
13+
]

Diff for: partials/tabs/projects.html

+4
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@
6060
<div ng-show="currentProject.initiatives.length>0">
6161
<div class="small-heading uppercase">Initiatives</div> <span class="chip" ng-repeat="initiative in currentProject.initiatives">{{ initiative }}</span>
6262
<br> </div>
63+
<div ng-show="currentProject.report.url.length>0">
64+
<div class="small-heading uppercase">GSoC</div>
65+
<span class="chip gsoc-report" ng-click="redirectToReport()">Report</span>
66+
</div>
6367
<div ng-show="currentProject.collaborating_projects.length>0">
6468
<div class="small-heading uppercase">Collaborating projects</div> <span class="pr-element-detail chip" ng-repeat="project in currentProject.collaborating_projects">{{ project }}</span>
6569
<br> </div>

Diff for: resources/css/style.css

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
.gsoc-report {
2+
cursor: pointer;
3+
}
14
.hash_value_dup {
25
position: 'absolute';
36
left: '-9999px';

Diff for: resources/js/app.js

+23-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
}
8888
})
8989

90-
app.directive('projects', ['$http', '$timeout', '$location', 'Languages', function ($http, $timeout, $location, Languages) {
90+
app.directive('projects', ['$http', '$timeout', '$location', '$window', 'Languages', function ($http, $timeout, $location, $window, Languages) {
9191
return {
9292
restrict: 'E',
9393
templateUrl: '/partials/tabs/projects.html',
@@ -110,6 +110,7 @@
110110
.then(function (res) {
111111
$scope.projectList = res.data;
112112
$scope.projectRequest();
113+
$scope.mapReportToProject();
113114
})
114115
}
115116

@@ -281,6 +282,27 @@
281282
$scope.searchText = search_requested
282283
}
283284

285+
$scope.redirectToReport = function () {
286+
$window.open($scope.currentProject.report.url, '_blank');
287+
}
288+
289+
$scope.mapReportToProject = function () {
290+
$http.get('data/reports.liquid')
291+
.then(function (res) {
292+
angular.forEach(res.data, function (report) {
293+
var completed_project = report.project.toLowerCase()
294+
angular.forEach($scope.projectList, function (project) {
295+
if (
296+
project.status.indexOf('completed') !== -1 && project.mentors.length > 0 &&
297+
completed_project === project.name.toLowerCase()
298+
) {
299+
project.report = report
300+
}
301+
})
302+
})
303+
})
304+
}
305+
284306
},
285307
controllerAs: 'lc'
286308
}

0 commit comments

Comments
 (0)