syllabus_content.mustache 3.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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. <% js_env :CAN_READ => can_do(@context, @current_user, :read) %>
  19. <% js_env :SYLLABUS_BODY => user_content(@syllabus_body || '') %>
  20. <% @active_tab = "syllabus" %>
  21. <% course_home ||= false %>
  22. <div class="ic-Action-header">
  23. <div class="ic-Action-header__Primary">
  24. <% if course_home %>
  25. <h2 class="ic-Action-header__Heading"><%= @context.nickname_for(@current_user) %></h2>
  26. <% else %>
  27. <h1 class="ic-Action-header__Heading"><%= t 'titles.course_syllabus', "Course Syllabus" %></h1>
  28. <% end %>
  29. </div>
  30. <div class="ic-Action-header__Secondary">
  31. <a href="#" class="jump_to_today_link"><%= t 'links.jump_to_today', "Jump to Today" %></a>
  32. <% if can_do(@context, @current_user, :manage_content) %>
  33. <a href="#" class="edit_syllabus_link btn button-sidebar-wide"><i class="icon-edit"></i> <%= t 'links.edit_syllabus_description', "Edit" %></a>
  34. <% end %>
  35. </div>
  36. </div>
  37. <div id="course_syllabus" style="margin-bottom: 10px;" class="user_content">
  38. <%= user_content(@syllabus_body) %>
  39. </div>
  40. <div id="course_syllabus_details" style="<%= hidden unless can_do(@context, @current_user, :manage_content) && (!@context.syllabus_body || @context.syllabus_body.strip.empty?) %>">
  41. <%= mt 'instructions.syllabus', <<-DOC
  42. The syllabus page shows a table-oriented view of the course schedule, and the basics of
  43. course grading. You can add any other comments, notes, or thoughts you have about the course
  44. structure, course policies or anything else.
  45. To add some comments, click the "Edit" link at the top.
  46. DOC
  47. %>
  48. </div>
  49. <%= form_for @context.class.to_s.underscore.to_sym, :url => context_url(@context, :context_url), :html => {:id => 'edit_course_syllabus_form', :style => 'display: none; margin-bottom: 10px;', :method => :put} do |f| %>
  50. <div style="float: right;">
  51. <a href="#" class="toggle_views_link toggle_html_editor_link"><%= t '#editor.switch_editor_html', "HTML Editor" %></a>
  52. <a href="#" class="toggle_views_link toggle_rich_editor_link" style="display:none;"><%= t '#editor.switch_editor_rich_text', "Rich Content Editor" %></a>
  53. </div>
  54. <%= f.blabel :syllabus_body, :en => "Syllabus Description" %>
  55. <div class="clear"></div>
  56. <%= f.text_area :syllabus_body, :style => "width: 100%; height: 300px;", :id => "course_syllabus_body" %>
  57. <div class='form-actions'>
  58. <button type="button" class="btn cancel_button"><%= t '#buttons.cancel', "Cancel" %></button>
  59. <button type="submit" class='btn btn-primary'><%= t 'buttons.update_syllabus', "Update Syllabus" %></button>
  60. </div>
  61. <% end %>
  62. <h2><%= before_label :assignments_summary, "Course Summary" %></h2>
  63. <div id="syllabusContainer">
  64. <div id="syllabus_links">
  65. <a id="toggle_special_dates_in_syllabus">&nbsp;</a>
  66. </div>
  67. <% css_bundle("syllabus") %>
  68. <table id="syllabus" class="ic-Table--condensed">
  69. <thead>
  70. <tr>
  71. <th scope="col" style="width: 25%;"><%= t 'headers.date', "Date" %></th>
  72. <th scope="col" style="width: 75%;"><%= t 'headers.details', "Details" %></th>
  73. </tr>
  74. </thead>
  75. <tbody>
  76. <tr>
  77. <td scope="row">
  78. <span id="loading_indicator"/>
  79. </td>
  80. </tr>
  81. </tbody>
  82. </table>
  83. </div>