Giter Site home page Giter Site logo

commontator's People

Contributors

akz92 avatar alaarab avatar andreibondarev avatar atrox avatar bolandrm avatar cpg avatar cyclingzealot avatar d4rky-pl avatar danmaz74 avatar dantemss avatar dept42 avatar felipekk avatar fosterfarrell9 avatar fourcolors avatar g8d3 avatar gambala avatar imgarylai avatar jdugarte avatar jpslav avatar ledzep443 avatar mpakus avatar mulander avatar nimir avatar pustomytnyk avatar stormmaster42 avatar tbprojects avatar triptate avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

commontator's Issues

pagination

Any plans to add a pagination feature? If not I'm going to take a look at doing this myself in a fork.

Add optional avatar location

Currently there is no options for an Avatar. It's defaulted to use gravitar. I think there should be an option for a normal image that falls back to gravitar.

"undefined method `thread' for true:TrueClass"

I'm not sure I understand the installation instructions. I want the comments to appear on my commentable's show page. In my controller I have:

@note = Note.publishable.find(params[:id])
@comments = commontator_thread_show(@note)

Then in my view I have:

= commontator_thread(@comments)

But I get an error: "undefined method `thread' for true:TrueClass". (When I just put a link to the comments, it works fine.)

Question: Missing partial when using "commontator_thread_show"

I have the gem running fine, but when I try to use: commontator_thread_show at the controller, I get the error:

Missing partial players/reply, application/reply with {:locale=>[:es], :formats=>[:html], :handlers=>[:erb, :builder, :coffee, :jbuilder, :axlsx, :wxlsx]}. Searched in:

  • "/home/ubuntu/web-app/app/views"
  • "/home/ubuntu/.rvm/gems/ruby-2.0.0-p247/gems/commontator-4.5.0/app/views"
  • "/home/ubuntu/.rvm/gems/ruby-2.0.0-p247/gems/kaminari-0.15.1/app/views"
  • "/home/ubuntu/.rvm/gems/ruby-2.0.0-p247/gems/devise-3.1.1/app/views"

