Project

General

Profile

Doodle Plugin

Added by Felix Schäfer over 14 years ago

I'm not sure how many people will need this, but I've put together a little Doodle Plugin, which is a per-project module (like the wiki or the forums). The point is that basic functionality works, but there are still some design decisions to be made (e.g.: should you be able to completely delete your votes to a doodle, or just be able to set all your answers to "no"), and I'd need a little help with the css, so if anyone is interested, follow the discussion here and give me some feedback :-)

Anyway, I'll try to clean up the code tonight and post a link to the subversion repo here, and we'll see where it goes from there. The project is hosted in a redmine, but not a public enough one that we could discuss anything there, so we'll have to stick to this thread for the time being.


Replies (87)

RE: Doodle Plugin - Added by Felix Schäfer over 13 years ago

Terence Mill wrote:

error: gnutls_handshake() failed: A TLS warning alert has been received.

Depending on how you see it, I suppose either your gnutls is too old or my openssl too new ;-) The github clone should be in sync with the one on fachschaften.org though, so it should work equally well either way.

RE: Doodle Plugin - Added by Terence Mill over 13 years ago

Well i am using debian lenny repos, no too much specific..

However i installed it "sucessfully" and made my first doodle. When clicking "create".. i get internal error and this messahe in production.log

Missing template mailer/doodle_added.text.plain.rhtml in view path app/views)

RE: Doodle Plugin - Added by Terence Mill over 13 years ago

Terence Mill wrote:

Well i am using debian lenny repos, no too much specific..

However i installed it "sucessfully" and made my first doodle. When clicking "create".. i get internal error and this messahe in production.log

[...]

i found a file similar to the name above ..here..

vendor/plugins/redmine_doodles/app/views/mailer/doodle_added.text.html.rhtml

RE: Doodle Plugin - Added by Terence Mill over 13 years ago

and also endor/plugins/redmine_doodles/app/views/mailer/doodle_added.text.plain

RE: Doodle Plugin - Added by Felix Schäfer over 13 years ago

Terence Mill wrote:

and also endor/plugins/redmine_doodles/app/views/mailer/doodle_added.text.plain

That should be called doodle_added.text.plain.rhtml obviously. Typo, or is it really like that in the repository?

RE: Doodle Plugin - Added by Terence Mill over 13 years ago

Yes, your are right

/redmine-trunk/vendor/plugins/redmine_doodles/app/views/mailer/doodle_added.text.plain.rhtml

It was typo.

Any idea where the error come from?

RE: Doodle Plugin - Added by Felix Schäfer over 13 years ago

Other than some weird permission problem, no. Do you experience any errors with other mail-sending stuff?

RE: Doodle Plugin - Added by Terence Mill over 13 years ago

No, email sending is working witout any problems

That is the log message from production.

# Logfile created on Wed Oct 27 18:00:03 +0200 2010
ActionView::MissingTemplate (Missing template mailer/doodle_added.text.plain.rhtml in view path app/views):
  /app/models/mailer.rb:393:in `render_multipart'
  vendor/plugins/redmine_doodles/app/models/doodle.rb:64:in `send_mails'
  vendor/plugins/redmine_doodles/app/controllers/doodles_controller.rb:46:in `create'
  passenger (2.2.14) lib/phusion_passenger/rack/request_handler.rb:92:in `process_request'
  passenger (2.2.14) lib/phusion_passenger/abstract_request_handler.rb:207:in `main_loop'
  passenger (2.2.14) lib/phusion_passenger/railz/application_spawner.rb:441:in `start_request_handler'
  passenger (2.2.14) lib/phusion_passenger/railz/application_spawner.rb:381:in `handle_spawn_application'
  passenger (2.2.14) lib/phusion_passenger/utils.rb:252:in `safe_fork'
  passenger (2.2.14) lib/phusion_passenger/railz/application_spawner.rb:377:in `handle_spawn_application'
  passenger (2.2.14) lib/phusion_passenger/abstract_server.rb:352:in `__send__'
  passenger (2.2.14) lib/phusion_passenger/abstract_server.rb:352:in `main_loop'
  passenger (2.2.14) lib/phusion_passenger/abstract_server.rb:196:in `start_synchronously'
  passenger (2.2.14) lib/phusion_passenger/abstract_server.rb:163:in `start'
  passenger (2.2.14) lib/phusion_passenger/railz/application_spawner.rb:222:in `start'
  passenger (2.2.14) lib/phusion_passenger/spawn_manager.rb:262:in `spawn_rails_application'
  passenger (2.2.14) lib/phusion_passenger/abstract_server_collection.rb:126:in `lookup_or_add'
  passenger (2.2.14) lib/phusion_passenger/spawn_manager.rb:256:in `spawn_rails_application'
  passenger (2.2.14) lib/phusion_passenger/abstract_server_collection.rb:80:in `synchronize'
  passenger (2.2.14) lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
  passenger (2.2.14) lib/phusion_passenger/spawn_manager.rb:255:in `spawn_rails_application'
  passenger (2.2.14) lib/phusion_passenger/spawn_manager.rb:154:in `spawn_application'
  passenger (2.2.14) lib/phusion_passenger/spawn_manager.rb:287:in `handle_spawn_application'
  passenger (2.2.14) lib/phusion_passenger/abstract_server.rb:352:in `__send__'
  passenger (2.2.14) lib/phusion_passenger/abstract_server.rb:352:in `main_loop'
  passenger (2.2.14) lib/phusion_passenger/abstract_server.rb:196:in `start_synchronously'

