Skip to content

Commit

Permalink
Show modifier information on post show page
Browse files Browse the repository at this point in the history
  • Loading branch information
5t111111 committed Aug 28, 2016
1 parent a999bf2 commit 7d21956
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 11 deletions.
8 changes: 5 additions & 3 deletions app/assets/stylesheets/posts.scss
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,18 @@
}
}

.author {
.user-information {
border-top: 1px solid $border-gray;
padding: 1.5rem 0;
text-align: right;
}

.author__nickname {
.author__nickname,
.modifier__nickname {
font-size: .9rem
}

.author__created-at {
.author__created-at,
.modifier__created-at {
font-size: .8rem
}
27 changes: 19 additions & 8 deletions app/views/posts/show.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,26 @@
= @post.title
.post__body
== sanitize(auto_link(markdown_to_html(emojify(@post.body))))
.author
.user-information
.row
.col.s3.offset-s9
.author__nickname
| Created by
span.blue-text
| #{@post.created_by.nickname}
.author__created-at.grey-text.text-darken-1
= @post.created_at
.col.s6.offset-s6
.author
.author__nickname
| Created by
span.blue-text
| #{@post.created_by.nickname}
.author__created-at.grey-text.text-darken-1
= @post.created_at
.row
.col.s6.offset-s6
.updater
.modifier__nickname
| Updated by
span.blue-text
/ TODO N+1
| #{User.find(@post.updated_by_id).nickname}
.modifier__created-at.grey-text.text-darken-1
= @post.updated_at
.row
.col.s12
= link_to edit_post_path(@post), class: 'waves-effect waves-light btn' do
Expand Down

0 comments on commit 7d21956

Please sign in to comment.