Git Product home page Git Product logo

opinio's People

Contributors

alainpilon avatar draiken avatar eicca avatar johnf avatar petertoth avatar r4vi 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

opinio's Issues

delete and reply settings

Hi there,

I'm quite new to rails, and even if I got your engine working, I can't figure out how to enable the delete method (I guess I didn't understand your explanation) and the reply feature (I'v uncommented it in the initializer, but it still doesn't work, or I receive NoMethod Error on the methods in it).

Could you be more specific about how to enable these?

My commentable model is Project.

Many thanks (for your awesome engine as well!),
Laetitia

Comments Number Count Issue

Luiz, thanks a lot for building this, I really appreciate it.

Within one of my views, I am trying to output the comments count per post:

<%= post.comments.size %>

This is only yeilding the number of parent comments. It is not including the replies. How do I get the total number of comments per post, including the replies? Where is this gem storing the comment replies?? How do I search through the replies from my rails console?

Also, how do I get the JavaScript to automatically hide the reply link for any reply comment, right now you have to refresh the page for the reply link to disappear under a second level/reply comment.

Customize destroy conditions documentation

Greetings,

Thanks so much for an awesome gem. I'm hung up on customizing the destroy conditions however. Would you be able to expand on this section of the documentation at bit (perhaps with an example)? Do you intend for the comment_destroy_conditions code block to go in an overrided comments controller's delete action?

Any additional information would be greatly appreciated to show the context in which this code block should live.

Thanks!

Demo Sites

Do you have any demo sites using opinio?
I think this would be useful on the README.

Username

Hi, I'm sorry this suppose to be really easy ... but I can't figure it out. (doh) I have the 'devise' for user reg and aut. Opinio has nicely cached the users' id from devise. How can I show usernames next to comments instead of id? I have username field in the users tab.

In v0.6 branch missing files

In the v0.6 branch Gemfile-rails-3.0.x and Gemfile-rails-3.1.x files are not present.
This prevent bundler fron installing the gem.
Can you fix it? I am looking forward to test on that branch.
regards

Deleted User

A user cancels his account, how do I set up dependent destroy scenario with comments?

Override redirect on successful POST

Is it possible to change the redirect_to action used when a comment is successfully created?

Given two problems:

  • the comments are on a model that is accessed through a namespaced controller (in this case /admin)
  • that controller has no method show

Not handling Strong_parameters

Hi there,

Opinio seems really cool and I'm about to use it but I'm using https://github.com/rails/strong_parameters in my project and Opinio doesn't seem to handle it.

I wanted to do it and to propose a pull request but I don't really understand how gems and Gemfile are handled in this project.
We have to Gemfiles for rails 3.0 and 3.1, but what about rails 3.2 ?

I've probably missed something, could you explain what's the process to participate to this project.

deeper reply levels

How difficult would this be to implement? If you could just write out what you'd do, I'd love to try. Just not sure if it's an issue with the models being structured how they are, or..

Thanks for a great gem :)

Comment owner must be valid?

opinio/lib/opinio/opinio_model/validations.rb
validates :owner, :presence => true, :associated => true

Using just :presence => true on the owner checks the table to see if it exists, at least while using Rails 3.2.19 and testing it in the console. Trying to use an owner_id that doesn't exist will fail validation.

Using :associated => true makes it more difficult to add a new required field. For example, a phone number is now required, but forcing existing users to immediately provide one so their user record is considered valid and they can comment again is probably overkill.

Perhaps this has changed in Rails? I've read conflicting questions / answers on the topic ...

minor contribution

Hi, I added 2 minor features that was usefull to me, it's on my fork https://github.com/fred/opinio/tree/fred

The features I added:

  1. Posibility to add condition options to the has_many block inside opinio fred@1614b8a
  2. in the controller it will add remote_ip and user_agent, if they are available in the model, it's useful for checking for spam with akismet.
    fred@603255e

if you are interested I can send pull request.
and sorry, not rspec tests :D

thanks for the awesome plugin.

haml views

Hello.

At first, thanks for this plugin.

I did a little contribution: possibility to generate haml views https://github.com/eicca/opinio/commit/75692f6b207e5f035e5c9f6874598b41aba0b72f
I think this is not the best solution, since views twice copied in the project. Sorry, but I have not enough skill in the development of gems.
Can you suggest a better way to do this?

And I also wanted to make a bootstraped version. Does this make sense?

Reply/Destroy showing up on nested resource comments for owners