Here are the rights for files&folders.

insgesamt 32
drwxr-sr-x 5 www-data www-data 4096 18. Okt 14:25 test
-rw-r--r-- 1 www-data www-data   33 18. Okt 14:25 README.rdoc
drwxr-sr-x 2 www-data www-data 4096 18. Okt 14:25 lib
-rw-r--r-- 1 www-data www-data 1066 18. Okt 14:25 init.rb
drwxr-sr-x 3 www-data www-data 4096 18. Okt 14:25 db
drwxr-sr-x 3 www-data www-data 4096 18. Okt 14:25 config
drwxr-sr-x 4 www-data www-data 4096 18. Okt 14:25 assets
drwxr-sr-x 6 www-data www-data 4096 18. Okt 14:25 app
sid-repo:/usr/local/lib/redmine-trunk/vendor/plugins/redmine_doodles# dir -l -R
.:
insgesamt 32
drwxr-sr-x 6 www-data www-data 4096 18. Okt 14:25 app
drwxr-sr-x 4 www-data www-data 4096 18. Okt 14:25 assets
drwxr-sr-x 3 www-data www-data 4096 18. Okt 14:25 config
drwxr-sr-x 3 www-data www-data 4096 18. Okt 14:25 db
-rw-r--r-- 1 www-data www-data 1066 18. Okt 14:25 init.rb
drwxr-sr-x 2 www-data www-data 4096 18. Okt 14:25 lib
-rw-r--r-- 1 www-data www-data   33 18. Okt 14:25 README.rdoc
drwxr-sr-x 5 www-data www-data 4096 18. Okt 14:25 test

./app:
insgesamt 16
drwxr-sr-x 2 www-data www-data 4096 18. Okt 14:25 controllers
drwxr-sr-x 2 www-data www-data 4096 18. Okt 14:25 helpers
drwxr-sr-x 2 www-data www-data 4096 18. Okt 14:25 models
drwxr-sr-x 4 www-data www-data 4096 18. Okt 14:25 views

./app/controllers:
insgesamt 4
-rw-r--r-- 1 www-data www-data 3447 18. Okt 14:25 doodles_controller.rb

./app/helpers:
insgesamt 4
-rw-r--r-- 1 www-data www-data 25 18. Okt 14:25 doodles_helper.rb

./app/models:
insgesamt 12
-rw-r--r-- 1 www-data www-data 1141 18. Okt 14:25 doodle_answers_edits.rb
-rw-r--r-- 1 www-data www-data  774 18. Okt 14:25 doodle_answers.rb
-rw-r--r-- 1 www-data www-data 2201 18. Okt 14:25 doodle.rb

./app/views:
insgesamt 8
drwxr-sr-x 2 www-data www-data 4096 18. Okt 14:25 doodles
drwxr-sr-x 2 www-data www-data 4096 18. Okt 14:25 mailer

