<% # 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 . %> <% title = @context.is_a?(Course) ? t('content_exports', "Content Exports") : t('user_data_exports', "Download Submissions") friendly_message = @context.is_a?(Course) ? nil : t("Creating a Submission Export will allow you to download a zip file of all your assignment submissions in all of your present and past courses. This could be a big file, so it may take a while. You can navigate away from the page and come back later.") %> <% add_crumb title %> <% provide :page_title do %><%= title %><% end %>

<%= title %>

<% if friendly_message %>

<%= friendly_message %>

<% end %>
<% @exports.each do |export| %> <% unless export.running? %> <% if export.workflow_state == 'exported' %>

<% date = "#{datetime_string export.created_at}".html_safe %> <% wrapper = link_to('\1', export.attachment ? verified_file_download_url(export.attachment) : nil) %> <% if export.expired? %> <%= t "Course Export from %{date} (file not available)", :date => date %> <% elsif export.export_type == ContentExport::COMMON_CARTRIDGE %> <%= t "*Course Export from %{date}*", :date => date, :wrapper => wrapper %> <% elsif export.export_type == ContentExport::QTI %> <%= t "*QTI Export from %{date}*", :date => date, :wrapper => wrapper %> <% elsif export.export_type == ContentExport::USER_DATA %> <%= t "*User Data Export from %{date}*", :date => date, :wrapper => wrapper %> <% elsif export.export_type == ContentExport::ZIP %> <%= t "*File Export from %{date}*", :date => date, :wrapper => wrapper %> <% end %>

<% end %> <% end %> <% end %>
<% if ContentExport.expire? %>

<%= t "Content export files cannot be downloaded after %{days} days.", days: ContentExport.expire_days %>

<% end %>
<% if @context.is_a?(Course) %> <%= form_tag course_content_exports_path(@context.id), :id => "exporter_form" do %>

<%= t :export_type, "Export Type" %>

<% end %> <% elsif @context == @current_user %> <% if @current_user.submissions.exists? %> <%= form_tag dashboard_content_exports_path, :id => "exporter_form" do %>
<% end %> <% else %> <%= t('no_submissions', "You currently have no submissions to export.") %> <% end %> <% end %>
<% if @context.is_a?(Course) %>
<%= mt 'message.export_started', "The export process has started. This can take awhile for large courses. *You can leave the page* and you'll get an email when the export is complete." %>
<% end %>
<% if @current_export_id %>
<%= @current_export_id %>
<% end %>
<% js_bundle :content_exports %>