pdf.jade 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. div.full-size(ng-controller="PdfController")
  2. .toolbar.toolbar-tall
  3. a.btn.btn-info(
  4. href,
  5. ng-disabled="pdf.compiling",
  6. ng-click="recompile()"
  7. )
  8. i.fa.fa-refresh(
  9. ng-class="{'fa-spin': pdf.compiling }"
  10. )
  11. |   
  12. span(ng-show="!pdf.compiling") Recompile
  13. span(ng-show="pdf.compiling") Compiling...
  14. a.log-btn(
  15. href
  16. ng-click="toggleLogs()"
  17. ng-class="{ 'active': (pdf.view == 'logs' || pdf.failure) && !pdf.error && !pdf.timeout && !pdf.uncompiled }"
  18. tooltip="Logs"
  19. tooltip-placement="bottom"
  20. )
  21. i.fa.fa-file-text-o
  22. span.label(
  23. ng-show="pdf.logEntries.warnings.length + pdf.logEntries.errors.length > 0"
  24. ng-class="{\
  25. 'label-warning': pdf.logEntries.errors.length == 0,\
  26. 'label-danger': pdf.logEntries.errors.length > 0\
  27. }"
  28. ) {{ pdf.logEntries.errors.length + pdf.logEntries.warnings.length }}
  29. .pdf-viewer(ng-show="pdf.url && pdf.view == 'pdf' && !pdf.failure && !pdf.timeout && !pdf.error")
  30. div(
  31. pdfjs
  32. pdf-src="pdf.url"
  33. key="project_id"
  34. resize-on="layout:main:resize,layout:pdf:resize"
  35. highlights="pdf.highlights"
  36. position="pdf.position"
  37. dbl-click-callback="syncToCode"
  38. )
  39. .pdf-uncompiled(ng-show="pdf.uncompiled && !pdf.compiling")
  40. |  
  41. i.fa.fa-level-up.fa-flip-horizontal.fa-2x
  42. |   Click here to preview your work as a PDF.
  43. .pdf-errors(ng-show="pdf.timeout || pdf.error")
  44. .alert.alert-danger(ng-show="pdf.error")
  45. strong Server Error.
  46. span Sorry, something went wrong and your project could not be compiled. Please try again in a few moments.
  47. .alert.alert-danger(ng-show="pdf.timeout")
  48. strong Timed out.
  49. span Sorry, your compile was taking too long and timed out.
  50. | This may be due to a large number of high-res images, or lots of complicated diagrams.
  51. | Please try to make your document simpler, or contact support for help.
  52. .pdf-logs(ng-show="(pdf.view == 'logs' || pdf.failure) && !pdf.error && !pdf.timeout && !pdf.uncompiled")
  53. .alert.alert-success(ng-show="pdf.logEntries.all.length == 0")
  54. | No errors, good job!
  55. .alert.alert-danger(ng-show="pdf.failure")
  56. strong Compile Error.
  57. span Sorry, your LaTeX code couldn't compile for some reason. Please check the errors below for details, or view the raw log.
  58. div(ng-repeat="entry in pdf.logEntries.all", ng-controller="PdfLogEntryController")
  59. .alert(
  60. ng-class="{\
  61. 'alert-danger': entry.level == 'error',\
  62. 'alert-warning': entry.level == 'warning',\
  63. 'alert-info': entry.level == 'typesetting'\
  64. }"
  65. ng-click="openInEditor(entry)"
  66. )
  67. span.line-no
  68. span(ng-show="entry.file") {{ entry.file }}
  69. span(ng-show="entry.line") , line {{ entry.line }}
  70. p.entry-message(ng-show="entry.message") {{ entry.message }}
  71. p.entry-content(ng-show="entry.content") {{ entry.content }}
  72. p
  73. .pull-right
  74. a.btn.btn-default.btn-sm(
  75. href,
  76. tooltip="Clear cached files",
  77. tooltip-placement="top",
  78. tooltip-append-to-body="true",
  79. ng-click="openClearCacheModal()"
  80. )
  81. i.fa.fa-trash-o
  82. |  
  83. div.dropdown(style="display: inline-block;")
  84. a.btn.btn-default.btn-sm(
  85. href
  86. data-toggle="dropdown"
  87. )
  88. | Other logs & files
  89. span.caret
  90. ul.dropdown-menu.dropdown-menu-right
  91. li(ng-repeat="file in pdf.outputFiles")
  92. a(
  93. href="/project/{{project_id}}/output/{{file.path}}"
  94. target="_blank"
  95. ng-click="openOutputFile(file)"
  96. ) {{ file.name }}
  97. a.btn.btn-info.btn-sm(href, ng-click="toggleRawLog()")
  98. span(ng-show="!pdf.showRawLog") View Raw Logs
  99. span(ng-show="pdf.showRawLog") Hide Raw Logs
  100. pre(ng-bind="pdf.rawLog", ng-show="pdf.showRawLog")
  101. script(type='text/ng-template', id='clearCacheModalTemplate')
  102. .modal-header
  103. h3 Clear cache?
  104. .modal-body
  105. p This will clear all hidden LaTeX files (.aux, .bbl, etc) from our compile server.
  106. | You generally don't need to do this unless you're having trouble with references.
  107. p Your project files will not be deleted or changed.
  108. .modal-footer
  109. button.btn.btn-default(
  110. ng-click="cancel()"
  111. ng-disabled="state.inflight"
  112. ) Cancel
  113. button.btn.btn-info(
  114. ng-click="clear()"
  115. ng-disabled="state.inflight"
  116. )
  117. span(ng-show="!state.inflight") Clear cache
  118. span(ng-show="state.inflight") Clearing...