./app/views/doodles:
insgesamt 36
-rw-r--r-- 1 www-data www-data   24 18. Okt 14:25 destroy.html.erb
-rw-r--r-- 1 www-data www-data 1346 18. Okt 14:25 _doodle.html.erb
-rw-r--r-- 1 www-data www-data  716 18. Okt 14:25 edit.html.erb
-rw-r--r-- 1 www-data www-data 1102 18. Okt 14:25 _form.html.erb
-rw-r--r-- 1 www-data www-data 1765 18. Okt 14:25 index.html.erb
-rw-r--r-- 1 www-data www-data  715 18. Okt 14:25 new.html.erb
-rw-r--r-- 1 www-data www-data  259 18. Okt 14:25 _option.html.erb
-rw-r--r-- 1 www-data www-data  370 18. Okt 14:25 preview.html.erb
-rw-r--r-- 1 www-data www-data 2587 18. Okt 14:25 show.html.erb

./app/views/mailer:
insgesamt 24
-rw-r--r-- 1 www-data www-data 270 18. Okt 14:25 doodle_added_answer_requested.t                                                                       ext.html.rhtml
-rw-r--r-- 1 www-data www-data 142 18. Okt 14:25 doodle_added_answer_requested.t                                                                       ext.plain.rhtml
-rw-r--r-- 1 www-data www-data 182 18. Okt 14:25 doodle_added.text.html.rhtml
-rw-r--r-- 1 www-data www-data  68 18. Okt 14:25 doodle_added.text.plain.rhtml
-rw-r--r-- 1 www-data www-data 236 18. Okt 14:25 doodle_answered.text.html.rhtml
-rw-r--r-- 1 www-data www-data 121 18. Okt 14:25 doodle_answered.text.plain.rhtm                                                                       l

./assets:
insgesamt 8
drwxr-sr-x 2 www-data www-data 4096 18. Okt 14:25 images
drwxr-sr-x 2 www-data www-data 4096 18. Okt 14:25 stylesheets

./assets/images:
insgesamt 12
-rwxr-xr-x 1 www-data www-data 799 18. Okt 14:25 date_edit.png
-rwxr-xr-x 1 www-data www-data 626 18. Okt 14:25 date.png
-rw-r--r-- 1 www-data www-data 511 18. Okt 14:25 sum.png

./assets/stylesheets:
insgesamt 4
-rw-r--r-- 1 www-data www-data 1802 18. Okt 14:25 redmine_doodles.css

./config:
insgesamt 8
drwxr-sr-x 2 www-data www-data 4096 18. Okt 14:25 locales
-rw-r--r-- 1 www-data www-data 1320 18. Okt 14:25 routes.rb

./config/locales:
insgesamt 16
-rw-r--r-- 1 www-data www-data 1003 18. Okt 14:25 de.yml
-rw-r--r-- 1 www-data www-data  947 18. Okt 14:25 en.yml
-rw-r--r-- 1 www-data www-data 1018 18. Okt 14:25 fr.yml
-rw-r--r-- 1 www-data www-data 1304 18. Okt 14:25 ru.yml

./db:
insgesamt 4
drwxr-sr-x 2 www-data www-data 4096 18. Okt 14:25 migrate

./db/migrate:
insgesamt 20
-rw-r--r-- 1 www-data www-data 443 18. Okt 14:25 001_create_doodles.rb
-rw-r--r-- 1 www-data www-data 357 18. Okt 14:25 002_create_doodle_answers.rb
-rw-r--r-- 1 www-data www-data 201 18. Okt 14:25 003_add_locked_state_to_doodles                                                                       .rb
-rw-r--r-- 1 www-data www-data 312 18. Okt 14:25 004_create_doodle_answers_edits                                                                       .rb
-rw-r--r-- 1 www-data www-data 330 18. Okt 14:25 005_create_users_should_answer_                                                                       doodles.rb

./lib:
insgesamt 8
-rw-r--r-- 1 www-data www-data 2644 18. Okt 14:25 patch_redmine_classes.rb
-rw-r--r-- 1 www-data www-data  235 18. Okt 14:25 view_hooks.rb

./test:
insgesamt 16
drwxr-sr-x 2 www-data www-data 4096 18. Okt 14:25 fixtures
drwxr-sr-x 2 www-data www-data 4096 18. Okt 14:25 functional
-rw-r--r-- 1 www-data www-data  203 18. Okt 14:25 test_helper.rb
drwxr-sr-x 2 www-data www-data 4096 18. Okt 14:25 unit

./test/fixtures:
insgesamt 12
-rw-r--r-- 1 www-data www-data 240 18. Okt 14:25 doodle_answers_edits.yml
-rw-r--r-- 1 www-data www-data 331 18. Okt 14:25 doodle_answers.yml
-rw-r--r-- 1 www-data www-data 271 18. Okt 14:25 doodles.yml

