test.html 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  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 :page_title, @context.name %>
  19. <% css_bundle :course_show %>
  20. <% @active_tab ||= "home" %>
  21. <h1 class='screenreader-only'><%= @context.name %></h1>
  22. <% content_for :auto_discovery do %>
  23. <% if @context_enrollment %>
  24. <%= auto_discovery_link_tag(:atom, feeds_course_format_path(@context_enrollment.feed_code, :atom), {:title => t("Course Atom Feed")}) %>
  25. <% elsif @context.available? %>
  26. <%= auto_discovery_link_tag(:atom, feeds_course_format_path(@context.feed_code, :atom), {:title => t("Course Atom Feed")}) %>
  27. <% end %>
  28. <% end %>
  29. <% content_for :right_side do %>
  30. <div id="course_show_secondary">
  31. <% @can_manage = can_do(@context, @current_user, :manage) %>
  32. <% @can_create_announcements = @context.announcements.temp_record.grants_right?(@current_user, session, :create) %>
  33. <% if can_do(@context, @current_user, :change_course_state) && (@context.unpublished? || @context.unpublishable?) %>
  34. <div id="course_status">
  35. <h3>
  36. {{#t}}_{{/t}}
  37. </h3>
  38. <div id='course_status_actions' class="ui-buttonset">
  39. <%= form_for @context, html: {id: "course_status_form"} do |f| %>
  40. <% if @context.created? || @context.claimed? %>
  41. <button type="button" class='ui-button btn-unpublish disabled' disabled>
  42. <i class="icon-unpublish"></i>{{#t}}_{{/t}}
  43. </button>
  44. <button type='submit' class="ui-button btn-publish">
  45. <i class="icon-publish icon-Solid"></i>{{#t}}_{{/t}}
  46. </button>
  47. <input type='hidden' name='course[event]' value='offer' />
  48. <% else %>
  49. <button type='submit' class="ui-button">
  50. <i class="icon-unpublish"></i>&nbsp;{{#t}}_{{/t}}
  51. </button>
  52. <button type="button" class="ui-button disabled btn-published" disabled>
  53. <i class="icon-publish icon-Solid"></i>{{#t}}_{{/t}}
  54. </button>
  55. <input type='hidden' name='course[event]' value='claim' />
  56. <% end %>
  57. <% end %>
  58. </div>
  59. </div>
  60. <% end %>
  61. <% if @can_manage || @can_create_announcements || @course_home_view != 'feed' || @course_home_sub_navigation_tools.present? %>
  62. <div class="course-options">
  63. <%= external_tools_menu_items(@course_home_sub_navigation_tools, {link_class: "btn button-sidebar-wide course-home-sub-navigation-lti", settings_key: :course_home_sub_navigation}) %>
  64. <% if @can_manage %>
  65. <div id="choose_home_page"></div>
  66. <div id="choose_home_page_not_modules"></div>
  67. <% end %>
  68. <% if @course_home_view != 'feed' %>
  69. <a class="btn button-sidebar-wide" href="<%= context_url(@context, :context_url, :view => 'feed') %>">
  70. <i class="icon-stats"></i>
  71. {{#t}}_{{/t}}
  72. </a>
  73. <% end %>
  74. <% if @can_manage && !@domain_root_account.try(:feature_enabled?, :new_user_tutorial) %>
  75. <% set_js_course_wizard_data %>
  76. <% js_bundle :course_wizard %>
  77. <% css_bundle :course_wizard %>
  78. <a href="#" class="btn button-sidebar-wide wizard_popup_link <%= 'auto_open' if @context.created? || @context.claimed? %>">
  79. <i class="icon-question"></i> {{#t}}_{{/t}}
  80. </a>
  81. <% end %>
  82. <% if @can_create_announcements %>
  83. <a class="btn button-sidebar-wide" href="<%= context_url(@context, :new_context_discussion_topic_url, :is_announcement => true) %>"><i class="icon-announcement"></i> {{#t}}_{{/t}}
  84. </a>
  85. <% end %>
  86. <% course_custom_links.each do |link| %>
  87. <a class="btn button-sidebar-wide" href="<%= link[:url] %>"><i class="<%= link[:icon_class] %>" role="presentation"></i> <%= link[:text] %></a>
  88. <% end %>
  89. </div>
  90. <% end %>
  91. <% if @context.available? && @context.self_enrollment_enabled? && @context.open_enrollment && (!@context_enrollment || !@context_enrollment.active?) %>
  92. <a href="<%= enroll_url(@context.self_enrollment_code) %>" class="btn button-sidebar-wide self_enrollment_link" data-open-as-dialog>
  93. <i class="icon-user-add"></i>
  94. {{#t}}_{{/t}}
  95. </a>
  96. <% elsif @context_enrollment && @context_enrollment.self_enrolled && @context_enrollment.active? %>
  97. <a href="#" class="btn button-sidebar-wide self_unenrollment_link">
  98. <i class="icon-end"></i>
  99. {{#t}}_{{/t}}
  100. </a>
  101. <div id="self_unenrollment_dialog" style="display: none;">
  102. <h2><i class="icon-warning"></i> {{#t}}_{{/t}}</h2>
  103. {{#t}}_{{/t}}
  104. <div class="button-container">
  105. <a href="<%= course_self_unenrollment_path(@context, @context_enrollment.uuid) %>" class="btn btn-primary action"><i class="icon-end"></i> <span>{{#t}}_{{/t}}</span></a>
  106. <a href="#" class="btn dialog_closer">{{#t}}_{{/t}}</a>
  107. </div>
  108. </div>
  109. <% end %>
  110. {{> to_do_list}}
  111. {{> group_list}}
  112. <%= nbsp unless @current_user %>
  113. </div>
  114. <% if @course_home_view == 'assignments' %>
  115. {{> assignments/assignments_list_right_side}}
  116. <% elsif @course_home_view == 'syllabus' %>
  117. {{> assignments/syllabus_right_side}}
  118. <% else %>
  119. <% locals = {:title => t("Coming Up"), :contexts_to_link_to => @context, :upcoming => true, :period => :one_week} %>
  120. <% if @current_user %>
  121. <% cache(safe_cache_key([@current_user, @contexts, 'course_upcoming_events' ])) do %>
  122. {{> shared/event_list}}
  123. <% end %>
  124. <% else %>
  125. {{> shared/event_list}}
  126. <% end %>
  127. <% end %>
  128. <% if @show_recent_feedback %>
  129. {{> shared/event_list", :object => @recent_feedback, :locals => {:title => t('titles.recent_feedback', "Recent Feedback}}
  130. <% end %>
  131. <% end %>
  132. <%
  133. css_bundle :dashboard
  134. case @course_home_view
  135. when 'wiki'
  136. css_bundle :tinymce
  137. when 'modules'
  138. js_bundle :context_modules
  139. css_bundle :context_modules2
  140. when 'assignments'
  141. js_bundle :assignment_index
  142. css_bundle :new_assignments
  143. when 'syllabus'
  144. js_bundle :syllabus
  145. css_bundle :tinymce
  146. else
  147. js_bundle :dashboard
  148. end
  149. %>
  150. <% js_bundle 'legacy/courses_show' %>
  151. <% if @pending_enrollment %>
  152. {{> shared/dashboard_invitation}}
  153. <% end %>
  154. <% if @context.show_announcements_on_home_page? %>
  155. <div id="announcements_on_home_page"></div>
  156. <% js_bundle :announcements_on_home_page %>
  157. <% end %>
  158. <div id="course_home_content">
  159. <% if @course_home_view == 'wiki' %>
  160. <% js_bundle :wiki_page_show %>
  161. <div id="wiki_page_show"></div>
  162. <% elsif @course_home_view == 'modules' %>
  163. {{> context_modules/content_next}}
  164. <% elsif @course_home_view == 'assignments' %>
  165. <%
  166. @body_classes << 'hide-content-while-scripts-not-loaded'
  167. @body_classes << 'with_item_groups'
  168. js_bundle :assignment_index
  169. css_bundle :new_assignments
  170. %>
  171. <% elsif @course_home_view == 'syllabus' %>
  172. {{> assignments/syllabus_content}}
  173. <% else %>
  174. {{> shared/dashboard_messages}}
  175. {{> shared/recent_activity}}
  176. <% end %>
  177. </div>
  178. <% if @context.public_license? %>
  179. <div class="public-license" style="margin-top: 20px;">
  180. <a class="public-license-image-link" href="<%= @context.license_url %>"><%= image_tag "cc/#{@context.license}.png", :alt => @context.readable_license %></a>
  181. <span class="public-license-text">{{#t}}'license_notice', %{This course content is offered under a %{license_type} license. Content in this course can be considered under this license unless otherwise noted.}, :license_type => content_tag('b', link_to(@context.readable_license, @context.license_url)) {{/t}}</span>
  182. <div class="clear"></div>
  183. </div>
  184. <% end %>
  185. <div id="wizard_box"></div>
  186. <% js_bundle :course %>