2014-07-03 12:05:50 -04:00
|
|
|
div.binary-file.full-size(
|
|
|
|
ng-controller="BinaryFileController"
|
|
|
|
ng-show="ui.view == 'file'"
|
|
|
|
ng-if="openFile"
|
|
|
|
)
|
|
|
|
img(
|
2016-05-04 04:32:59 -04:00
|
|
|
ng-show="!failedLoad"
|
2014-07-03 12:05:50 -04:00
|
|
|
ng-src="/project/{{ project_id }}/file/{{ openFile.id }}"
|
2018-02-20 05:37:55 -05:00
|
|
|
ng-if="isImageFile()"
|
2016-05-20 09:28:51 -04:00
|
|
|
ng-class="{'img-preview': !imgLoaded}"
|
2016-05-04 04:32:59 -04:00
|
|
|
onerror="sl_binaryFilePreviewError()"
|
|
|
|
onabort="sl_binaryFilePreviewError()"
|
2016-05-20 09:28:51 -04:00
|
|
|
onload="sl_binaryFilePreviewLoaded()"
|
2014-07-03 12:05:50 -04:00
|
|
|
)
|
2016-05-17 12:00:14 -04:00
|
|
|
|
2014-07-03 12:05:50 -04:00
|
|
|
img(
|
2016-05-04 04:32:59 -04:00
|
|
|
ng-show="!failedLoad"
|
2014-07-03 12:05:50 -04:00
|
|
|
ng-src="/project/{{ project_id }}/file/{{ openFile.id }}?format=png"
|
2018-02-20 05:37:55 -05:00
|
|
|
ng-if="isPreviewableFile()"
|
2016-05-20 09:28:51 -04:00
|
|
|
ng-class="{'img-preview': !imgLoaded}"
|
2016-05-04 04:32:59 -04:00
|
|
|
onerror="sl_binaryFilePreviewError()"
|
|
|
|
onabort="sl_binaryFilePreviewError()"
|
2016-05-20 09:28:51 -04:00
|
|
|
onload="sl_binaryFilePreviewLoaded()"
|
2014-07-03 12:05:50 -04:00
|
|
|
)
|
2016-05-17 12:00:14 -04:00
|
|
|
|
2018-02-20 05:37:55 -05:00
|
|
|
div(ng-if="isTextFile() && !textPreview.error")
|
|
|
|
div.text-loading(ng-show="textPreview.loading && !textPreview.error")
|
2016-05-17 12:00:14 -04:00
|
|
|
| #{translate('loading')}...
|
2018-02-20 05:37:55 -05:00
|
|
|
div.text-preview(ng-show="textPreview.data && !textPreview.loading && !textPreview.error")
|
2016-05-17 12:00:14 -04:00
|
|
|
div.scroll-container
|
|
|
|
p
|
2018-02-20 05:37:55 -05:00
|
|
|
| {{ textPreview.data }}
|
|
|
|
p(ng-show="textPreview.shouldShowDots")
|
2016-05-17 12:00:14 -04:00
|
|
|
| ...
|
|
|
|
|
2014-07-03 12:05:50 -04:00
|
|
|
p.no-preview(
|
2018-02-20 05:37:55 -05:00
|
|
|
ng-if="failedLoad || textPreview.error || isUnpreviewableFile()"
|
2018-03-21 17:50:37 -04:00
|
|
|
) #{translate("no_preview_available")}
|
2016-05-17 12:00:14 -04:00
|
|
|
|
2018-02-20 05:37:55 -05:00
|
|
|
div.binary-file-footer
|
2018-06-08 11:06:47 -04:00
|
|
|
// Linked Files: URL
|
2018-03-05 06:21:31 -05:00
|
|
|
div(ng-if="openFile.linkedFileData.provider == 'url'")
|
2018-02-20 05:37:55 -05:00
|
|
|
p
|
|
|
|
i.fa.fa-fw.fa-external-link-square.fa-rotate-180.linked-file-icon
|
|
|
|
| Imported from
|
|
|
|
|
|
|
|
|
a(ng-href='{{openFile.linkedFileData.url}}') {{ displayUrl(openFile.linkedFileData.url) }}
|
|
|
|
|
|
|
|
|
| at {{ openFile.created | formatDate:'h:mm a' }} {{ openFile.created | relativeDate }}
|
|
|
|
|
2018-06-08 11:06:47 -04:00
|
|
|
// Linked Files: Project File
|
2018-05-16 05:41:21 -04:00
|
|
|
div(ng-if="openFile.linkedFileData.provider == 'project_file'")
|
|
|
|
p
|
|
|
|
i.fa.fa-fw.fa-external-link-square.fa-rotate-180.linked-file-icon
|
|
|
|
| Imported from
|
|
|
|
|
|
2018-06-01 10:16:27 -04:00
|
|
|
a(ng-if='!openFile.linkedFileData.v1_source_doc_id'
|
|
|
|
ng-href='/project/{{openFile.linkedFileData.source_project_id}}' target="_blank")
|
2018-06-21 10:27:32 -04:00
|
|
|
| Another project
|
2018-06-01 10:16:27 -04:00
|
|
|
span(ng-if='openFile.linkedFileData.v1_source_doc_id')
|
2018-06-21 10:27:32 -04:00
|
|
|
| Another project
|
2018-05-16 08:52:54 -04:00
|
|
|
| /{{ openFile.linkedFileData.source_entity_path.slice(1) }},
|
2018-05-16 05:41:21 -04:00
|
|
|
|
|
|
|
|
| at {{ openFile.created | formatDate:'h:mm a' }} {{ openFile.created | relativeDate }}
|
|
|
|
|
2018-06-08 11:06:47 -04:00
|
|
|
// Linked Files: Project Output File
|
|
|
|
div(ng-if="openFile.linkedFileData.provider == 'project_output_file'")
|
|
|
|
p
|
|
|
|
i.fa.fa-fw.fa-external-link-square.fa-rotate-180.linked-file-icon
|
|
|
|
| Imported from the output of
|
|
|
|
|
|
|
|
|
a(ng-if='!openFile.linkedFileData.v1_source_doc_id'
|
|
|
|
ng-href='/project/{{openFile.linkedFileData.source_project_id}}' target="_blank")
|
2018-06-21 10:27:32 -04:00
|
|
|
| Another project
|
2018-06-08 11:06:47 -04:00
|
|
|
span(ng-if='openFile.linkedFileData.v1_source_doc_id')
|
2018-06-21 10:27:32 -04:00
|
|
|
| Another project
|
2018-06-08 11:06:47 -04:00
|
|
|
| : {{ openFile.linkedFileData.source_output_file_path }},
|
|
|
|
|
|
|
|
|
| at {{ openFile.created | formatDate:'h:mm a' }} {{ openFile.created | relativeDate }}
|
|
|
|
|
2018-06-26 05:15:45 -04:00
|
|
|
!= moduleIncludes("binaryFile:linkedFileInfo", locals)
|
|
|
|
|
2018-06-08 11:06:47 -04:00
|
|
|
// Bottom Controls
|
|
|
|
span(ng-if="openFile.linkedFileData.provider")
|
2018-02-20 06:49:02 -05:00
|
|
|
button.btn.btn-success(
|
|
|
|
href, ng-click="refreshFile(openFile)",
|
|
|
|
ng-disabled="refreshing"
|
2018-02-20 05:37:55 -05:00
|
|
|
)
|
2018-02-20 06:49:02 -05:00
|
|
|
i.fa.fa-fw.fa-refresh(ng-class={'fa-spin': refreshing})
|
2018-02-20 05:37:55 -05:00
|
|
|
|
|
2018-02-20 06:49:02 -05:00
|
|
|
span(ng-show="!refreshing") Refresh
|
|
|
|
span(ng-show="refreshing") Refreshing...
|
2018-02-20 05:37:55 -05:00
|
|
|
|
|
|
|
|
a.btn.btn-info(
|
|
|
|
ng-href="/project/{{ project_id }}/file/{{ openFile.id }}"
|
|
|
|
)
|
|
|
|
i.fa.fa-fw.fa-download
|
|
|
|
|
|
|
|
|
| #{translate("download")}
|
2018-06-26 05:15:45 -04:00
|
|
|
|
|
|
|
// Refresh Error
|
|
|
|
div(ng-if="refreshError").row
|
2018-05-21 06:02:12 -04:00
|
|
|
br
|
|
|
|
.alert.alert-danger.col-md-6.col-md-offset-3
|
|
|
|
| Error: {{ refreshError}}
|
2018-06-26 05:15:45 -04:00
|
|
|
!= moduleIncludes("binaryFile:linkedFileRefreshError", locals)
|