lml / commontator

A Rails engine for comments
MIT License
353 stars 99 forks source link

How to remove users avatar? #64

Closed poustovitss closed 9 years ago

poustovitss commented 9 years ago

Hello. I want to completely remove user's avatar. How can i do that?

Dantemss commented 9 years ago

Hello. You can either make the avatar proc in the config return nil or a blank string, or use some CSS that hides the .comment_avatar class.

poustovitss commented 9 years ago

Thanks. One more: how can I add wysihtml5 for comments?

Dantemss commented 9 years ago

Unfortunately, you will most likely have to copy https://github.com/lml/commontator/blob/master/app/views/commontator/comments/_form.html.erb into your app as app/views/commontator/comments/_form.html.erb and edit the :body textarea manually to add the editor in there.

poustovitss commented 9 years ago

I added class: 'wysihtml5' to :body textarea and little script like here: https://github.com/Nerian/bootstrap-wysihtml5-rails It works. Thanks.

poustovitss commented 9 years ago

How can I add pagination? Only change config.comments_per_page ?

poustovitss commented 9 years ago

And how can I count comment?

Dantemss commented 9 years ago

To add pagination, you need to add the will_paginate gem to your gemfile and then set comments_per_page.

Not sure what you mean by counting comments. The output of commontator_thread should include how many comments there are in the thread (and if they are subscribed, it will also count the unread comments).

poustovitss commented 9 years ago

I was talking about adding to "Comment" button the number of unread messages.

poustovitss commented 9 years ago

I used @invoice.thread.comments.count to show number of comments. But there is a problem. When I delete comments, number of comments doesn't change. How can I fix this?

Dantemss commented 9 years ago

I would try @invoice.thread.comments.where(deleted_at: nil).count