commontator 5.0.0 → 5.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +10 -1
- data/app/assets/javascripts/commontator/application.js~ +3 -0
- data/app/assets/javascripts/commontator/mentions.js~ +31 -0
- data/app/assets/stylesheets/commontator/application.css~ +14 -0
- data/app/assets/stylesheets/commontator/threads.css~ +71 -0
- data/app/controllers/commontator/comments_controller.rb~ +160 -0
- data/app/controllers/commontator/threads_controller.rb~ +75 -0
- data/app/mailers/commontator/subscriptions_mailer.rb~ +65 -0
- data/app/models/commontator/comment.rb~ +124 -0
- data/app/models/commontator/subscription.rb~ +23 -0
- data/app/views/commontator/shared/_thread.html.erb~ +21 -0
- data/app/views/commontator/subscriptions_mailer/comment_created.html.erb~ +10 -0
- data/app/views/commontator/threads/_hide_show.js.erb~ +21 -0
- data/app/views/commontator/threads/_hide_show_links.js.erb~ +17 -0
- data/app/views/commontator/threads/_show.html.erb~ +118 -0
- data/app/views/commontator/threads/_show.js.erb~ +18 -0
- data/config/initializers/commontator.rb~ +290 -0
- data/config/locales/en.yml~ +101 -0
- data/config/locales/ru.yml~ +79 -0
- data/config/locales/zh.yml~ +79 -0
- data/config/routes.rb~ +25 -0
- data/db/migrate/0_install_commontator.rb~ +52 -0
- data/db/migrate/1_add_parent_comment_id_to_commontator_comments.rb~ +9 -0
- data/lib/commontator.rb~ +145 -0
- data/lib/commontator/acts_as_commontable.rb +3 -1
- data/lib/commontator/shared_helper.rb~ +26 -0
- data/lib/commontator/version.rb +1 -1
- data/lib/commontator/version.rb~ +3 -0
- data/spec/controllers/commontator/comments_controller_spec.rb~ +612 -0
- data/spec/controllers/commontator/subscriptions_controller_spec.rb~ +101 -0
- data/spec/controllers/commontator/threads_controller_spec.rb~ +218 -0
- data/spec/dummy/README.md~ +3 -0
- data/spec/dummy/Rakefile~ +6 -0
- data/spec/dummy/app/assets/javascripts/application.js~ +16 -0
- data/spec/dummy/app/assets/stylesheets/application.css~ +14 -0
- data/spec/dummy/app/controllers/application_controller.rb~ +4 -0
- data/spec/dummy/app/controllers/dummy_models_controller.rb~ +23 -0
- data/spec/dummy/app/helpers/application_helper.rb~ +15 -0
- data/spec/dummy/app/models/dummy_dependent_model.rb +4 -0
- data/spec/dummy/app/models/dummy_model.rb~ +3 -0
- data/spec/dummy/app/models/dummy_user.rb~ +13 -0
- data/spec/dummy/app/views/dummy_models/index.html.erb~ +6 -0
- data/spec/dummy/app/views/dummy_models/show.html.erb~ +2 -0
- data/spec/dummy/app/views/layouts/application.html.erb~ +14 -0
- data/spec/dummy/config.ru~ +4 -0
- data/spec/dummy/config/application.rb~ +26 -0
- data/spec/dummy/config/boot.rb~ +5 -0
- data/spec/dummy/config/database.yml~ +25 -0
- data/spec/dummy/config/environment.rb~ +8 -0
- data/spec/dummy/config/environments/development.rb~ +31 -0
- data/spec/dummy/config/environments/production.rb~ +82 -0
- data/spec/dummy/config/environments/test.rb~ +40 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb~ +7 -0
- data/spec/dummy/config/initializers/commontator.rb~ +21 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb~ +4 -0
- data/spec/dummy/config/initializers/inflections.rb~ +16 -0
- data/spec/dummy/config/initializers/mime_types.rb~ +5 -0
- data/spec/dummy/config/initializers/secret_token.rb~ +12 -0
- data/spec/dummy/config/initializers/session_store.rb~ +3 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb~ +14 -0
- data/spec/dummy/config/routes.rb~ +10 -0
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/migrate/1_create_dummy_models.rb~ +7 -0
- data/spec/dummy/db/migrate/2_create_dummy_users.rb~ +7 -0
- data/spec/dummy/db/migrate/3_acts_as_votable_migration.rb~ +27 -0
- data/spec/dummy/db/migrate/4_create_dummy_dependent_models.rb +7 -0
- data/spec/dummy/db/schema.rb +6 -1
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/lib/controllers.rb~ +10 -0
- data/spec/dummy/log/development.log +6471 -191
- data/spec/dummy/log/test.log +121221 -31445
- data/spec/dummy/public/404.html~ +26 -0
- data/spec/dummy/public/422.html~ +26 -0
- data/spec/dummy/public/500.html~ +25 -0
- data/spec/dummy/script/rails~ +6 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/-RolHYhJdGiLoPkoWZXQdI9AIWUjMMCa2yFJezCE_Bo.cache +2 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/-STzK7UuGeY3gSvnmTELWLvtRMKpmSAQCEw4ao3b1r8.cache +1 -0
- 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 +2 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/6wKNjFdNd4OHjIpLC0nq1kBWcbYg1aEYrp7ZhWoJlvY.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/7Xxb5iYP5elo40JRlhNQB1gLbv3ueELK2rTinYt5xdc.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/7twIKlS6VYCyLlwhsQg2vu4wLSUJsT2REHR4DjZf1oE.cache +2 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/87m-4EcbQnkbo2HYkQp4V9I2U3AYQO1mPeReieduolA.cache +1 -0
- 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 +1 -0
- 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 +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/E1zaNOh68xzPxdtdOwRtOaMCoKivN2dxVwCP65WEi5I.cache +2 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/EmPkV3H8p2Snv9WyPjWran_kOMQ0MqQ1a9CVdGDd8l4.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/Hc12Nxe7cw2e0u2pzNsAe8D3ncQpcqLuI2NVL7aAXgw.cache +1 -0
- 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 +1 -0
- 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 +2 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/KAY1_IaTONtGr0KK8ihOdoA-RDXybqBMNSZLIDRHx68.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/KBHIDNfa4ryw9LAkYqK8GgPWne7HkX6mNYgrJajGm94.cache +1 -0
- 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 +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/MiX2Z4Vbha1riozZWw1U3_PGttRiZ1iQ_o4wSZJnKCs.cache +3 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/MntKfwol0ud4LuvrX3MVPthTlfNlJZRYbQXpQBxhRrs.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/MrqmgPGNYJV1capJKIKJOVEQ4NiO-Z_2YhpjNteJ8B8.cache +2 -0
- 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 +1 -0
- 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 +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/S-6Iq5YOEpVnd_vQ0RSSfrmyIwB1dk0op35alFgJ9xA.cache +2 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/TKV8dUTo88gdFY-z2I7Xa5vDC1Z3LY6Paa18385MJsI.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/UI4zPmWfZA2d_5ZZIXqK9KmkjOKSDg6JoM7qcOIxm0Q.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/UP29vrIQbCkfghZGSCFxpW5gjlsgCxlVrncjjopvRqM.cache +2 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/UoU16f4V7haEXM5GY5j4QFuNMP7PJZaAMEvVNNtNLBA.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/VqPqYNG07yqcjbd7FA05Mu-jr5hzsZPaHFf8X0FFbXk.cache +2 -0
- 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 +2 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/XMeYF1vwAg53eVjXVkw_IKQH2W3-9tWvtuCdqUCbPBM.cache +2 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/XX0Z7OM0xZKfQaAvHARpyeQNZCstNyu9MlsnwThSkg8.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/Y-pGNFTA6bAKxSvqZvmMVs3b4Els1aByxZVFxtJR71c.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/Y3p3m5V5NOm7yq56apKmF5KZUUsTfnhT_SG3fqbEJgo.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/YLZuRWklL6q-csC-7A7CiOTTTYEQcA9PCdWEOm9MpNU.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/Yo7V5YXukEBm6z37l-TIRCJx3HZExEUBu3MUMhAzkMU.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/bK6QttR8pGmMAMJO0avCBLwH0za8_bAC-yWqkU3Yj24.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/cLncjrqpQXzsVBp7K0W7iG1STLrnzfGpbJXxNE7aIUk.cache +2 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/dBcAd64EZFdhHZNXKGXPIR7EtPGf03bzqkci2W12T8g.cache +2 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/d_bbPiareJHKkzFZFCl3pcwfQOFzsB1KHn4A2xxhR20.cache +1 -0
- 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 +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/gumo32Bd3W_q7MYEt9JIZEiQdHF93tLSsGfmXIm2MqU.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/jKTlG9KP0iaCGHwg8kQ1amz9SHJ1OAWeCRRn9wc5w7c.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/kPJfTiWbmX-q6i2rjM9MAMdEf2silSihU0_lxlTGVA8.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/lrt1SWPj4qWUZUMH9xg3n9KLYUqJZxRn-XI-NTU6oTI.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/mcCP5u08nlCL6TgWdzzrem9uE2rbsbG3KyIXxvWvlJE.cache +3 -0
- 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 +2 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/qfXc71sDbi1cE9f327D6ABPURPU6lLguGiJqH2fqM0w.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/rBcrkzXcMaiCjwvWl8tO0eARzKZS69I3i-lfsTAFzcc.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/sfl8l1_1AGn-4llkmb91Q0wHJ-A-x5gAGkIUWe1zLqo.cache +1 -0
- 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 +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/uKmWfbgaNZ8FTsVK1VNuUv15rmtTHzSdJ7TQRGr0Rck.cache +2 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/ul0QEoovfr_12YOpyWx8BJs8fvz5Ay3AZG8-lsLr-a4.cache +1 -0
- 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 +1 -0
- 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 +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/yLxMFI0ARh2OKSOQLF2xEfM7sbst2vUbOBXoOuI6iTE.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/ynnYZxuxqerlFUytw54dl_CwP94g0U4HmGjyILWnhfQ.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/zCivVPbSRpKF_X-P5OJeld32YhymG-bkjQwzqe2o6zg.cache +2 -0
- 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 +1 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/E1zaNOh68xzPxdtdOwRtOaMCoKivN2dxVwCP65WEi5I.cache +2 -0
- 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 +2 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/L5DjABL_iOtoxSOLn3X7_YlxECU5EhnrVIKxJFAysgc.cache +1 -0
- 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 +2 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/Vuc93A9yywiFxc9CAdxrzdsAQw4jxiCa6JRzRjNxOYs.cache +1 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/YAPBll4U0cgs6cz-WyMRKoakK_gVOOcl9n0CvGyxPjY.cache +1 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/bDNeZfPBQaef5z0YajZc4jFE54nNy9gc06mPNKvvPFk.cache +1 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/c5Wa2loowFYFRBaMoTn1IWYXo4BGMbEy7NIi0vbvfRU.cache +1 -0
- 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 +1 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/gumo32Bd3W_q7MYEt9JIZEiQdHF93tLSsGfmXIm2MqU.cache +1 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/ige85jXyj8X7XYr7HpA0gSTThqfPUm71HjhSJXtTbUY.cache +1 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/kuYeE5bV6FdXmfB_o-xhflhSDWoQhYYaaupAXODZ9dQ.cache +1 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/qhZbbNIRUaAOtGano94zLHjeBKUhKr4qbh2tTCi0Bnk.cache +2 -0
- 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 +2 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/ytHkF2DwUE6oaiLyrK6tL-0INpeNhjN6ctD7J0LNY6I.cache +2 -0
- data/spec/helpers/commontator/application_helper_spec.rb~ +9 -0
- data/spec/lib/commontator/acts_as_commontable_spec.rb~ +25 -0
- data/spec/lib/commontator/acts_as_commontator_spec.rb~ +52 -0
- data/spec/lib/commontator/commontable_config_spec.rb~ +29 -0
- data/spec/lib/commontator/commontator_config_spec.rb~ +29 -0
- data/spec/lib/commontator/controller_includes_spec.rb~ +18 -0
- data/spec/lib/commontator/controllers_spec.rb~ +18 -0
- data/spec/lib/commontator/shared_helper_spec.rb~ +22 -0
- data/spec/lib/commontator_spec.rb~ +26 -0
- data/spec/mailers/commontator/subscriptions_mailer_spec.rb~ +30 -0
- data/spec/models/commontator/comment_spec.rb~ +82 -0
- data/spec/models/commontator/subscription_spec.rb~ +38 -0
- data/spec/models/commontator/thread_spec.rb +37 -0
- data/spec/models/commontator/thread_spec.rb~ +122 -0
- data/spec/rails_helper.rb~ +74 -0
- data/spec/spec_helper.rb~ +93 -0
- data/vendor/assets/javascripts/mentionsInput/index.js~ +3 -0
- metadata +409 -51
@@ -0,0 +1,101 @@
|
|
1
|
+
# Files in the config/locales directory are used for internationalization
|
2
|
+
# and are automatically loaded by Rails. If you want to use locales other
|
3
|
+
# than English, add the necessary files in this directory.
|
4
|
+
#
|
5
|
+
# To use the locales, use `I18n.t`:
|
6
|
+
#
|
7
|
+
# I18n.t 'hello'
|
8
|
+
#
|
9
|
+
# In views, this is aliased to just `t`:
|
10
|
+
#
|
11
|
+
# <%= t('hello') %>
|
12
|
+
#
|
13
|
+
# To use a different locale, set it with `I18n.locale`:
|
14
|
+
#
|
15
|
+
# I18n.locale = :es
|
16
|
+
#
|
17
|
+
# This would use the information in config/locales/es.yml.
|
18
|
+
#
|
19
|
+
# To learn more, please read the Rails Internationalization guide
|
20
|
+
# available at http://guides.rubyonrails.org/i18n.html.
|
21
|
+
|
22
|
+
---
|
23
|
+
en:
|
24
|
+
activerecord:
|
25
|
+
attributes:
|
26
|
+
commontator/comment:
|
27
|
+
body: Comment
|
28
|
+
creator: Creator
|
29
|
+
editor: Editor
|
30
|
+
thread: Discussion
|
31
|
+
commontator/subscription:
|
32
|
+
subscriber: Subscriber
|
33
|
+
thread: Discussion
|
34
|
+
commontator/thread:
|
35
|
+
commontable: Commontable
|
36
|
+
models:
|
37
|
+
commontator/comment:
|
38
|
+
one: comment
|
39
|
+
other: comments
|
40
|
+
commontator/subscription:
|
41
|
+
one: subscription
|
42
|
+
other: subscriptions
|
43
|
+
commontator/thread:
|
44
|
+
one: thread
|
45
|
+
other: threads
|
46
|
+
commontator:
|
47
|
+
anonymous: Anonymous
|
48
|
+
comment:
|
49
|
+
actions:
|
50
|
+
cancel: Cancel
|
51
|
+
confirm_delete: "Are you sure you want to delete this comment?"
|
52
|
+
create: "Post Comment"
|
53
|
+
delete: Delete
|
54
|
+
edit: Edit
|
55
|
+
new: "New Comment"
|
56
|
+
undelete: Undelete
|
57
|
+
update: "Modify Comment"
|
58
|
+
errors:
|
59
|
+
already_deleted: "This comment has already been deleted."
|
60
|
+
create: "This comment could not be posted because:"
|
61
|
+
double_posted: "is a duplicate of another comment."
|
62
|
+
not_deleted: "This comment is not deleted."
|
63
|
+
update: "This comment could not be modified because:"
|
64
|
+
status:
|
65
|
+
created_at: "Posted on %{created_at}."
|
66
|
+
deleted_by: "Comment deleted by %{deleter_name}."
|
67
|
+
updated_at: "Last modified by %{editor_name} on %{updated_at}."
|
68
|
+
email:
|
69
|
+
comment_created:
|
70
|
+
body: "%{creator_name} commented on %{commontable_name}:"
|
71
|
+
subject: "%{creator_name} posted a comment on %{commontable_name}"
|
72
|
+
thread_link_html: "<a href=\"%{comment_url}\">Click here</a> to view all comments on %{commontable_name}."
|
73
|
+
undisclosed_recipients: "Undisclosed Recipients"
|
74
|
+
require_login: "You must login before you can post a comment."
|
75
|
+
subscription:
|
76
|
+
actions:
|
77
|
+
confirm_unsubscribe: "Are you sure you want to unsubscribe from this discussion?"
|
78
|
+
subscribe: Subscribe
|
79
|
+
unsubscribe: Unsubscribe
|
80
|
+
errors:
|
81
|
+
already_subscribed: "You are already subscribed to this discussion."
|
82
|
+
not_subscribed: "You are not subscribed to this discussion."
|
83
|
+
thread:
|
84
|
+
actions:
|
85
|
+
show_all: "Show All Comments"
|
86
|
+
filter: "Filter Comments"
|
87
|
+
close: "Close Discussion"
|
88
|
+
confirm_close: "Are you sure you want to close this discussion?"
|
89
|
+
reopen: "Reopen Discussion"
|
90
|
+
show: "Show Comments"
|
91
|
+
hide: "Hide Comments"
|
92
|
+
errors:
|
93
|
+
already_closed: "This discussion has already been closed."
|
94
|
+
not_closed: "This discussion is not closed."
|
95
|
+
status:
|
96
|
+
cannot_post: "New comments cannot be posted at this time."
|
97
|
+
closed: "Comments (Closed by %{closer_name})"
|
98
|
+
open: Comments
|
99
|
+
time:
|
100
|
+
formats:
|
101
|
+
commontator: "%b %d %Y at %I:%M%p %Z"
|
@@ -0,0 +1,79 @@
|
|
1
|
+
ru:
|
2
|
+
activerecord:
|
3
|
+
attributes:
|
4
|
+
commontator/comment:
|
5
|
+
body: Комментарий
|
6
|
+
creator: Создал
|
7
|
+
editor: Редактировал
|
8
|
+
thread: Обсуждение
|
9
|
+
commontator/subscription:
|
10
|
+
subscriber: Подписчик
|
11
|
+
thread: Обсуждение
|
12
|
+
commontator/thread:
|
13
|
+
commontable: Комментируем
|
14
|
+
models:
|
15
|
+
commontator/comment:
|
16
|
+
one: комментарий
|
17
|
+
other: комментарии
|
18
|
+
commontator/subscription:
|
19
|
+
one: подписка
|
20
|
+
other: подписки
|
21
|
+
commontator/thread:
|
22
|
+
one: обсуждение
|
23
|
+
other: обсуждения
|
24
|
+
commontator:
|
25
|
+
anonymous: Аноним
|
26
|
+
comment:
|
27
|
+
actions:
|
28
|
+
cancel: Отменить
|
29
|
+
confirm_delete: "Вы уверены, что хотите удалить комментарий?"
|
30
|
+
create: "Оставить Комментарий"
|
31
|
+
delete: Удалить
|
32
|
+
edit: Редактировать
|
33
|
+
new: "Новый Комментарий"
|
34
|
+
undelete: Восстановить
|
35
|
+
update: "Изменить Комментарий"
|
36
|
+
errors:
|
37
|
+
already_deleted: "Этот комментарий был удален."
|
38
|
+
create: "Комментарий нельзя оставить потому что"
|
39
|
+
double_posted: "этот комментарий уже есть."
|
40
|
+
not_deleted: "Этот комментарий не удален."
|
41
|
+
update: "Этот комментарий нельзя изменить потому что"
|
42
|
+
status:
|
43
|
+
created_at: "Создан %{created_at}."
|
44
|
+
deleted_by: "Комментарий был удален %{deleter_name}."
|
45
|
+
updated_at: "Редактировал %{editor_name}, %{updated_at}."
|
46
|
+
email:
|
47
|
+
comment_created:
|
48
|
+
body: "%{creator_name} комментировал %{commontable_name}:"
|
49
|
+
subject: "%{creator_name} оставил комментарий к %{commontable_name}"
|
50
|
+
thread_link_html: "<a href=\"%{comment_url}\">Нажмите здесь</a> чтобы посмотреть все комментарии к %{commontable_name}."
|
51
|
+
undisclosed_recipients: "Не указан получатель"
|
52
|
+
require_login: "Вы должны залогиниться прежде чем оставить комментарий."
|
53
|
+
subscription:
|
54
|
+
actions:
|
55
|
+
confirm_unsubscribe: "Вы уверены, что хотите отписать от обсуждения?"
|
56
|
+
subscribe: Подписаться
|
57
|
+
unsubscribe: Отписаться
|
58
|
+
errors:
|
59
|
+
already_subscribed: "Вы уже подписаны на это обсуждение."
|
60
|
+
not_subscribed: "Вы не подписаны на это обсуждение."
|
61
|
+
thread:
|
62
|
+
actions:
|
63
|
+
show_all: "Показать все комментарии"
|
64
|
+
filter: "Фильтровать комментарии"
|
65
|
+
close: "Закрыть обсуждение"
|
66
|
+
confirm_close: "Вы уверены, что хотите закрыть обсуждение?"
|
67
|
+
reopen: "Открыть заново обсуждение"
|
68
|
+
show: "Показать комментарии"
|
69
|
+
hide: "скрыть комментарии"
|
70
|
+
errors:
|
71
|
+
already_closed: "Это обсуждение было закрыто."
|
72
|
+
not_closed: "Это обсуждение не закрыто."
|
73
|
+
status:
|
74
|
+
cannot_post: "Новый комментарии нельзя разместить в данный момент."
|
75
|
+
closed: "Комментарии (Закрыты %{closer_name})"
|
76
|
+
open: Комментарии
|
77
|
+
time:
|
78
|
+
formats:
|
79
|
+
commontator: "%b %d %Y в %I:%M%p %Z"
|
@@ -0,0 +1,79 @@
|
|
1
|
+
zh:
|
2
|
+
activerecord:
|
3
|
+
attributes:
|
4
|
+
commontator/comment:
|
5
|
+
body: "留言"
|
6
|
+
creator: "留言者"
|
7
|
+
editor: "編輯"
|
8
|
+
thread: "討論"
|
9
|
+
commontator/subscription:
|
10
|
+
subscriber: "訂閱者"
|
11
|
+
thread: "討論"
|
12
|
+
commontator/thread:
|
13
|
+
commontable: "可以留言"
|
14
|
+
models:
|
15
|
+
commontator/comment:
|
16
|
+
one: "留言"
|
17
|
+
other: "留言"
|
18
|
+
commontator/subscription:
|
19
|
+
one: "訂閱"
|
20
|
+
other: "訂閱"
|
21
|
+
commontator/thread:
|
22
|
+
one: "討論"
|
23
|
+
other: "討論"
|
24
|
+
commontator:
|
25
|
+
anonymous: "匿名"
|
26
|
+
comment:
|
27
|
+
actions:
|
28
|
+
cancel: "取消"
|
29
|
+
confirm_delete: "確定要刪除這筆留言嗎?"
|
30
|
+
create: "發佈"
|
31
|
+
delete: "刪除"
|
32
|
+
edit: "編輯"
|
33
|
+
new: "新留言"
|
34
|
+
undelete: "未刪除"
|
35
|
+
update: "修改留言"
|
36
|
+
errors:
|
37
|
+
already_deleted: "此留言已經被刪除了"
|
38
|
+
create: "此留言無法發佈因為:"
|
39
|
+
double_posted: "已經有一筆相同的留言。"
|
40
|
+
not_deleted: "此留言未被刪除"
|
41
|
+
update: "此留言無法被修改因為:"
|
42
|
+
status:
|
43
|
+
created_at: "於%{created_at}發佈"
|
44
|
+
deleted_by: "被%{deleter_name}刪除"
|
45
|
+
updated_at: "最在於%{updated_at}被%{editor_name}修改"
|
46
|
+
email:
|
47
|
+
comment_created:
|
48
|
+
body: "%{creator_name}留言於%{commontable_name}"
|
49
|
+
subject: "%{creator_name}於%{commontable_name}發佈了一則留言"
|
50
|
+
thread_link_html: "<a href=\"%{commontable_url}\">點此處</a>看%{commontable_name}的所有留言"
|
51
|
+
undisclosed_recipients: "收件者"
|
52
|
+
require_login: "你需要先登入"
|
53
|
+
subscription:
|
54
|
+
actions:
|
55
|
+
confirm_unsubscribe: "你確定要去取消訂閱此則討論嗎?"
|
56
|
+
subscribe: "訂閱"
|
57
|
+
unsubscribe: "取消訂閱"
|
58
|
+
errors:
|
59
|
+
already_subscribed: "你已經訂閱過了"
|
60
|
+
not_subscribed: "你沒有訂閱過"
|
61
|
+
thread:
|
62
|
+
actions:
|
63
|
+
show_all: "列出所有留言"
|
64
|
+
filter: "過濾留言"
|
65
|
+
close: "關閉討論"
|
66
|
+
confirm_close: "你確定要關閉此討論嗎??"
|
67
|
+
reopen: "回復討論"
|
68
|
+
show: "打開留言"
|
69
|
+
hide: "隐藏评论"
|
70
|
+
errors:
|
71
|
+
already_closed: "此討論已經被關閉"
|
72
|
+
not_closed: "此討論尚未被關閉"
|
73
|
+
status:
|
74
|
+
cannot_post: "現在還不能發佈"
|
75
|
+
closed: "留言已經被%{closer_name}關閉"
|
76
|
+
open: 留言
|
77
|
+
time:
|
78
|
+
formats:
|
79
|
+
commontator: "%b %d %Y 於 %I:%M%p %Z"
|
data/config/routes.rb~
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
Commontator::Engine.routes.draw do
|
2
|
+
resources :threads, :only => [:show] do
|
3
|
+
resources :comments, :except => [:index, :destroy], :shallow => true do
|
4
|
+
member do
|
5
|
+
put 'delete'
|
6
|
+
put 'undelete'
|
7
|
+
|
8
|
+
put 'upvote'
|
9
|
+
put 'downvote'
|
10
|
+
put 'unvote'
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
member do
|
15
|
+
get 'mentions' if Commontator.mentions_enabled
|
16
|
+
|
17
|
+
get 'hide'
|
18
|
+
put 'close'
|
19
|
+
put 'reopen'
|
20
|
+
|
21
|
+
put 'subscribe', :to => 'subscriptions#subscribe'
|
22
|
+
put 'unsubscribe', :to => 'subscriptions#unsubscribe'
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,52 @@
|
|
1
|
+
class InstallCommontator < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :commontator_comments do |t|
|
4
|
+
t.string :creator_type
|
5
|
+
t.integer :creator_id
|
6
|
+
t.string :editor_type
|
7
|
+
t.integer :editor_id
|
8
|
+
t.integer :thread_id, :null => false
|
9
|
+
t.text :body, :null => false
|
10
|
+
t.datetime :deleted_at
|
11
|
+
|
12
|
+
t.integer :cached_votes_up, :default => 0
|
13
|
+
t.integer :cached_votes_down, :default => 0
|
14
|
+
|
15
|
+
t.timestamps
|
16
|
+
end
|
17
|
+
|
18
|
+
add_index :commontator_comments, [:creator_id, :creator_type, :thread_id],
|
19
|
+
:name => 'index_commontator_comments_on_c_id_and_c_type_and_t_id'
|
20
|
+
add_index :commontator_comments, [:thread_id, :created_at]
|
21
|
+
|
22
|
+
add_index :commontator_comments, :cached_votes_up
|
23
|
+
add_index :commontator_comments, :cached_votes_down
|
24
|
+
|
25
|
+
create_table :commontator_subscriptions do |t|
|
26
|
+
t.string :subscriber_type, :null => false
|
27
|
+
t.integer :subscriber_id, :null => false
|
28
|
+
t.integer :thread_id, :null => false
|
29
|
+
|
30
|
+
t.timestamps
|
31
|
+
end
|
32
|
+
|
33
|
+
add_index :commontator_subscriptions, [:subscriber_id, :subscriber_type, :thread_id],
|
34
|
+
:unique => true,
|
35
|
+
:name => 'index_commontator_subscriptions_on_s_id_and_s_type_and_t_id'
|
36
|
+
add_index :commontator_subscriptions, :thread_id
|
37
|
+
|
38
|
+
create_table :commontator_threads do |t|
|
39
|
+
t.string :commontable_type
|
40
|
+
t.integer :commontable_id
|
41
|
+
t.datetime :closed_at
|
42
|
+
t.string :closer_type
|
43
|
+
t.integer :closer_id
|
44
|
+
|
45
|
+
t.timestamps
|
46
|
+
end
|
47
|
+
|
48
|
+
add_index :commontator_threads, [:commontable_id, :commontable_type],
|
49
|
+
:unique => true,
|
50
|
+
:name => 'index_commontator_threads_on_c_id_and_c_type'
|
51
|
+
end
|
52
|
+
end
|
data/lib/commontator.rb~
ADDED
@@ -0,0 +1,145 @@
|
|
1
|
+
require 'commontator/engine'
|
2
|
+
require 'commontator/controller_includes'
|
3
|
+
|
4
|
+
module Commontator
|
5
|
+
# Attributes
|
6
|
+
|
7
|
+
# Can be set in initializer only
|
8
|
+
ENGINE_ATTRIBUTES = [
|
9
|
+
:current_user_proc,
|
10
|
+
:javascript_proc,
|
11
|
+
:mentions_enabled
|
12
|
+
]
|
13
|
+
|
14
|
+
# Can be set in initializer or passed as an option to acts_as_commontator
|
15
|
+
COMMONTATOR_ATTRIBUTES = [
|
16
|
+
:user_name_proc,
|
17
|
+
:user_link_proc,
|
18
|
+
:user_avatar_proc,
|
19
|
+
:user_email_proc,
|
20
|
+
:user_mentions_proc
|
21
|
+
]
|
22
|
+
|
23
|
+
# Can be set in initializer or passed as an option to acts_as_commontable
|
24
|
+
COMMONTABLE_ATTRIBUTES = [
|
25
|
+
:comment_filter,
|
26
|
+
:thread_read_proc,
|
27
|
+
:thread_moderator_proc,
|
28
|
+
:comment_editing,
|
29
|
+
:comment_deletion,
|
30
|
+
:moderator_permissions,
|
31
|
+
:comment_voting,
|
32
|
+
:vote_count_proc,
|
33
|
+
:comment_order,
|
34
|
+
:new_comment_style,
|
35
|
+
:comments_per_page,
|
36
|
+
:thread_subscription,
|
37
|
+
:email_from_proc,
|
38
|
+
:commontable_name_proc,
|
39
|
+
:comment_url_proc
|
40
|
+
]
|
41
|
+
|
42
|
+
DEPRECATED_ATTRIBUTES = [
|
43
|
+
[:moderators_can_edit_comments, :moderator_permissions],
|
44
|
+
[:hide_deleted_comments, :comment_filter],
|
45
|
+
[:hide_closed_threads, :thread_read_proc],
|
46
|
+
[:wp_link_renderer_proc],
|
47
|
+
[:voting_text_proc, :vote_count_proc],
|
48
|
+
[:user_name_clickable, :user_link_proc],
|
49
|
+
[:user_admin_proc, :thread_moderator_proc],
|
50
|
+
[:auto_subscribe_on_comment, :thread_subscription],
|
51
|
+
[:can_edit_own_comments, :comment_editing],
|
52
|
+
[:can_edit_old_comments, :comment_editing],
|
53
|
+
[:can_delete_own_comments, :comment_deletion],
|
54
|
+
[:can_delete_old_comments, :comment_deletion],
|
55
|
+
[:can_subscribe_to_thread, :thread_subscription],
|
56
|
+
[:can_vote_on_comments, :comment_voting],
|
57
|
+
[:combine_upvotes_and_downvotes, :vote_count_proc],
|
58
|
+
[:comments_order, :comment_order],
|
59
|
+
[:closed_threads_are_readable, :thread_read_proc],
|
60
|
+
[:deleted_comments_are_visible, :comment_filter],
|
61
|
+
[:can_read_thread_proc, :thread_read_proc],
|
62
|
+
[:can_edit_thread_proc, :thread_moderator_proc],
|
63
|
+
[:admin_can_edit_comments, :moderator_permissions],
|
64
|
+
[:subscription_email_enable_proc, :user_email_proc],
|
65
|
+
[:comment_name, 'config/locales'],
|
66
|
+
[:comment_create_verb_present, 'config/locales'],
|
67
|
+
[:comment_create_verb_past, 'config/locales'],
|
68
|
+
[:comment_edit_verb_present, 'config/locales'],
|
69
|
+
[:comment_edit_verb_past, 'config/locales'],
|
70
|
+
[:timestamp_format, 'config/locales'],
|
71
|
+
[:subscription_email_to_proc, 'config/locales'],
|
72
|
+
[:subscription_email_from_proc, :email_from_proc],
|
73
|
+
[:subscription_email_subject_proc, 'config/locales'],
|
74
|
+
[:comments_ordered_by_votes, :comment_order],
|
75
|
+
[:current_user_method, :current_user_proc],
|
76
|
+
[:user_missing_name, 'config/locales'],
|
77
|
+
[:user_email_method, :user_email_proc],
|
78
|
+
[:user_name_method, :user_name_proc],
|
79
|
+
[:commontable_name, :commontable_name_proc],
|
80
|
+
[:commontable_id_method],
|
81
|
+
[:commontable_url_proc, :comment_url_proc]
|
82
|
+
]
|
83
|
+
|
84
|
+
(ENGINE_ATTRIBUTES + COMMONTATOR_ATTRIBUTES + \
|
85
|
+
COMMONTABLE_ATTRIBUTES).each do |attribute|
|
86
|
+
mattr_accessor attribute
|
87
|
+
end
|
88
|
+
|
89
|
+
DEPRECATED_ATTRIBUTES.each do |deprecated, replacement|
|
90
|
+
define_singleton_method(deprecated) do
|
91
|
+
@deprecated_method_called = true
|
92
|
+
replacement_string = (replacement.nil? ? 'No replacement is available. You can safely remove it from your configuration file.' : "Use `#{replacement.to_s}` instead.")
|
93
|
+
warn "\n[COMMONTATOR] Deprecation: `config.#{deprecated.to_s}` is deprecated and has been disabled. #{replacement_string}\n"
|
94
|
+
end
|
95
|
+
|
96
|
+
define_singleton_method("#{deprecated.to_s}=") do |obj|
|
97
|
+
send(deprecated)
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
def self.configure
|
102
|
+
@deprecated_method_called = false
|
103
|
+
yield self
|
104
|
+
warn "\n[COMMONTATOR] We recommend that you backup the config/initializers/commontator.rb file, rename or remove it, run rake commontator:install:initializers to copy the new default one, then configure it to your liking.\n" if @deprecated_method_called
|
105
|
+
end
|
106
|
+
|
107
|
+
def self.commontator_config(user)
|
108
|
+
(user && user.is_commontator) ? user.commontator_config : self
|
109
|
+
end
|
110
|
+
|
111
|
+
def self.commontable_config(obj)
|
112
|
+
(obj && obj.is_commontable) ? obj.commontable_config : self
|
113
|
+
end
|
114
|
+
|
115
|
+
def self.commontator_name(user)
|
116
|
+
commontator_config(user).user_name_proc.call(user)
|
117
|
+
end
|
118
|
+
|
119
|
+
def self.commontator_link(user, routing_proxy)
|
120
|
+
commontator_config(user).user_link_proc.call(user, routing_proxy)
|
121
|
+
end
|
122
|
+
|
123
|
+
def self.commontator_email(user, mailer = nil)
|
124
|
+
commontator_config(user).user_email_proc.call(user, mailer)
|
125
|
+
end
|
126
|
+
|
127
|
+
def self.commontator_avatar(user, view)
|
128
|
+
commontator_config(user).user_avatar_proc.call(user, view)
|
129
|
+
end
|
130
|
+
|
131
|
+
def self.commontator_mentions(user, search_phrase)
|
132
|
+
commontator_config(user).user_mentions_proc.call(user, search_phrase)
|
133
|
+
end
|
134
|
+
|
135
|
+
def self.commontable_name(commontable)
|
136
|
+
commontable_config(commontable).commontable_name_proc.call(commontable)
|
137
|
+
end
|
138
|
+
|
139
|
+
def self.comment_url(comment, routing_proxy)
|
140
|
+
commontable_config(comment.thread.commontable).comment_url_proc.call(comment, routing_proxy)
|
141
|
+
end
|
142
|
+
end
|
143
|
+
|
144
|
+
require 'commontator/acts_as_commontator'
|
145
|
+
require 'commontator/acts_as_commontable'
|