./test/functional:
insgesamt 4
-rw-r--r-- 1 www-data www-data 191 18. Okt 14:25 doodles_controller_test.rb

./test/unit:
insgesamt 12
-rw-r--r-- 1 www-data www-data 220 18. Okt 14:25 doodle_answers_edits_test.rb
-rw-r--r-- 1 www-data www-data 209 18. Okt 14:25 doodle_answers_test.rb
-rw-r--r-- 1 www-data www-data 195 18. Okt 14:25 doodle_test.rb

RE: Doodle Plugin - Added by Eric Seigne over 13 years ago

Hello,
here is a problem, i've just installed doodle plugin from http://github.com/thegcat/redmine_doodles.git

ActionController::RoutingError (No route matches "/plugin_assets/redmine_doodles/stylesheets/redmine_doodles.css" with {:method=>:get}):

Thank you for this plugin, this is a very good idea !

RE: Doodle Plugin - Added by Felix Schäfer over 13 years ago

Do you have redmine installed in a subdirectory? Or is your public/plugin_assets directory not writeable by the redmine/rails server?

RE: Doodle Plugin - Added by Eric Seigne over 13 years ago

"Bingo": this is the solution:

ls -al public/plugin_assets/
total 28
drwxr-xr-x 6 root    root    4096 2010-09-07 21:51 .
drwxr-xr-x 8 redmine redmine 4096 2010-09-12 13:14 ..

i don't know why this directory was root:root ... i change it, restart redmine "et voilà".

Thanks

RE: Doodle Plugin - Added by nick c over 13 years ago

when you say restart redmine - what command do you issue to do that? I really need to and cant find any documentation on it.

RE: Doodle Plugin - Added by Felix Schäfer over 13 years ago

nick c wrote:

when you say restart redmine - what command do you issue to do that?

Depends on what server you use. If you use apache with passenger, restart your apache or touch /path/to/redmine/tmp/restart.txt, I won't list the others here because there are too many.

RE: Doodle Plugin - Added by nick c over 13 years ago

Thanks Felix. Now when I restart I get redmine 500 error and it crashes the whole of redmine. If i take the Dir away it all runs fine, any ideas?

RE: Doodle Plugin - Added by nick c over 13 years ago

nick c wrote:

Thanks Felix. Now when I restart I get redmine 500 error and it crashes the whole of redmine. If i take the Dir away it all runs fine, any ideas?

Permissions are rwx for redmine and ruby

RE: Doodle Plugin - Added by Felix Schäfer over 13 years ago

nick c wrote:

Now when I restart I get redmine 500 error and it crashes the whole of redmine.

What version of redmine, what do the logs (redmine and apache) have to report?

RE: Doodle Plugin - Added by nick c over 13 years ago

nothing of use in the logs.

RE: Doodle Plugin - Added by nick c over 13 years ago

and in the redmine log

passenger (2.2.11) lib/phusion_passenger/abstract_server_collection.rb:80:in `synchronize'
passenger (2.2.11) lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
passenger (2.2.11) lib/phusion_passenger/spawn_manager.rb:255:in `spawn_rails_application'
passenger (2.2.11) lib/phusion_passenger/spawn_manager.rb:154:in `spawn_application'
passenger (2.2.11) lib/phusion_passenger/spawn_manager.rb:287:in `handle_spawn_application'
passenger (2.2.11) lib/phusion_passenger/abstract_server.rb:352:in `__send__'
passenger (2.2.11) lib/phusion_passenger/abstract_server.rb:352:in `main_loop'
passenger (2.2.11) lib/phusion_passenger/abstract_server.rb:196:in `start_synchronously'

Rendering /REDMINE_PATH/redmine/public/500.html (500 Internal Server Error)

RE: Doodle Plugin - Added by nick c over 13 years ago

nick c wrote:

and in the redmine log

passenger (2.2.11) lib/phusion_passenger/abstract_server_collection.rb:80:in `synchronize'
passenger (2.2.11) lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
passenger (2.2.11) lib/phusion_passenger/spawn_manager.rb:255:in `spawn_rails_application'
passenger (2.2.11) lib/phusion_passenger/spawn_manager.rb:154:in `spawn_application'
passenger (2.2.11) lib/phusion_passenger/spawn_manager.rb:287:in `handle_spawn_application'
passenger (2.2.11) lib/phusion_passenger/abstract_server.rb:352:in `__send__'
passenger (2.2.11) lib/phusion_passenger/abstract_server.rb:352:in `main_loop'
passenger (2.2.11) lib/phusion_passenger/abstract_server.rb:196:in `start_synchronously'

