Skip to content

Commit

Permalink
Add GSoC report link for completed tasks
Browse files Browse the repository at this point in the history
This commit adds the corresponding GSoC report
link for completed tasks.

Closes coala#703
  • Loading branch information
KVGarg committed Aug 26, 2019
1 parent c1a5d30 commit 53e114f
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 2 deletions.
13 changes: 13 additions & 0 deletions data/reports.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
---
[
{% for report in site.reports %}
{
"categories": [{% for category in report.categories %}"{{ category }}"{% unless forloop.last %},{% endunless %}{% endfor %}],
"date": "{{ report.date }}",
"student": "{{ report.student }}",
"project": "{{ report.project }}",
"project_link": "{{ report.project_link }}",
"url": "{{ report.url }}"
}{% unless forloop.last %},{% endunless %}{% endfor %}
]
6 changes: 5 additions & 1 deletion partials/tabs/projects.html
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,13 @@ <h6><b>Filter Projects</b></h6>
<li btf-markdown="req" class="milestones" ng-repeat="req in currentProject.requirements"></li>
</ul>
<br> </div>
<div ng-show="currentProject.initiatives.length>0">
<div ng-show="currentProject.initiatives.length>0 && currentProject.report === undefined">
<div class="small-heading uppercase">Initiatives</div> <span class="chip" ng-repeat="initiative in currentProject.initiatives">{{ initiative }}</span>
<br> </div>
<div ng-show="currentProject.report.url.length>0">
<div class="small-heading uppercase">{{ currentProject.report.initiative }}</div>
<span class="chip gsoc-report" ng-click="redirectToReport()">Report</span>
</div>
<div ng-show="currentProject.collaborating_projects.length>0">
<div class="small-heading uppercase">Collaborating projects</div> <span class="pr-element-detail chip" ng-repeat="project in currentProject.collaborating_projects">{{ project }}</span>
<br> </div>
Expand Down
3 changes: 3 additions & 0 deletions resources/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@
.evenly-spread-content {
justify-content: space-evenly;
}
.gsoc-report {
cursor: pointer;
}
.hash_value_dup {
position: 'absolute';
left: '-9999px';
Expand Down
26 changes: 25 additions & 1 deletion resources/js/directives/projects.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
angular.module('coala')
.directive('projects', ['$http', '$timeout', '$location', 'Languages', 'orderByFilter', function ($http, $timeout, $location, Languages, orderBy) {
.directive('projects', ['$http', '$timeout', '$location', '$window', 'Languages', 'orderByFilter', function ($http, $timeout, $location, $window, Languages, orderBy) {
return {
restrict: 'E',
templateUrl: '/partials/tabs/projects.html',
Expand Down Expand Up @@ -221,6 +221,7 @@ angular.module('coala')
$scope.projectList = res.data;
$scope.allProjects = res.data;
$scope.projectRequest();
$scope.mapReportToProject();
})
}

Expand Down Expand Up @@ -397,6 +398,29 @@ angular.module('coala')
}

$scope.getAllFilters();
$scope.redirectToReport = function () {
$window.open($scope.currentProject.report.url, '_blank');
}

$scope.mapReportToProject = function () {
$http.get('data/reports.liquid')
.then(function (res) {
angular.forEach(res.data, function (report) {
var completed_project = report.project.toLowerCase()
angular.forEach($scope.projectList, function (project) {
if (project.status.indexOf('completed') !== -1 && project.mentors.length > 0 && completed_project === project.name.toLowerCase()) {
angular.forEach(project.initiatives, function (initiative) {
if (report.categories.indexOf(initiative) != -1) {
report.initiative = initiative
project.report = report
return
}
})
}
})
})
})
}
},
controllerAs: 'lc'
}
Expand Down

0 comments on commit 53e114f

Please sign in to comment.