Skip to content
Browse files

デザインを少し修正

  • Loading branch information...
1 parent 0d0f453 commit 7fb1f7410e687d674ca82fe9efe9cd333933ae7a @jugyo committed
View
15 app/views/home/index.html.haml
@@ -1,10 +1,11 @@
-!= form_for Tweet.new do |f|
- %div
- != f.select :trans_type, Tweet::TRANS_TYPES.invert.to_a
- %div
- != f.text_area :text, :size => '80x3'
- %div
- != f.submit
+- if logged_in?
+ != form_for Tweet.new do |f|
+ %div
+ != f.select :trans_type, Tweet::TRANS_TYPES.invert.to_a
+ %div
+ != f.text_area :text, :size => '80x3'
+ %div
+ != f.submit
%ul.tweets
- @tweets.each do |tweet|
View
19 app/views/tweets/show.html.haml
@@ -1,11 +1,18 @@
-%p
+.tweet
+ != image_tag @tweet.user.profile_image_url
+ @#{@tweet.user.login}
+ \:
= @tweet.text
-!= form_for @tweet.comments.new, :url => tweet_comments_path(@tweet), :method => :post do |f|
- %p
- != f.text_area :text, :size => '80x3'
- != f.submit
+.translate
+ - if logged_in?
+ != form_for @tweet.comments.new, :url => tweet_comments_path(@tweet), :method => :post do |f|
+ %p
+ != f.text_area :text, :size => '80x3'
+ != f.submit
+ - else
+ 訳すには#{link_to 'ログイン', login_path(:return_to => request.fullpath)}してください
-%ul
+%ul.comments
- @tweet.comments.desc(:created_at).each do |comment|
%li= comment.text
View
13 public/stylesheets/application.css
@@ -33,6 +33,9 @@ table {
border-collapse: collapse;
border-spacing: 0; }
+textarea {
+ width: 99%; }
+
.header {
padding: 8px;
border-bottom: dashed 1px #CCC; }
@@ -76,3 +79,13 @@ ul.tweets {
color: #AAA;
font-size: 80%;
text-align: right; }
+
+.tweet {
+ padding: 10px;
+ border: solid 1px #CCC;
+ margin-bottom: 10px; }
+ .tweet img {
+ vertical-align: top; }
+
+.translate {
+ margin-bottom: 10px; }
View
4 public/stylesheets/sass/_base.scss
@@ -1,3 +1,7 @@
+textarea {
+ width: 99%;
+}
+
.header {
padding: 8px;
border-bottom: dashed 1px #CCC;
View
14 public/stylesheets/sass/_tweets.scss
@@ -20,3 +20,17 @@ ul.tweets {
}
}
}
+
+.tweet {
+ padding: 10px;
+ border: solid 1px #CCC;
+ margin-bottom: 10px;
+
+ img {
+ vertical-align: top;
+ }
+}
+
+.translate {
+ margin-bottom: 10px;
+}

0 comments on commit 7fb1f74

Please sign in to comment.
Something went wrong with that request. Please try again.