-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- currently using ng-pdfviewer from https://github.com/akrennmair/ng-pdfviewer/ - pdf links now opens new tab and display the pdf within a new AttachmentPDFController - The preferred way of displaying the pdfs is inline with the other content, especially for the judgement page. However currently this library only allows us to display one pdf per page. A fix has been made but has not been pulled into the master branch of the library. akrennmair/ng-pdfviewer#8
- Loading branch information
Showing
17 changed files
with
111 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,3 +24,5 @@ | |
// EVALUATE SCREEN | ||
@import 'judgement.less'; | ||
|
||
// ANSWER SCREEN | ||
@import 'attachment.less'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
pdfviewer#viewer canvas{ | ||
width: 100%; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
(function() { | ||
|
||
var module = angular.module('ubc.ctlt.acj.attachment', | ||
[ | ||
'ngPDFViewer', | ||
'ngResource', | ||
'ubc.ctlt.acj.authorization', | ||
'ubc.ctlt.acj.course', | ||
'ubc.ctlt.acj.question', | ||
'ubc.ctlt.acj.toaster' | ||
] | ||
); | ||
|
||
/***** Controllers *****/ | ||
module.controller( | ||
"AttachmentPDFController", | ||
function($scope, $log, $routeParams, Authorize, CourseResource, QuestionResource, PDFViewerService, Toaster) | ||
{ | ||
var courseId = $routeParams['courseId']; | ||
var questionId = $routeParams['questionId']; | ||
var postId = $routeParams['postId']; | ||
|
||
Authorize.can(Authorize.READ, CourseResource.MODEL).then(function(result) { | ||
$scope.canReadCourse = result; | ||
}); | ||
Authorize.can(Authorize.READ, QuestionResource.MODEL).then(function(result) { | ||
$scope.canReadQuestion = result; | ||
}); | ||
$scope.pdfURL = 'pdf/'+ courseId + '_' + questionId + '_' + postId + '.pdf'; | ||
$scope.instance = PDFViewerService.Instance("viewer"); | ||
$scope.nextPage = function() { | ||
$scope.instance.nextPage(); | ||
}; | ||
|
||
$scope.prevPage = function() { | ||
$scope.instance.prevPage(); | ||
}; | ||
|
||
$scope.gotoPage = function(page) { | ||
$scope.instance.gotoPage(page); | ||
}; | ||
|
||
$scope.pageLoaded = function(curPage, totalPages) { | ||
$scope.currentPage = curPage; | ||
$scope.totalPages = totalPages; | ||
}; | ||
} | ||
); | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<div ng-controller="AttachmentPDFController"> | ||
<div class="row text-center"> | ||
<a class="btn btn-success" ng-click="gotoPage(1)">First</a> | ||
<a class="btn btn-success" ng-click="prevPage()">Prev</a> | ||
{{currentPage}} / {{totalPages}} | ||
<a class="btn btn-success" ng-click="nextPage()">Next</a> | ||
<a class="btn btn-success" ng-click="gotoPage(totalPages)">Last</a> | ||
</div> | ||
<div class="row"> | ||
<pdfviewer src="{{pdfURL}}" id="viewer" on-page-load='pageLoaded(page, total)'></pdfviewer> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters