2020-10-27 00:47:42 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2011-02-01 09:57:29 +08:00
|
|
|
#
|
2017-04-28 03:50:31 +08:00
|
|
|
# Copyright (C) 2011 - present Instructure, Inc.
|
2011-02-01 09:57:29 +08:00
|
|
|
#
|
|
|
|
# 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 <http://www.gnu.org/licenses/>.
|
|
|
|
#
|
|
|
|
|
|
|
|
module AccountsHelper
|
|
|
|
def show_last_batch
|
|
|
|
@last_batch && !(@current_batch && @current_batch.importing?)
|
|
|
|
end
|
2016-05-20 12:52:30 +08:00
|
|
|
|
2011-02-01 09:57:29 +08:00
|
|
|
def print_messages(batch)
|
|
|
|
return "" unless batch
|
2021-09-23 00:23:01 +08:00
|
|
|
|
2011-02-24 05:05:43 +08:00
|
|
|
render partial: "accounts/sis_batch_messages", object: batch
|
2011-02-01 09:57:29 +08:00
|
|
|
end
|
2016-05-20 12:52:30 +08:00
|
|
|
|
2011-02-01 09:57:29 +08:00
|
|
|
def print_counts(batch)
|
|
|
|
return "" unless batch.data && batch.data[:counts]
|
2021-09-23 00:23:01 +08:00
|
|
|
|
2011-02-24 05:05:43 +08:00
|
|
|
render partial: "accounts/sis_batch_counts", object: batch
|
2011-02-01 09:57:29 +08:00
|
|
|
end
|
2012-04-06 03:23:56 +08:00
|
|
|
|
|
|
|
def show_code_and_term_for(course)
|
|
|
|
show_term = course.enrollment_term && !course.enrollment_term.default_term?
|
|
|
|
show_code = course.course_code != course.name
|
|
|
|
"#{course.course_code if show_code}#{", " if show_term && show_code}#{course.enrollment_term.name if show_term}"
|
|
|
|
end
|
2016-05-20 12:52:30 +08:00
|
|
|
|
2018-10-06 00:01:30 +08:00
|
|
|
def turnitin_originality_options(account)
|
2016-05-20 12:52:30 +08:00
|
|
|
[
|
2018-10-06 00:01:30 +08:00
|
|
|
account.root_account? ? nil : [I18n.t("Use parent account setting"), nil],
|
2016-05-20 12:52:30 +08:00
|
|
|
[I18n.t("#turnitin_settings.originality_report_visible_immediately", "Immediately"), "immediate"],
|
|
|
|
[I18n.t("#turnitin_settings.originality_report_visible_after_grading", "After the assignment is graded"), "after_grading"],
|
|
|
|
[I18n.t("#turnitin_settings.originality_report_visible_after_due_date", "After the Due Date"), "after_due_date"],
|
|
|
|
[I18n.t("#turnitin_settings.originality_report_never", "Never"), "never"]
|
2018-10-06 00:01:30 +08:00
|
|
|
].compact
|
2016-05-20 12:52:30 +08:00
|
|
|
end
|
2018-01-17 14:02:02 +08:00
|
|
|
|
2021-10-21 07:07:35 +08:00
|
|
|
def dashboard_view_options
|
2018-01-17 14:02:02 +08:00
|
|
|
[
|
|
|
|
[I18n.t("Card View"), "cards"],
|
|
|
|
[I18n.t("Recent Activity"), "activity"],
|
2020-07-13 21:34:57 +08:00
|
|
|
[I18n.t("List View"), "planner"]
|
|
|
|
]
|
2018-01-17 14:02:02 +08:00
|
|
|
end
|
2011-02-01 09:57:29 +08:00
|
|
|
end
|