<% # 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 . %> <% page_section ||= nil %>
" id="page_section_<%= idx %>"> "><%= image_tag "move.png", :alt => t('Drag to rearrange sections') %>
<% if !page_section || page_section["section_type"] == "rich_text" %> <%= t('section_types.rich_text', "Rich Text Content") %> <% elsif page_section["section_type"] == "html" %> <%= t('section_types.html', "HTML/Embedded Content") %> <% elsif page_section["section_type"] == "submission" %> <%= t('section_types.submission', "Course Submission") %> <% elsif page_section["section_type"] == "attachment" %> <%= t('section_types.attachment', "Image/File Upload") %> <% end %>
<% if page_section %> <% if !page_section["section_type"] || page_section["section_type"] == "rich_text" || page_section["section_type"] == "html" %> <%= page_section["content"] ? raw(Sanitize.clean(page_section["content"], CanvasSanitize::SANITIZE)) : t('rich_text.default_content', "Nothing Entered Yet") %> <% elsif page_section["section_type"] == "attachment" %>
<% attachment = @portfolio.shard.activate { @portfolio.user.attachments.find(page_section["attachment_id"]) } %> <% if attachment && attachment.content_type.match(/\Aimage/) %> <%= image_tag eportfolio_entry_view_file_path(@portfolio, @page, attachment.uuid), :alt => attachment.display_name %> <% elsif attachment %> <%= t('links.download_attachment', "Click here to Download *%{attachment}*", :attachment => attachment.display_name, :wrapper => '\1') %> <% end %>
<% elsif page_section["section_type"] == "submission" %> <% submission = @portfolio.user.submissions.where(id: page_section["submission_id"]).first if page_section["submission_id"].present? %> <% if submission %> <% end %> <% end %> <% end %>
<%= (page_section["section_type"] || "rich_text") rescue "rich_text" %> <%= (page_section["attachment_id"] || nbsp) rescue nbsp %> <%= (page_section["submission_id"] || nbsp) rescue nbsp %>