I have a nested resource, and whenever comments are made, they store properly, but both reply and delete buttons are always available to all users (e.g., another user sees the delete button for other users' comments, and a user sees a reply button for his own comments, as well as reply buttons for replies).

Any idea where to start looking for a fix?

How can I add a counter_cache?

Hi,
I think it could be could to be able to add a counter cache for opinio_subjectum, I've tried to add belongs_to :my_model, counter_cache: true in comments.rb, but to no avail.

Any idea is welcome!

Pagination not working

We are using render_comments @articles in our view to show the comments. And we have added the paginate comments to show the pagination links. The pagination adds ?page=N to the URL and which loads the same page with the partial.

I checked the helper (lib/opinio/controllers/helpers.rb) and found that the render_comments method passing comments value as object.comments.page(1).limit(limit). Here the page value is hard coded to 1, so it won't load the other pages. Can you please help me with a solution?

Thanks!

unrecognised users?

It seems like users are not really linked to their own comment, and I don't know how to fix it.

  • in dev environnement everything seems ok when a user post a comment, but in production, I get a no method error on any method I apply to comment.owner (including 'comment.owner.name').
    When I check the db in production, in the user column, it shows 0
  • even in dev environnement, when I try to delete my own comment as a user, I get this error:

Started DELETE "/comments/109?locale=fr" for 127.0.0.1 at 2013-05-16 20:33:08 +0200
Processing by Opinio::CommentsController#destroy as JS
Parameters: {"locale"=>"fr", "id"=>"109"}
Comment Load (0.7ms) SELECT "comments".* FROM "comments" WHERE "comments"."id" = $1 LIMIT 1 [["id", "109"]]
User Load (0.6ms) SELECT "users".* FROM "users" WHERE "users"."id" = 2 LIMIT 1
CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = 2 LIMIT 1
user #User:0x007fde499f3100 tried to remove a comment from another user 2
Rendered text template (0.0ms)
Completed 401 Unauthorized in 33ms (Views: 25.9ms | ActiveRecord: 1.3ms)

Would you have an idea of where I'm missing something? It seems that those two problems have the same origin...

Many thanks again for your time!

Need some features

  1. Comments sorted by ASC. I need to show comments ordered by DESC.
  2. Need to connect owner with 'devise' user.
  3. Reply not work?
  4. Need so more documented features...

NoMethodError undefined method warning for ActiveSupport::BufferedLogger

Hi,

When I customize the destroy action:

comment_destroy_conditions do |comment|
  (comment.owner == current_user) && !current_user.suspended?
end

The server return an http error 500:

Started DELETE "/comments/9" for 127.0.0.1 at 2011-12-20 16:04:55 +0100
  Processing by Opinio::CommentsController#destroy as JS
  Parameters: {"id"=>"9"}
  Comment Load (0.4ms)  SELECT "comments".* FROM "comments" WHERE "comments"."id" = $1 LIMIT 1  [["id", "9"]]
  User Load (0.8ms)  SELECT "users".* FROM "users" WHERE "users"."id" = 2 LIMIT 1
  CACHE (0.0ms)  SELECT "users".* FROM "users" WHERE "users"."id" = 2 LIMIT 1
Completed 500 Internal Server Error in 277ms

NoMethodError (undefined method `warning' for #<ActiveSupport::BufferedLogger:0x00000104fa8ea8>):
  lib/middleware/flash_session_cookie_middleware.rb:16:in `call'

Rendered /Users/francois/.rvm/gems/ruby-1.9.2-p290@witineo/gems/actionpack-3.1.1/lib/action_dispatch/middleware/templates/rescues/_trace.erb (2.3ms)
Rendered /Users/francois/.rvm/gems/ruby-1.9.2-p290@witineo/gems/actionpack-3.1.1/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (1.9ms)
Rendered /Users/francois/.rvm/gems/ruby-1.9.2-p290@witineo/gems/actionpack-3.1.1/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (7.8ms)

Any ideas ?

  • Rails version 3.1.1
  • Ruby version 1.9.2p290
  • Opinio version 0.3.1

Problem with using opinio in app with engine

I have an app with mountable engine which called menu_with_pages.

Also app has opinio.

gem 'menu_with_pages', :path => "vendor/engines/menu_with_pages"
gem 'opinio'

Also I have model Page from engine:

#coding: utf-8
require "#{MenuWithPages.models_dir}/page"


module MenuWithPages
  class Page

    opinio_subjectum

  end
end


# routes.rb
...
 opinio_model
mount MenuWithPages::Engine, :at => "/", :as => "menu_with_pages"
  resources 'menu_with_pages/pages' do
    opinio # ERROR!
  end

At this case I've got an error:

Invalid route name: 'menu_with_pages/page_comments'

Ok. I solve this by writing:

get "/pages/:page_id/comments(/:page)" => "menu_with_pages/opinio/comments#index", :as => page_comments

In my page show view:

= comments_for @page

But I always get this :

ActionView::Template::Error (undefined method `comments_path' for #<#<Class:0x000000049daa90>:0x00000003c8a0c0>):
    1: <div id="new_comment">
    2:   <% if send(Opinio.current_user_method) %>
    3:     <h3><%= t('opinio.messages.add_comment') %></h3>
    4:     <%= form_for Comment.new, :remote => false do |f| %>
    5:       <p>
    6:         <%= f.text_area :body %>
    7:       </p>

I think this error provided because i have engines in my app.

And it can be solved by using

main_app.comments_path

But I think it's not good solution.

Cancan ability

Hello.
How can i restrict commenting on some resource using CanCan?

Anyway to disable Pagination?

Is there anyway to disable pagination? I can't seem to override it with my own controller, and there's no pagination option within the the initializer.

Pagination Problem

Is it only possible to paginate one set of comments at a time? I have many items commentable in a news feed. I am already using page params on home/index for something else. Any other options for pagination of multiple sets of comments?

Comments UL ID

I have multiple items to comment on a single page. Every UL renders as #comments. Is this fixable? This results in all new comments appending to the first item. Messages about deletion end up here as well.

nested commentable

Quick question: how do you deal with nested commentable? Because right now, it seems like the comments_controller returns to the commentable_path.

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.