commontator 4.10.5 → 4.11.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 +48 -2
- data/Rakefile +8 -9
- data/app/assets/javascripts/commontator/application.js +3 -0
- data/app/assets/javascripts/commontator/application.js~ +3 -0
- data/app/assets/javascripts/commontator/mentions.js +32 -0
- data/app/assets/javascripts/commontator/mentions.js~ +31 -0
- data/app/assets/stylesheets/commontator/application.css +1 -9
- data/app/assets/stylesheets/commontator/application.css~ +14 -0
- data/app/assets/stylesheets/commontator/threads.css +5 -0
- data/app/assets/stylesheets/commontator/threads.css~ +71 -0
- data/app/controllers/commontator/comments_controller.rb +8 -0
- data/app/controllers/commontator/comments_controller.rb~ +160 -0
- data/app/controllers/commontator/threads_controller.rb +21 -0
- data/app/controllers/commontator/threads_controller.rb~ +75 -0
- data/app/mailers/commontator/subscriptions_mailer.rb +31 -13
- 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/comments/_form.html.erb +1 -0
- data/app/views/commontator/comments/_list.html.erb +1 -1
- data/app/views/commontator/shared/_thread.html.erb +2 -4
- data/app/views/commontator/shared/_thread.html.erb~ +21 -0
- data/app/views/commontator/subscriptions_mailer/comment_created.html.erb +1 -1
- 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/_hide_show_links.js.erb~ +17 -0
- data/app/views/commontator/threads/_show.html.erb +96 -72
- 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 +39 -8
- data/config/initializers/commontator.rb~ +290 -0
- data/config/locales/en.yml +3 -2
- data/config/locales/en.yml~ +101 -0
- data/config/locales/ru.yml +3 -2
- data/config/locales/ru.yml~ +79 -0
- data/config/locales/zh.yml +79 -0
- data/config/locales/zh.yml~ +79 -0
- data/config/routes.rb +2 -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 +16 -9
- data/lib/commontator.rb~ +145 -0
- data/lib/commontator/{controller_includes.rb → controllers.rb} +2 -2
- 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 +46 -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 +88 -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 +1 -0
- data/spec/dummy/app/assets/javascripts/application.js~ +16 -0
- data/spec/dummy/app/assets/stylesheets/application.css +1 -0
- data/spec/dummy/app/assets/stylesheets/application.css~ +14 -0
- data/spec/dummy/app/controllers/application_controller.rb +2 -0
- data/spec/dummy/app/controllers/application_controller.rb~ +4 -0
- data/spec/dummy/app/controllers/dummy_models_controller.rb +3 -15
- 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_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_model → dummy_models}/show.html.erb +0 -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 +2 -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 +5 -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 +4 -2
- 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/schema.rb +6 -6
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/lib/controllers.rb~ +10 -0
- data/spec/dummy/lib/dummy_controllers.rb +10 -0
- data/spec/dummy/log/development.log +5825 -29
- data/spec/dummy/log/test.log +111962 -32939
- 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/{test/sprockets/v3.0/E6KZN1luOC7jAKXFS_xo-XOd5H41vK-eeCsj8MITJHA.cache → 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/{test/sprockets/v3.0/SN7TWtuyq1ZblzWxqqcr26s_vanAr5PyZ8q_w8IxIPE.cache → development/sprockets/v3.0/gumo32Bd3W_q7MYEt9JIZEiQdHF93tLSsGfmXIm2MqU.cache} +0 -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/{test/sprockets/v3.0/Kg9VuIGtHRNvM4_TXG3EmqpEWzfEY1kQUI1Mx8AHklY.cache → 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/{test/sprockets/v3.0/CT_fvD-uYyN5f1Kis6kQ7DNUnwtnSVT1sdDKxW1e4hw.cache → development/sprockets/v3.0/xhYTRUOS8cIvyRp2Jn6FKnXlGOSsIM2z3HAGOJoJs7w.cache} +0 -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/{72b63dddbc5c995f79af8e3c94904fd9 → 02d4b791eb831cf2057bf4703a1218d1} +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/{a77b1a9223d168112e1705c29220116f → 0f196a1a50363b0a076ec6e1ee5417f6} +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/{afa63eb365bdf4f42584b17ac9176b9d → a3fb9025f90ff05a6fd4afc7ded2692c} +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/a41c8be5379abec3c0d0d98e2f0d5609 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/{a473b3873e554893372a53d71f5e9879 → c69ee3cc5796188d873574179290a6ef} +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/{f721383d531f067d82b071e14aed7a92 → e1f674c11941d62aac1764ef3a7134e4} +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/{d2244ccef8e05bb993f75715af0344cc → 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/{controller_includes_spec.rb → controllers_spec.rb~} +0 -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 +21 -1
- 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~ +122 -0
- data/spec/rails_helper.rb~ +74 -0
- data/spec/spec_helper.rb +1 -0
- data/spec/spec_helper.rb~ +93 -0
- data/vendor/assets/javascripts/mentionsInput/index.js~ +3 -0
- data/vendor/assets/javascripts/mentionsInput/jquery.mentionsInput.js +538 -0
- data/vendor/assets/javascripts/underscore/underscore.js +1590 -0
- data/vendor/assets/stylesheets/mentionsInput/jquery.mentionsInput.css +114 -0
- metadata +445 -100
- data/spec/dummy/tmp/cache/assets/test/sprockets/decb63cac838a5314aa0c22a979f5ac9 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/2MuTpyqaQLj1O4wgROKGqNe4lXIGrVZDYXCWWWMRmrA.cache +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/4CjNCL1K4fowKckGvL9F3HkCEtCH42rfsn2geU5A1xs.cache +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/CjR916jO_S7Mo8eTI1vKieKJoKQ0t-bk4sxhcYYQ5Bw.cache +0 -1
- data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/DtzP3rNdkPulzFug4nVQunOws8OXjvPJwB2nNhp9Scs.cache +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/FmvRMZstlcKHCKy5g4mmAu4vjz-YPScTigFnnvs1v-E.cache +0 -1
- data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/HXtFVXhiLFEohXrf9PBX2u9xkPew5yU2IOyxmFCa7fo.cache +0 -2
- data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/Kqg37VotFbWELQyr3-R20M2yWWoiloqBWDWRG-i3m5E.cache +0 -2
- data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/PeZjQ1KGvso4tt6qvVQZniMzlTlVTWeH-tjln1fERkw.cache +0 -1
- data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/VH5BWA_SC2XnIxStJ5vtjX3pNqdbo7uMo9Tg9GVFUGU.cache +0 -1
- data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/lzmR_-kjjgHYgaJd_fvBlAimt7_xADtnhEPo_CIBiPM.cache +0 -1
- data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/q3giWdNvlLQ39xIHQWPY8vzbfjW9zXkSqwibRQBKcvM.cache +0 -2
- data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/zpCVMbdGU9JtJWkk95WWomNsxP3Q7jqZmWKJXnsGH0g.cache +0 -2
@@ -0,0 +1,10 @@
|
|
1
|
+
<h4><%= t 'commontator.email.comment_created.body',
|
2
|
+
:creator_name => @creator_name,
|
3
|
+
:commontable_name => @commontable_name %></h4>
|
4
|
+
|
5
|
+
<%= render :partial => 'commontator/comments/body',
|
6
|
+
:locals => { :comment => @comment } %>
|
7
|
+
|
8
|
+
<p><%= t 'commontator.email.thread_link_html',
|
9
|
+
:comment_url => @commontable_url,
|
10
|
+
:commontable_name => @commontable_name %></p>
|
@@ -0,0 +1,21 @@
|
|
1
|
+
$("#").replaceWith(<%= ej(
|
2
|
+
link_to t('commontator.thread.actions.show'),
|
3
|
+
'#',
|
4
|
+
:id => "thread_#{thread.id.to_s}_show_link",
|
5
|
+
:class => "thread_show_link",
|
6
|
+
:remote => true
|
7
|
+
) %>);
|
8
|
+
|
9
|
+
$().replaceWith(<%= ej(
|
10
|
+
link_to t('commontator.thread.actions.hide'),
|
11
|
+
'#',
|
12
|
+
:id => "thread_#{thread.id.to_s}_hide_link",
|
13
|
+
:class => "thread_hide_link",
|
14
|
+
:remote => true
|
15
|
+
) %>);
|
16
|
+
|
17
|
+
<%= link_to t('commontator.thread.actions.hide'),
|
18
|
+
'',
|
19
|
+
:id => "thread_#{thread.id.to_s}_hide_link",
|
20
|
+
:class => "thread_hide_link",
|
21
|
+
:remote => true %>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<% # Clients of this partial must supply the following variables:
|
2
|
+
# thread
|
3
|
+
%>
|
4
|
+
|
5
|
+
$("#thread_<%= thread.id %>_hide_link").click(function() {
|
6
|
+
$("#thread_<%= thread.id %>_span").hide();
|
7
|
+
|
8
|
+
$("#thread_<%= thread.id %>_show_span").fadeIn()[0].scrollIntoView();
|
9
|
+
});
|
10
|
+
|
11
|
+
$("#thread_<%= thread.id %>_show_link").click(function() {
|
12
|
+
$("#thread_<%= thread.id %>_span").fadeIn()[0].scrollIntoView();
|
13
|
+
|
14
|
+
$("#thread_<%= thread.id %>_show_span").hide();
|
15
|
+
});
|
16
|
+
|
17
|
+
$("#thread_<%= thread.id %>_hide_span").show();
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<% # Clients of this partial must supply the following variables:
|
2
|
+
# thread
|
3
|
+
%>
|
4
|
+
|
5
|
+
$("#thread_<%= thread.id %>_hide_link").click(function() {
|
6
|
+
$("#thread_<%= thread.id %>_span").hide();
|
7
|
+
|
8
|
+
$("#thread_<%= thread.id %>_show_span").fadeIn()[0].scrollIntoView();
|
9
|
+
});
|
10
|
+
|
11
|
+
$("#thread_<%= thread.id %>_show_link").click(function() {
|
12
|
+
$("#thread_<%= thread.id %>_span").fadeIn()[0].scrollIntoView();
|
13
|
+
|
14
|
+
$("#thread_<%= thread.id %>_span").hide();
|
15
|
+
});
|
16
|
+
|
17
|
+
$("#thread_<%= thread.id %>_hide_span").show();
|
@@ -10,85 +10,109 @@
|
|
10
10
|
<% can_subscribe = thread.can_subscribe?(user)
|
11
11
|
can_edit = thread.can_be_edited_by?(user) %>
|
12
12
|
|
13
|
-
<span id="thread_<%= thread.id.to_s %>
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
13
|
+
<span id="thread_<%= thread.id.to_s %>_show_span" class="thread_show commontator_hidden">
|
14
|
+
<%= link_to t('commontator.thread.actions.show'),
|
15
|
+
'#',
|
16
|
+
id: "thread_#{thread.id.to_s}_show_link",
|
17
|
+
class: "thread_show_link" %>
|
18
|
+
</span>
|
19
|
+
|
20
|
+
<span id="thread_<%= thread.id %>_span" class="thread_span">
|
21
|
+
<span id="thread_<%= thread.id.to_s %>_actions_span" class="thread_actions">
|
22
|
+
<span id="thread_<%= thread.id.to_s %>_hide_span" class="thread_hide commontator_hidden">
|
23
|
+
<%= link_to t('commontator.thread.actions.hide'),
|
24
|
+
'#',
|
25
|
+
id: "thread_#{thread.id.to_s}_hide_link",
|
26
|
+
class: "thread_hide_link" %>
|
19
27
|
</span>
|
20
|
-
<% end %>
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
<% if can_edit %>
|
25
|
-
<% filter_string = show_all ? 'filter' : 'show_all'
|
26
|
-
is_closed = thread.is_closed?
|
27
|
-
close_string = is_closed ? 'reopen' : 'close' %>
|
28
|
-
|
29
|
-
<% if thread.is_filtered? %>
|
30
|
-
<%= link_to t("commontator.thread.actions.#{filter_string}"),
|
31
|
-
commontator.thread_path(thread, :show_all => (show_all ? nil : true)),
|
32
|
-
:id => "thread_#{thread.id.to_s}_#{filter_string}_link",
|
33
|
-
:class => "thread_#{filter_string}_link",
|
34
|
-
:remote => true %>
|
35
28
|
|
36
|
-
|
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 } %>
|
36
|
+
</span>
|
37
|
+
<% end %>
|
38
|
+
|
39
|
+
|
40
|
+
|
41
|
+
<% if can_edit %>
|
42
|
+
<% filter_string = show_all ? 'filter' : 'show_all'
|
43
|
+
is_closed = thread.is_closed?
|
44
|
+
close_string = is_closed ? 'reopen' : 'close' %>
|
45
|
+
|
46
|
+
<% if thread.is_filtered? %>
|
47
|
+
<%= link_to t("commontator.thread.actions.#{filter_string}"),
|
48
|
+
commontator.thread_path(thread, :show_all => (show_all ? nil : true)),
|
49
|
+
:id => "thread_#{thread.id.to_s}_#{filter_string}_link",
|
50
|
+
:class => "thread_#{filter_string}_link",
|
51
|
+
:remote => true %>
|
52
|
+
|
53
|
+
|
54
|
+
<% end %>
|
55
|
+
|
56
|
+
<%= link_to t("commontator.thread.actions.#{close_string}"),
|
57
|
+
commontator.polymorphic_path([close_string, thread]),
|
58
|
+
:confirm => (!is_closed ? t('commontator.thread.actions.confirm_close') : nil),
|
59
|
+
:method => :put,
|
60
|
+
:id => "thread_#{thread.id.to_s}_#{close_string}_link",
|
61
|
+
:class => "thread_#{close_string}_link",
|
62
|
+
:remote => true %>
|
37
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>
|
38
70
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
:method => :put,
|
43
|
-
:id => "thread_#{thread.id.to_s}_#{close_string}_link",
|
44
|
-
:class => "thread_#{close_string}_link",
|
45
|
-
:remote => true %>
|
71
|
+
<% if thread.config.comment_order == :l %>
|
72
|
+
<%= render :partial => 'commontator/threads/reply',
|
73
|
+
:locals => { :thread => thread, :user => user, :per_page => per_page } %>
|
46
74
|
<% end %>
|
47
|
-
</span>
|
48
75
|
|
49
|
-
<
|
50
|
-
|
51
|
-
|
52
|
-
|
76
|
+
<div id="thread_<%= thread.id.to_s %>_comment_list_div" class="thread_comment_list">
|
77
|
+
<% comments = show_all ? thread.ordered_comments(true) : \
|
78
|
+
thread.paginated_comments(page, per_page) %>
|
79
|
+
<%= render :partial => 'commontator/comments/list',
|
80
|
+
:locals => { :comments => comments,
|
81
|
+
:user => user } %>
|
82
|
+
</div>
|
53
83
|
|
54
|
-
<% if thread.
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
</div>
|
65
|
-
|
66
|
-
<% if thread.will_paginate? && !show_all %>
|
67
|
-
<div id="thread_<%= thread.id.to_s %>_pagination_div" class="thread_pagination">
|
68
|
-
<div id="thread_<%= thread.id.to_s %>_page_entries_info_div" class="thread_page_entries_info">
|
69
|
-
<%= page_entries_info comments,
|
70
|
-
:params => { :controller => 'commontator/threads',
|
71
|
-
:action => 'show',
|
72
|
-
:id => thread.id,
|
73
|
-
:page => page,
|
74
|
-
:per_page => per_page } %>.
|
75
|
-
</div>
|
84
|
+
<% if thread.will_paginate? && !show_all %>
|
85
|
+
<div id="thread_<%= thread.id.to_s %>_pagination_div" class="thread_pagination">
|
86
|
+
<div id="thread_<%= thread.id.to_s %>_page_entries_info_div" class="thread_page_entries_info">
|
87
|
+
<%= page_entries_info comments,
|
88
|
+
:params => { :controller => 'commontator/threads',
|
89
|
+
:action => 'show',
|
90
|
+
:id => thread.id,
|
91
|
+
:page => page,
|
92
|
+
:per_page => per_page } %>.
|
93
|
+
</div>
|
76
94
|
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
95
|
+
<div id="thread_<%= thread.id.to_s %>_will_paginate_div" class="thread_will_paginate">
|
96
|
+
<%= will_paginate comments,
|
97
|
+
:renderer => Commontator::LinkRenderer,
|
98
|
+
:routes_proxy => commontator,
|
99
|
+
:remote => true,
|
100
|
+
:params => { :controller => 'commontator/threads',
|
101
|
+
:action => 'show',
|
102
|
+
:id => thread.id,
|
103
|
+
:page => page,
|
104
|
+
:per_page => per_page } %>
|
105
|
+
</div>
|
87
106
|
</div>
|
88
|
-
|
89
|
-
|
107
|
+
<% end %>
|
108
|
+
|
109
|
+
<% if thread.config.comment_order != :l %>
|
110
|
+
<%= render :partial => 'commontator/threads/reply',
|
111
|
+
:locals => { :thread => thread, :user => user, :per_page => per_page } %>
|
112
|
+
<% end %>
|
113
|
+
</span>
|
90
114
|
|
91
|
-
|
92
|
-
<%= render :
|
93
|
-
:
|
94
|
-
|
115
|
+
<script type="text/javascript">
|
116
|
+
<%= render partial: 'commontator/threads/hide_show_links.js',
|
117
|
+
locals: { thread: thread } %>
|
118
|
+
</script>
|
@@ -0,0 +1,118 @@
|
|
1
|
+
<% # Clients of this partial must supply the following variables:
|
2
|
+
# thread
|
3
|
+
# user
|
4
|
+
# page
|
5
|
+
# per_page
|
6
|
+
# Optionally, they can also supply the following variable:
|
7
|
+
show_all ||= false
|
8
|
+
%>
|
9
|
+
|
10
|
+
<% can_subscribe = thread.can_subscribe?(user)
|
11
|
+
can_edit = thread.can_be_edited_by?(user) %>
|
12
|
+
|
13
|
+
<span id="thread_<%= thread.id.to_s %>_show_span" class="thread_show commontator_hidden">
|
14
|
+
<%= link_to t('commontator.thread.actions.show'),
|
15
|
+
'#',
|
16
|
+
id: "thread_#{thread.id.to_s}_show_link",
|
17
|
+
class: "thread_show_link" %>
|
18
|
+
</span>
|
19
|
+
|
20
|
+
<span id="thread_<%= thread.id %>_span" class="thread_span">
|
21
|
+
<span id="thread_<%= thread.id.to_s %>_actions_span" class="thread_actions">
|
22
|
+
<span id="thread_<%= thread.id.to_s %>_hide_span" class="thread_hide commontator_hidden">
|
23
|
+
<%= link_to t('commontator.thread.actions.hide'),
|
24
|
+
'#',
|
25
|
+
id: "thread_#{thread.id.to_s}_hide_link",
|
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 } %>
|
36
|
+
</span>
|
37
|
+
<% end %>
|
38
|
+
|
39
|
+
|
40
|
+
|
41
|
+
<% if can_edit %>
|
42
|
+
<% filter_string = show_all ? 'filter' : 'show_all'
|
43
|
+
is_closed = thread.is_closed?
|
44
|
+
close_string = is_closed ? 'reopen' : 'close' %>
|
45
|
+
|
46
|
+
<% if thread.is_filtered? %>
|
47
|
+
<%= link_to t("commontator.thread.actions.#{filter_string}"),
|
48
|
+
commontator.thread_path(thread, :show_all => (show_all ? nil : true)),
|
49
|
+
:id => "thread_#{thread.id.to_s}_#{filter_string}_link",
|
50
|
+
:class => "thread_#{filter_string}_link",
|
51
|
+
:remote => true %>
|
52
|
+
|
53
|
+
|
54
|
+
<% end %>
|
55
|
+
|
56
|
+
<%= link_to t("commontator.thread.actions.#{close_string}"),
|
57
|
+
commontator.polymorphic_path([close_string, thread]),
|
58
|
+
:confirm => (!is_closed ? t('commontator.thread.actions.confirm_close') : nil),
|
59
|
+
:method => :put,
|
60
|
+
:id => "thread_#{thread.id.to_s}_#{close_string}_link",
|
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>
|
70
|
+
|
71
|
+
<% if thread.config.comment_order == :l %>
|
72
|
+
<%= render :partial => 'commontator/threads/reply',
|
73
|
+
:locals => { :thread => thread, :user => user, :per_page => per_page } %>
|
74
|
+
<% end %>
|
75
|
+
|
76
|
+
<div id="thread_<%= thread.id.to_s %>_comment_list_div" class="thread_comment_list">
|
77
|
+
<% comments = show_all ? thread.ordered_comments(true) : \
|
78
|
+
thread.paginated_comments(page, per_page) %>
|
79
|
+
<%= render :partial => 'commontator/comments/list',
|
80
|
+
:locals => { :comments => comments,
|
81
|
+
:user => user } %>
|
82
|
+
</div>
|
83
|
+
|
84
|
+
<% if thread.will_paginate? && !show_all %>
|
85
|
+
<div id="thread_<%= thread.id.to_s %>_pagination_div" class="thread_pagination">
|
86
|
+
<div id="thread_<%= thread.id.to_s %>_page_entries_info_div" class="thread_page_entries_info">
|
87
|
+
<%= page_entries_info comments,
|
88
|
+
:params => { :controller => 'commontator/threads',
|
89
|
+
:action => 'show',
|
90
|
+
:id => thread.id,
|
91
|
+
:page => page,
|
92
|
+
:per_page => per_page } %>.
|
93
|
+
</div>
|
94
|
+
|
95
|
+
<div id="thread_<%= thread.id.to_s %>_will_paginate_div" class="thread_will_paginate">
|
96
|
+
<%= will_paginate comments,
|
97
|
+
:renderer => Commontator::LinkRenderer,
|
98
|
+
:routes_proxy => commontator,
|
99
|
+
:remote => true,
|
100
|
+
:params => { :controller => 'commontator/threads',
|
101
|
+
:action => 'show',
|
102
|
+
:id => thread.id,
|
103
|
+
:page => page,
|
104
|
+
:per_page => per_page } %>
|
105
|
+
</div>
|
106
|
+
</div>
|
107
|
+
<% end %>
|
108
|
+
|
109
|
+
<% if thread.config.comment_order != :l %>
|
110
|
+
<%= render :partial => 'commontator/threads/reply',
|
111
|
+
:locals => { :thread => thread, :user => user, :per_page => per_page } %>
|
112
|
+
<% end %>
|
113
|
+
</span>
|
114
|
+
|
115
|
+
<script type="text/javascript">
|
116
|
+
<%= j(render partial: 'commontator/threads/hide_show_links.js',
|
117
|
+
locals: { thread: thread }) %>
|
118
|
+
</script>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<% # Clients of this partial must supply the following variables:
|
2
|
+
# thread
|
3
|
+
# user
|
4
|
+
# page
|
5
|
+
# per_page
|
6
|
+
# Optionally, they can also supply the following variable:
|
7
|
+
show_all ||= false
|
8
|
+
%>
|
9
|
+
|
10
|
+
$("#thread_<%= thread.id %>_div").replaceWith(
|
11
|
+
"<%= escape_javascript(
|
12
|
+
render :partial => 'commontator/threads/show',
|
13
|
+
:formats => [:html],
|
14
|
+
:locals => { :thread => thread,
|
15
|
+
:user => user,
|
16
|
+
:page => page,
|
17
|
+
:per_page => per_page,
|
18
|
+
:show_all => show_all }) %>");
|
@@ -234,16 +234,47 @@ Commontator.configure do |config|
|
|
234
234
|
config.commontable_name_proc = lambda { |thread|
|
235
235
|
"#{thread.commontable.class.name} ##{thread.commontable.id}" }
|
236
236
|
|
237
|
-
#
|
237
|
+
# comment_url_proc
|
238
238
|
# Type: Proc
|
239
|
-
# Arguments: a
|
239
|
+
# Arguments: a comment (Commontator::Comment),
|
240
240
|
# the app_routes (ActionDispatch::Routing::RoutesProxy)
|
241
|
-
# Returns: a String containing the url of the view that displays the given
|
241
|
+
# Returns: a String containing the url of the view that displays the given comment
|
242
242
|
# This usually is the commontable's "show" page
|
243
243
|
# The main application's routes can be accessed through the app_routes object
|
244
|
-
# Default: lambda { |
|
245
|
-
#
|
246
|
-
#
|
247
|
-
|
248
|
-
|
244
|
+
# Default: lambda { |comment, app_routes|
|
245
|
+
# app_routes.polymorphic_url(comment.thread.commontable,
|
246
|
+
# anchor: "comment_#{comment.id}_div") }
|
247
|
+
# (defaults to the commontable's show url with an anchor pointing to the comment's div)
|
248
|
+
config.comment_url_proc = lambda { |comment, app_routes|
|
249
|
+
app_routes.polymorphic_url(comment.thread.commontable, anchor: "comment_#{comment.id}_div") }
|
250
|
+
|
251
|
+
# mentions_enabled
|
252
|
+
# Type: Boolean
|
253
|
+
# Whether users can mention other users to subscribe them to the thread
|
254
|
+
# Valid options:
|
255
|
+
# false (no mentions)
|
256
|
+
# true (mentions enabled)
|
257
|
+
# Default: false
|
258
|
+
config.mentions_enabled = false
|
259
|
+
|
260
|
+
# user_mentions_proc
|
261
|
+
# Type: Proc
|
262
|
+
# Arguments:
|
263
|
+
# the current user (acts_as_commontator)
|
264
|
+
# the search query inputted by user (String)
|
265
|
+
# Returns: an ActiveRecord Relation object
|
266
|
+
# Important notes:
|
267
|
+
#
|
268
|
+
# - The proc will be called internally with an empty search string.
|
269
|
+
# In that case, it MUST return all users that can be mentioned.
|
270
|
+
#
|
271
|
+
# - With mentions enabled, any registered user in your app is able
|
272
|
+
# to call this proc with any search query >= 3 characters.
|
273
|
+
# Make sure to handle SQL escaping properly and that the
|
274
|
+
# attribute being searched does not contain sensitive information.
|
275
|
+
#
|
276
|
+
# Default: lambda { |current_user, query|
|
277
|
+
# current_user.class.where('username LIKE ?', "#{query}%") }
|
278
|
+
config.user_mentions_proc = lambda { |current_user, query|
|
279
|
+
current_user.class.where('username LIKE ?', "#{query}%") }
|
249
280
|
end
|