gradebook.mustache 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  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. content_for :page_title, t('Gradebook - %{context_name}', context_name: @context.name)
  20. @body_classes << "gradebook full-width"
  21. @show_left_side = true
  22. @collapse_course_menu = true
  23. @show_embedded_chat = false
  24. css_bundle :slickgrid, :gradebook
  25. js_bundle :gradebook
  26. %>
  27. <div id="keyboard_navigation"></div>
  28. <div id="gradebook_wrapper">
  29. <h1 class="screenreader-only">{{#t}}Gradebook{{/t}}</h1>
  30. <div class="gradebook-header">
  31. <div class="accessibility_warning">
  32. <%= link_to t('Warning: For improved accessibility, please click here to use the Individual View Gradebook.'), context_url(@context, :change_gradebook_version_context_gradebook_url, :version => "srgb"), :id => "accessibility_warning", :class => "screenreader-only" %>
  33. </div>
  34. <% if @context.feature_enabled?(:outcome_gradebook) || @context.feature_enabled?(:post_grades) %>
  35. <nav class="gradebook-navigation">
  36. <ul class="nav nav-pills gradebook-navigation-pills">
  37. <li class="active">
  38. <a href="#" data-id="assignment">{{#t}}Grades{{/t}}</a>
  39. </li>
  40. <% if @context.feature_enabled?(:outcome_gradebook) %>
  41. <li>
  42. <a href="#" data-id="outcome">{{#t}}Learning Mastery{{/t}}</a>
  43. </li>
  44. <% end %>
  45. </ul>
  46. </nav>
  47. <% end %>
  48. <div class="header-buttons">
  49. <div class="post-grades-button-placeholder">
  50. <button id="keyboard-shortcuts" class="Button--icon-action Button--active" type="button">
  51. <i class="icon-keyboard-shortcuts"></i>
  52. </button>
  53. <% if !@context.account.feature_enabled?(:new_sis_integrations) %>
  54. <% if @post_grades_tools.count > 1 %>
  55. <button id="post_grades" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only">{{#t}}Sync Grades{{/t}}</button>
  56. <ul style="display: none;" class="post-grades-menu ui-kyle-menu">
  57. <% @post_grades_tools.each do |tool| %>
  58. <% case tool[:type] %>
  59. <% when :lti %>
  60. <li class="external-tools-dialog">
  61. <a aria-controls="post_grades_frame_dialog" role="button" data-url="<%= tool[:data_url]%>" data-width="<%= tool[:data_width]%>" data-height="<%= tool[:data_height]%>">
  62. <%= tool[:name]%>
  63. </a>
  64. </li>
  65. <% when :post_grades %>
  66. <li class="post-grades-placeholder in-menu"></li>
  67. <% end %>
  68. <% end %>
  69. </ul>
  70. <% elsif @post_grades_tools.count == 1 %>
  71. <% case @post_grades_tools[0][:type] %>
  72. <% when :lti %>
  73. <button class="external-tools-dialog ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" data-url="<%= @post_grades_tools[0][:data_url]%>" data-width="<%= @post_grades_tools[0][:data_width]%>" data-height="<%= @post_grades_tools[0][:data_height]%>"><%= @post_grades_tools[0][:name]%></button>
  74. <% when :post_grades %>
  75. <span class="post-grades-placeholder"></span>
  76. <% end %>
  77. <% end %>
  78. <% end %>
  79. </div>
  80. <a
  81. href="<%= context_url(@context, :change_gradebook_version_context_gradebook_url, version: "srgb") %>"
  82. class="Button individual-view-button"
  83. id="change_gradebook_version_link_holder"
  84. type="button"
  85. >{{#t}}Individual View{{/t}}</a>
  86. <div class="section-button-placeholder"></div>
  87. </div>
  88. </div>
  89. <div class="assignment-gradebook-container hidden">
  90. <div id="gradebook-toolbar" class="toolbar">
  91. <div class="gradebook_dropdowns">
  92. <% if grading_periods? %>
  93. <span class="multiple-grading-periods-selector-placeholder"></span>
  94. <% end %>
  95. </div>
  96. <div class="gradebook_filter" style="display:none">
  97. <% placeholder = t('Filter by student name or secondary ID') %>
  98. <input type="text" class="search-query" placeholder="<%= placeholder %>" aria-label="<%= placeholder %>">
  99. </div>
  100. <div class="gradebook_menu">
  101. <span class="ui-buttonset">
  102. <% if @gradebook_is_editable && @context.allows_gradebook_uploads? %>
  103. <%= link_to(new_course_gradebook_upload_path(@context), class: "ui-button") do %>
  104. <i class="icon-import"></i>
  105. <%= t 'Import' %>
  106. <% end %>
  107. <% end %>
  108. <button class="ui-button" id="download_csv">
  109. <i class="icon-export"></i>
  110. {{#t}}Export{{/t}}
  111. </button>
  112. <ul style="display: none;" id="csv_export_options" class="export_dropdown ui-kyle-menu">
  113. <li class="generate_new_csv"><a href="#">{{#t}}CSV File{{/t}}</a></li>
  114. <% if @last_exported_gradebook_csv.present? %>
  115. <li><a href="<%= @last_exported_gradebook_csv.attachment.download_url %>" class="open_in_a_new_tab">
  116. <%= t('Previous CSV File (%{time})', time: datetime_string(@last_exported_gradebook_csv.attachment.updated_at)) %>
  117. </a></li>
  118. <% else %>
  119. <li style="display:none;">
  120. <a class="open_in_a_new_tab"></a>
  121. </li>
  122. <% end %>
  123. <% if @context.account.feature_enabled?(:new_sis_integrations) %>
  124. <% @post_grades_tools.each do |tool| %>
  125. <% case tool[:type] %>
  126. <% when :lti %>
  127. <li class="external-tools-dialog">
  128. <a aria-controls="post_grades_frame_dialog" role="button" data-url="<%= tool[:data_url]%>" data-width="<%= tool[:data_width]%>" data-height="<%= tool[:data_height]%>"><%= tool[:name]%></a>
  129. </li>
  130. <% when :post_grades %>
  131. <li class="post-grades-placeholder in-menu"></li>
  132. <% end %>
  133. <% end %>
  134. <% end %>
  135. </ul>
  136. </span>
  137. <iframe id="csv_download" style="display:none"></iframe>
  138. <button id="gradebook_settings">
  139. <i class="icon-settings" aria-hidden="true"></i>
  140. </button>
  141. <ul style="display: none;" class="gradebook_dropdown ui-kyle-menu">
  142. <li><a href="<%= context_url(@context, :context_gradebook_url) %>/history">{{#t}}View Grading History{{/t}}</a></li>
  143. <% if @context.allows_grade_publishing_by(@current_user) && can_do(@context, @current_user, :manage_grades) %>
  144. <li><a id="publish_to_sis" href="<%= context_url(@context, :context_details_url,
  145. :anchor => 'tab-grade-publishing') %>">
  146. {{#t}}Sync grades to SIS{{/t}}
  147. </a></li>
  148. <% end %>
  149. <li><a class="student_names_toggle" href="#" role="button">{{#t}}Hide Student Names{{/t}}</a></li>
  150. <li><a data-arrange-columns-by="due_date" href="#"><label>{{#t}}Arrange columns by due date{{/t}}<input type="radio" name="arrange-columns-by" /></label></a></li>
  151. <li><a data-arrange-columns-by="points" href="#"><label>{{#t}}Arrange columns by points{{/t}}<input type="radio" name="arrange-columns-by" /></label></a></li>
  152. <li><a data-arrange-columns-by="assignment_group" href="#"><label>{{#t}}Arrange columns by assignment group{{/t}}<input type="radio" name="arrange-columns-by" /></label></a></li>
  153. <li><a href="#"><label>{{#t}}Show Attendance Columns{{/t}} <input type="checkbox" id="show_attendance" /></label></a></li>
  154. <li id="include-ungraded-list-item"><a href="#"><label>{{#t}}Treat Ungraded as 0{{/t}}<input type="checkbox" id="include_ungraded_assignments" /></label></a></li>
  155. <li class="<% if @course_is_concluded %>ui-state-disabled<% end %>"><a href="#"><label>{{#t}}Show Concluded Enrollments{{/t}}<input type="checkbox" id="show_concluded_enrollments" /></label></a></li>
  156. <li><a href="#"><label>{{#t}}Show Inactive Enrollments{{/t}}<input type="checkbox" id="show_inactive_enrollments" /></label></a></li>
  157. </ul>
  158. </div>
  159. </div>
  160. <div id="gradebook-grid-wrapper" class="use-css-transitions-for-show-hide" style="display:none;">
  161. <div id="gradebook_grid"></div>
  162. </div>
  163. <div style="display:none;">
  164. {{> views/shared/message_students}}
  165. {{> views/submissions/submission_download}}
  166. </div>
  167. </div>
  168. <% if @context.feature_enabled?(:outcome_gradebook) %>
  169. <div class="outcome-gradebook-container hidden"></div>
  170. <% end %>
  171. </div>