Extracted source (around line #59):

56: <% end %>
57:
58: <% if thread.config.comment_order != :l %>
59: <%= render :partial => 'reply', :locals => {:thread => thread, :user => user} %>
60: <% end %>

Can you help me?

Replying

Is it allowable to make user reply on comments ?
and how ?

Editing a comment

I can only edit the last comment that was posted. Is there any way for all comments to be edited (assuming that the current user is the one that created the comment)?

undefined method `thread' for nil:NilClass

I just installed and I followed all of the instructions, but I'm getting this error. Here is the trace: app/controllers/posts_controller.rb:19:in `index'

here is my code that I added manually:

class PostsController < ApplicationController

before_action :authenticate_user!

def index
@posts = Post.includes(:user).all.sort_by &:created_at
@posts.reverse!
commontator_thread_show(@post)

end

def show
@post = Post.find(params[:id])
commontator_thread_show(@post)
end

Post and user models have acts_as_commontable and acts_as_commontator respectively.

my view (index.html.erb):

<%= render "global/new_post_form" %>

<% @posts.each do |post| %>

<%= post.user.name %>

<%= post.post_content %>

<%= commontator_thread(@post) %>

<% end %>

Thanks for any help!

Commontator Interaction with auto_html gem

Another great gem, auto_html parses text into links. Generally, its stored in the model of the text you wish to parse.

auto_html comes with a helper method that can be called from a view: <%= auto_html('url') {conditions} %>

Installing commontator alongside auto_html causes rails to throw a no-method error for auto_html. Removing commontator instantly fixes the error.

Is commontator using auto_html or any similar keywords that could be shared in scope?

undefined method `can_be_read_by?' for nil:NilClass

Hi,

I have just installed your gem on an existing Rails app with a post model and a user.
The database has already some posts. And I guess no thread is created for existing post.
Is there a migration to create threads for existing models ?

Thanks

New Comment

Hello, when I click on make a new comment, a form pops as usual. However, whenever I go to submit a new comment it says "comment could not be posted because the comment is a duplicate of another comment." Then when I go back to look the comment saves for some reason, but when i click on show comment it doesn't load.

How do you customize the username?

I have a current_user with a username however its always showing up as Anonymous. I checked the commontator.rb file and noticed it has a default set to Anonymous however there isn't a way to change what field its look for on my current_user. Is there an easy way to do this?

Question: adding filter

I added a "label" field to the commontator comments. Now I want to filter the comments displayed by using a form to select the label. Could you please give me some directions on the best way to do that?

Thanks a lot

Comment nesting

Any thoughts on implementing ancestry for nested comments? That would tip the scales and make this even more powerful out of the box than it already is.

Error on show.

Hi, I got this error. Im using rails 4.

Showing /Users/administrador/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/commontator-2.0.1/app/views/commontator/threads/_show.html.erb where line #39 raised:

uninitialized constant Commontator::Thread::Comment

Extracted source (around line #39):

<% thread.ordered_comments.each do |comment| %> <% next unless comment.can_be_read_by?(user) %> <%= render :partial => 'commontator/comments/show', :locals => {:comment => comment,

"body has already been posted" error

Sometimes when I try to post a comment I get the following message:

"This comment could not be posted because of the following error:
Body has already been posted"

However, my comment still ends up being posted. Any ideas what is causing the error? Thanks!

Undefined local variable or method `votes'

I added the acts_as_votable gem and changed the initializer configuration to config.comment_voting = :ld
Now when I want to show comments I get an Error undefined local variable or method``votes'

The problem seems to appear on here:
<% vote = comment.get_vote_by(user) %>

Do you have any idea why I get this error message?

Thanks!

undefined local variable or method `commontator'

Hi,
I've installed the gem according to your instructions, including the acts_as_votable (+migrations) on my Rails 4.1.4 app. I have a model User that has acts_as_commontator. I have a model Recipe that has acts_as_commontable. On my view for RecipesController#show (that doesn't require a signed in user, but I've tested both ways anyway) I have <%= commontator_thread(@recipe) %>. After restarting the webserver, when trying to show a recipe I get the abovementioned error, linking to commontator (4.7.2) app/views/commontator/shared/_thread.html.erb.

On my server I see:

Rendered recipes/_step.html.erb (9.3ms)
  Commontator::Thread Load (1.3ms)  SELECT  "commontator_threads".* FROM "commontator_threads"  WHERE "commontator_threads"."commontable_id" = $1 AND "commontator_threads"."commontable_type" = $2 LIMIT 1  [["commontable_id", 7], ["commontable_type", "Recipe"]]
Recipe Load (0.5ms)  SELECT  "recipes".* FROM "recipes"  WHERE "recipes"."id" = $1 LIMIT 1  [["id", 7]]
  Commontator::Subscription Load (0.4ms)  SELECT  "commontator_subscriptions".* FROM "commontator_subscriptions"  WHERE "commontator_subscriptions"."subscriber_id" = $1 AND "commontator_subscriptions"."subscriber_type" = $2 AND "commontator_subscriptions"."thread_id" = 1  ORDER BY "commontator_subscriptions"."id" ASC LIMIT 1  [["subscriber_id", 2], ["subscriber_type", "User"]]
   (0.3ms)  SELECT COUNT(*) FROM "commontator_comments"  WHERE "commontator_comments"."thread_id" = $1  [["thread_id", 1]]
  Rendered /Users/anon/.rvm/gems/ruby-2.1.2@app/gems/commontator-4.7.2/app/views/commontator/shared/_thread.html.erb (44.5ms)
  Rendered recipes/show.html.erb within layouts/application (76.9ms)
Completed 500 Internal Server Error in 88ms

Any ideas? What other information can I provide you with to help find what could be the problem?

New comment form not showing when config.new_comment_style = :l

I had an issue that sounded similar to #47, but without the javascript error. If I changed config.new_comment_style to :t, it worked as expected.

I found out that the form was rendered, but hidden. It seems to me that this is because in app/views/commontator/threads/_reply.html.erb, @new_comment has not been set, even though commontator_set_new_comment has been called via set_thread due to the before_filter in CommentsController. I'm not sure whether @new_comment is in a scope that should be visible to the form but I confirmed that it is nil in the form, hence the form being hidden.

It is also unclear to me what happens to the @comment created in the new action of the CommentsController, so there seems to be some disconnect there.

Unfortunately I can't check this in a clean clone of your repo due to:

Bundler::GemspecError: Could not read gem at /Users/my_user/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/cache/actionview-4.1.8.gem. It may be corrupted.
An error occurred while installing actionview (4.1.8), and Bundler cannot continue.
Make sure that `gem install actionview -v '4.1.8'` succeeds before bundling.

Not sure what to do about that.

Hope this is helpful.

Can't delete an entry due to association

Hello, the error is:

Cannot modify association 'Movie#subscriptions' because the source reflection class 'Subscription' is associated to 'Commontator::Thread' via :has_many.

I think there is some model rails parameters (like has_many or belongs_to) to write on model(s) that are "commentable", but i'm not sure which can be.

undefined method `current_user'

undefined method `current_user' for #ProductsController:0xc73cce0
using the method:
def show
commontator_thread_show(@Product)
end

stops in
config/initializers/commontator.rb:15:in `block (2 levels) in <top (required)>'

the line
config.current_user_proc = lambda { |controller| controller.current_user }

Delete comment from database and view

Hello gem creator,

I am having some issue here figuring out how to delete the comment completely after selecting the "delete" link. As for now, when I delete the comment it is still shown in my view as "comment deleted by ..." and I would like it to be completely deleted so that it doesn't show as a deleted comment in my view. I couldn't find anything in the documentation that deals with that. Any help?
thanks!

How to track activity on the commontator

Hi,
I am wondering how to use Public activity to track the activity in commontator? I need to place the track command to the model of this commontator but I cannot find the commentator model anywhere.

Thank you very much

Always Show Create Comment Form

Love the gem.

But currently there is no option to show the 'add comment form' automatically when the page loads. Always have to click 'New Comment' to fetch the form, would love it if there was a config option to do this.

At the moment after digging around in the files I've had to do a botch job of copying the HTML there and displaying it on the page without commontator running it.

Migration Error

Mysql2::Error: BLOB/TEXT column 'body' can't have a default value.

:D

acts_as_votable broken methods names causes exceptions

After adding acts_as_votable to my Gemfile, creating votes migration, restarting the server, following exceptions got fired from _votes.html.erb:

  1. comment.rb L41 votes.where throws
    undefined local variable or method `votes' for #Commontator::Comment:0x007ffb653c6910
  2. _votes.html.erb L41 upvotes throws
    undefined method `upvotes' for #Commontator::Comment:0x007ffb652c8d38
  3. _votes.html.erb L41 downvotes throws
    undefined method `downvotes' for #Commontator::Comment:0x0000000624a530

Getting error when user not logged in.

Basically it works perfectly fine when a user is logged in. However when I log out and go to a page with the commentator_thread(@pin) then it breaks with this message.

NoMethodError in PinsController#show
undefined method `is_commontator' for nil:NilClass

The controller currently is as follows

  def show
    respond_with(@pin)
    commontator_thread_show(@pin)
  end

And the view is as follows:

    <div class="panel-body">
    <%= commontator_thread(@pin) %>
    </div>

It's pretty basic. My guess was that it requires a current_user to not be nil so my alternative to fixing it was to to just put an if statement to only show the comments if they are logged in but what if I want it to always be visible?

2 Questions: pagination and date format

Hi:

I have 2 questions: when I don't use commontator_thread_show at the controller the pagination works fine, but when I use commontator_thread_show I can't change the pages, don't know why,

The second: how can I change the format of the date? (posted at abr 17 2014 at 05:32PM UTC)

Thanks a lot

[resolved] undefined local variable or method `commontable'

Hello,
i followed the "readme.md" on github gem page of commontator, but i think i can not understand this error (i'm a newbie on rails).
So... I'm on rails-4.0.1 with the commontator-4.2.
Maybe this can be an error from Devise or Cancan gem in association with commontator ? But i can not understand.

So... first, after install commontator, when try to go again on rails server (webrick), i had some error from ./config/initializer/commontator.rb on lines for config declaration (lignes: 8, 23, 32, 36, 77, 122, 135). For pass through, i had to make # for comment them out.

maybe it is not a bug, but i see nothing about this on google or stackoverflow. Could you provide some help or information about that, or can it be a bug from commontator ?

thanks.

(PS: when doing the code indicate after "development" indication... this erase all inside tables created before. Because... no update happen but create goes onside the other existed and erase all content tables. So... maybe it can be important for newbies to indicate this happen)

Sorry... i not understand the readme.rd file. When read #12 bug report, i understand.
The problemn was due tu the (commentable) who is in fact: the name of the variable define for the class controller of the designed with comments inside...
Again... i'm sorry for not been able to understand this.
Thanks for your great work.

Issue while creating new post

I have used this gem for my appliaction and its configured fine.
I have posts and on that each post comments will be given by users.These posts will be created by admin[rails_admin gem].
While creating new post by admin it is giving me following error:
ActionController::UrlGenerationError at /post/new
No route matches {:action=>"show", :controller=>"rails_admin/main", :id=>nil, :model_name=>"commontator~thread"}

Please help me on this?

need some require_dependency's?

Running commontator and it looks like the commontator controllers are finding my app's application controller instead of the commontator one.

maybe need to add require_dependency 'commontator/application_controller' at the top of the controller files?

specifically my app was complaining that it couldn't find the get_thread method called in a before_filter before the CommentsController's new action.

Users can only Upvote/Downvote once same comment

When a user up vote a comment from 0 to +1 and then tries to up vote the same comment again, the view changes from +1 to 0. Same for down vote. Down vote the comment once (0 to -1), down vote the same comment again (-1 to 0).

I would like to allow users to only vote on a comment once whether up voted or down voted.

commontator_thread_show breaks when current_user returns false

There are many many cases where current_user could return false instead of nil (Devise, Sorcery etc) do this. In the commontator_thread_show(commontable) method this line

raise SecurityTransgression unless (user.nil? || user.is_commontator)

breaks. Mainly because false.is_commontator breaks.

Ordering depends on database implementation?

Hi,
I'm having a problem ordering the comments "earliest first". The gem does respects ordering by highest voted first in my app. Whenever I use config.comment_order = :ve (or :e), the comments with the same quantity of votes are still ordered with the most recently updated comment first. After going through the code, checking the method ordered_comments in https://github.com/lml/commontator/blob/master/app/models/commontator/thread.rb, I don't see:
a) code for handling :e within the case block;
b) a default ordering scope.

This means that when comment_order is either :e or :ve, the comments (with the same amount of votes for :ve) are going to presented in whatever order the database fetches them.

This leads me to believe that the gem, especially when config.comment_order = :e, is relying on the default ordering of the database, which I believe is a bad practice.

I'm using PostgreSQL on a Mac btw.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.