mirror of https://github.com/halo-dev/halo
Add additional content in comment content
parent
3a1bf64636
commit
2e94ff0524
|
@ -27,7 +27,7 @@ public interface CommentService extends CrudService<Comment, Long> {
|
|||
* %s: parent commentator author name
|
||||
* %s: comment content
|
||||
*/
|
||||
String COMMENT_TEMPLATE = "<a href='#comment-id-%d>@%s</a> %s";
|
||||
String COMMENT_TEMPLATE = "<a href='#comment-id-%d'>@%s</a> %s";
|
||||
|
||||
/**
|
||||
* Lists latest comments.
|
||||
|
|
|
@ -219,7 +219,11 @@ public class CommentServiceImpl extends AbstractCrudService<Comment, Long> imple
|
|||
// Convert to comment vo
|
||||
CommentVO commentVO = new CommentVO().convertFrom(comment);
|
||||
|
||||
// TODO Add template
|
||||
// Add additional content
|
||||
if (commentVO.getParentId() > 0) {
|
||||
// TODO Provide an optional additional content
|
||||
commentVO.setContent(String.format(COMMENT_TEMPLATE, parentComment.getId(), parentComment.getAuthor(), commentVO.getContent()));
|
||||
}
|
||||
|
||||
// Init children container
|
||||
if (parentComment.getChildren() == null) {
|
||||
|
|
Loading…
Reference in New Issue