Skip to content

Commit 0c0c445

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 4c8db7f commit 0c0c445

File tree

4 files changed

+52
-2
lines changed

4 files changed

+52
-2
lines changed

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+
]

partials/tabs/projects.html

+5-1
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,13 @@
5454
<li btf-markdown="req" class="milestones" ng-repeat="req in currentProject.requirements"></li>
5555
</ul>
5656
<br> </div>
57-
<div ng-show="currentProject.initiatives.length>0">
57+
<div ng-show="currentProject.initiatives.length>0 && currentProject.report === undefined">
5858
<div class="small-heading uppercase">Initiatives</div> <span class="chip" ng-repeat="initiative in currentProject.initiatives">{{ initiative }}</span>
5959
<br> </div>
60+
<div ng-show="currentProject.report.url.length>0">
61+
<div class="small-heading uppercase">{{ currentProject.report.initiative }}</div>
62+
<span class="chip gsoc-report" ng-click="redirectToReport()">Report</span>
63+
</div>
6064
<div ng-show="currentProject.collaborating_projects.length>0">
6165
<div class="small-heading uppercase">Collaborating projects</div> <span class="pr-element-detail chip" ng-repeat="project in currentProject.collaborating_projects">{{ project }}</span>
6266
<br> </div>

resources/css/style.css

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
.break-word {
22
word-wrap: break-word;
33
}
4+
.gsoc-report {
5+
cursor: pointer;
6+
}
47
.hash_value_dup {
58
position: 'absolute';
69
left: '-9999px';

resources/js/app.js

+31-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,9 @@
9090
}
9191
})
9292

93-
app.directive('projects', ['$http', '$timeout', '$location', 'Languages', 'orderByFilter', function ($http, $timeout, $location, Languages, orderBy) {
93+
app.directive('projects', [
94+
'$http', '$timeout', '$location', '$window', 'Languages', 'orderByFilter',
95+
function ($http, $timeout, $location, $window, Languages, orderBy) {
9496
return {
9597
restrict: 'E',
9698
templateUrl: '/partials/tabs/projects.html',
@@ -117,6 +119,7 @@
117119
.then(function (res) {
118120
$scope.projectList = res.data;
119121
$scope.projectRequest();
122+
$scope.mapReportToProject();
120123
})
121124
}
122125

@@ -292,6 +295,33 @@
292295
$scope.searchText = search_requested
293296
}
294297

298+
$scope.redirectToReport = function () {
299+
$window.open($scope.currentProject.report.url, '_blank');
300+
}
301+
302+
$scope.mapReportToProject = function () {
303+
$http.get('data/reports.liquid')
304+
.then(function (res) {
305+
angular.forEach(res.data, function (report) {
306+
var completed_project = report.project.toLowerCase()
307+
angular.forEach($scope.projectList, function (project) {
308+
if (
309+
project.status.indexOf('completed') !== -1 && project.mentors.length > 0 &&
310+
completed_project === project.name.toLowerCase()
311+
) {
312+
angular.forEach(project.initiatives, function(initiative){
313+
if(report.categories.indexOf(initiative) != -1){
314+
report.initiative = initiative
315+
return
316+
}
317+
})
318+
project.report = report
319+
}
320+
})
321+
})
322+
})
323+
}
324+
295325
},
296326
controllerAs: 'lc'
297327
}

0 commit comments

Comments
 (0)