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 25, 2019
1 parent f287fab commit 05f8057
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 1 deletion.
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 %}
]
4 changes: 4 additions & 0 deletions partials/tabs/projects.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@
<div ng-show="currentProject.initiatives.length>0">
<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">GSoC</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
@@ -1,3 +1,6 @@
.gsoc-report {
cursor: pointer;
}
.hash_value_dup {
position: 'absolute';
left: '-9999px';
Expand Down
24 changes: 23 additions & 1 deletion resources/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
}
})

app.directive('projects', ['$http', '$timeout', '$location', 'Languages', function ($http, $timeout, $location, Languages) {
app.directive('projects', ['$http', '$timeout', '$location', '$window', 'Languages', function ($http, $timeout, $location, $window, Languages) {
return {
restrict: 'E',
templateUrl: '/partials/tabs/projects.html',
Expand All @@ -110,6 +110,7 @@
.then(function (res) {
$scope.projectList = res.data;
$scope.projectRequest();
$scope.mapReportToProject();
})
}

Expand Down Expand Up @@ -281,6 +282,27 @@
$scope.searchText = search_requested
}

$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()
) {
project.report = report
}
})
})
})
}

},
controllerAs: 'lc'
}
Expand Down

0 comments on commit 05f8057

Please sign in to comment.