inline_preview.mustache 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. <%
  2. # Copyright (C) 2011 - present Instructure, Inc.
  3. #
  4. # This file is part of Canvas.
  5. #
  6. # Canvas is free software: you can redistribute it and/or modify it under
  7. # the terms of the GNU Affero General Public License as published by the Free
  8. # Software Foundation, version 3 of the License.
  9. #
  10. # Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
  11. # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  12. # A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
  13. # details.
  14. #
  15. # You should have received a copy of the GNU Affero General Public License along
  16. # with this program. If not, see <http://www.gnu.org/licenses/>.
  17. %>
  18. <% content_for :stylesheets do %>
  19. <style>
  20. #content {
  21. padding: 0;
  22. }
  23. #content_preview {
  24. width: 100%;
  25. height: 300px;
  26. border: 0;
  27. }
  28. #file_content {
  29. width: 100%;
  30. }
  31. #file_content td {
  32. padding: 0;
  33. vertical-align: top;
  34. }
  35. #file_content_header {
  36. background: url("/images/canvas/header_bg.png") repeat-x left -28px;
  37. border-bottom: 1px solid #aaa;
  38. padding: 8px 5px 0px 45px;
  39. text-align: center;
  40. min-height: 25px;
  41. }
  42. #content_holder {
  43. width: 100%;
  44. }
  45. #file_content_header a {
  46. color: #333;
  47. font-weight: bold;
  48. }
  49. #file_content .context_module .header .completion_status {
  50. display: none;
  51. }
  52. #file_content .context_module .header {
  53. margin-left: 5px;
  54. }
  55. #file_content .context_module {
  56. margin-bottom: 0;
  57. width: 100%;
  58. overflow: hidden;
  59. }
  60. #file_content .context_module_item td {
  61. padding-top: 2px;
  62. padding-bottom: 2px;
  63. }
  64. #file_content .hide_sidebar_link {
  65. position: absolute;
  66. top: 3px;
  67. right: 3px;
  68. }
  69. #file_content .modules_holder {
  70. background-color: #F2F3F4;
  71. }
  72. #modules {
  73. overflow: auto;
  74. width: 250px;
  75. position: relative;
  76. border-right: 1px solid #aaa;
  77. }
  78. #modules .context_module_item .move_item_link {
  79. display: none;
  80. }
  81. #modules .context_module_item .title {
  82. white-space: nowrap;
  83. }
  84. #modules .context_module_item .due_date_display,
  85. #modules .context_module_item .points_possible_display,
  86. #modules .context_module_item .links {
  87. display: none;
  88. }
  89. #modules .context_module_item.context_module_sub_header .title {
  90. white-space: inherit;
  91. }
  92. #modules .context_module_item .module_item_icons {
  93. padding-left: 20px;
  94. }
  95. #modules .context_module {
  96. border: 0
  97. }
  98. #modules .context_module .reorder_module_link {
  99. display: none;
  100. }
  101. #modules .context_module .links {
  102. display: none;
  103. }
  104. #modules .context_module .header {
  105. background: transparent;
  106. border: 0;
  107. }
  108. #modules .context_module .footer {
  109. display: none;
  110. }
  111. #modules .context_module_item .links {
  112. display: none;
  113. }
  114. #modules .context_module_item.selected .title {
  115. font-weight: bold;
  116. }
  117. #modules .context_module_item.selected .module_item_icons {
  118. background: url(/images/arrow_right.png) no-repeat left 3px;
  119. }
  120. #modules .context_module_item .title {
  121. white-space: normal;
  122. }
  123. #file_display_name {
  124. font-size: 1.5em;
  125. font-weight: bold;
  126. }
  127. </style>
  128. <% end %>
  129. <div id="file_content_header">
  130. <div style="float: left;" id="file_display_name"><%= @attachment ? @attachment.display_name : @tag.title %>
  131. </div>
  132. <div style="float: right; padding-top:0.5em;">
  133. <a href="#" id="frameless_link"><%= t 'links.exit_frame', "Lose the Frames"%></a>
  134. </div>
  135. <div id="current_item_id" style="display: none;"><%= @tag.try(:id) %></div>
  136. <div style="padding-top: 0.5em;">
  137. <a href="<%= context_url(@context, :context_url) %>"><%= t 'links.course_home', "Course Home" %></a> |
  138. <a href="<%= context_url(@context, :context_files_url) %>"><%= t 'links.files', "Files" %></a>
  139. <% if @module %>
  140. | <a href="<%= context_url(@context, :context_context_modules_url) %>"><%= t 'links.modules', "Modules" %></a>
  141. <% end %>
  142. </div>
  143. <div class="clear"></div>
  144. </div>
  145. <table id="file_content" cellspacing="0">
  146. <tr>
  147. <td style="<%= hidden unless @module %>" class="modules_holder">
  148. <div id="modules">
  149. {{> views/context_modules/context_module}}
  150. <div style="float: right; margin-top: 5px;">
  151. <a href="#" class="hide_sidebar_link no-hover" title="<%= t 'links.hide_sidebar', "Hide Sidebar" %>"><%= image_tag "delete_circle.png", :alt => t('Hide Sidebar') %></a>
  152. </div>
  153. </div>
  154. </td>
  155. <td id="content_holder">
  156. <% if @attachment %>
  157. <iframe name="content_preview" frameborder="0" id="content_preview" src="<%= context_url(@context, :context_file_url, @attachment.id) %>/<%= @attachment.full_path %>" title="{{#t}}Preview{{/t}}">
  158. </iframe>
  159. <% elsif @tag %>
  160. <iframe name="content_preview" frameborder="0" id="content_preview" src="<%= @tag.url %>" title="{{#t}}Preview{{/t}}">
  161. </iframe>
  162. <% end %>
  163. </td>
  164. </tr>
  165. </table>
  166. <% js_bundle 'legacy/inlined_preview' %>