<% # Copyright (C) 2015 - 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 . # This is rendered both on the dashboard and on the course homepage. On the # dashboard, contexts is nil, and so the cache is only based on the user, which # does not get touched when an assignment needs_grading count changes. So for # the dashboard, we expire after 3 minutes. On the course page, contexts is the # course, which does get touched, and so the cache expiration works. # # BTW if you add a new thing here, it probably needs adding to the /users/self/todo API show_legacy_todo_list ||= false %> <% if !show_legacy_todo_list %> <% else cache_opts = (contexts.present? ? {} : { :expires_in => 3.minutes }) cache(safe_cache_key([@current_user, @current_user&.cache_key(:todo_list), contexts, show_legacy_todo_list, 'to_do_list_view']), cache_opts) do hidden_todos = 0 presenter = ToDoListPresenter.new(self, @current_user, contexts) %> <% if presenter.any_assignments? %>

<%= t('headings.to_do', %{To Do}) %>

<% end %> <% end %> <% end %>