From 583a3ba519d2f18f5f7153bcbd63ddb0468776c8 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Fri, 15 Apr 2022 18:55:45 +0200 Subject: [PATCH] Remove `user#lists` action, view and route --- app/controllers/user_controller.rb | 11 ----------- app/views/user/lists.haml | 9 --------- config/routes.rb | 1 - 3 files changed, 21 deletions(-) delete mode 100644 app/views/user/lists.haml diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index c02e75b4..b413be07 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -71,17 +71,6 @@ class UserController < ApplicationController end # endregion - # region Lists - def lists - @user = User.where('LOWER(screen_name) = ?', params[:username].downcase).first! - @lists = if current_user == @user - @user.lists - else - @user.lists.where(private: false) - end.all - end - # endregion - def followers @title = 'Followers' @user = User.where('LOWER(screen_name) = ?', params[:username].downcase).includes(:profile).first! diff --git a/app/views/user/lists.haml b/app/views/user/lists.haml deleted file mode 100644 index 3a675de4..00000000 --- a/app/views/user/lists.haml +++ /dev/null @@ -1,9 +0,0 @@ -%ul - - @lists.each do |list| - %li - - if list.private? - %i.fa.fa-lock - = list.display_name - -- provide(:title, user_title(@user, 'lists')) -- parent_layout 'user/profile' diff --git a/config/routes.rb b/config/routes.rb index 6b6d443e..9bdfdced 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -143,7 +143,6 @@ Rails.application.routes.draw do match '/:username/followers(/p/:page)', to: 'user#followers', via: 'get', as: :show_user_followers, defaults: {page: 1} match '/:username/followings(/p/:page)', to: 'user#followings', via: 'get', as: :show_user_followings, defaults: {page: 1} match '/:username/friends(/p/:page)', to: redirect('/%{username}/followings/p/%{page}'), via: 'get', defaults: {page: 1} - match '/:username/lists(/p/:page)', to: 'user#lists', via: 'get', as: :show_user_lists, defaults: {page: 1} match '/:username/questions(/p/:page)', to: 'user#questions', via: 'get', as: :show_user_questions, defaults: {page: 1} match '/feedback/consent', to: 'feedback#consent', via: 'get', as: 'feedback_consent'