评论的内容过长时不美观, 处理一下, 并处理管理评论时排序问题
This commit is contained in:
parent
36fe8db384
commit
7a58f78cd0
|
@ -35,7 +35,9 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.pre {
|
.pre {
|
||||||
white-space: pre;
|
white-space: pre-wrap;
|
||||||
|
word-break: break-all;
|
||||||
|
word-wrap: break-word;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@ class Admin::CommentsController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@comments = @post.comments
|
@comments = @post.comments.order(created_at: :desc)
|
||||||
end
|
end
|
||||||
|
|
||||||
def destroy
|
def destroy
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
th 名字
|
th 名字
|
||||||
th 邮箱
|
th 邮箱
|
||||||
th 内容
|
th 内容
|
||||||
|
th 时间
|
||||||
th 操作
|
th 操作
|
||||||
tbody
|
tbody
|
||||||
- @comments.each do |comment|
|
- @comments.each do |comment|
|
||||||
|
@ -18,6 +19,9 @@
|
||||||
= mail_to comment.email
|
= mail_to comment.email
|
||||||
td
|
td
|
||||||
p.pre #{comment.content}
|
p.pre #{comment.content}
|
||||||
|
td
|
||||||
|
= format_time(comment.created_at)
|
||||||
|
|
||||||
td
|
td
|
||||||
= link_to '回复', blog_path(@post), target: '_blank', class: 'edit-post-link'
|
= link_to '回复', blog_path(@post), target: '_blank', class: 'edit-post-link'
|
||||||
= link_to '删除', admin_post_comment_path(@post, comment), method: 'DELETE', 'data-confirm'=> '确认删除?'
|
= link_to '删除', admin_post_comment_path(@post, comment), method: 'DELETE', 'data-confirm'=> '确认删除?'
|
||||||
|
|
Loading…
Reference in New Issue