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 @@ -
  • - - <%= l activity.created_at, format: :full %> - - - <%= activity_truncate(activity.message) %> - <% if activity.my_module %> - [<%=t 'Project' %>: - <% if activity.my_module.experiment.project.name.length > - Constants::NAME_TRUNCATION_LENGTH %> - - <% else %> - <%= activity.my_module.experiment.project.name %> - <% end %>, <%=t 'Module' %>: - <% if activity.my_module.name.length > - Constants::NAME_TRUNCATION_LENGTH %> - - <% else %> - <%= activity.my_module.name %> - <% end %> - ] - <% end %> - -
  • diff --git a/app/views/activities/_list.html.erb b/app/views/activities/_list.html.erb deleted file mode 100644 index 9f12727e5..000000000 --- a/app/views/activities/_list.html.erb +++ /dev/null @@ -1,3 +0,0 @@ -<% activities.each_with_index do |activity, index| %> - <%= render 'activity', activity: activity %> -<% end %> diff --git a/app/views/activities/index.html.erb b/app/views/activities/index.html.erb deleted file mode 100644 index 4c7c5f04e..000000000 --- a/app/views/activities/index.html.erb +++ /dev/null @@ -1,27 +0,0 @@ -<% provide :head_title, t('nav.label.activities') %> - -
    -
    -
    -
      - <% if @vars[:activities].blank? %> -
    • <%= t'activities.index.no_activities' %>
    • - <% else %> - <% @vars[:activities].each do |activity| %> - <%= render 'activity', activity: activity %> - <% end %> - <% end %> -
    - <% if @vars[:more_activities_url].present? && @vars[:page] == 1 %> - - <% end %> -
    -
    -
    - -<%= javascript_include_tag 'activities/index.js' %> diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb index 5c260f003..34fcb9aa8 100644 --- a/config/initializers/assets.rb +++ b/config/initializers/assets.rb @@ -87,7 +87,6 @@ Rails.application.config.assets.precompile += %w(repositories/share_modal.js) Rails.application.config.assets.precompile += %w(repositories/edit.js) Rails.application.config.assets.precompile += %w(repositories/stock.js) Rails.application.config.assets.precompile += %w(repositories/repository_datatable.js) -Rails.application.config.assets.precompile += %w(activities/index.js) Rails.application.config.assets.precompile += %w(global_activities/index.js) Rails.application.config.assets.precompile += %w(repositories/show.js) Rails.application.config.assets.precompile += %w(sidebar_toggle.js) diff --git a/config/routes.rb b/config/routes.rb index c04ec7676..fb51e3322 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -28,8 +28,6 @@ Rails.application.routes.draw do end end - resources :activities, only: [:index] - get '/jobs/:id/status', to: 'active_jobs#status' get 'forbidden', to: 'application#forbidden', as: 'forbidden'