diff options
author | Rhenium <rhenium@rhe.jp> | 2014-02-20 20:44:09 +0900 |
---|---|---|
committer | Rhenium <rhenium@rhe.jp> | 2014-02-20 20:44:09 +0900 |
commit | 5a6d3a389c622a0c9802a0b69b227bcbc88a2509 (patch) | |
tree | e35e38411c68288ba89a091ff461027dfd24ea05 | |
parent | 33689cbce02d01aa59aab7d2aaba9e7127aacd9f (diff) | |
download | aclog-5a6d3a389c622a0c9802a0b69b227bcbc88a2509.tar.gz |
rename user page in tweets controller (best -> user_best, timeline -> user_timeline)
-rw-r--r-- | app/controllers/tweets_controller.rb | 34 | ||||
-rw-r--r-- | app/views/tweets/user_best.html.haml (renamed from app/views/tweets/best.html.haml) | 0 | ||||
-rw-r--r-- | app/views/tweets/user_discovered_by.atom.builder (renamed from app/views/tweets/discovered_by.atom.builder) | 0 | ||||
-rw-r--r-- | app/views/tweets/user_discovered_by.html.haml (renamed from app/views/tweets/discovered_by.html.haml) | 0 | ||||
-rw-r--r-- | app/views/tweets/user_discoveries.atom.builder (renamed from app/views/tweets/discoveries.atom.builder) | 0 | ||||
-rw-r--r-- | app/views/tweets/user_discoveries.html.haml (renamed from app/views/tweets/discoveries.html.haml) | 0 | ||||
-rw-r--r-- | app/views/tweets/user_favorites.html.haml (renamed from app/views/tweets/favorites.html.haml) | 0 | ||||
-rw-r--r-- | app/views/tweets/user_recent.html.haml (renamed from app/views/tweets/recent.html.haml) | 0 | ||||
-rw-r--r-- | app/views/tweets/user_retweets.html.haml (renamed from app/views/tweets/retweets.html.haml) | 0 | ||||
-rw-r--r-- | app/views/tweets/user_timeline.atom.builder (renamed from app/views/tweets/timeline.atom.builder) | 0 | ||||
-rw-r--r-- | app/views/tweets/user_timeline.html.haml (renamed from app/views/tweets/timeline.html.haml) | 0 | ||||
-rw-r--r-- | config/routes.rb | 16 |
12 files changed, 25 insertions, 25 deletions
diff --git a/app/controllers/tweets_controller.rb b/app/controllers/tweets_controller.rb index 4a2590f..9a23739 100644 --- a/app/controllers/tweets_controller.rb +++ b/app/controllers/tweets_controller.rb @@ -1,14 +1,4 @@ class TweetsController < ApplicationController - def index - begin - best - render :best - rescue Aclog::Exceptions::AccountPrivate - timeline - render :timeline - end - end - def show @tweet = Tweet.find(params[:id]) @user = @tweet.user @@ -17,45 +7,55 @@ class TweetsController < ApplicationController @replies_after = @tweet.reply_descendants(2) end - def best + def user_index + begin + user_best + render :user_best + rescue Aclog::Exceptions::AccountPrivate + user_timeline + render :user_timeline + end + end + + def user_best @user = require_user authorize_to_show_user! @user authorize_to_show_user_best! @user @tweets = paginate_with_page_number(@user.tweets.reacted.order_by_reactions) end - def recent + def user_recent @user = require_user authorize_to_show_user! @user authorize_to_show_user_best! @user @tweets = paginate_with_page_number(@user.tweets.reacted.recent.order_by_reactions) end - def timeline + def user_timeline @user = require_user authorize_to_show_user! @user @tweets = paginate(@user.tweets.reacted(params[:reactions]).order_by_id) end - def discoveries + def user_discoveries @user = require_user authorize_to_show_user! @user @tweets = paginate(Tweet).discovered_by(@user).order_by_id end - def favorites + def user_favorites @user = require_user authorize_to_show_user! @user @tweets = paginate(Tweet).favorited_by(@user).order_by_id end - def retweets + def user_retweets @user = require_user authorize_to_show_user! @user @tweets = paginate(Tweet).retweeted_by(@user).order_by_id end - def discovered_by + def user_discovered_by @user = require_user authorize_to_show_user! @user @source_user = User.find(id: params[:user_id_b], screen_name: params[:screen_name_b]) diff --git a/app/views/tweets/best.html.haml b/app/views/tweets/user_best.html.haml index 6c12ef4..6c12ef4 100644 --- a/app/views/tweets/best.html.haml +++ b/app/views/tweets/user_best.html.haml diff --git a/app/views/tweets/discovered_by.atom.builder b/app/views/tweets/user_discovered_by.atom.builder index 18597db..18597db 100644 --- a/app/views/tweets/discovered_by.atom.builder +++ b/app/views/tweets/user_discovered_by.atom.builder diff --git a/app/views/tweets/discovered_by.html.haml b/app/views/tweets/user_discovered_by.html.haml index 63b0aeb..63b0aeb 100644 --- a/app/views/tweets/discovered_by.html.haml +++ b/app/views/tweets/user_discovered_by.html.haml diff --git a/app/views/tweets/discoveries.atom.builder b/app/views/tweets/user_discoveries.atom.builder index c4ecede..c4ecede 100644 --- a/app/views/tweets/discoveries.atom.builder +++ b/app/views/tweets/user_discoveries.atom.builder diff --git a/app/views/tweets/discoveries.html.haml b/app/views/tweets/user_discoveries.html.haml index bebf34a..bebf34a 100644 --- a/app/views/tweets/discoveries.html.haml +++ b/app/views/tweets/user_discoveries.html.haml diff --git a/app/views/tweets/favorites.html.haml b/app/views/tweets/user_favorites.html.haml index bebf34a..bebf34a 100644 --- a/app/views/tweets/favorites.html.haml +++ b/app/views/tweets/user_favorites.html.haml diff --git a/app/views/tweets/recent.html.haml b/app/views/tweets/user_recent.html.haml index 46d6d34..46d6d34 100644 --- a/app/views/tweets/recent.html.haml +++ b/app/views/tweets/user_recent.html.haml diff --git a/app/views/tweets/retweets.html.haml b/app/views/tweets/user_retweets.html.haml index bebf34a..bebf34a 100644 --- a/app/views/tweets/retweets.html.haml +++ b/app/views/tweets/user_retweets.html.haml diff --git a/app/views/tweets/timeline.atom.builder b/app/views/tweets/user_timeline.atom.builder index ca1ad59..ca1ad59 100644 --- a/app/views/tweets/timeline.atom.builder +++ b/app/views/tweets/user_timeline.atom.builder diff --git a/app/views/tweets/timeline.html.haml b/app/views/tweets/user_timeline.html.haml index 17e385a..17e385a 100644 --- a/app/views/tweets/timeline.html.haml +++ b/app/views/tweets/user_timeline.html.haml diff --git a/config/routes.rb b/config/routes.rb index 5d813db..0247b44 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -26,14 +26,14 @@ Aclog::Application.routes.draw do # User pages scope "/:screen_name" do - get "/" => "tweets#index", as: "user" - get "/best" => "tweets#best", as: "user_best" - get "/recent" => "tweets#recent", as: "user_recent" - get "/timeline" => "tweets#timeline", as: "user_timeline" - get "/discoveries" => "tweets#discoveries", as: "user_discoveries" - get "/favorites" => "tweets#favorites", as: "user_favorites" - get "/retweets" => "tweets#retweets", as: "user_retweets" - get "/discovered_by/:screen_name_b" => "tweets#discovered_by", as: "user_discovered_by_user" + get "/" => "tweets#user_index", as: "user" + get "/best" => "tweets#user_best", as: "user_best" + get "/recent" => "tweets#user_recent", as: "user_recent" + get "/timeline" => "tweets#user_timeline", as: "user_timeline" + get "/discoveries" => "tweets#user_discoveries", as: "user_discoveries" + get "/favorites" => "tweets#user_favorites", as: "user_favorites" + get "/retweets" => "tweets#user_retweets", as: "user_retweets" + get "/discovered_by/:screen_name_b" => "tweets#user_discovered_by", as: "user_discovered_by_user" get "/discovered_by" => "users#discovered_by", as: "user_discovered_by" get "/discovered_users" => "users#discovered_users", as: "user_discovered_users" |