support displaying output files using .url parameter from clsi

This commit is contained in:
Brian Gough 2016-05-20 10:09:42 +01:00
parent 939c7a8c72
commit eaa41e4361

View file

@ -76,12 +76,15 @@ define [
# prepare query string # prepare query string
qs = {} qs = {}
# define the base url. if the pdf file has a build number, pass it to the clsi in the url # define the base url. if the pdf file has a build number, pass it to the clsi in the url
if fileByPath['output.pdf']?.build? if fileByPath['output.pdf']?.url?
$scope.pdf.url = fileByPath['output.pdf'].url
else if fileByPath['output.pdf']?.build?
build = fileByPath['output.pdf'].build build = fileByPath['output.pdf'].build
$scope.pdf.url = "/project/#{$scope.project_id}/build/#{build}/output/output.pdf" $scope.pdf.url = "/project/#{$scope.project_id}/build/#{build}/output/output.pdf"
# no need to bust cache, build id is unique
else else
$scope.pdf.url = "/project/#{$scope.project_id}/output/output.pdf" $scope.pdf.url = "/project/#{$scope.project_id}/output/output.pdf"
# check if we need to bust cache (build id is unique so don't need it in that case)
if not fileByPath['output.pdf']?.build?
qs = { cache_bust : "#{Date.now()}" } qs = { cache_bust : "#{Date.now()}" }
# add a query string parameter for the compile group # add a query string parameter for the compile group
if response.compileGroup? if response.compileGroup?
@ -111,7 +114,9 @@ define [
fetchLogs = (logFile, blgFile) -> fetchLogs = (logFile, blgFile) ->
getFile = (name, file) -> getFile = (name, file) ->
if file?.build? if file.url? # FIXME clean this up when we have file.urls out consistently
url = file.url
else if file?.build?
url = "/project/#{$scope.project_id}/build/#{file.build}/output/#{name}" url = "/project/#{$scope.project_id}/build/#{file.build}/output/#{name}"
else else
url = "/project/#{$scope.project_id}/output/#{name}" url = "/project/#{$scope.project_id}/output/#{name}"