commontator 5.1.0 → 6.0.0.pre.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/MIT-LICENSE +1 -1
- data/README.md +83 -63
- data/app/assets/javascripts/commontator/mentions.js +2 -2
- data/app/assets/stylesheets/commontator/application.scss +101 -0
- data/app/assets/stylesheets/commontator/comments.scss +103 -0
- data/app/controllers/commontator/application_controller.rb +21 -21
- data/app/controllers/commontator/comments_controller.rb +123 -114
- data/app/controllers/commontator/security_transgression.rb +2 -0
- data/app/controllers/commontator/subscriptions_controller.rb +20 -22
- data/app/controllers/commontator/threads_controller.rb +50 -50
- data/app/helpers/commontator/application_helper.rb +3 -5
- data/app/helpers/commontator/link_renderer.rb +25 -0
- data/app/mailers/commontator/subscriptions_mailer.rb +35 -35
- data/app/models/commontator/comment.rb +208 -91
- data/app/models/commontator/json_array_coder.rb +10 -0
- data/app/models/commontator/subscription.rb +13 -16
- data/app/models/commontator/thread.rb +139 -133
- data/app/views/commontator/comments/_actions.html.erb +9 -10
- data/app/views/commontator/comments/_body.html.erb +11 -6
- data/app/views/commontator/comments/_form.html.erb +31 -20
- data/app/views/commontator/comments/_list.html.erb +6 -5
- data/app/views/commontator/comments/_reply.html.erb +15 -0
- data/app/views/commontator/comments/_show.html.erb +31 -25
- data/app/views/commontator/comments/_votes.html.erb +12 -11
- data/app/views/commontator/comments/cancel.js.erb +6 -14
- data/app/views/commontator/comments/create.js.erb +20 -14
- data/app/views/commontator/comments/delete.js.erb +14 -14
- data/app/views/commontator/comments/edit.js.erb +6 -4
- data/app/views/commontator/comments/new.js.erb +11 -7
- data/app/views/commontator/comments/update.js.erb +6 -4
- data/app/views/commontator/comments/vote.js.erb +3 -4
- data/app/views/commontator/shared/_thread.html.erb +23 -11
- data/app/views/commontator/subscriptions/_link.html.erb +7 -8
- data/app/views/commontator/subscriptions/subscribe.js.erb +3 -4
- data/app/views/commontator/subscriptions_mailer/comment_created.html.erb +9 -8
- data/app/views/commontator/threads/_hide_show_links.js.erb +10 -9
- data/app/views/commontator/threads/_reply.html.erb +17 -16
- data/app/views/commontator/threads/_show.html.erb +75 -76
- data/app/views/commontator/threads/_show.js.erb +12 -16
- data/app/views/commontator/threads/show.js.erb +9 -6
- data/config/initializers/commontator.rb +81 -67
- data/config/locales/de.yml +28 -48
- data/config/locales/en.yml +38 -27
- data/config/locales/pt-BR.yml +31 -29
- data/config/locales/ru.yml +34 -29
- data/config/locales/zh.yml +65 -48
- data/db/migrate/0_install_commontator.rb +27 -32
- data/db/migrate/1_add_replying_to_comments.rb +9 -0
- data/lib/commontator.rb +9 -140
- data/lib/commontator/acts_as_commontable.rb +24 -33
- data/lib/commontator/acts_as_commontator.rb +28 -25
- data/lib/commontator/build_thread.rb +10 -0
- data/lib/commontator/commontable_config.rb +10 -10
- data/lib/commontator/commontator_config.rb +10 -10
- data/lib/{commontator.rb~ → commontator/config.rb} +57 -57
- data/lib/commontator/controllers.rb +35 -29
- data/lib/commontator/engine.rb +6 -4
- data/lib/commontator/shared_helper.rb +58 -21
- data/lib/commontator/version.rb +1 -3
- data/lib/tasks/commontator_tasks.rake +2 -2
- data/vendor/assets/stylesheets/mentionsInput/jquery.mentionsInput.css +0 -1
- metadata +50 -496
- data/Rakefile +0 -22
- data/app/assets/javascripts/commontator/application.js~ +0 -3
- data/app/assets/javascripts/commontator/mentions.js~ +0 -31
- data/app/assets/stylesheets/commontator/application.css +0 -5
- data/app/assets/stylesheets/commontator/application.css~ +0 -14
- data/app/assets/stylesheets/commontator/comments.css +0 -121
- data/app/assets/stylesheets/commontator/threads.css +0 -71
- data/app/assets/stylesheets/commontator/threads.css~ +0 -71
- data/app/controllers/commontator/comments_controller.rb~ +0 -160
- data/app/controllers/commontator/threads_controller.rb~ +0 -75
- data/app/mailers/commontator/subscriptions_mailer.rb~ +0 -65
- data/app/models/commontator/comment.rb~ +0 -124
- data/app/models/commontator/subscription.rb~ +0 -23
- data/app/views/commontator/shared/_thread.html.erb~ +0 -21
- data/app/views/commontator/subscriptions_mailer/comment_created.html.erb~ +0 -10
- data/app/views/commontator/threads/_hide_show.js.erb~ +0 -21
- data/app/views/commontator/threads/_hide_show_links.js.erb~ +0 -17
- data/app/views/commontator/threads/_show.html.erb~ +0 -118
- data/app/views/commontator/threads/_show.js.erb~ +0 -18
- data/config/initializers/commontator.rb~ +0 -290
- data/config/locales/en.yml~ +0 -101
- data/config/locales/ru.yml~ +0 -79
- data/config/locales/zh.yml~ +0 -79
- data/config/routes.rb~ +0 -25
- data/db/migrate/0_install_commontator.rb~ +0 -52
- data/db/migrate/1_add_parent_comment_id_to_commontator_comments.rb~ +0 -9
- data/lib/commontator/link_renderer.rb +0 -28
- data/lib/commontator/security_transgression.rb +0 -4
- data/lib/commontator/shared_helper.rb~ +0 -26
- data/lib/commontator/version.rb~ +0 -3
- data/spec/controllers/commontator/comments_controller_spec.rb +0 -613
- data/spec/controllers/commontator/comments_controller_spec.rb~ +0 -612
- data/spec/controllers/commontator/subscriptions_controller_spec.rb +0 -101
- data/spec/controllers/commontator/subscriptions_controller_spec.rb~ +0 -101
- data/spec/controllers/commontator/threads_controller_spec.rb +0 -219
- data/spec/controllers/commontator/threads_controller_spec.rb~ +0 -218
- data/spec/dummy/README.md +0 -4
- data/spec/dummy/README.md~ +0 -3
- data/spec/dummy/Rakefile +0 -7
- data/spec/dummy/Rakefile~ +0 -6
- data/spec/dummy/app/assets/javascripts/application.js +0 -17
- data/spec/dummy/app/assets/javascripts/application.js~ +0 -16
- data/spec/dummy/app/assets/stylesheets/application.css +0 -15
- data/spec/dummy/app/assets/stylesheets/application.css~ +0 -14
- data/spec/dummy/app/controllers/application_controller.rb +0 -6
- data/spec/dummy/app/controllers/application_controller.rb~ +0 -4
- data/spec/dummy/app/controllers/dummy_models_controller.rb +0 -23
- data/spec/dummy/app/controllers/dummy_models_controller.rb~ +0 -23
- data/spec/dummy/app/helpers/application_helper.rb +0 -16
- data/spec/dummy/app/helpers/application_helper.rb~ +0 -15
- data/spec/dummy/app/models/dummy_dependent_model.rb +0 -4
- data/spec/dummy/app/models/dummy_model.rb +0 -4
- data/spec/dummy/app/models/dummy_model.rb~ +0 -3
- data/spec/dummy/app/models/dummy_user.rb +0 -14
- data/spec/dummy/app/models/dummy_user.rb~ +0 -13
- data/spec/dummy/app/views/dummy_models/index.html.erb~ +0 -6
- data/spec/dummy/app/views/dummy_models/show.html.erb +0 -2
- data/spec/dummy/app/views/dummy_models/show.html.erb~ +0 -2
- data/spec/dummy/app/views/layouts/application.html.erb +0 -14
- data/spec/dummy/app/views/layouts/application.html.erb~ +0 -14
- data/spec/dummy/config.ru +0 -5
- data/spec/dummy/config.ru~ +0 -4
- data/spec/dummy/config/application.rb +0 -27
- data/spec/dummy/config/application.rb~ +0 -26
- data/spec/dummy/config/boot.rb +0 -6
- data/spec/dummy/config/boot.rb~ +0 -5
- data/spec/dummy/config/database.yml +0 -26
- data/spec/dummy/config/database.yml~ +0 -25
- data/spec/dummy/config/environment.rb +0 -8
- data/spec/dummy/config/environment.rb~ +0 -8
- data/spec/dummy/config/environments/development.rb +0 -31
- data/spec/dummy/config/environments/development.rb~ +0 -31
- data/spec/dummy/config/environments/production.rb +0 -82
- data/spec/dummy/config/environments/production.rb~ +0 -82
- data/spec/dummy/config/environments/test.rb +0 -40
- data/spec/dummy/config/environments/test.rb~ +0 -40
- data/spec/dummy/config/initializers/backtrace_silencers.rb +0 -8
- data/spec/dummy/config/initializers/backtrace_silencers.rb~ +0 -7
- data/spec/dummy/config/initializers/commontator.rb +0 -20
- data/spec/dummy/config/initializers/commontator.rb~ +0 -21
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +0 -5
- data/spec/dummy/config/initializers/filter_parameter_logging.rb~ +0 -4
- data/spec/dummy/config/initializers/inflections.rb +0 -17
- data/spec/dummy/config/initializers/inflections.rb~ +0 -16
- data/spec/dummy/config/initializers/mime_types.rb +0 -6
- data/spec/dummy/config/initializers/mime_types.rb~ +0 -5
- data/spec/dummy/config/initializers/secret_token.rb +0 -13
- data/spec/dummy/config/initializers/secret_token.rb~ +0 -12
- data/spec/dummy/config/initializers/session_store.rb +0 -4
- data/spec/dummy/config/initializers/session_store.rb~ +0 -3
- data/spec/dummy/config/initializers/wrap_parameters.rb +0 -15
- data/spec/dummy/config/initializers/wrap_parameters.rb~ +0 -14
- data/spec/dummy/config/routes.rb +0 -9
- data/spec/dummy/config/routes.rb~ +0 -10
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/migrate/1_create_dummy_models.rb +0 -7
- data/spec/dummy/db/migrate/1_create_dummy_models.rb~ +0 -7
- data/spec/dummy/db/migrate/2_create_dummy_users.rb +0 -7
- data/spec/dummy/db/migrate/2_create_dummy_users.rb~ +0 -7
- data/spec/dummy/db/migrate/3_acts_as_votable_migration.rb +0 -22
- data/spec/dummy/db/migrate/3_acts_as_votable_migration.rb~ +0 -27
- data/spec/dummy/db/migrate/4_create_dummy_dependent_models.rb +0 -7
- data/spec/dummy/db/schema.rb +0 -85
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/lib/controllers.rb~ +0 -10
- data/spec/dummy/lib/dummy_controllers.rb +0 -10
- data/spec/dummy/log/development.log +0 -6693
- data/spec/dummy/log/test.log +0 -125970
- data/spec/dummy/public/404.html +0 -27
- data/spec/dummy/public/404.html~ +0 -26
- data/spec/dummy/public/422.html +0 -27
- data/spec/dummy/public/422.html~ +0 -26
- data/spec/dummy/public/500.html +0 -26
- data/spec/dummy/public/500.html~ +0 -25
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/script/rails +0 -7
- data/spec/dummy/script/rails~ +0 -6
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/-RolHYhJdGiLoPkoWZXQdI9AIWUjMMCa2yFJezCE_Bo.cache +0 -2
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/-STzK7UuGeY3gSvnmTELWLvtRMKpmSAQCEw4ao3b1r8.cache +0 -1
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/3NH8nN7uktAXgA3NqaqXTXDVic3BxBvqCxoLpGGbib4.cache +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/4_iT7KM6P2IT75Rssrk9p4crTBwM8DQWR41gmsxczL0.cache +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/58TLCXvf5bFFYY-mIUXrQNOVWlGsq7qPAoSX2OIIB8Y.cache +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/6OQdyrATvNatvWu8Mp1qbuvRx-HLmzCZ5XBGYca-rZU.cache +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/6UKCUV-ZLaWCoPMfMB6a2W0RCFPQzPJ6Mz-y67sH7zk.cache +0 -2
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/6wKNjFdNd4OHjIpLC0nq1kBWcbYg1aEYrp7ZhWoJlvY.cache +0 -1
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/7Xxb5iYP5elo40JRlhNQB1gLbv3ueELK2rTinYt5xdc.cache +0 -1
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/7twIKlS6VYCyLlwhsQg2vu4wLSUJsT2REHR4DjZf1oE.cache +0 -2
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/87m-4EcbQnkbo2HYkQp4V9I2U3AYQO1mPeReieduolA.cache +0 -1
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/8B331vt8qC4iXTcVzkx3j-ET8i1oaQskj5LyqGq8mPQ.cache +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/8KWvIOgvo7BVJYtdTpFuiSQQFFwZhLWYtwacZv52y48.cache +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/9yQa5M2ObK2-qDu231zMoarjVbhKUUg-ND3r2iXqB_Q.cache +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/A-ffuUI2juZT6qFpTUwUR1P8OPWcyFFN26WSUZe60Ko.cache +0 -1
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/BbO4diS6uacx69Hn_bCabYlXEbWWdjHShRlfzlWSOMI.cache +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/CXhqxaQQAQ8b0Y8y0jTQyiqsZ6Oe4fZn0YiacpJ9IoI.cache +0 -1
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/E1zaNOh68xzPxdtdOwRtOaMCoKivN2dxVwCP65WEi5I.cache +0 -2
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/EmPkV3H8p2Snv9WyPjWran_kOMQ0MqQ1a9CVdGDd8l4.cache +0 -1
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/Hc12Nxe7cw2e0u2pzNsAe8D3ncQpcqLuI2NVL7aAXgw.cache +0 -1
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/HdWuQr9W2mZvggsAxVjDgLYUNfg3rbI-T8KhaDIsvQk.cache +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/I7lsrHTKpbfLWqIqdDIx2RN_12yFL2PyLRyYsMxg1IU.cache +0 -1
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/JOCzfBjMjX3D5BUUGh5lJ7fjzMuJrHLxAginRA2_hZQ.cache +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/JusxTSXt06IqBm9jeCMM2nTmM3Wvbl3i3L1IwEvW5YA.cache +0 -2
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/KAY1_IaTONtGr0KK8ihOdoA-RDXybqBMNSZLIDRHx68.cache +0 -1
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/KBHIDNfa4ryw9LAkYqK8GgPWne7HkX6mNYgrJajGm94.cache +0 -1
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/L_lv02y00MmIFiFhg5c9zhl7CDHLSahehzLyi_mRZeY.cache +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/MOT2X4iikR8v89A4N1bxDTeS1-xV8c9036TNFXmwXCM.cache +0 -1
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/MiX2Z4Vbha1riozZWw1U3_PGttRiZ1iQ_o4wSZJnKCs.cache +0 -3
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/MntKfwol0ud4LuvrX3MVPthTlfNlJZRYbQXpQBxhRrs.cache +0 -1
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/MrqmgPGNYJV1capJKIKJOVEQ4NiO-Z_2YhpjNteJ8B8.cache +0 -2
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/NVMnAwylzGp5bjl_o9dwMAQxVAPDzc4ygddNQSD1fiw.cache +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/O2sKqGxNuCYhjzuEZVC9hX_FeemOfRn_1-CCuHBQYyg.cache +0 -1
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/Qy3TykLFmAt5jhSluMTaZaefcA5c_vfBRhQ7tin-gsk.cache +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/R3DpUgZ_hja1dQTIzumiP9AD_r8mlOaqv0U9QqnGQqo.cache +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/RF07mgb06A30OcDWtCaDlM5tEc1yp0uAsk986Gqs5w8.cache +0 -1
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/S-6Iq5YOEpVnd_vQ0RSSfrmyIwB1dk0op35alFgJ9xA.cache +0 -2
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/TKV8dUTo88gdFY-z2I7Xa5vDC1Z3LY6Paa18385MJsI.cache +0 -1
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/UI4zPmWfZA2d_5ZZIXqK9KmkjOKSDg6JoM7qcOIxm0Q.cache +0 -1
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/UP29vrIQbCkfghZGSCFxpW5gjlsgCxlVrncjjopvRqM.cache +0 -2
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/UoU16f4V7haEXM5GY5j4QFuNMP7PJZaAMEvVNNtNLBA.cache +0 -1
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/VqPqYNG07yqcjbd7FA05Mu-jr5hzsZPaHFf8X0FFbXk.cache +0 -2
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/WkN1QFvcuzXSsyNmfaK02ojXPk-8zmdEegzNPfdAEL4.cache +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/WkQX7Wiz41OKx2aGF7uffOmS04hIVZeGCondBAvwum8.cache +0 -2
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/XMeYF1vwAg53eVjXVkw_IKQH2W3-9tWvtuCdqUCbPBM.cache +0 -2
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/XX0Z7OM0xZKfQaAvHARpyeQNZCstNyu9MlsnwThSkg8.cache +0 -1
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/Y-pGNFTA6bAKxSvqZvmMVs3b4Els1aByxZVFxtJR71c.cache +0 -1
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/Y3p3m5V5NOm7yq56apKmF5KZUUsTfnhT_SG3fqbEJgo.cache +0 -1
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/YLZuRWklL6q-csC-7A7CiOTTTYEQcA9PCdWEOm9MpNU.cache +0 -1
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/Yo7V5YXukEBm6z37l-TIRCJx3HZExEUBu3MUMhAzkMU.cache +0 -1
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/bK6QttR8pGmMAMJO0avCBLwH0za8_bAC-yWqkU3Yj24.cache +0 -1
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/cLncjrqpQXzsVBp7K0W7iG1STLrnzfGpbJXxNE7aIUk.cache +0 -2
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/dBcAd64EZFdhHZNXKGXPIR7EtPGf03bzqkci2W12T8g.cache +0 -2
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/d_bbPiareJHKkzFZFCl3pcwfQOFzsB1KHn4A2xxhR20.cache +0 -1
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/eaHZBuJRcawVlkGZVyyRr5_4xYKVOXbCqnTcmaNXzL0.cache +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/gWnmfJty3jBn53qsJfOXKrWv4e8i3Dp80wVel-f1L1E.cache +0 -1
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/gumo32Bd3W_q7MYEt9JIZEiQdHF93tLSsGfmXIm2MqU.cache +0 -1
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/jKTlG9KP0iaCGHwg8kQ1amz9SHJ1OAWeCRRn9wc5w7c.cache +0 -1
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/kPJfTiWbmX-q6i2rjM9MAMdEf2silSihU0_lxlTGVA8.cache +0 -1
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/lrt1SWPj4qWUZUMH9xg3n9KLYUqJZxRn-XI-NTU6oTI.cache +0 -1
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/mcCP5u08nlCL6TgWdzzrem9uE2rbsbG3KyIXxvWvlJE.cache +0 -3
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/pC4exGjkQLXXPE0O9hjX_2AJ4DASTFeB6RGjXagxEac.cache +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/pIRh_Lq-ZhYC_XdRcqIsCtUkTnwVET0Wrrpw1EltHd8.cache +0 -2
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/qfXc71sDbi1cE9f327D6ABPURPU6lLguGiJqH2fqM0w.cache +0 -1
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/rBcrkzXcMaiCjwvWl8tO0eARzKZS69I3i-lfsTAFzcc.cache +0 -1
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/sfl8l1_1AGn-4llkmb91Q0wHJ-A-x5gAGkIUWe1zLqo.cache +0 -1
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/tFQc0MOeWpJ7t7cNP2GOzo7o9Z6YBgLEpdS0tGLvUSw.cache +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/tb9v5OemP-ADEwYnETLLi1r088kZm_TMb9ZVeTV5JxI.cache +0 -1
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/uKmWfbgaNZ8FTsVK1VNuUv15rmtTHzSdJ7TQRGr0Rck.cache +0 -2
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/ul0QEoovfr_12YOpyWx8BJs8fvz5Ay3AZG8-lsLr-a4.cache +0 -1
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/vY6eUgBIXKHqfU2ZroS-GugKPg5_fo2QBs-vS5gBN2o.cache +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/vrRc4DPAbHIJHJqsXfBYdyKUPFv8f8YYKJUrk-1zdVw.cache +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/wTET4PQq7wlxzrgvNivPJad-CACkoQS4BNxAP0FQaR4.cache +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/wcvE87iLx7cDjMDs_Yu1jKYvep-VyLEyj1eXL79KLp4.cache +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/xQeZ92qbm2t9FaRck5xUakvNP-MJ2cs0RroN-fm0Tf8.cache +0 -1
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/xQz9WPf67Mu5uV4rNuOfU-y6_KWSlWcnTWrTvQPonKM.cache +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/xhYTRUOS8cIvyRp2Jn6FKnXlGOSsIM2z3HAGOJoJs7w.cache +0 -1
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/yLxMFI0ARh2OKSOQLF2xEfM7sbst2vUbOBXoOuI6iTE.cache +0 -1
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/ynnYZxuxqerlFUytw54dl_CwP94g0U4HmGjyILWnhfQ.cache +0 -1
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/zCivVPbSRpKF_X-P5OJeld32YhymG-bkjQwzqe2o6zg.cache +0 -2
- data/spec/dummy/tmp/cache/assets/test/sprockets/02d4b791eb831cf2057bf4703a1218d1 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/0f196a1a50363b0a076ec6e1ee5417f6 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/a3fb9025f90ff05a6fd4afc7ded2692c +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/a41c8be5379abec3c0d0d98e2f0d5609 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/c69ee3cc5796188d873574179290a6ef +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/e1f674c11941d62aac1764ef3a7134e4 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/e85565206c3e5fdf9dfeb367c85557b1 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/-gXoYfEJ-e9QQUbNRpNa-pwMCnTc7Eqvkq6Bosde6W8.cache +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/6iNAIrMKxHltOChiHQQf9VNsLQuj2rVKz6oqWnK7aSM.cache +0 -1
- data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/E1zaNOh68xzPxdtdOwRtOaMCoKivN2dxVwCP65WEi5I.cache +0 -2
- data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/HsNbq1o4RbrEWNL4zXVqFfUVnXXLK_y0F0BvddDre6g.cache +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/JusxTSXt06IqBm9jeCMM2nTmM3Wvbl3i3L1IwEvW5YA.cache +0 -2
- data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/L5DjABL_iOtoxSOLn3X7_YlxECU5EhnrVIKxJFAysgc.cache +0 -1
- data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/PNc9TJUmRdGTSwgZvGlxKaIiJIkyoWtTPiGGWBqpHAE.cache +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/QkgTHa6nNs7XP6RPoV3yBbWWV-uo1u2-qxLuvLCFe_0.cache +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/S-6Iq5YOEpVnd_vQ0RSSfrmyIwB1dk0op35alFgJ9xA.cache +0 -2
- data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/Vuc93A9yywiFxc9CAdxrzdsAQw4jxiCa6JRzRjNxOYs.cache +0 -1
- data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/YAPBll4U0cgs6cz-WyMRKoakK_gVOOcl9n0CvGyxPjY.cache +0 -1
- data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/bDNeZfPBQaef5z0YajZc4jFE54nNy9gc06mPNKvvPFk.cache +0 -1
- data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/c5Wa2loowFYFRBaMoTn1IWYXo4BGMbEy7NIi0vbvfRU.cache +0 -1
- data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/dkn8MYu2ve_AJW6u0jjTlKrj1KBRqorOHQR0Obx2elU.cache +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/fZuAzt_-48u9C7ZXmsPgTraGDYtNC9B9zN-9-EnxJG4.cache +0 -1
- data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/gumo32Bd3W_q7MYEt9JIZEiQdHF93tLSsGfmXIm2MqU.cache +0 -1
- data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/ige85jXyj8X7XYr7HpA0gSTThqfPUm71HjhSJXtTbUY.cache +0 -1
- data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/kuYeE5bV6FdXmfB_o-xhflhSDWoQhYYaaupAXODZ9dQ.cache +0 -1
- data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/qhZbbNIRUaAOtGano94zLHjeBKUhKr4qbh2tTCi0Bnk.cache +0 -2
- data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/wJJbzdHJHP6tchng3HhfTwmjc5LursgX8yZkAjpO5UA.cache +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/xNL1WW-qU3EvV2iTSW6F4hAFRBsCYmFKJhLjgCZkOV8.cache +0 -2
- data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/ytHkF2DwUE6oaiLyrK6tL-0INpeNhjN6ctD7J0LNY6I.cache +0 -2
- data/spec/helpers/commontator/application_helper_spec.rb +0 -10
- data/spec/helpers/commontator/application_helper_spec.rb~ +0 -9
- data/spec/lib/commontator/acts_as_commontable_spec.rb +0 -25
- data/spec/lib/commontator/acts_as_commontable_spec.rb~ +0 -25
- data/spec/lib/commontator/acts_as_commontator_spec.rb +0 -26
- data/spec/lib/commontator/acts_as_commontator_spec.rb~ +0 -52
- data/spec/lib/commontator/commontable_config_spec.rb +0 -28
- data/spec/lib/commontator/commontable_config_spec.rb~ +0 -29
- data/spec/lib/commontator/commontator_config_spec.rb +0 -28
- data/spec/lib/commontator/commontator_config_spec.rb~ +0 -29
- data/spec/lib/commontator/controller_includes_spec.rb~ +0 -18
- data/spec/lib/commontator/controllers_spec.rb +0 -18
- data/spec/lib/commontator/controllers_spec.rb~ +0 -18
- data/spec/lib/commontator/shared_helper_spec.rb +0 -21
- data/spec/lib/commontator/shared_helper_spec.rb~ +0 -22
- data/spec/lib/commontator_spec.rb +0 -25
- data/spec/lib/commontator_spec.rb~ +0 -26
- data/spec/mailers/commontator/subscriptions_mailer_spec.rb +0 -49
- data/spec/mailers/commontator/subscriptions_mailer_spec.rb~ +0 -30
- data/spec/models/commontator/comment_spec.rb +0 -82
- data/spec/models/commontator/comment_spec.rb~ +0 -82
- data/spec/models/commontator/subscription_spec.rb +0 -38
- data/spec/models/commontator/subscription_spec.rb~ +0 -38
- data/spec/models/commontator/thread_spec.rb +0 -159
- data/spec/models/commontator/thread_spec.rb~ +0 -122
- data/spec/rails_helper.rb +0 -72
- data/spec/rails_helper.rb~ +0 -74
- data/spec/spec_helper.rb +0 -94
- data/spec/spec_helper.rb~ +0 -93
- data/vendor/assets/javascripts/mentionsInput/index.js~ +0 -3
@@ -1,28 +1,29 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
<%#
|
2
|
+
Views that use this partial must supply the following variables:
|
3
|
+
thread
|
4
|
+
user
|
5
|
+
per_page
|
6
|
+
%>
|
5
7
|
|
6
|
-
|
7
|
-
|
8
|
-
<div id="thread_<%= thread.id %>_reply" class="thread_reply">
|
8
|
+
<div id="commontator-thread-<%= thread.id %>-reply" class="reply">
|
9
9
|
<% if thread.is_closed? %>
|
10
10
|
<p><%= t 'commontator.thread.status.cannot_post' %></p>
|
11
11
|
<% elsif !user %>
|
12
12
|
<p><%= t 'commontator.require_login' %>.</p>
|
13
13
|
<% else %>
|
14
|
-
<div id="
|
15
|
-
|
16
|
-
<% unless @
|
17
|
-
<%=
|
18
|
-
|
19
|
-
|
20
|
-
|
14
|
+
<div id="commontator-thread-<%= thread.id %>-new-comment" class="new-comment<%=
|
15
|
+
@commontator_new_comment.nil? ? ' hidden' : '' %>">
|
16
|
+
<% unless @commontator_new_comment.nil? %>
|
17
|
+
<%=
|
18
|
+
render partial: 'commontator/comments/form', locals: {
|
19
|
+
comment: @commontator_new_comment, thread: thread, per_page: per_page
|
20
|
+
}
|
21
|
+
%>
|
21
22
|
<% end %>
|
22
23
|
</div>
|
23
24
|
|
24
|
-
<% if @
|
25
|
-
<div id="
|
25
|
+
<% if @commontator_new_comment.nil? %>
|
26
|
+
<div id="commontator-thread-<%= thread.id %>-new-comment-link" class="new-comment">
|
26
27
|
<%= link_to t('commontator.comment.actions.new'),
|
27
28
|
commontator.new_thread_comment_path(thread, per_page: per_page),
|
28
29
|
remote: true %>
|
@@ -1,107 +1,107 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
1
|
+
<%#
|
2
|
+
Views that use this partial must supply the following variables:
|
3
|
+
thread
|
4
|
+
user
|
5
|
+
page
|
6
|
+
per_page
|
7
|
+
show_all
|
8
8
|
%>
|
9
9
|
|
10
10
|
<% can_subscribe = thread.can_subscribe?(user)
|
11
11
|
can_edit = thread.can_be_edited_by?(user) %>
|
12
12
|
|
13
|
-
<
|
13
|
+
<div id="commontator-thread-<%= thread.id %>-show" class="show hidden">
|
14
14
|
<%= link_to t('commontator.thread.actions.show'),
|
15
15
|
'#',
|
16
|
-
id: "
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
<
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
class: "thread_hide_link" %>
|
27
|
-
</span>
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
<% if can_subscribe %>
|
32
|
-
<span id="thread_<%= thread.id.to_s %>_subscription_span" class="thread_subscription">
|
33
|
-
<%= render partial: 'commontator/subscriptions/link',
|
34
|
-
locals: { thread: thread,
|
35
|
-
user: user } %>
|
16
|
+
id: "commontator-thread-#{thread.id}-show-link" %>
|
17
|
+
</div>
|
18
|
+
|
19
|
+
<div id="commontator-thread-<%= thread.id %>-content" class="content">
|
20
|
+
<div id="commontator-thread-<%= thread.id %>-header" class="header">
|
21
|
+
<span id="commontator-thread-<%= thread.id %>-actions" class="actions">
|
22
|
+
<span id="commontator-thread-<%= thread.id %>-hide" class="hide hidden">
|
23
|
+
<%= link_to t('commontator.thread.actions.hide'),
|
24
|
+
'#',
|
25
|
+
id: "commontator-thread-#{thread.id}-hide-link" %>
|
36
26
|
</span>
|
37
|
-
<% end %>
|
38
|
-
|
39
|
-
|
40
27
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
28
|
+
<% if can_subscribe %>
|
29
|
+
<span id="commontator-thread-<%= thread.id %>-subscription" class="subscription">
|
30
|
+
<%= render partial: 'commontator/subscriptions/link',
|
31
|
+
locals: { thread: thread, user: user } %>
|
32
|
+
</span>
|
33
|
+
<% end %>
|
45
34
|
|
46
|
-
<% if
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
35
|
+
<% if can_edit %>
|
36
|
+
<%
|
37
|
+
if show_all
|
38
|
+
filter_class = filter_string = 'filter'
|
39
|
+
else
|
40
|
+
filter_string = 'show_all'
|
41
|
+
filter_class = 'show-all'
|
42
|
+
end
|
43
|
+
is_closed = thread.is_closed?
|
44
|
+
close_string = is_closed ? 'reopen' : 'close'
|
45
|
+
%>
|
46
|
+
|
47
|
+
<% if thread.is_filtered? %>
|
48
|
+
<%= link_to t("commontator.thread.actions.#{filter_string}"),
|
49
|
+
commontator.thread_url(thread, show_all: (show_all ? nil : true)),
|
50
|
+
id: "commontator-thread-#{thread.id}-#{filter_class}-link",
|
51
|
+
class: filter_class,
|
52
|
+
remote: true %>
|
53
|
+
<% end %>
|
54
|
+
|
55
|
+
<%= link_to t("commontator.thread.actions.#{close_string}"),
|
56
|
+
commontator.polymorphic_url([close_string, thread]),
|
57
|
+
data: is_closed ? {} :
|
58
|
+
{ confirm: t('commontator.thread.actions.confirm_close') },
|
59
|
+
method: :put,
|
60
|
+
id: "commontator-thread-#{thread.id}-#{close_string}-link",
|
61
|
+
class: close_string,
|
51
62
|
remote: true %>
|
52
|
-
|
53
|
-
|
54
63
|
<% end %>
|
64
|
+
</span>
|
55
65
|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
class: "thread_#{close_string}_link",
|
62
|
-
remote: true %>
|
63
|
-
<% end %>
|
64
|
-
</span>
|
65
|
-
|
66
|
-
<span id="thread_<%= thread.id.to_s %>_header_span" class="thread_header">
|
67
|
-
<%= t "commontator.thread.status.#{thread.is_closed? ? 'closed' : 'open'}",
|
68
|
-
closer_name: (thread.is_closed? ? Commontator.commontator_name(thread.closer) : '') %>
|
69
|
-
</span>
|
66
|
+
<span id="commontator-thread-<%= thread.id %>-status" class="status">
|
67
|
+
<%= t "commontator.thread.status.#{thread.is_closed? ? 'closed' : 'open'}",
|
68
|
+
closer_name: (thread.is_closed? ? Commontator.commontator_name(thread.closer) : '') %>
|
69
|
+
</span>
|
70
|
+
</div>
|
70
71
|
|
71
72
|
<% if thread.config.comment_order == :l %>
|
72
73
|
<%= render partial: 'commontator/threads/reply',
|
73
74
|
locals: { thread: thread, user: user, per_page: per_page } %>
|
74
75
|
<% end %>
|
75
76
|
|
76
|
-
<div id="
|
77
|
-
<% comments =
|
78
|
-
|
77
|
+
<div id="commontator-thread-<%= thread.id %>-comment-list" class="comment-list">
|
78
|
+
<% comments = thread.paginated_comments(page, per_page, show_all) %>
|
79
|
+
|
79
80
|
<%= render partial: 'commontator/comments/list',
|
80
|
-
locals: { comments: comments,
|
81
|
-
user: user } %>
|
81
|
+
locals: { comments: comments, user: user, per_page: per_page } %>
|
82
82
|
</div>
|
83
83
|
|
84
|
-
<% if thread.will_paginate?
|
85
|
-
<div id="
|
86
|
-
<div id="
|
84
|
+
<% if thread.will_paginate? %>
|
85
|
+
<div id="commontator-thread-<%= thread.id %>-pagination" class="pagination">
|
86
|
+
<div id="commontator-thread-<%= thread.id %>-page-entries-info" class="page-entries-info">
|
87
87
|
<%= page_entries_info comments,
|
88
88
|
params: { controller: 'commontator/threads',
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
89
|
+
action: 'show',
|
90
|
+
id: thread.id,
|
91
|
+
page: page,
|
92
|
+
per_page: per_page } %>.
|
93
93
|
</div>
|
94
94
|
|
95
|
-
<div id="
|
95
|
+
<div id="commontator-thread-<%= thread.id %>-will-paginate" class="will-paginate">
|
96
96
|
<%= will_paginate comments,
|
97
97
|
renderer: Commontator::LinkRenderer,
|
98
98
|
routes_proxy: commontator,
|
99
99
|
remote: true,
|
100
100
|
params: { controller: 'commontator/threads',
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
101
|
+
action: 'show',
|
102
|
+
id: thread.id,
|
103
|
+
page: page,
|
104
|
+
per_page: per_page } %>
|
105
105
|
</div>
|
106
106
|
</div>
|
107
107
|
<% end %>
|
@@ -110,9 +110,8 @@
|
|
110
110
|
<%= render partial: 'commontator/threads/reply',
|
111
111
|
locals: { thread: thread, user: user, per_page: per_page } %>
|
112
112
|
<% end %>
|
113
|
-
</
|
113
|
+
</div>
|
114
114
|
|
115
115
|
<script type="text/javascript">
|
116
|
-
<%= render partial: 'commontator/threads/hide_show_links.js',
|
117
|
-
locals: { thread: thread } %>
|
116
|
+
<%= render partial: 'commontator/threads/hide_show_links.js', locals: { thread: thread } %>
|
118
117
|
</script>
|
@@ -1,18 +1,14 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
1
|
+
<%#
|
2
|
+
Views that use this partial must supply the following variables:
|
3
|
+
thread
|
4
|
+
user
|
5
|
+
page
|
6
|
+
per_page
|
7
|
+
show_all
|
8
8
|
%>
|
9
9
|
|
10
|
-
$("#
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
user: user,
|
16
|
-
page: page,
|
17
|
-
per_page: per_page,
|
18
|
-
show_all: show_all }) %>");
|
10
|
+
$("#commontator-thread-<%= thread.id %>").html("<%= escape_javascript(
|
11
|
+
render partial: 'commontator/threads/show',
|
12
|
+
formats: [ :html ],
|
13
|
+
locals: { thread: thread, user: user, page: page, per_page: per_page, show_all: show_all }
|
14
|
+
) %>");
|
@@ -1,8 +1,11 @@
|
|
1
|
-
<%=
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
1
|
+
<%=
|
2
|
+
render partial: 'show', locals: {
|
3
|
+
thread: @commontator_thread,
|
4
|
+
user: @commontator_user,
|
5
|
+
page: @commontator_page,
|
6
|
+
per_page: @commontator_per_page,
|
7
|
+
show_all: @commontator_show_all
|
8
|
+
}
|
9
|
+
%>
|
7
10
|
|
8
11
|
<%= javascript_proc %>
|
@@ -1,30 +1,28 @@
|
|
1
1
|
# Change the settings below to suit your needs
|
2
2
|
# All settings are initially set to their default values
|
3
|
-
|
4
|
-
# Note: Do not "return" from a Proc, use "next" instead if necessary
|
5
3
|
Commontator.configure do |config|
|
6
4
|
# Engine Configuration
|
7
5
|
|
8
6
|
# current_user_proc
|
9
7
|
# Type: Proc
|
10
|
-
# Arguments: the current controller (ActionController::Base)
|
8
|
+
# Arguments: the current controller (ActionController::Base) or view (ActionView::Base)
|
11
9
|
# Returns: the current user (acts_as_commontator)
|
12
10
|
# The default works for Devise and similar authentication plugins
|
13
|
-
#
|
14
|
-
|
11
|
+
# If you define your own custom method, make sure it is accessible to all controllers and views
|
12
|
+
# by adding the method and a call to helper_method to ActionController::Base
|
13
|
+
# Default: ->(context) { context.current_user }
|
14
|
+
config.current_user_proc = ->(context) { context.current_user }
|
15
15
|
|
16
16
|
# javascript_proc
|
17
17
|
# Type: Proc
|
18
18
|
# Arguments: a view (ActionView::Base)
|
19
|
-
# Returns: a String that is appended to Commontator JS views
|
20
|
-
# Can be used, for example, to
|
21
|
-
# or to reapply JQuery UI styles after Ajax calls
|
19
|
+
# Returns: a String that is appended to all Commontator JS views
|
20
|
+
# Can be used, for example, to reapply JQuery UI styles after Ajax calls
|
22
21
|
# Objects visible in view templates can be accessed
|
23
22
|
# through the view object (for example, view.flash)
|
24
23
|
# However, the view does not include the main application's helpers
|
25
|
-
# Default: ->(view) { '
|
26
|
-
config.javascript_proc = ->(view) { '
|
27
|
-
|
24
|
+
# Default: ->(view) { '' }
|
25
|
+
config.javascript_proc = ->(view) { '' }
|
28
26
|
|
29
27
|
|
30
28
|
# User (acts_as_commontator) Configuration
|
@@ -50,21 +48,22 @@ Commontator.configure do |config|
|
|
50
48
|
# user_avatar_proc
|
51
49
|
# Type: Proc
|
52
50
|
# Arguments: a user (acts_as_commontator), a view (ActionView::Base)
|
53
|
-
# Returns: a String containing
|
54
|
-
# The commontator_gravatar_image_tag helper takes a user object,
|
51
|
+
# Returns: a String containing an HTML <img> tag pointing to the user's avatar image
|
52
|
+
# The optional commontator_gravatar_image_tag helper takes a user object,
|
55
53
|
# a border size and an options hash for Gravatar, and produces a Gravatar image tag
|
56
|
-
# See available options at
|
54
|
+
# See available options at https://en.gravatar.com/site/implement/images/)
|
57
55
|
# Note: Gravatar has several security implications for your users
|
58
56
|
# It makes your users trackable across different sites and
|
59
57
|
# allows de-anonymization attacks against their email addresses
|
60
58
|
# If you absolutely want to keep users' email addresses or identities secret,
|
61
59
|
# do not use Gravatar or similar services
|
62
|
-
#
|
63
|
-
#
|
64
|
-
#
|
65
|
-
|
66
|
-
|
67
|
-
|
60
|
+
# If you are sure you want to use Gravatar, uncomment the command inside the block.
|
61
|
+
# Default: ->(user, view) do
|
62
|
+
# # view.commontator_gravatar_image_tag(user, 1, s: 60, d: 'mm')
|
63
|
+
# end
|
64
|
+
config.user_avatar_proc = ->(user, view) do
|
65
|
+
# view.commontator_gravatar_image_tag(user, 1, s: 60, d: 'mm')
|
66
|
+
end
|
68
67
|
|
69
68
|
# user_email_proc
|
70
69
|
# Type: Proc
|
@@ -78,6 +77,29 @@ Commontator.configure do |config|
|
|
78
77
|
# Default: ->(user, mailer) { user.try(:email) || '' }
|
79
78
|
config.user_email_proc = ->(user, mailer) { user.try(:email) || '' }
|
80
79
|
|
80
|
+
# user_mentions_proc
|
81
|
+
# Type: Proc
|
82
|
+
# Arguments:
|
83
|
+
# the current user (acts_as_commontator)
|
84
|
+
# the current thread (Commontator::Thread)
|
85
|
+
# the search query inputted by user (String)
|
86
|
+
# Returns: an ActiveRecord Relation object
|
87
|
+
# Important notes:
|
88
|
+
#
|
89
|
+
# - This proc is only used if you enable mentions (see config below)
|
90
|
+
#
|
91
|
+
# - The proc will be called internally with an empty search string.
|
92
|
+
# In that case, it MUST return all users that can be mentioned.
|
93
|
+
#
|
94
|
+
# - With mentions enabled, any registered user in your app is able
|
95
|
+
# to call this proc with any search query >= 3 characters.
|
96
|
+
# Make sure to handle SQL escaping properly and that the
|
97
|
+
# attribute being searched does not contain sensitive information.
|
98
|
+
#
|
99
|
+
# Default: ->(current_user, query) { current_user.class.where('username LIKE ?', "#{query}%") }
|
100
|
+
config.user_mentions_proc = ->(current_user, thread, query) do
|
101
|
+
current_user.class.where('username LIKE ?', "#{query}%")
|
102
|
+
end
|
81
103
|
|
82
104
|
|
83
105
|
# Thread/Commontable (acts_as_commontable) Configuration
|
@@ -144,24 +166,26 @@ Commontator.configure do |config|
|
|
144
166
|
# comment_voting
|
145
167
|
# Type: Symbol
|
146
168
|
# Whether users can vote on other users' comments
|
169
|
+
# Any option other than :n requires the acts_as_votable gem
|
147
170
|
# Valid options:
|
148
171
|
# :n (no voting)
|
149
|
-
# :l (likes
|
150
|
-
# :ld (likes/dislikes
|
151
|
-
# Not yet implemented:
|
152
|
-
# :s (star ratings)
|
153
|
-
# :r (reputation system)
|
172
|
+
# :l (likes)
|
173
|
+
# :ld (likes/dislikes)
|
154
174
|
# Default: :n
|
155
175
|
config.comment_voting = :n
|
156
176
|
|
157
177
|
# vote_count_proc
|
158
178
|
# Type: Proc
|
159
|
-
# Arguments: a thread (Commontator::Thread), pos (
|
179
|
+
# Arguments: a thread (Commontator::Thread), pos (Integer), neg (Integer)
|
160
180
|
# Returns: vote count to be displayed (String)
|
161
181
|
# pos is the number of likes, or the rating, or the reputation
|
162
182
|
# neg is the number of dislikes, if applicable, or 0 otherwise
|
163
|
-
# Default: ->(thread, pos, neg)
|
164
|
-
config.
|
183
|
+
# Default: ->(thread, pos, neg) do
|
184
|
+
# ((thread.config.comment_voting == :ld ? '%+d' : '%d') % (pos - neg)).sub('+0', '0')
|
185
|
+
# end
|
186
|
+
config.vote_count_proc = ->(thread, pos, neg) do
|
187
|
+
((thread.config.comment_voting == :ld ? '%+d' : '%d') % (pos - neg)).sub('+0', '0')
|
188
|
+
end
|
165
189
|
|
166
190
|
# comment_order
|
167
191
|
# Type: Symbol
|
@@ -192,8 +216,20 @@ Commontator.configure do |config|
|
|
192
216
|
# Default: :l
|
193
217
|
config.new_comment_style = :l
|
194
218
|
|
219
|
+
# comment_reply_style
|
220
|
+
# Type: Symbol
|
221
|
+
# How to handle replies to comments
|
222
|
+
# Valid options:
|
223
|
+
# :n (no replies, though users can still manually add <blockquote>s)
|
224
|
+
# :q (copies the comment being replied to into a <blockquote>)
|
225
|
+
# Not yet implemented:
|
226
|
+
# :i (indents each reply under the comment being replied to)
|
227
|
+
# It might be a good idea to add some CSS to hide <blockquote>s when converting from :q to :i
|
228
|
+
# Default: :n
|
229
|
+
config.comment_reply_style = :n
|
230
|
+
|
195
231
|
# comments_per_page
|
196
|
-
# Type:
|
232
|
+
# Type: Integer or nil
|
197
233
|
# Number of comments to display in each page
|
198
234
|
# Set to nil to disable pagination
|
199
235
|
# Any other value requires the will_paginate gem
|
@@ -216,12 +252,12 @@ Commontator.configure do |config|
|
|
216
252
|
# Arguments: a thread (Commontator::Thread)
|
217
253
|
# Returns: the address emails are sent "from" (String)
|
218
254
|
# Important: If using subscriptions, change this to at least match your domain name
|
219
|
-
# Default: ->(thread)
|
255
|
+
# Default: ->(thread) do
|
220
256
|
# "no-reply@#{Rails.application.class.parent.to_s.downcase}.com"
|
221
|
-
#
|
222
|
-
config.email_from_proc = ->(thread)
|
257
|
+
# end
|
258
|
+
config.email_from_proc = ->(thread) do
|
223
259
|
"no-reply@#{Rails.application.class.parent.to_s.downcase}.com"
|
224
|
-
|
260
|
+
end
|
225
261
|
|
226
262
|
# commontable_name_proc
|
227
263
|
# Type: Proc
|
@@ -229,10 +265,12 @@ Commontator.configure do |config|
|
|
229
265
|
# Returns: a name that refers to the commontable object (String)
|
230
266
|
# If you have multiple commontable models, you can also pass this
|
231
267
|
# configuration value as an argument to acts_as_commontable for each one
|
232
|
-
# Default: ->(thread)
|
233
|
-
#
|
234
|
-
|
235
|
-
|
268
|
+
# Default: ->(thread) do
|
269
|
+
# "#{thread.commontable.class.name} ##{thread.commontable.id}"
|
270
|
+
# end
|
271
|
+
config.commontable_name_proc = ->(thread) do
|
272
|
+
"#{thread.commontable.class.name} ##{thread.commontable.id}"
|
273
|
+
end
|
236
274
|
|
237
275
|
# comment_url_proc
|
238
276
|
# Type: Proc
|
@@ -241,13 +279,13 @@ Commontator.configure do |config|
|
|
241
279
|
# Returns: a String containing the url of the view that displays the given comment
|
242
280
|
# This usually is the commontable's "show" page
|
243
281
|
# The main application's routes can be accessed through the app_routes object
|
244
|
-
# Default: ->(comment, app_routes)
|
245
|
-
# app_routes.polymorphic_url(comment.thread.commontable, anchor: "
|
246
|
-
#
|
282
|
+
# Default: ->(comment, app_routes) do
|
283
|
+
# app_routes.polymorphic_url(comment.thread.commontable, anchor: "comment-#{comment.id}-div")
|
284
|
+
# end
|
247
285
|
# (defaults to the commontable's show url with an anchor pointing to the comment's div)
|
248
|
-
config.comment_url_proc = ->(comment, app_routes)
|
249
|
-
app_routes.polymorphic_url(comment.thread.commontable, anchor: "
|
250
|
-
|
286
|
+
config.comment_url_proc = ->(comment, app_routes) do
|
287
|
+
app_routes.polymorphic_url(comment.thread.commontable, anchor: "comment-#{comment.id}-div")
|
288
|
+
end
|
251
289
|
|
252
290
|
# mentions_enabled
|
253
291
|
# Type: Boolean
|
@@ -257,28 +295,4 @@ Commontator.configure do |config|
|
|
257
295
|
# true (mentions enabled)
|
258
296
|
# Default: false
|
259
297
|
config.mentions_enabled = false
|
260
|
-
|
261
|
-
# user_mentions_proc
|
262
|
-
# Type: Proc
|
263
|
-
# Arguments:
|
264
|
-
# the current user (acts_as_commontator)
|
265
|
-
# the current thread (Commontator::Thread)
|
266
|
-
# the search query inputted by user (String)
|
267
|
-
# Returns: an ActiveRecord Relation object
|
268
|
-
# Important notes:
|
269
|
-
#
|
270
|
-
# - The proc will be called internally with an empty search string.
|
271
|
-
# In that case, it MUST return all users that can be mentioned.
|
272
|
-
#
|
273
|
-
# - With mentions enabled, any registered user in your app is able
|
274
|
-
# to call this proc with any search query >= 3 characters.
|
275
|
-
# Make sure to handle SQL escaping properly and that the
|
276
|
-
# attribute being searched does not contain sensitive information.
|
277
|
-
#
|
278
|
-
# Default: ->(current_user, query) {
|
279
|
-
# current_user.class.where('username LIKE ?', "#{query}%")
|
280
|
-
# }
|
281
|
-
config.user_mentions_proc = ->(current_user, thread, query) {
|
282
|
-
current_user.class.where('username LIKE ?', "#{query}%")
|
283
|
-
}
|
284
298
|
end
|