<% # 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 do %><%= @section.name %><% end %> <% provide :right_side do %> <% if can_do(@section, @current_user, :update) %> <%= t('buttons.edit_section', 'Edit Section') %> <% if @section.nonxlist_course_id %> <% if can_do(@section.nonxlist_course, @current_user, :manage_sections_edit) %> <%= t('buttons.uncrosslist_section', 'De-Cross-List this Section') %> <% end %> <%= t('buttons.recrosslist_section', 'Re-Cross-List this Section') %> <% else %> <%= t('buttons.crosslist_section', 'Cross-List this Section') %> <% end %> <% end %> <%= t('buttons.back_to_course', 'Back to Course Settings') %> <% end %> <%= form_for @section, :url => context_url(@context, :context_section_url, @section), :html => {:id => "edit_section_form", :style => "display: none;"} do |f| %> <% if @section.sis_source_id && can_do(@context, @current_user, :read_sis) || can_do(@context.root_account, @current_user, :manage_sis) %> <% end %>
<%= f.blabel :name, :en => "Section Name" %> <%= f.text_field :name %>
<%= f.blabel :sis_source_id, :en => "SIS ID" %> <% if can_do(@context.root_account, @current_user, :manage_sis) %> <%= f.text_field :sis_source_id, :style => "width: 50px;", :title => "SIS ID", :value => @section.sis_source_id %> <% else %> <%= @section.sis_source_id %> <% end %>
<%= t "Changing section dates may override course and term availability settings and placement in the Courses page and Dashboard. Please confirm term and course dates before modifying section dates." %>
<%= f.blabel :start_at, en: "Starts" %> <%= f.text_field :start_at, class: "datetime_field", value: datetime_string(@section.start_at), style: 'width: 120px;', "aria-labelledby" => "section_starts_at_label", "data-tooltip" => "", title: accessible_date_format %>
<%= f.blabel :end_at, en: "Ends" %> <%= f.text_field :end_at, class: "datetime_field", value: datetime_string(@section.end_at), style: 'width: 120px;', "aria-labelledby" => "section_ends_at_label", "data-tooltip" => "", title: accessible_date_format %>
<%= f.check_box :restrict_enrollments_to_section_dates, 'aria-describedby' => 'restrict-enrollments-description' %> <%= f.label :restrict_enrollments_to_section_dates, t("Students can only participate in the course between these dates") %>
<%= t "When selected, the course section is in a read-only state outside these dates." %>
<% end %>

<%= @section.name %>

<% if @pending_enrollments_count > 0 %> <% end %> <% if @enrollments_count > 0 %> <% end %> <% if @completed_enrollments_count > 0 %> <% end %>
<%= t('pending_enrollment', {:one => '1 Pending Enrollment', :other => '%{count} Pending Enrollments'}, :count => @pending_enrollments_count) %>
<%= t('active_enrollment', {:one => '1 Active Enrollment', :other => '%{count} Active Enrollments'}, :count => @enrollments_count) %>
<%= t('completed_enrollment', {:one => '1 Completed Enrollment', :other => '%{count} Completed Enrollments'}, :count => @completed_enrollments_count) %>
<% if @section && ( @section.sis_source_id && can_do(@context, @current_user, :read_sis) || can_do(@context, @current_user, :manage_sis))%>
<%= before_label('sis_id', "SIS ID") %> <%= @section.sis_source_id %>
<% end %> <% if @section.start_at || @section.end_at %>
<% if @section.start_at && @section.end_at %> <%= t('run_dates', 'Runs from %{start_date} to %{end_date}', :start_date => friendly_datetime(@section.start_at, context: @context).html_safe, :end_date => friendly_datetime(@section.end_at, context: @context).html_safe) %> <% elsif @section.end_at %> <%= t('runs_until', 'Runs until %{end_date}', :end_date => friendly_datetime(@section.end_at, context: @context).html_safe) %> <% elsif @section.start_at %> <%= t('run_from', 'Runs from %{start_date} with no end date', :start_date => friendly_datetime(@section.start_at, context: @context).html_safe) %> <% end %>
<%= t('Students can only participate in the course between these dates') if @section.restrict_enrollments_to_section_dates %>
<% end %>
<% manage_perm = @context.root_account.feature_enabled?(:granular_permissions_manage_users) ? :allow_course_admin_actions : :manage_admin_users %> <% if can_do @context, @current_user, :read_roster, :manage_students, manage_perm %>

<%= t('titles.current_enrollments', 'Current Enrollments') %>

    <%= t('titles.completed_enrollments', 'Completed Enrollments') %>

      <% end %> <% js_bundle :section %>
      <%= form_tag context_url(@context, :context_section_crosslist_url, @section.id), :id => "crosslist_course_form", :class => "form-dialog no-margin-bottom", :title => t('titles.crosslist_this_section', 'Cross-List this Section'), :method => :post do %>

      <%= t('titles.cross_listed_sections', 'Cross-List Section') %>

      <%= t('crosslist_description', %{ Cross-listing allows you to create a section in one account and then move it to a course on a different account. To cross-list this course, you'll need to find the course you want to move it to, either using the search tool or by entering the course's ID. }) %>

      " id="course_confirm_crosslist_url" style="display: none;"> 
      <%= before_label('labels.selected_course', 'Selected Course') %>
      <% end %> <%= form_tag context_url(@context, :context_section_uncrosslist_url, @section.id), :id => "uncrosslist_form", :title => t('titles.decrosslist_section', 'De-Cross-List this Section'), :method => :delete do %>

      <%= t('titles.decrosslist_section', 'De-Cross-List this Section') %>

      <%= t('prompts.are_you_sure_decrosslist', 'Are you sure you want to de-cross-list this section?') %> <% if @section.nonxlist_course %> <%= mt('decrosslist_description', 'This will move the section back to its original course, **%{course_name}**.', :course_name => @section.nonxlist_course.name) %> <% end %>

      <% if @student_enrollments_count > 0 %>

      <%= t('decrosslist_long_description', %{ All grades for students in this course will no longer be visible. You can retrieve the grades later by re-cross-listing the course, but in the mean time the grades for these students will come from the original course. }) %>

      <% end %>
      <% end %>