diff --git a/app/assets/javascripts/activities/index.js b/app/assets/javascripts/activities/index.js deleted file mode 100644 index 01f333857..000000000 --- a/app/assets/javascripts/activities/index.js +++ /dev/null @@ -1,16 +0,0 @@ -'use strict'; - -(function() { - function initActivitiesButton() { - $('.btn-more-activities') - .on('ajax:success', function(e, data) { - $(data.html).insertAfter($('#list-activities li').last()); - if (data.more_url) { - $(this).attr('href', data.more_url); - } else { - $(this).remove(); - } - }); - } - initActivitiesButton(); -}()); diff --git a/app/controllers/activities_controller.rb b/app/controllers/activities_controller.rb deleted file mode 100644 index 594dfb76d..000000000 --- a/app/controllers/activities_controller.rb +++ /dev/null @@ -1,36 +0,0 @@ -class ActivitiesController < ApplicationController - include ActivityHelper - - def index - @vars = local_vars - render json: { - more_url: local_vars.fetch(:more_activities_url), - html: render_to_string( - partial: 'list', locals: @vars, formats: :html - ) - } - end - - private - - def local_vars - page = (params[:page] || 1).to_i - activities = current_user.last_activities - .page(page) - .per(Constants::ACTIVITY_AND_NOTIF_SEARCH_LIMIT) - unless activities.blank? || activities.last_page? - more_url = url_for( - activities_url( - format: :json, - page: page + 1, - last_activity: activities.last.id - ) - ) - end - { - activities: activities, - more_activities_url: more_url, - page: page - } - end -end diff --git a/app/controllers/my_modules_controller.rb b/app/controllers/my_modules_controller.rb index eb03381ed..c4f7a03ff 100644 --- a/app/controllers/my_modules_controller.rb +++ b/app/controllers/my_modules_controller.rb @@ -131,11 +131,19 @@ class MyModulesController < ApplicationController @next_page = activities.next_page @starting_timestamp = activities.first&.created_at.to_i - render json: { - activities_html: render_to_string(partial: 'global_activities/activity_list'), - next_page: @next_page, - starting_timestamp: @starting_timestamp - } + respond_to do |format| + format.json do + render json: { + activities_html: render_to_string( + partial: 'global_activities/activity_list', + formats: :html + ), + next_page: @next_page, + starting_timestamp: @starting_timestamp + } + end + format.html + end end # Different controller for showing activities inside tab diff --git a/app/views/activities/_activity.html.erb b/app/views/activities/_activity.html.erb deleted file mode 100644 index e4865539a..000000000 --- a/app/views/activities/_activity.html.erb +++ /dev/null @@ -1,32 +0,0 @@ -