Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make it easier to notice pending comments #326

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions backend/classes/commentsui.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@
class CommentsUI extends FormUI
{
// Creates a wrapper element for each comment
public function commentWrapper ($permalink = '{permalink}')
public function commentWrapper ($permalink = '{permalink}', $status = '{status}')
{
$status_class = (! empty($status)) ? " hashover-status-${status}" : '';

$comment_wrapper = new HTMLTag ('div', array (
'id' => $this->prefix ($permalink),
'class' => 'hashover-comment'
'class' => 'hashover-comment' . $status_class
), false);

if ($this->mode !== 'php') {
Expand Down
5 changes: 4 additions & 1 deletion backend/classes/phpmode.php
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,11 @@ public function parseComment (array $comment, $parent = null, $popular = false)
$permatext = explode ('r', $permatext);
$permatext = array_pop ($permatext);

// Post moderation status
$status = isset ($comment['status']) ? $comment['status'] : null;

// Wrapper element for each comment
$comment_wrapper = $this->ui->commentWrapper ($permalink);
$comment_wrapper = $this->ui->commentWrapper ($permalink, $comment['status']);

// Check if this comment is a popular comment
if ($popular === true) {
Expand Down
5 changes: 5 additions & 0 deletions frontend/parsecomment.js
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,11 @@ HashOverConstructor.prototype.parseComment = function (comment, parent, collapse
}
}

// Append status class
if (comment['status']) {
classes += ` hashover-status-${comment['status']}`;
}

// Wrap comment HTML
var wrapper = this.strings.parseTemplate (
this.ui['comment-wrapper'], {
Expand Down
9 changes: 9 additions & 0 deletions themes/default/comments.css
Original file line number Diff line number Diff line change
Expand Up @@ -649,6 +649,15 @@ conditions, unless such conditions are required by law.
/*background-color: #FFE5F0;*/
}

.hashover .hashover-comment.hashover-status-pending > .hashover-header {
/* Light red (pink-ish) */
background-color: #FFE5F0;

/* Sriped light red (pink-ish) and light blue */
background-image: linear-gradient(45deg, #FFE5F0 25%, #E5F0FF 25%, #E5F0FF 50%, #FFE5F0 50%, #FFE5F0 75%, #E5F0FF 75%, # E5F0FF 100%);
background-size: 50px 50px;
}

.hashover .hashover-avatar-image *,
.hashover .hashover-avatar *,
.hashover .hashover-reply .hashover-header,
Expand Down