diff --git a/app/views/hyrax/users/_activity_log.html.erb b/app/views/hyrax/users/_activity_log.html.erb index 183bbf4685..6c3700bb4f 100644 --- a/app/views/hyrax/users/_activity_log.html.erb +++ b/app/views/hyrax/users/_activity_log.html.erb @@ -7,17 +7,23 @@ - <% events.each do |event| %> - <% next if event[:action].blank? or event[:timestamp].blank? %> + <% valid_events = events.reject { |event| event[:action].blank? || event[:timestamp].blank? } %> + <% if valid_events.empty? %> - <%= sanitize event[:action] %> - <% time = Time.zone.at(event[:timestamp].to_i) %> - - - <%= time.to_formatted_s(:long_ordinal) %> - - + No user activity + <% else %> + <% valid_events.each do |event| %> + + <%= sanitize event[:action] %> + <% time = Time.zone.at(event[:timestamp].to_i) %> + + + <%= time.to_formatted_s(:long_ordinal) %> + + + + <% end %> <% end %>