content_next.mustache 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  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. <%
  19. @body_classes << 'padless-content'
  20. course_home ||= false
  21. js_env({
  22. :COLLAPSED_MODULES => @collapsed_modules,
  23. :CAN_MANAGE_MODULES => @can_edit,
  24. :IS_STUDENT => can_do(@context, @current_user, :participate_as_student),
  25. :COURSE_ID => @context.id,
  26. :NO_MODULE_PROGRESSIONS => @context.large_roster,
  27. })
  28. js_bundle :context_modules
  29. css_bundle :content_next
  30. %>
  31. <% if course_home %>
  32. <div class="screenreader-only"><%= @context.name %></div>
  33. <h2 class="context-modules-title screenreader-only">{{#t}}Course Modules{{/t}}</h2>
  34. <% else %>
  35. <h1 class="context-modules-title screenreader-only">{{#t}}Course Modules{{/t}}</h1>
  36. <% end %>
  37. <% if @can_edit %>
  38. <div tabindex="0" class="drag_and_drop_warning screenreader-only" >
  39. <%= t('modules_keyboard_hint_updated',
  40. 'Warning: For improved accessibility in reordering Modules (or Module items), please use the Move To Dialog option found in the menu.') %>
  41. </div>
  42. <% end %>
  43. <div class="header-bar">
  44. <div class="header-bar-right header-bar__module-layout">
  45. <div class="header-bar-right__buttons">
  46. <% if @can_edit %>
  47. <a class="btn module_progressions_link" href="<%= progressions_course_context_modules_path(@context) %>">{{#t}}View Progress{{/t}}</a>
  48. <% end %>
  49. <% if @allow_web_export_download %>
  50. <%= form_tag(context_url(@context, :context_start_offline_web_export_url)) do %>
  51. <button type="submit" class="btn offline_web_export">
  52. <i class="icon-export" role="presentation"></i>
  53. {{#t}}Export Course Content{{/t}}
  54. </button>
  55. <% end %>
  56. <% end %>
  57. <% if @can_edit %>
  58. <button class="btn btn-primary add_module_link">
  59. <i class="icon-plus" role="presentation"></i>
  60. {{#t}}Module{{/t}}
  61. </button>
  62. <% end %>
  63. </div>
  64. <% if @last_web_export %>
  65. <small class="muted">
  66. {{#t}}Last Export: {{/t}}
  67. <a href="<%= context_url(@context, :context_offline_web_exports_url) %>">
  68. <%= datetime_string(force_zone(@last_web_export.created_at)) %>
  69. </a>
  70. </small>
  71. <% end %>
  72. </div>
  73. </div>
  74. <div class="item-group-container" id="context_modules_sortable_container">
  75. <div id="no_context_modules_message" style="display:none;">
  76. <% if can_do(@context.context_modules.temp_record, @current_user, :create) %>
  77. <div id="modules_homepage_user_create"></div>
  78. <% else %>
  79. <p>{{#t}}No modules have been defined for this course.{{/t}}</p>
  80. <% end %>
  81. </div>
  82. <div
  83. id="context_modules"
  84. aria-label="{{#t}}Course Modules{{/t}}"
  85. class="ig-list <%= 'editable' if @can_edit %>"
  86. >
  87. <% cache(@modules_cache_key) do %>
  88. <% preload_modules_content(@modules, @can_edit) %>
  89. <% @modules.each do |m| %>
  90. {{> views/context_modules/context_module_next}}
  91. <% end %>
  92. <% end %>
  93. </div>
  94. </div>
  95. {{> views/context_modules/context_module_next}}
  96. {{> views/context_modules/module_item_next}}
  97. <% if @can_edit %>
  98. {{> views/context_modules/add_context_module_form}}
  99. <div id="add_module_prerequisite_dialog" style="display: none;">
  100. <span class="context_module_id" style="display: none;">&nbsp;</span>
  101. <div>
  102. <%= t 'add_prerequisite', "Add prerequisite to *%{module}*", :wrapper => '<span class="module_name">\1</span>', :module => 'module' %>
  103. </div>
  104. <div style="text-align: center;" class="prerequisite_module_select">
  105. </div>
  106. <div class="button-container">
  107. <button type="button" class="btn submit_button">{{#t}}Add Prerequisite{{/t}}</button>
  108. <button type="button" class="btn button-secondary cancel_button">{{#t}}Cancel{{/t}}</button>
  109. </div>
  110. </div>
  111. {{> views/shared/select_content_dialog}}
  112. <div id="edit_item_dialog" style="display: none;">
  113. <%= form_for :content_tag, :url => "", :html => {:id => "edit_item_form", :method => :put, :style => "margin: 20px 10px;"} do |f| %>
  114. <p tabindex="0"> </p>
  115. <table class="formtable">
  116. <tr>
  117. <td><%= f.blabel :title, :en => "Title" %></td>
  118. <td><%= f.text_field :title, :style => "width: 200px;" %></td>
  119. </tr>
  120. <tr class="external external_url">
  121. <td><%= f.blabel :url, :en => "URL" %></td>
  122. <td><%= f.text_field :url, :style => "width: 200px;" %></td>
  123. </tr>
  124. <tr>
  125. <td><label for="content_tag_indent_select"><%= before_label('indent', %{Indent}) %></label></td>
  126. <td>
  127. <label class="screenreader-only" for="content_tag_indent_select">{{#t}}Select indentation{{/t}}</label>
  128. <select name="content_tag[indent]" id="content_tag_indent_select">
  129. <% 0.upto(3) do |i| %>
  130. <option value="<%= i %>"><%= t('indent.n', { :zero => %{Don't Indent}, :one => %{Indent 1 Level}, :other => %{Indent %{count} Levels} }, :count => i) %></option>
  131. <% end %>
  132. </select>
  133. </td>
  134. </tr>
  135. <tr class="external">
  136. <td colspan="2">
  137. <%= f.check_box :new_tab %>
  138. <%= f.label :new_tab, :en => "Load in a new tab" %>
  139. </td>
  140. </tr>
  141. <tr>
  142. <td colspan="2">
  143. <div class="button-container">
  144. <button type="button" class="btn cancel_button">{{#t}}Cancel{{/t}}</button>
  145. <button type="submit" class="btn btn-primary">{{#t}}Update{{/t}}</button>
  146. </div>
  147. </td>
  148. </tr>
  149. </table>
  150. <% end %>
  151. <form>
  152. <table>
  153. </table>
  154. </form>
  155. </div>
  156. <div id="add_prerequisite_dialog" style="display: none;">
  157. <h3><%= t 'headings.add_prerequisite', 'Add Prerequisite to %{name}', :name => '<span class="name">&nbsp;</span>'.html_safe %></h3>
  158. <p style="display: none;">{{#t}}Select the type of prerequisite. Students cannot see a module until all prerequisites are satisfied.{{/t}}
  159. <div>
  160. <label class="screenreader-only" for="prerequisite_type_select">{{#t}}Select type of prerequisite{{/t}}</label>
  161. <select id="prerequisite_type_select" class="type" style="display: none;">
  162. <option value="module">{{#t}}Another Module{{/t}}</option>
  163. </select>
  164. </div>
  165. </p>
  166. <p class="module_details"><%= t 'module_details', %{Modules are shown in sequential order, so only modules that are above %{name} can be set as prerequisites.}, :name => '<span class="name">&nbsp;</span>'.html_safe %>
  167. <div>
  168. <label class="screenreader-only" for="prerequisite_module_select">{{#t}}Select prerequite module{{/t}}</label>
  169. <select id="prerequisite_module_select" class="module_id">
  170. </select>
  171. </div>
  172. </p>
  173. </div>
  174. <% end %>
  175. <div style="display: none;">
  176. <a href="<%= context_url(@context, :progressions_context_context_modules_url) %>" class="progression_list_url">&nbsp;</a>
  177. <a href="<%= context_url(@context, :context_context_modules_assignment_info_url) %>" class="assignment_info_url">&nbsp;</a>
  178. <select id="module_list" aria-label="{{#t}}Select prerequisite module{{/t}}">
  179. <option value="">[ {{#t}}Select Module{{/t}} ]</option>
  180. <% @modules.each do |m| %>
  181. <option value="<%= m.id %>" class="context_module_option context_module_<%= m.id %>"><%= t 'select_module.name', '%{module}', :module => m.name %></option>
  182. <% end %>
  183. </select>
  184. <div id="display_criterion_blank" class="criterion" style="display: none; float: left;">
  185. <span class="id" style="display: none;">&nbsp;</span>
  186. <span class="type" style="display: none;">&nbsp;</span>
  187. <span class="name">{{#t}}module{{/t}}</span>
  188. <span><a href="#" class="delete_prerequisite_link" title="{{#t}}Remove this prerequisite{{/t}}">&#215;</a></span>
  189. </div>
  190. <div id="completion_criterion_option" class="completion_criterion_option">
  191. <% ot 'criterion_for_assignment', '%{assignment} %{select_criterion}', :assignment => capture { %>
  192. <span style="padding: 0 4px;">
  193. <select class="id assignment_picker" tabindex="0" aria-label="{{#t}}Requirement subject{{/t}}"></select>
  194. </span>
  195. <% }, :select_criterion => capture { %>
  196. <span style="padding: 0 4px;">
  197. <select class="type assignment_requirement_picker" tabindex="0" aria-label="{{#t}}Requirement{{/t}}">
  198. <option class="any" value="must_view">{{#t}}view the item{{/t}}</option>
  199. <option class="assignment wiki_page" value="must_mark_done"><%= t(%{mark as done}) %></option>
  200. <option class="wiki_page discussion_topic" value="must_contribute">{{#t}}contribute to the page{{/t}}</option>
  201. <option class="assignment quiz graded" value="must_submit">{{#t}}submit the assignment{{/t}}</option>
  202. <option class="assignment quiz graded" value="min_score">{{#t}}score at least{{/t}}</option>
  203. </select>
  204. </span>
  205. <% } %>
  206. <span class="min_score_box" style="display: none;" tabindex="0">
  207. <label class="screenreader-only" for="criterion_min_score">{{#t}}Minimum Score{{/t}}</label>
  208. <input id="criterion_min_score" type="text" class="min_score" style="width: 30px; margin-right: 5px;"/>
  209. <span class="points_possible_parent"><%= t 'assignment_points_possible', '/ %{points_possible}', :points_possible => '<span class="points_possible">&nbsp;</span>'.html_safe %></span>
  210. </pan>
  211. </div>
  212. <%= image_tag "flagged_question_dim.png", :id => "criterion_image_min_score", :class => "image not_blank", :alt => t('images.alt.min_score', "minimum score"), :title => t('images.title.min_score', "Students must get at least a %{min_score} on this item before the module is considered complete", :min_score => "{{ min_score }}") %>
  213. <%= image_tag "preview_dim.png", :id => "criterion_image_must_view", :class => "image not_blank", :alt => t('images.alt.must_view', "must view"), :title => t('images.title.must_view', "Students must view this item before the module is considered complete") %>
  214. <%= image_tag "text_entry_dim.png", :id => "criterion_image_must_submit", :class => "image not_blank", :alt => t('images.alt.must_submit', "must submit"), :title => t('images.title.must_submit', "Students must submit this assignment before the module is considered complete") %>
  215. <%= image_tag "text_entry_dim.png", :id => "criterion_image_must_contribute", :class => "image not_blank", :alt => t('images.alt.must_contribute', "must contribute"), :title => t('images.title.must_contribute', "Students must contribute to this item before the module is considered complete") %>
  216. <%= image_tag "blank.png", :id => "criterion_image_blank", :class => "image", :alt => "" %>
  217. </div>
  218. <div id="current_user_progression_list" class="user_<%= @current_user && @current_user.id %>" style="display: none;">
  219. <div class="progression progression_blank">
  220. <div class="context_module_id">&nbsp;</div>
  221. <div class="workflow_state">&nbsp;</div>
  222. <div class="requirements_met">&nbsp;</div>
  223. <div class="current_position">&nbsp;</div>
  224. <div class="collapsed">&nbsp;</div>
  225. </div>
  226. </div>
  227. {{> views/context_modules/keyboard_navigation}}