2014-04-17 17:49:51 +01:00
|
|
|
if @activity_feeds.next_page
|
2015-05-05 13:25:29 +01:00
|
|
|
json.next_page_link root_path(filter: @filter,
|
|
|
|
page: @activity_feeds.next_page,
|
|
|
|
owner_filter: @owner_filter,
|
|
|
|
project_name_filter: @project_name_filter,
|
|
|
|
format: :json)
|
2014-04-17 17:49:51 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
json.feed do
|
|
|
|
json.array!(@activity_feeds) do |item|
|
2014-06-24 10:03:08 +01:00
|
|
|
json.cache! item, expires_in: 10.minutes do
|
2014-04-17 17:49:51 +01:00
|
|
|
json.date item.created_at
|
|
|
|
json.kind item.kind
|
|
|
|
user = get_user_from_activity_item(item)
|
|
|
|
json.user do
|
|
|
|
json.link user_path(user) if user.persisted?
|
|
|
|
json.image avatar_url(user, :small) if user.persisted?
|
|
|
|
json.uname (user.fullname || user.email)
|
|
|
|
end if user
|
|
|
|
|
2015-05-05 13:25:29 +01:00
|
|
|
project_name_with_owner = "#{item.project_owner}/#{item.project_name}"
|
2015-05-08 11:47:30 +01:00
|
|
|
@project = Project.find_by_owner_and_name(project_name_with_owner)
|
2014-04-17 17:49:51 +01:00
|
|
|
|
|
|
|
json.project_name_with_owner project_name_with_owner
|
2014-05-12 09:19:10 +01:00
|
|
|
json.partial! item.partial, item: item, project_name_with_owner: project_name_with_owner
|
2014-04-17 17:49:51 +01:00
|
|
|
json.id item.id
|
2014-06-24 10:03:08 +01:00
|
|
|
end
|
2014-04-17 17:49:51 +01:00
|
|
|
end
|
|
|
|
end
|