Rendering /REDMINE_PATH/redmine/public/500.html (500 Internal Server Error)

looking further up the log it complained about the name. The dir needs to be called redmine_doodles rather than 'thegcat-redmine_doodles-5e94020'

RE: Doodle Plugin - Added by Felix Schäfer over 13 years ago

nick c wrote:

The dir needs to be called redmine_doodles rather than 'thegcat-redmine_doodles-5e94020'

Yes. All redmine plugins generally have to be named redmine_something.

RE: Doodle Plugin - Added by nick c over 13 years ago

new problem : NoMethodError (undefined method `recipients' for #<Doodle:0x7fd0585eef40>):
vendor/plugins/redmine_doodles/app/models/doodle.rb:64:in `send_mails'
vendor/plugins/redmine_doodles/app/controllers/doodles_controller.rb:46:in `create'
passenger (2.2.11) lib/phusion_passenger/rack/request_handler.rb:92:in `process_request'
passenger (2.2.11) lib/phusion_passenger/abstract_request_handler.rb:207:in `main_loop'
passenger (2.2.11) lib/phusion_passenger/railz/application_spawner.rb:418:in `start_request_handler'
passenger (2.2.11) lib/phusion_passenger/railz/application_spawner.rb:358:in `handle_spawn_application'
passenger (2.2.11) lib/phusion_passenger/utils.rb:184:in `safe_fork'
passenger (2.2.11) lib/phusion_passenger/railz/application_spawner.rb:354:in `handle_spawn_application'
passenger (2.2.11) lib/phusion_passenger/abstract_server.rb:352:in `__send__'
passenger (2.2.11) lib/phusion_passenger/abstract_server.rb:352:in `main_loop'
passenger (2.2.11) lib/phusion_passenger/abstract_server.rb:196:in `start_synchronously'
passenger (2.2.11) lib/phusion_passenger/abstract_server.rb:163:in `start'
passenger (2.2.11) lib/phusion_passenger/railz/application_spawner.rb:213:in `start'
passenger (2.2.11) lib/phusion_passenger/spawn_manager.rb:262:in `spawn_rails_application'
passenger (2.2.11) lib/phusion_passenger/abstract_server_collection.rb:126:in `lookup_or_add'
passenger (2.2.11) lib/phusion_passenger/spawn_manager.rb:256:in `spawn_rails_application'
passenger (2.2.11) lib/phusion_passenger/abstract_server_collection.rb:80:in `synchronize'
passenger (2.2.11) lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
passenger (2.2.11) lib/phusion_passenger/spawn_manager.rb:255:in `spawn_rails_application'
passenger (2.2.11) lib/phusion_passenger/spawn_manager.rb:154:in `spawn_application'
passenger (2.2.11) lib/phusion_passenger/spawn_manager.rb:287:in `handle_spawn_application'
passenger (2.2.11) lib/phusion_passenger/abstract_server.rb:352:in `__send__'
passenger (2.2.11) lib/phusion_passenger/abstract_server.rb:352:in `main_loop'
passenger (2.2.11) lib/phusion_passenger/abstract_server.rb:196:in `start_synchronously'

RE: Doodle Plugin - Added by Felix Schäfer over 13 years ago

nick c wrote:

new problem

And again: Which redmine version? And see if http://www.redmine.org/boards/3/topics/9957?r=17740#message-17740 helps.

RE: Doodle Plugin - Added by nick c over 13 years ago

checking the page now, thanks.

Sorry, forgot the version, here it is : redmine-0.9.3

RE: Doodle Plugin - Added by nick c over 13 years ago

Flexi thanks alot! http://www.redmine.org/boards/3/topics/9957?r=17740#message-17740 helps.

I added the following to vendor/plugins/redmine_doodles/app/models/doodle.rb and it works great.

def recipients
notified = project.notified_users
notified.reject! {|user| !visible?(user)}
notified.collect(&:mail)
end

Thanks for you amazing fast responses to my questions, very much appreciated! Great plugin!

(26-50/87)