<% # Copyright (C) 2011 - present Instructure, Inc. # # This file is part of Canvas. # # Canvas is free software: you can redistribute it and/or modify it under # the terms of the GNU Affero General Public License as published by the Free # Software Foundation, version 3 of the License. # # Canvas is distributed in the hope that it will be useful, but WITHOUT ANY # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR # A PARTICULAR PURPOSE. See the GNU Affero General Public License for more # details. # # You should have received a copy of the GNU Affero General Public License along # with this program. If not, see . %> <% provide :page_title, @context.name %>

<%= @context.name %>

<% provide :right_side do %>
<% @can_manage = can_do(@context, @current_user, :manage) %> <% @module_dnd_FF = @domain_root_account.feature_enabled?(:module_dnd) %> <% @can_create_announcements = @context.announcements.temp_record.grants_right?(@current_user, session, :create) %> <% if can_do(@context, @current_user, :change_course_state) && (@context.unpublished? || @context.unpublishable?) %>

<%= t('headers.course_status', %{Course Status}) %>

<%= form_for @context, html: {id: "course_status_form"} do |f| %> <% if @context.created? || @context.claimed? %> <% else %> <% end %> <% end %>
<% end %> <% if @module_dnd_FF && can_do(@context, @current_user, :manage_content) %> <%= t('links.import', %{Import Existing Content}) %> <% end %> <% if @can_manage || @can_create_announcements || @course_home_view != 'feed' || @course_home_sub_navigation_tools.present? %>
<%= 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}) %> <% if @can_manage %>
<% end %> <% if @course_home_view != 'feed' %> <%= t('links.view_course_stream', %{View Course Stream}) %> <% end %> <% if @can_manage && !@domain_root_account.try(:feature_enabled?, :new_user_tutorial) %> <% js_bundle :course_wizard %> <% css_bundle :course_wizard %> <%= t('links.course_setup', %{Course Setup Checklist}) %> <% end %> <% if @can_create_announcements %> <%= t('links.new_announcement', %{New Announcement}) %> <% end %> <% if can_do(@context, @current_user, :use_student_view) && !@context.feature_enabled?(:easy_student_view) %> <%= link_to course_student_view_path(@context), :method => :post, :class => 'btn button-sidebar-wide' do %> <%= t('links.student_view', 'Student View') %> <% end %> <% end %> <% course_custom_links.each do |link| %> <%= link[:text] %> <% end %>
<% end %> <% if @context.available? && @context.self_enrollment_enabled? && @context.open_enrollment && (!@context_enrollment || !@context_enrollment.active?) %> <%= t('links.join_course', %{Join this Course}) %> <% elsif @context_enrollment && @context_enrollment.self_enrolled && @context_enrollment.active? %> <%= t('links.drop_course', %{Drop this Course}) %> <% end %> <% if @context_enrollment&.student? %> <%= t('links.view_course_calendar', %{View Course Calendar}) %> <% end %> <% if @context_enrollment %> "> <%= t('links.view_course_notification_settings', %{View Course Notifications}) %> <% end %> <%= render :partial => 'to_do_list', :locals => {:contexts => [@context], :show_legacy_todo_list => !@context_enrollment&.student?} %> <%= render :partial => "group_list", :locals => {:group_list => @user_groups} %> <%= nbsp unless @current_user %>
<% if @course_home_view == 'assignments' %> <%= render :partial => 'assignments/assignments_list_right_side', :locals => {:course_home => true} %> <% elsif @course_home_view == 'syllabus' %> <%= render :partial => 'assignments/syllabus_right_side', :locals => {:course_home => true} %> <% elsif !@context_enrollment&.student? %> <% locals = {:title => t("Coming Up"), :contexts_to_link_to => @context, :upcoming => true, :period => :one_week} %> <% if @current_user %> <% cache([@current_user, safe_cache_key(@contexts), 'course_upcoming_events' ].cache_key) do %> <% events = @current_user.upcoming_events(:contexts => @contexts) assignments = events.select{|e| e.is_a?(Assignment)} @current_user_submissions = Submission.where(:assignment_id => assignments, :user_id => @current_user).to_a if assignments.any? %> <%= render :partial => "shared/event_list", :object => events, :locals => locals %> <% end %> <% else %> <%= render :partial => "shared/event_list", :object => [], :locals => locals %> <% end %> <% end %> <% if @show_recent_feedback %> <%= render :partial => "shared/event_list", :object => @recent_feedback, :locals => {:title => t('titles.recent_feedback', "Recent Feedback"), :contexts_to_link_to => @context, :is_recent_feedback => true} %> <% end %> <% end %> <% if @pending_enrollment %> <%= render :partial => 'shared/dashboard_invitation', :object => @pending_enrollment %> <% end %> <% if @context.show_announcements_on_home_page? %>
<% js_bundle :announcements_on_home_page %> <% end %>
<% if @course_home_view == 'wiki' %>
<% elsif @course_home_view == 'modules' %> <%= render :partial => 'context_modules/content_next', :locals => {:course_home => true} %> <% elsif @course_home_view == 'assignments' %> <% elsif @course_home_view == 'syllabus' %> <%= render :partial => 'assignments/syllabus_content', :locals => {:course_home => true} %> <% else %> <%= render :partial => 'shared/dashboard_messages' %> <%= render :partial => 'shared/recent_activity' %> <% end %>
<% if @context.public_license? %>
<%= image_tag "cc/#{@context.license}.png", :alt => @context.readable_license %> <%= 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)) %>
<% end %>