diff options
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/eu/mulk/mulkcms2/benki/posts/PostResource.java | 5 | ||||
-rw-r--r-- | src/main/resources/templates/tags/commentBox.html | 4 |
2 files changed, 7 insertions, 2 deletions
diff --git a/src/main/java/eu/mulk/mulkcms2/benki/posts/PostResource.java b/src/main/java/eu/mulk/mulkcms2/benki/posts/PostResource.java index d1e5775..569c535 100644 --- a/src/main/java/eu/mulk/mulkcms2/benki/posts/PostResource.java +++ b/src/main/java/eu/mulk/mulkcms2/benki/posts/PostResource.java @@ -344,6 +344,11 @@ public abstract class PostResource { assignPostTargets(post.getVisibility(), post.owner, comment); comment.persist(); + var currentUser = getCurrentUser(); + if (currentUser != null) { + comment.owner = currentUser; + } + var admins = User.findAdmins(); var mailText = Templates.commentNotificationMail(postId, comment); diff --git a/src/main/resources/templates/tags/commentBox.html b/src/main/resources/templates/tags/commentBox.html index abe73f5..41907ab 100644 --- a/src/main/resources/templates/tags/commentBox.html +++ b/src/main/resources/templates/tags/commentBox.html @@ -24,9 +24,9 @@ {#for comment in comments} <div class="comment" id="comment-{comment.id}"> - {#if comment.owner != null}<span class="comment-owner post-owner">{comment.owner.firstName}</span>{/if} - <div class="comment-info"> + {#if comment.owner != null}<span class="comment-owner post-owner">{comment.owner.firstName}</span>{/if} + <a class="comment-link" href="/posts/{postId}#comment-{comment.id}"> <span class="comment-self-link">#</span> </a> |