123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200 |
- <%
- # 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 <http://www.gnu.org/licenses/>.
- %>
- <% content_for :page_title, @context.name %>
- <% css_bundle :course_show %>
- <% @active_tab ||= "home" %>
- <h1 class='screenreader-only'><%= @context.name %></h1>
- <% content_for :auto_discovery do %>
- <% if @context_enrollment %>
- <%= auto_discovery_link_tag(:atom, feeds_course_format_path(@context_enrollment.feed_code, :atom), {:title => t("Course Atom Feed")}) %>
- <% elsif @context.available? %>
- <%= auto_discovery_link_tag(:atom, feeds_course_format_path(@context.feed_code, :atom), {:title => t("Course Atom Feed")}) %>
- <% end %>
- <% end %>
- <% content_for :right_side do %>
- <div id="course_show_secondary">
- <% @can_manage = can_do(@context, @current_user, :manage) %>
- <% @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?) %>
- <div id="course_status">
- <h3>
- {{#t}}_{{/t}}
- </h3>
- <div id='course_status_actions' class="ui-buttonset">
- <%= form_for @context, html: {id: "course_status_form"} do |f| %>
- <% if @context.created? || @context.claimed? %>
- <button type="button" class='ui-button btn-unpublish disabled' disabled>
- <i class="icon-unpublish"></i>{{#t}}_{{/t}}
- </button>
- <button type='submit' class="ui-button btn-publish">
- <i class="icon-publish icon-Solid"></i>{{#t}}_{{/t}}
- </button>
- <input type='hidden' name='course[event]' value='offer' />
- <% else %>
- <button type='submit' class="ui-button">
- <i class="icon-unpublish"></i> {{#t}}_{{/t}}
- </button>
- <button type="button" class="ui-button disabled btn-published" disabled>
- <i class="icon-publish icon-Solid"></i>{{#t}}_{{/t}}
- </button>
- <input type='hidden' name='course[event]' value='claim' />
- <% end %>
- <% end %>
- </div>
- </div>
- <% end %>
- <% if @can_manage || @can_create_announcements || @course_home_view != 'feed' || @course_home_sub_navigation_tools.present? %>
- <div class="course-options">
- <%= 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 %>
- <div id="choose_home_page"></div>
- <div id="choose_home_page_not_modules"></div>
- <% end %>
- <% if @course_home_view != 'feed' %>
- <a class="btn button-sidebar-wide" href="<%= context_url(@context, :context_url, :view => 'feed') %>">
- <i class="icon-stats"></i>
- {{#t}}_{{/t}}
- </a>
- <% end %>
- <% if @can_manage && !@domain_root_account.try(:feature_enabled?, :new_user_tutorial) %>
- <% set_js_course_wizard_data %>
- <% js_bundle :course_wizard %>
- <% css_bundle :course_wizard %>
- <a href="#" class="btn button-sidebar-wide wizard_popup_link <%= 'auto_open' if @context.created? || @context.claimed? %>">
- <i class="icon-question"></i> {{#t}}_{{/t}}
- </a>
- <% end %>
- <% if @can_create_announcements %>
- <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}}
- </a>
- <% end %>
- <% course_custom_links.each do |link| %>
- <a class="btn button-sidebar-wide" href="<%= link[:url] %>"><i class="<%= link[:icon_class] %>" role="presentation"></i> <%= link[:text] %></a>
- <% end %>
- </div>
- <% end %>
- <% if @context.available? && @context.self_enrollment_enabled? && @context.open_enrollment && (!@context_enrollment || !@context_enrollment.active?) %>
- <a href="<%= enroll_url(@context.self_enrollment_code) %>" class="btn button-sidebar-wide self_enrollment_link" data-open-as-dialog>
- <i class="icon-user-add"></i>
- {{#t}}_{{/t}}
- </a>
- <% elsif @context_enrollment && @context_enrollment.self_enrolled && @context_enrollment.active? %>
- <a href="#" class="btn button-sidebar-wide self_unenrollment_link">
- <i class="icon-end"></i>
- {{#t}}_{{/t}}
- </a>
- <div id="self_unenrollment_dialog" style="display: none;">
- <h2><i class="icon-warning"></i> {{#t}}_{{/t}}</h2>
- {{#t}}_{{/t}}
- <div class="button-container">
- <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>
- <a href="#" class="btn dialog_closer">{{#t}}_{{/t}}</a>
- </div>
- </div>
- <% end %>
- {{> to_do_list}}
- {{> group_list}}
- <%= nbsp unless @current_user %>
- </div>
- <% if @course_home_view == 'assignments' %>
- {{> assignments/assignments_list_right_side}}
- <% elsif @course_home_view == 'syllabus' %>
- {{> assignments/syllabus_right_side}}
- <% else %>
- <% locals = {:title => t("Coming Up"), :contexts_to_link_to => @context, :upcoming => true, :period => :one_week} %>
- <% if @current_user %>
- <% cache(safe_cache_key([@current_user, @contexts, 'course_upcoming_events' ])) do %>
- {{> shared/event_list}}
- <% end %>
- <% else %>
- {{> shared/event_list}}
- <% end %>
- <% end %>
- <% if @show_recent_feedback %>
- {{> shared/event_list", :object => @recent_feedback, :locals => {:title => t('titles.recent_feedback', "Recent Feedback}}
- <% end %>
- <% end %>
- <%
- css_bundle :dashboard
- case @course_home_view
- when 'wiki'
- css_bundle :tinymce
- when 'modules'
- js_bundle :context_modules
- css_bundle :context_modules2
- when 'assignments'
- js_bundle :assignment_index
- css_bundle :new_assignments
- when 'syllabus'
- js_bundle :syllabus
- css_bundle :tinymce
- else
- js_bundle :dashboard
- end
- %>
- <% js_bundle 'legacy/courses_show' %>
- <% if @pending_enrollment %>
- {{> shared/dashboard_invitation}}
- <% end %>
- <% if @context.show_announcements_on_home_page? %>
- <div id="announcements_on_home_page"></div>
- <% js_bundle :announcements_on_home_page %>
- <% end %>
- <div id="course_home_content">
- <% if @course_home_view == 'wiki' %>
- <% js_bundle :wiki_page_show %>
- <div id="wiki_page_show"></div>
- <% elsif @course_home_view == 'modules' %>
- {{> context_modules/content_next}}
- <% elsif @course_home_view == 'assignments' %>
- <%
- @body_classes << 'hide-content-while-scripts-not-loaded'
- @body_classes << 'with_item_groups'
- js_bundle :assignment_index
- css_bundle :new_assignments
- %>
- <% elsif @course_home_view == 'syllabus' %>
- {{> assignments/syllabus_content}}
- <% else %>
- {{> shared/dashboard_messages}}
- {{> shared/recent_activity}}
- <% end %>
- </div>
- <% if @context.public_license? %>
- <div class="public-license" style="margin-top: 20px;">
- <a class="public-license-image-link" href="<%= @context.license_url %>"><%= image_tag "cc/#{@context.license}.png", :alt => @context.readable_license %></a>
- <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>
- <div class="clear"></div>
- </div>
- <% end %>
- <div id="wizard_box"></div>
- <% js_bundle :course %>
|