<% # Copyright (C) 2020 - 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_title = t("%{assignment}: Submissions Uploaded", assignment: @assignment.title) @comments = [] @ignored_files = [] progress = @presenter.progress @finished = progress&.workflow_state == "completed" @failed = progress&.workflow_state == "failed" @pending = progress&.pending? if @finished @comments = progress.results[:comments] @ignored_files = progress.results[:ignored_files] end %> <% provide :page_title do %><%= @page_title %><% end %> <% if progress.nil? %>

<%= t("No Submissions Have Been Uploaded") %>

<%= t('To upload some submissions for this assignment, click on the "Back to Assignment" button above.') %>

<% else %>

<%= @page_title %>

<% end %> <% if @pending %>

<%= t(<<~TEXT) We are currently processing your files. This may take a while depending on the file size of the submissions. You may navigate away from this screen and check back later by clicking on the "View Upload Status" link on the assignment page, or refresh this page to see the status. TEXT %>

<% elsif @failed %>

<%= t("Oops, there was a problem re-uploading submissions. Check the zip file for issues and try again.") %>

<% elsif @finished %>

<%= t(<<~TEXT) Done! We took the files you uploaded and attached them with a short comment to each user's submission page for this assignment. The students will get a notification that a new comment was added. TEXT %>

<% if @comments.any? %> <% heading = t({ one: "(1) file was attached to the following user submission", other: "(%{count}) files were attached to the following user submissions" }, count: @comments.size) %>

<%= heading %>

<% @comments.each do |comment| %> <% end %>
<%= t('Student') %> <%= t('File') %>
<%= @presenter.student_name(comment) %> <% last_index = comment[:attachments].size - 1 %> <% comment[:attachments].each_with_index do |file, index| -%> <% renamed = file[:filename] != file[:display_name] %> <%= file[:display_name] %><%= "," unless renamed || index == last_index %> <% if renamed -%> (<%= t("renamed from %{filename}", filename: file[:filename]) %>)<%= "," unless index == last_index %> <%- end %> <%- end %>
<% end %> <% if @ignored_files.any? %> <% heading = t({ one: "(1) file was ignored", other: "(%{count}) files were ignored" }, count: @ignored_files.size) %>

<%= heading %>

<%= t(<<~TEXT) There were some files we didn't know what to do with. They have not been added to anyone's submission page. TEXT %>

<% end %> <% end %>