%
# Copyright (C) 2012 - 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 .
%>
<% categorized_items =
Rails.cache.fetch(['categorized_stream_items', @user || @current_user, collection_cache_key(@stream_items)].cache_key, :expires_in => 15.minutes) do
categorize_stream_items(@stream_items)
end
%>
<% %w(Announcement Conversation Assignment DiscussionTopic AssessmentRequest).each do |category| %>
<% items = categorized_items[category] %>
<% items = items.to_a + categorized_items['DiscussionEntry'].to_a if category == 'DiscussionTopic'%>
<% category_class = category.underscore %>
<% if items.present? %>
-
<%= category_details_label(category) %>
<%= t(:unread_column, "Unread") %> |
<%= t(:message_column, "Message") %> |
<%= t(:date_column, "Date") %> |
|
<%= render :partial => 'shared/recent_activity_item', :collection => items %>
<% end %>
<% end %>
<% if categorized_items.values.map(&:count).sum == 0 %>
<%= render :partial => 'shared/no_recent_activity' %>
<% end %>