diff --git a/public/s/css/f0ck.css b/public/s/css/f0ck.css index c13fceb..1b1dab0 100644 --- a/public/s/css/f0ck.css +++ b/public/s/css/f0ck.css @@ -891,7 +891,6 @@ html[theme="f0ck95"] #next { } #comments-container { - margin-top: 20px; padding: 10px; color: var(--white); max-width: 1000px; @@ -3844,7 +3843,6 @@ input#s_avatar { /* Comments System */ #comments-container { - margin-top: 20px; padding: 15px; background: var(--metadata-bg); border-radius: 5px; @@ -4028,4 +4026,64 @@ input#s_avatar { .comment-content a { text-decoration: underline; +} + +/* Admin buttons */ +.admin-edit-btn, +.admin-delete-btn { + background: none; + border: none; + cursor: pointer; + font-size: 0.9em; + padding: 0 4px; + margin-left: 5px; + opacity: 0.6; + transition: opacity 0.2s; +} + +.admin-edit-btn:hover, +.admin-delete-btn:hover { + opacity: 1; +} + +.admin-delete-btn:hover { + color: #e74c3c; +} + +/* Edit mode */ +.edit-textarea { + width: 100%; + min-height: 80px; + background: var(--bg); + border: 1px solid var(--accent); + color: var(--white); + padding: 10px; + border-radius: 4px; + font-family: inherit; + resize: vertical; + margin-bottom: 8px; +} + +.edit-actions { + display: flex; + gap: 8px; +} + +.save-edit-btn, +.cancel-edit-btn { + padding: 6px 12px; + border: none; + border-radius: 3px; + cursor: pointer; + font-weight: bold; +} + +.save-edit-btn { + background: var(--accent); + color: var(--black); +} + +.cancel-edit-btn { + background: #666; + color: white; } \ No newline at end of file diff --git a/public/s/js/comments.js b/public/s/js/comments.js index 37b770e..16f294e 100644 --- a/public/s/js/comments.js +++ b/public/s/js/comments.js @@ -54,6 +54,7 @@ class CommentSystem { const data = await res.json(); if (data.success) { + this.isAdmin = data.is_admin || false; this.render(data.comments, data.user_id, data.is_subscribed); // Priority: Explicit ID > Hash @@ -171,6 +172,15 @@ class CommentSystem { const content = isDeleted ? '[deleted]' : this.renderCommentContent(comment.content); const date = new Date(comment.created_at).toLocaleString(); + // Admin buttons + let adminButtons = ''; + if (this.isAdmin && !isDeleted) { + adminButtons = ` + + + `; + } + return `