<% # Copyright (C) 2013 - 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 . %> <% context_module_next ||= nil context_module ||= context_module_next module_data = context_module ? process_module_data(context_module, @is_student, @current_user, @session) : { published_status: 'unpublished' } can_direct_share = can_do(@context, @current_user, :direct_share) workflow_state = context_module && context_module.workflow_state @modules ||= [] js_bundle :context_modules_publish_icon %> <% cache_if_module(context_module, @can_view, @can_add, @can_edit, @can_delete, @is_student, @can_view_unpublished, @current_user, @context) do %>
" data-workflow-state="<%= context_module ? context_module.workflow_state : "{{ workflow_state }}"%>" data-module-url="<%= context_url(@context, :context_url) %>/modules/<%= context_module ? context_module.id : "{{ id }}" %>" data-module-id="<%= context_module ? context_module.id : "{{ id }}" %>" id="context_module_<%= context_module ? context_module.id : "blank" %>" style="<%= hidden unless context_module %>" >

<%= context_module.try_rescue(:name) || nbsp %>

/collapse" class="ig-header-title collapse_module_link ellipsis" aria-controls="context_module_content_<%= context_module && context_module.id %>" aria-expanded="true" aria-label="<%= context_module.try_rescue(:name) || nbsp %> <%= t('toggle module visibility') %>" title="<%= context_module.try_rescue(:name) || nbsp %>" > <%= context_module.try_rescue(:name) || nbsp %> /collapse" class="ig-header-title expand_module_link ellipsis" aria-controls="context_module_content_<%= context_module && context_module.id %>" aria-expanded="false" aria-label="<%= context_module.try_rescue(:name) || nbsp %> <%= t('toggle module visibility') %>" title="<%= context_module.try_rescue(:name) || nbsp %>" > <%= context_module.try_rescue(:name) || nbsp %> <%= render :partial => "context_modules/prerequisites_message", :locals => {:viewable => @can_view, :context_module => context_module} %>
<% if context_module && context_module.completion_requirements.present? %>
    <% count = context_module.requirement_count %> <% completion_label = count == 1 ? t("Complete One Item") : t("Complete All Items") %>
  • <%= completion_label %>
<% end %>
<% unless @can_view %> <% if context_module %>
<%= t("Module Completed") %> <%= t("Module In Progress") %> <%= t("Module Locked") %>
<% end %> <% end %> <% if @can_edit%>
<% end %> <% if @can_add %> <% end %> <% if @can_view || can_direct_share %> <% end %> <%= context_module && context_module.name %> <%= context_module && context_module.id %> <%= context_module.try_rescue(:publish_final_grade?) || nbsp %> <%= context_module.try_rescue(:require_sequential_progress) || "" %>
<% if @can_edit && Account.site_admin.feature_enabled?(:selective_release_ui_api) %>
<% if context_module && @module_ids_with_overrides&.include?(context_module.id) %> <% end %>
<% end %>
    <% if context_module && module_data[:items] %> <% module_data[:items].each do |item| %> <% item_data = module_data[:items_data][item.id] locals = { item_restrictions: module_data.dig(:items_restrictions, item.id), completion_criteria: context_module.completion_requirements, item_data: item_data, viewable: @can_view, } %> <%= render :partial => 'context_modules/module_item_next', :object => item, :as => :module_item, :locals => locals %> <% if item_data[:show_cyoe_placeholder] %> <%= render :partial => 'context_modules/module_item_conditional_next', :object => item, :as => :module_item, :locals => locals %> <% end %> <% end %> <% end %>
<% if !context_module || @can_view && module_data[:items]&.empty? %>
<% end %>
<% end %>