Skip to content

Commit a4e3725

Browse files
committed
Show modifier information on post show page
1 parent 50b691f commit a4e3725

2 files changed

Lines changed: 24 additions & 11 deletions

File tree

app/assets/stylesheets/posts.scss

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,16 +79,18 @@
7979
}
8080
}
8181

82-
.author {
82+
.user-information {
8383
border-top: 1px solid $border-gray;
8484
padding: 1.5rem 0;
8585
text-align: right;
8686
}
8787

88-
.author__nickname {
88+
.author__nickname,
89+
.modifier__nickname {
8990
font-size: .9rem
9091
}
9192

92-
.author__created-at {
93+
.author__created-at,
94+
.modifier__created-at {
9395
font-size: .8rem
9496
}

app/views/posts/show.html.slim

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,26 @@
55
= @post.title
66
.post__body
77
== sanitize(auto_link(markdown_to_html(emojify(@post.body))))
8-
.author
8+
.user-information
99
.row
10-
.col.s3.offset-s9
11-
.author__nickname
12-
| Created by
13-
span.blue-text
14-
| #{@post.created_by.nickname}
15-
.author__created-at.grey-text.text-darken-1
16-
= @post.created_at
10+
.col.s6.offset-s6
11+
.author
12+
.author__nickname
13+
| Created by
14+
span.blue-text
15+
| #{@post.created_by.nickname}
16+
.author__created-at.grey-text.text-darken-1
17+
= @post.created_at
18+
.row
19+
.col.s6.offset-s6
20+
.updater
21+
.modifier__nickname
22+
| Updated by
23+
span.blue-text
24+
/ TODO N+1
25+
| #{User.find(@post.updated_by_id).nickname}
26+
.modifier__created-at.grey-text.text-darken-1
27+
= @post.updated_at
1728
.row
1829
.col.s12
1930
= link_to edit_post_path(@post), class: 'waves-effect waves-light btn' do

0 commit comments

Comments
 (0)