aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorrhenium <re4k@re4k.info>2013-05-19 00:06:18 +0900
committerrhenium <re4k@re4k.info>2013-05-19 00:06:18 +0900
commitc93b516fdb0a2f826bde15aaefe3a66508639111 (patch)
tree9499b9cf64b28231ce5930da674603efdfa8ff8d /app
parent0e2b4dd140f37fc67c11f990b473762c9a3fd5f7 (diff)
downloadaclog-c93b516fdb0a2f826bde15aaefe3a66508639111.tar.gz
update protected user support
Diffstat (limited to 'app')
-rw-r--r--app/assets/stylesheets/_tweets.css.sass8
-rw-r--r--app/controllers/application_controller.rb1
-rw-r--r--app/views/tweets/_tweet.html.haml8
3 files changed, 11 insertions, 6 deletions
diff --git a/app/assets/stylesheets/_tweets.css.sass b/app/assets/stylesheets/_tweets.css.sass
index 61504b9..d86c427 100644
--- a/app/assets/stylesheets/_tweets.css.sass
+++ b/app/assets/stylesheets/_tweets.css.sass
@@ -46,10 +46,10 @@
:line-height 25px
:padding 0 5px 15px
:word-wrap break-word
- .copied
- :font-size 14px
- :color #999999
- :line-height inherit
+ .quiet
+ :font-size 14px
+ :color #999999
+ :line-height inherit
.meta
:padding 0 5px
:color #666666
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 029aba9..b48be9c 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -5,6 +5,7 @@ class ApplicationController < ActionController::Base
protect_from_forgery
before_filter :check_format, :check_session
after_filter :xhtml
+ helper_method :authorized_to_show?
protected
def _get_user(id, screen_name)
diff --git a/app/views/tweets/_tweet.html.haml b/app/views/tweets/_tweet.html.haml
index 6546a47..44d6d88 100644
--- a/app/views/tweets/_tweet.html.haml
+++ b/app/views/tweets/_tweet.html.haml
@@ -14,8 +14,12 @@
.user
%span.nam= link_to tweet.user.name, user_best_path(tweet.user.screen_name)
%span.screen_name= link_to tweet.user.screen_name, user_best_path(tweet.user.screen_name)
- .text{class: tweet.stolen_tweet ? "copied" : nil}
- = simple_format(format_tweet_text(tweet.text))
+ .text{class: tweet.stolen_tweet ? "quiet" : nil}
+ - if authorized_to_show?(tweet.user)
+ = simple_format(format_tweet_text(tweet.text))
+ - else
+ %span.quiet
+ ユーザーは非公開です
.meta.clearfix
%span.twitter_bird
= link_to image_tag("bird_gray_16.png", alt: "Twitter"), twitter_status_url(tweet), target: "_blank"