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.
Files changed (319) hide show
  1. checksums.yaml +5 -5
  2. data/MIT-LICENSE +1 -1
  3. data/README.md +83 -63
  4. data/app/assets/javascripts/commontator/mentions.js +2 -2
  5. data/app/assets/stylesheets/commontator/application.scss +101 -0
  6. data/app/assets/stylesheets/commontator/comments.scss +103 -0
  7. data/app/controllers/commontator/application_controller.rb +21 -21
  8. data/app/controllers/commontator/comments_controller.rb +123 -114
  9. data/app/controllers/commontator/security_transgression.rb +2 -0
  10. data/app/controllers/commontator/subscriptions_controller.rb +20 -22
  11. data/app/controllers/commontator/threads_controller.rb +50 -50
  12. data/app/helpers/commontator/application_helper.rb +3 -5
  13. data/app/helpers/commontator/link_renderer.rb +25 -0
  14. data/app/mailers/commontator/subscriptions_mailer.rb +35 -35
  15. data/app/models/commontator/comment.rb +208 -91
  16. data/app/models/commontator/json_array_coder.rb +10 -0
  17. data/app/models/commontator/subscription.rb +13 -16
  18. data/app/models/commontator/thread.rb +139 -133
  19. data/app/views/commontator/comments/_actions.html.erb +9 -10
  20. data/app/views/commontator/comments/_body.html.erb +11 -6
  21. data/app/views/commontator/comments/_form.html.erb +31 -20
  22. data/app/views/commontator/comments/_list.html.erb +6 -5
  23. data/app/views/commontator/comments/_reply.html.erb +15 -0
  24. data/app/views/commontator/comments/_show.html.erb +31 -25
  25. data/app/views/commontator/comments/_votes.html.erb +12 -11
  26. data/app/views/commontator/comments/cancel.js.erb +6 -14
  27. data/app/views/commontator/comments/create.js.erb +20 -14
  28. data/app/views/commontator/comments/delete.js.erb +14 -14
  29. data/app/views/commontator/comments/edit.js.erb +6 -4
  30. data/app/views/commontator/comments/new.js.erb +11 -7
  31. data/app/views/commontator/comments/update.js.erb +6 -4
  32. data/app/views/commontator/comments/vote.js.erb +3 -4
  33. data/app/views/commontator/shared/_thread.html.erb +23 -11
  34. data/app/views/commontator/subscriptions/_link.html.erb +7 -8
  35. data/app/views/commontator/subscriptions/subscribe.js.erb +3 -4
  36. data/app/views/commontator/subscriptions_mailer/comment_created.html.erb +9 -8
  37. data/app/views/commontator/threads/_hide_show_links.js.erb +10 -9
  38. data/app/views/commontator/threads/_reply.html.erb +17 -16
  39. data/app/views/commontator/threads/_show.html.erb +75 -76
  40. data/app/views/commontator/threads/_show.js.erb +12 -16
  41. data/app/views/commontator/threads/show.js.erb +9 -6
  42. data/config/initializers/commontator.rb +81 -67
  43. data/config/locales/de.yml +28 -48
  44. data/config/locales/en.yml +38 -27
  45. data/config/locales/pt-BR.yml +31 -29
  46. data/config/locales/ru.yml +34 -29
  47. data/config/locales/zh.yml +65 -48
  48. data/db/migrate/0_install_commontator.rb +27 -32
  49. data/db/migrate/1_add_replying_to_comments.rb +9 -0
  50. data/lib/commontator.rb +9 -140
  51. data/lib/commontator/acts_as_commontable.rb +24 -33
  52. data/lib/commontator/acts_as_commontator.rb +28 -25
  53. data/lib/commontator/build_thread.rb +10 -0
  54. data/lib/commontator/commontable_config.rb +10 -10
  55. data/lib/commontator/commontator_config.rb +10 -10
  56. data/lib/{commontator.rb~ → commontator/config.rb} +57 -57
  57. data/lib/commontator/controllers.rb +35 -29
  58. data/lib/commontator/engine.rb +6 -4
  59. data/lib/commontator/shared_helper.rb +58 -21
  60. data/lib/commontator/version.rb +1 -3
  61. data/lib/tasks/commontator_tasks.rake +2 -2
  62. data/vendor/assets/stylesheets/mentionsInput/jquery.mentionsInput.css +0 -1
  63. metadata +50 -496
  64. data/Rakefile +0 -22
  65. data/app/assets/javascripts/commontator/application.js~ +0 -3
  66. data/app/assets/javascripts/commontator/mentions.js~ +0 -31
  67. data/app/assets/stylesheets/commontator/application.css +0 -5
  68. data/app/assets/stylesheets/commontator/application.css~ +0 -14
  69. data/app/assets/stylesheets/commontator/comments.css +0 -121
  70. data/app/assets/stylesheets/commontator/threads.css +0 -71
  71. data/app/assets/stylesheets/commontator/threads.css~ +0 -71
  72. data/app/controllers/commontator/comments_controller.rb~ +0 -160
  73. data/app/controllers/commontator/threads_controller.rb~ +0 -75
  74. data/app/mailers/commontator/subscriptions_mailer.rb~ +0 -65
  75. data/app/models/commontator/comment.rb~ +0 -124
  76. data/app/models/commontator/subscription.rb~ +0 -23
  77. data/app/views/commontator/shared/_thread.html.erb~ +0 -21
  78. data/app/views/commontator/subscriptions_mailer/comment_created.html.erb~ +0 -10
  79. data/app/views/commontator/threads/_hide_show.js.erb~ +0 -21
  80. data/app/views/commontator/threads/_hide_show_links.js.erb~ +0 -17
  81. data/app/views/commontator/threads/_show.html.erb~ +0 -118
  82. data/app/views/commontator/threads/_show.js.erb~ +0 -18
  83. data/config/initializers/commontator.rb~ +0 -290
  84. data/config/locales/en.yml~ +0 -101
  85. data/config/locales/ru.yml~ +0 -79
  86. data/config/locales/zh.yml~ +0 -79
  87. data/config/routes.rb~ +0 -25
  88. data/db/migrate/0_install_commontator.rb~ +0 -52
  89. data/db/migrate/1_add_parent_comment_id_to_commontator_comments.rb~ +0 -9
  90. data/lib/commontator/link_renderer.rb +0 -28
  91. data/lib/commontator/security_transgression.rb +0 -4
  92. data/lib/commontator/shared_helper.rb~ +0 -26
  93. data/lib/commontator/version.rb~ +0 -3
  94. data/spec/controllers/commontator/comments_controller_spec.rb +0 -613
  95. data/spec/controllers/commontator/comments_controller_spec.rb~ +0 -612
  96. data/spec/controllers/commontator/subscriptions_controller_spec.rb +0 -101
  97. data/spec/controllers/commontator/subscriptions_controller_spec.rb~ +0 -101
  98. data/spec/controllers/commontator/threads_controller_spec.rb +0 -219
  99. data/spec/controllers/commontator/threads_controller_spec.rb~ +0 -218
  100. data/spec/dummy/README.md +0 -4
  101. data/spec/dummy/README.md~ +0 -3
  102. data/spec/dummy/Rakefile +0 -7
  103. data/spec/dummy/Rakefile~ +0 -6
  104. data/spec/dummy/app/assets/javascripts/application.js +0 -17
  105. data/spec/dummy/app/assets/javascripts/application.js~ +0 -16
  106. data/spec/dummy/app/assets/stylesheets/application.css +0 -15
  107. data/spec/dummy/app/assets/stylesheets/application.css~ +0 -14
  108. data/spec/dummy/app/controllers/application_controller.rb +0 -6
  109. data/spec/dummy/app/controllers/application_controller.rb~ +0 -4
  110. data/spec/dummy/app/controllers/dummy_models_controller.rb +0 -23
  111. data/spec/dummy/app/controllers/dummy_models_controller.rb~ +0 -23
  112. data/spec/dummy/app/helpers/application_helper.rb +0 -16
  113. data/spec/dummy/app/helpers/application_helper.rb~ +0 -15
  114. data/spec/dummy/app/models/dummy_dependent_model.rb +0 -4
  115. data/spec/dummy/app/models/dummy_model.rb +0 -4
  116. data/spec/dummy/app/models/dummy_model.rb~ +0 -3
  117. data/spec/dummy/app/models/dummy_user.rb +0 -14
  118. data/spec/dummy/app/models/dummy_user.rb~ +0 -13
  119. data/spec/dummy/app/views/dummy_models/index.html.erb~ +0 -6
  120. data/spec/dummy/app/views/dummy_models/show.html.erb +0 -2
  121. data/spec/dummy/app/views/dummy_models/show.html.erb~ +0 -2
  122. data/spec/dummy/app/views/layouts/application.html.erb +0 -14
  123. data/spec/dummy/app/views/layouts/application.html.erb~ +0 -14
  124. data/spec/dummy/config.ru +0 -5
  125. data/spec/dummy/config.ru~ +0 -4
  126. data/spec/dummy/config/application.rb +0 -27
  127. data/spec/dummy/config/application.rb~ +0 -26
  128. data/spec/dummy/config/boot.rb +0 -6
  129. data/spec/dummy/config/boot.rb~ +0 -5
  130. data/spec/dummy/config/database.yml +0 -26
  131. data/spec/dummy/config/database.yml~ +0 -25
  132. data/spec/dummy/config/environment.rb +0 -8
  133. data/spec/dummy/config/environment.rb~ +0 -8
  134. data/spec/dummy/config/environments/development.rb +0 -31
  135. data/spec/dummy/config/environments/development.rb~ +0 -31
  136. data/spec/dummy/config/environments/production.rb +0 -82
  137. data/spec/dummy/config/environments/production.rb~ +0 -82
  138. data/spec/dummy/config/environments/test.rb +0 -40
  139. data/spec/dummy/config/environments/test.rb~ +0 -40
  140. data/spec/dummy/config/initializers/backtrace_silencers.rb +0 -8
  141. data/spec/dummy/config/initializers/backtrace_silencers.rb~ +0 -7
  142. data/spec/dummy/config/initializers/commontator.rb +0 -20
  143. data/spec/dummy/config/initializers/commontator.rb~ +0 -21
  144. data/spec/dummy/config/initializers/filter_parameter_logging.rb +0 -5
  145. data/spec/dummy/config/initializers/filter_parameter_logging.rb~ +0 -4
  146. data/spec/dummy/config/initializers/inflections.rb +0 -17
  147. data/spec/dummy/config/initializers/inflections.rb~ +0 -16
  148. data/spec/dummy/config/initializers/mime_types.rb +0 -6
  149. data/spec/dummy/config/initializers/mime_types.rb~ +0 -5
  150. data/spec/dummy/config/initializers/secret_token.rb +0 -13
  151. data/spec/dummy/config/initializers/secret_token.rb~ +0 -12
  152. data/spec/dummy/config/initializers/session_store.rb +0 -4
  153. data/spec/dummy/config/initializers/session_store.rb~ +0 -3
  154. data/spec/dummy/config/initializers/wrap_parameters.rb +0 -15
  155. data/spec/dummy/config/initializers/wrap_parameters.rb~ +0 -14
  156. data/spec/dummy/config/routes.rb +0 -9
  157. data/spec/dummy/config/routes.rb~ +0 -10
  158. data/spec/dummy/db/development.sqlite3 +0 -0
  159. data/spec/dummy/db/migrate/1_create_dummy_models.rb +0 -7
  160. data/spec/dummy/db/migrate/1_create_dummy_models.rb~ +0 -7
  161. data/spec/dummy/db/migrate/2_create_dummy_users.rb +0 -7
  162. data/spec/dummy/db/migrate/2_create_dummy_users.rb~ +0 -7
  163. data/spec/dummy/db/migrate/3_acts_as_votable_migration.rb +0 -22
  164. data/spec/dummy/db/migrate/3_acts_as_votable_migration.rb~ +0 -27
  165. data/spec/dummy/db/migrate/4_create_dummy_dependent_models.rb +0 -7
  166. data/spec/dummy/db/schema.rb +0 -85
  167. data/spec/dummy/db/test.sqlite3 +0 -0
  168. data/spec/dummy/lib/controllers.rb~ +0 -10
  169. data/spec/dummy/lib/dummy_controllers.rb +0 -10
  170. data/spec/dummy/log/development.log +0 -6693
  171. data/spec/dummy/log/test.log +0 -125970
  172. data/spec/dummy/public/404.html +0 -27
  173. data/spec/dummy/public/404.html~ +0 -26
  174. data/spec/dummy/public/422.html +0 -27
  175. data/spec/dummy/public/422.html~ +0 -26
  176. data/spec/dummy/public/500.html +0 -26
  177. data/spec/dummy/public/500.html~ +0 -25
  178. data/spec/dummy/public/favicon.ico +0 -0
  179. data/spec/dummy/script/rails +0 -7
  180. data/spec/dummy/script/rails~ +0 -6
  181. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/-RolHYhJdGiLoPkoWZXQdI9AIWUjMMCa2yFJezCE_Bo.cache +0 -2
  182. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/-STzK7UuGeY3gSvnmTELWLvtRMKpmSAQCEw4ao3b1r8.cache +0 -1
  183. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/3NH8nN7uktAXgA3NqaqXTXDVic3BxBvqCxoLpGGbib4.cache +0 -0
  184. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/4_iT7KM6P2IT75Rssrk9p4crTBwM8DQWR41gmsxczL0.cache +0 -0
  185. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/58TLCXvf5bFFYY-mIUXrQNOVWlGsq7qPAoSX2OIIB8Y.cache +0 -0
  186. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/6OQdyrATvNatvWu8Mp1qbuvRx-HLmzCZ5XBGYca-rZU.cache +0 -0
  187. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/6UKCUV-ZLaWCoPMfMB6a2W0RCFPQzPJ6Mz-y67sH7zk.cache +0 -2
  188. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/6wKNjFdNd4OHjIpLC0nq1kBWcbYg1aEYrp7ZhWoJlvY.cache +0 -1
  189. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/7Xxb5iYP5elo40JRlhNQB1gLbv3ueELK2rTinYt5xdc.cache +0 -1
  190. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/7twIKlS6VYCyLlwhsQg2vu4wLSUJsT2REHR4DjZf1oE.cache +0 -2
  191. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/87m-4EcbQnkbo2HYkQp4V9I2U3AYQO1mPeReieduolA.cache +0 -1
  192. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/8B331vt8qC4iXTcVzkx3j-ET8i1oaQskj5LyqGq8mPQ.cache +0 -0
  193. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/8KWvIOgvo7BVJYtdTpFuiSQQFFwZhLWYtwacZv52y48.cache +0 -0
  194. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/9yQa5M2ObK2-qDu231zMoarjVbhKUUg-ND3r2iXqB_Q.cache +0 -0
  195. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/A-ffuUI2juZT6qFpTUwUR1P8OPWcyFFN26WSUZe60Ko.cache +0 -1
  196. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/BbO4diS6uacx69Hn_bCabYlXEbWWdjHShRlfzlWSOMI.cache +0 -0
  197. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/CXhqxaQQAQ8b0Y8y0jTQyiqsZ6Oe4fZn0YiacpJ9IoI.cache +0 -1
  198. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/E1zaNOh68xzPxdtdOwRtOaMCoKivN2dxVwCP65WEi5I.cache +0 -2
  199. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/EmPkV3H8p2Snv9WyPjWran_kOMQ0MqQ1a9CVdGDd8l4.cache +0 -1
  200. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/Hc12Nxe7cw2e0u2pzNsAe8D3ncQpcqLuI2NVL7aAXgw.cache +0 -1
  201. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/HdWuQr9W2mZvggsAxVjDgLYUNfg3rbI-T8KhaDIsvQk.cache +0 -0
  202. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/I7lsrHTKpbfLWqIqdDIx2RN_12yFL2PyLRyYsMxg1IU.cache +0 -1
  203. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/JOCzfBjMjX3D5BUUGh5lJ7fjzMuJrHLxAginRA2_hZQ.cache +0 -0
  204. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/JusxTSXt06IqBm9jeCMM2nTmM3Wvbl3i3L1IwEvW5YA.cache +0 -2
  205. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/KAY1_IaTONtGr0KK8ihOdoA-RDXybqBMNSZLIDRHx68.cache +0 -1
  206. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/KBHIDNfa4ryw9LAkYqK8GgPWne7HkX6mNYgrJajGm94.cache +0 -1
  207. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/L_lv02y00MmIFiFhg5c9zhl7CDHLSahehzLyi_mRZeY.cache +0 -0
  208. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/MOT2X4iikR8v89A4N1bxDTeS1-xV8c9036TNFXmwXCM.cache +0 -1
  209. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/MiX2Z4Vbha1riozZWw1U3_PGttRiZ1iQ_o4wSZJnKCs.cache +0 -3
  210. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/MntKfwol0ud4LuvrX3MVPthTlfNlJZRYbQXpQBxhRrs.cache +0 -1
  211. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/MrqmgPGNYJV1capJKIKJOVEQ4NiO-Z_2YhpjNteJ8B8.cache +0 -2
  212. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/NVMnAwylzGp5bjl_o9dwMAQxVAPDzc4ygddNQSD1fiw.cache +0 -0
  213. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/O2sKqGxNuCYhjzuEZVC9hX_FeemOfRn_1-CCuHBQYyg.cache +0 -1
  214. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/Qy3TykLFmAt5jhSluMTaZaefcA5c_vfBRhQ7tin-gsk.cache +0 -0
  215. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/R3DpUgZ_hja1dQTIzumiP9AD_r8mlOaqv0U9QqnGQqo.cache +0 -0
  216. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/RF07mgb06A30OcDWtCaDlM5tEc1yp0uAsk986Gqs5w8.cache +0 -1
  217. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/S-6Iq5YOEpVnd_vQ0RSSfrmyIwB1dk0op35alFgJ9xA.cache +0 -2
  218. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/TKV8dUTo88gdFY-z2I7Xa5vDC1Z3LY6Paa18385MJsI.cache +0 -1
  219. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/UI4zPmWfZA2d_5ZZIXqK9KmkjOKSDg6JoM7qcOIxm0Q.cache +0 -1
  220. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/UP29vrIQbCkfghZGSCFxpW5gjlsgCxlVrncjjopvRqM.cache +0 -2
  221. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/UoU16f4V7haEXM5GY5j4QFuNMP7PJZaAMEvVNNtNLBA.cache +0 -1
  222. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/VqPqYNG07yqcjbd7FA05Mu-jr5hzsZPaHFf8X0FFbXk.cache +0 -2
  223. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/WkN1QFvcuzXSsyNmfaK02ojXPk-8zmdEegzNPfdAEL4.cache +0 -0
  224. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/WkQX7Wiz41OKx2aGF7uffOmS04hIVZeGCondBAvwum8.cache +0 -2
  225. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/XMeYF1vwAg53eVjXVkw_IKQH2W3-9tWvtuCdqUCbPBM.cache +0 -2
  226. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/XX0Z7OM0xZKfQaAvHARpyeQNZCstNyu9MlsnwThSkg8.cache +0 -1
  227. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/Y-pGNFTA6bAKxSvqZvmMVs3b4Els1aByxZVFxtJR71c.cache +0 -1
  228. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/Y3p3m5V5NOm7yq56apKmF5KZUUsTfnhT_SG3fqbEJgo.cache +0 -1
  229. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/YLZuRWklL6q-csC-7A7CiOTTTYEQcA9PCdWEOm9MpNU.cache +0 -1
  230. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/Yo7V5YXukEBm6z37l-TIRCJx3HZExEUBu3MUMhAzkMU.cache +0 -1
  231. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/bK6QttR8pGmMAMJO0avCBLwH0za8_bAC-yWqkU3Yj24.cache +0 -1
  232. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/cLncjrqpQXzsVBp7K0W7iG1STLrnzfGpbJXxNE7aIUk.cache +0 -2
  233. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/dBcAd64EZFdhHZNXKGXPIR7EtPGf03bzqkci2W12T8g.cache +0 -2
  234. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/d_bbPiareJHKkzFZFCl3pcwfQOFzsB1KHn4A2xxhR20.cache +0 -1
  235. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/eaHZBuJRcawVlkGZVyyRr5_4xYKVOXbCqnTcmaNXzL0.cache +0 -0
  236. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/gWnmfJty3jBn53qsJfOXKrWv4e8i3Dp80wVel-f1L1E.cache +0 -1
  237. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/gumo32Bd3W_q7MYEt9JIZEiQdHF93tLSsGfmXIm2MqU.cache +0 -1
  238. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/jKTlG9KP0iaCGHwg8kQ1amz9SHJ1OAWeCRRn9wc5w7c.cache +0 -1
  239. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/kPJfTiWbmX-q6i2rjM9MAMdEf2silSihU0_lxlTGVA8.cache +0 -1
  240. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/lrt1SWPj4qWUZUMH9xg3n9KLYUqJZxRn-XI-NTU6oTI.cache +0 -1
  241. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/mcCP5u08nlCL6TgWdzzrem9uE2rbsbG3KyIXxvWvlJE.cache +0 -3
  242. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/pC4exGjkQLXXPE0O9hjX_2AJ4DASTFeB6RGjXagxEac.cache +0 -0
  243. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/pIRh_Lq-ZhYC_XdRcqIsCtUkTnwVET0Wrrpw1EltHd8.cache +0 -2
  244. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/qfXc71sDbi1cE9f327D6ABPURPU6lLguGiJqH2fqM0w.cache +0 -1
  245. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/rBcrkzXcMaiCjwvWl8tO0eARzKZS69I3i-lfsTAFzcc.cache +0 -1
  246. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/sfl8l1_1AGn-4llkmb91Q0wHJ-A-x5gAGkIUWe1zLqo.cache +0 -1
  247. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/tFQc0MOeWpJ7t7cNP2GOzo7o9Z6YBgLEpdS0tGLvUSw.cache +0 -0
  248. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/tb9v5OemP-ADEwYnETLLi1r088kZm_TMb9ZVeTV5JxI.cache +0 -1
  249. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/uKmWfbgaNZ8FTsVK1VNuUv15rmtTHzSdJ7TQRGr0Rck.cache +0 -2
  250. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/ul0QEoovfr_12YOpyWx8BJs8fvz5Ay3AZG8-lsLr-a4.cache +0 -1
  251. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/vY6eUgBIXKHqfU2ZroS-GugKPg5_fo2QBs-vS5gBN2o.cache +0 -0
  252. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/vrRc4DPAbHIJHJqsXfBYdyKUPFv8f8YYKJUrk-1zdVw.cache +0 -0
  253. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/wTET4PQq7wlxzrgvNivPJad-CACkoQS4BNxAP0FQaR4.cache +0 -0
  254. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/wcvE87iLx7cDjMDs_Yu1jKYvep-VyLEyj1eXL79KLp4.cache +0 -0
  255. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/xQeZ92qbm2t9FaRck5xUakvNP-MJ2cs0RroN-fm0Tf8.cache +0 -1
  256. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/xQz9WPf67Mu5uV4rNuOfU-y6_KWSlWcnTWrTvQPonKM.cache +0 -0
  257. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/xhYTRUOS8cIvyRp2Jn6FKnXlGOSsIM2z3HAGOJoJs7w.cache +0 -1
  258. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/yLxMFI0ARh2OKSOQLF2xEfM7sbst2vUbOBXoOuI6iTE.cache +0 -1
  259. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/ynnYZxuxqerlFUytw54dl_CwP94g0U4HmGjyILWnhfQ.cache +0 -1
  260. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/zCivVPbSRpKF_X-P5OJeld32YhymG-bkjQwzqe2o6zg.cache +0 -2
  261. data/spec/dummy/tmp/cache/assets/test/sprockets/02d4b791eb831cf2057bf4703a1218d1 +0 -0
  262. data/spec/dummy/tmp/cache/assets/test/sprockets/0f196a1a50363b0a076ec6e1ee5417f6 +0 -0
  263. data/spec/dummy/tmp/cache/assets/test/sprockets/a3fb9025f90ff05a6fd4afc7ded2692c +0 -0
  264. data/spec/dummy/tmp/cache/assets/test/sprockets/a41c8be5379abec3c0d0d98e2f0d5609 +0 -0
  265. data/spec/dummy/tmp/cache/assets/test/sprockets/c69ee3cc5796188d873574179290a6ef +0 -0
  266. data/spec/dummy/tmp/cache/assets/test/sprockets/e1f674c11941d62aac1764ef3a7134e4 +0 -0
  267. data/spec/dummy/tmp/cache/assets/test/sprockets/e85565206c3e5fdf9dfeb367c85557b1 +0 -0
  268. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/-gXoYfEJ-e9QQUbNRpNa-pwMCnTc7Eqvkq6Bosde6W8.cache +0 -0
  269. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/6iNAIrMKxHltOChiHQQf9VNsLQuj2rVKz6oqWnK7aSM.cache +0 -1
  270. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/E1zaNOh68xzPxdtdOwRtOaMCoKivN2dxVwCP65WEi5I.cache +0 -2
  271. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/HsNbq1o4RbrEWNL4zXVqFfUVnXXLK_y0F0BvddDre6g.cache +0 -0
  272. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/JusxTSXt06IqBm9jeCMM2nTmM3Wvbl3i3L1IwEvW5YA.cache +0 -2
  273. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/L5DjABL_iOtoxSOLn3X7_YlxECU5EhnrVIKxJFAysgc.cache +0 -1
  274. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/PNc9TJUmRdGTSwgZvGlxKaIiJIkyoWtTPiGGWBqpHAE.cache +0 -0
  275. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/QkgTHa6nNs7XP6RPoV3yBbWWV-uo1u2-qxLuvLCFe_0.cache +0 -0
  276. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/S-6Iq5YOEpVnd_vQ0RSSfrmyIwB1dk0op35alFgJ9xA.cache +0 -2
  277. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/Vuc93A9yywiFxc9CAdxrzdsAQw4jxiCa6JRzRjNxOYs.cache +0 -1
  278. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/YAPBll4U0cgs6cz-WyMRKoakK_gVOOcl9n0CvGyxPjY.cache +0 -1
  279. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/bDNeZfPBQaef5z0YajZc4jFE54nNy9gc06mPNKvvPFk.cache +0 -1
  280. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/c5Wa2loowFYFRBaMoTn1IWYXo4BGMbEy7NIi0vbvfRU.cache +0 -1
  281. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/dkn8MYu2ve_AJW6u0jjTlKrj1KBRqorOHQR0Obx2elU.cache +0 -0
  282. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/fZuAzt_-48u9C7ZXmsPgTraGDYtNC9B9zN-9-EnxJG4.cache +0 -1
  283. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/gumo32Bd3W_q7MYEt9JIZEiQdHF93tLSsGfmXIm2MqU.cache +0 -1
  284. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/ige85jXyj8X7XYr7HpA0gSTThqfPUm71HjhSJXtTbUY.cache +0 -1
  285. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/kuYeE5bV6FdXmfB_o-xhflhSDWoQhYYaaupAXODZ9dQ.cache +0 -1
  286. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/qhZbbNIRUaAOtGano94zLHjeBKUhKr4qbh2tTCi0Bnk.cache +0 -2
  287. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/wJJbzdHJHP6tchng3HhfTwmjc5LursgX8yZkAjpO5UA.cache +0 -0
  288. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/xNL1WW-qU3EvV2iTSW6F4hAFRBsCYmFKJhLjgCZkOV8.cache +0 -2
  289. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/ytHkF2DwUE6oaiLyrK6tL-0INpeNhjN6ctD7J0LNY6I.cache +0 -2
  290. data/spec/helpers/commontator/application_helper_spec.rb +0 -10
  291. data/spec/helpers/commontator/application_helper_spec.rb~ +0 -9
  292. data/spec/lib/commontator/acts_as_commontable_spec.rb +0 -25
  293. data/spec/lib/commontator/acts_as_commontable_spec.rb~ +0 -25
  294. data/spec/lib/commontator/acts_as_commontator_spec.rb +0 -26
  295. data/spec/lib/commontator/acts_as_commontator_spec.rb~ +0 -52
  296. data/spec/lib/commontator/commontable_config_spec.rb +0 -28
  297. data/spec/lib/commontator/commontable_config_spec.rb~ +0 -29
  298. data/spec/lib/commontator/commontator_config_spec.rb +0 -28
  299. data/spec/lib/commontator/commontator_config_spec.rb~ +0 -29
  300. data/spec/lib/commontator/controller_includes_spec.rb~ +0 -18
  301. data/spec/lib/commontator/controllers_spec.rb +0 -18
  302. data/spec/lib/commontator/controllers_spec.rb~ +0 -18
  303. data/spec/lib/commontator/shared_helper_spec.rb +0 -21
  304. data/spec/lib/commontator/shared_helper_spec.rb~ +0 -22
  305. data/spec/lib/commontator_spec.rb +0 -25
  306. data/spec/lib/commontator_spec.rb~ +0 -26
  307. data/spec/mailers/commontator/subscriptions_mailer_spec.rb +0 -49
  308. data/spec/mailers/commontator/subscriptions_mailer_spec.rb~ +0 -30
  309. data/spec/models/commontator/comment_spec.rb +0 -82
  310. data/spec/models/commontator/comment_spec.rb~ +0 -82
  311. data/spec/models/commontator/subscription_spec.rb +0 -38
  312. data/spec/models/commontator/subscription_spec.rb~ +0 -38
  313. data/spec/models/commontator/thread_spec.rb +0 -159
  314. data/spec/models/commontator/thread_spec.rb~ +0 -122
  315. data/spec/rails_helper.rb +0 -72
  316. data/spec/rails_helper.rb~ +0 -74
  317. data/spec/spec_helper.rb +0 -94
  318. data/spec/spec_helper.rb~ +0 -93
  319. data/vendor/assets/javascripts/mentionsInput/index.js~ +0 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: acf6d8175a90bff17e463df97782fd7bf93b8565
4
- data.tar.gz: 7320feebb54d1995b15e2d5627ff2845eac42756
2
+ SHA256:
3
+ metadata.gz: 5eff6c0a48d5f543bfb93305eac807e923acf0542f10afb4720aae10220b6447
4
+ data.tar.gz: 4875720a501fbf2087ab5d350b9e570f94271623f9df6834d30002afbf545f72
5
5
  SHA512:
6
- metadata.gz: 2ce7dec91a95320fa1ee613a8a62021eba0d88501d7a740ee069a0ce886346a734bd1903bd332b84cc71ccbacf8c408fd8adf67d26d9ae7b24bf85b231b36fba
7
- data.tar.gz: 8829fd206d56d284d9ea23d9fb781602de7f136479c4b2828ae04f4211bf8322954065193fe247b0ea3ee0a64458c12fae9b8c58482c5e073121e70b1aad203f
6
+ metadata.gz: 96c05e5272b89801962355a629f22be1662c4fe9cce699d7c7be01ad4139275ab0c604c529252deba630117b9e0bd916b195bc669bb8797bce94ab896a4a34e8
7
+ data.tar.gz: 4e319ccd0514499cf691509ed1a15262e319c32d80f9f04ce4d1b4b873b07a94e83d5071310d07c741979ffb50c22106c1f7afabd0788f65085775538985ca1c
@@ -1,4 +1,4 @@
1
- Copyright 2012-14 Rice University
1
+ Copyright 2012-19 Rice University
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.md CHANGED
@@ -1,36 +1,44 @@
1
1
  # Commontator
2
2
 
3
- [![Gem Version](https://badge.fury.io/rb/commontator.svg)](http://badge.fury.io/rb/commontator)
3
+ [![Gem Version](https://badge.fury.io/rb/commontator.svg)](https://badge.fury.io/rb/commontator)
4
4
  [![Build Status](https://travis-ci.org/lml/commontator.svg?branch=master)](https://travis-ci.org/lml/commontator)
5
5
  [![Code Climate](https://codeclimate.com/github/lml/commontator/badges/gpa.svg)](https://codeclimate.com/github/lml/commontator)
6
6
  [![Code Coverage](https://codeclimate.com/github/lml/commontator/badges/coverage.svg)](https://codeclimate.com/github/lml/commontator)
7
7
 
8
- Commontator is a Rails engine for comments. It is compatible with Rails 3.1+ and Rails 4.
8
+ Commontator is a Rails engine for comments. It is compatible with Rails 5.
9
9
  Being an engine means it is fully functional as soon as you install and
10
10
  configure the gem, providing models, views and controllers of its own.
11
11
  At the same time, almost anything about it can be configured or customized to suit your needs.
12
12
 
13
13
  ## Installation
14
14
 
15
- There are 4 steps you must follow to install commontator:
15
+ Follow the steps below to install Commontator:
16
16
 
17
17
  1. Gem
18
18
 
19
19
  Add this line to your application's Gemfile:
20
20
 
21
21
  ```rb
22
- gem 'commontator', '~> 5.1.0'
22
+ gem 'commontator'
23
23
  ```
24
24
 
25
- And then execute:
25
+ You will also need jquery-ujs and a sass compiler, which can be either be installed through
26
+ the webpacker gem and yarn/npm/bower or through the jquery-rails and sass[c]-rails gems:
27
+
28
+ ```rb
29
+ gem 'jquery-rails'
30
+ gem 'sassc-rails'
31
+ ```
32
+
33
+ Then execute:
26
34
 
27
35
  ```sh
28
36
  $ bundle install
29
37
  ```
30
38
 
31
- 2. Initializer and Migration
39
+ 2. Initializer and Migrations
32
40
 
33
- Run the following command to copy commontator's initializer and migration to your app:
41
+ Run the following command to copy Commontator's initializer and migrations to your app:
34
42
 
35
43
  ```sh
36
44
  $ rake commontator:install
@@ -47,15 +55,20 @@ There are 4 steps you must follow to install commontator:
47
55
  And then execute:
48
56
 
49
57
  ```sh
50
- $ rake db:migrate
58
+ $ rails db:migrate
51
59
  ```
52
60
 
53
61
  3. Configuration
54
62
 
55
- Change commontator's configurations to suit your needs by editing `config/initializers/commontator.rb`.
63
+ Change Commontator's configurations to suit your needs by editing `config/initializers/commontator.rb`.
56
64
  Make sure to check that your configuration file is up to date every time you update the gem, as available options can change with each minor version.
57
65
  If you have deprecated options in your initializer, Commontator will issue warnings (usually printed to your console).
58
66
 
67
+ Commontator relies on Rails's `sanitize` helper method to sanitize user input before display.
68
+ The default allowed tags and attributes are very permissive, basically
69
+ only blocking tags, attributes and attribute values that could be used for XSS.
70
+ [Read more about configuring the Rails sanitize helper.](https://edgeapi.rubyonrails.org/classes/ActionView/Helpers/SanitizeHelper.html).
71
+
59
72
  4. Routes
60
73
 
61
74
  Add this line to your Rails application's `routes.rb` file:
@@ -66,10 +79,28 @@ There are 4 steps you must follow to install commontator:
66
79
 
67
80
  You can change the mount path if you would like a different one.
68
81
 
69
- 5. Stylesheets
82
+ 5. Javascripts
70
83
 
71
- In order to display comment threads properly,
72
- you must add the following to your `application.css`:
84
+ Make sure your application.js requires jquery and jquery-ujs:
85
+
86
+ ```js
87
+ //= require jquery
88
+ // If jquery-ujs was installed through jquery-rails
89
+ //= require jquery_ujs
90
+ // If jquery-ujs was installed through webpacker and yarn/npm/bower
91
+ //= require jquery-ujs
92
+ ```
93
+
94
+ If using Commontator's mentions functionality, also require Commontator's application.js:
95
+
96
+ ```js
97
+ //= require commontator/application
98
+ ```
99
+
100
+ 6. Stylesheets
101
+
102
+ In order to display comment threads properly, you must
103
+ require Commontator's application.scss in your `application.[s]css`:
73
104
 
74
105
  ```css
75
106
  *= require commontator/application
@@ -77,7 +108,7 @@ There are 4 steps you must follow to install commontator:
77
108
 
78
109
  ## Usage
79
110
 
80
- Follow the steps below to add commontator to your models and views:
111
+ Follow the steps below to add Commontator to your models and views:
81
112
 
82
113
  1. Models
83
114
 
@@ -130,35 +161,35 @@ Follow the steps below to add commontator to your models and views:
130
161
 
131
162
  Note that the call to `commontator_thread` in the view is still necessary in either case.
132
163
 
133
- The `commontator_thread_show` method checks the current user's read permission on the thread and will raise a
134
- Commontator::SecurityTransgression exception if the user is not allowed to read it, according to the options in the initializer.
135
- It is up to you to ensure that this method is only called if the user is authorized to read the thread.
164
+ The `commontator_thread_show` method checks the current user's read permission on the thread and will display the thread if the user is allowed to read it, according to the options in the initializer.
136
165
 
137
166
  That's it! Commontator is now ready for use.
138
167
 
139
168
  ## Emails
140
169
 
141
- When you enable subscriptions, emails are sent automatically by Commontator. If sending emails, remember to add your host URL's to your environment files (test.rb, development.rb and production.rb):
170
+ When you enable subscriptions, emails are sent automatically by Commontator.
171
+ If sending emails, remember to add your host URL's to your environment files
172
+ (test.rb, development.rb and production.rb):
142
173
 
143
174
  ```rb
144
- config.action_mailer.default_url_options = { host: "www.example.com" }
175
+ config.action_mailer.default_url_options = { host: "https://www.example.com" }
145
176
  ```
146
177
 
178
+ Sometimes you may need to subscribe (commontator) users automatically when some event happens.
179
+ You can call `object.commontator_thread.subscribe(user)` to subscribe users programmatically.
147
180
  Batch sending through Mailgun is also supported and automatically detected.
148
-
149
- You may need to customize the mailer views with `rake commontator:copy:views` though only `app/views/commontator/subscriptions_mailer/` may be necessary. These in turn may require that you customize the localizations as well (see below for more details on that).
150
-
151
- Sometimes you may need to add users automatically upon some event. For example, you may wish to automatically "subscribe" a (commontator) `user` to a (commontable) `event` so they get messages sent to the event automatically after joining the event. To do this you call `event.thread.subscribe(user)` when adding that `user` to that `event`.
181
+ Read the Customization section to see how to customize subscription emails.
152
182
 
153
183
  ## Voting
154
184
 
155
- You can allow users to vote on each others' comments by adding the `acts_as_votable` gem to your gemfile:
185
+ You can allow users to vote on each others' comments
186
+ by adding the `acts_as_votable` gem to your Gemfile:
156
187
 
157
188
  ```rb
158
189
  gem 'acts_as_votable'
159
190
  ```
160
191
 
161
- And enabling the relevant option in commontator's initializer:
192
+ And enabling the relevant option in Commontator's initializer:
162
193
 
163
194
  ```rb
164
195
  config.comment_voting = :ld # See the initializer for available options
@@ -169,22 +200,17 @@ config.comment_voting = :ld # See the initializer for available options
169
200
  You can allow users to mention other users in the comments.
170
201
  Mentioned users are automatically subscribed to the thread and receive email notifications.
171
202
 
172
- First add the following to your application.js file:
173
-
174
- ```js
175
- //= require commontator/application
176
- ```
177
-
178
- Then enable mentions in commontator's initializer:
203
+ First make sure you required Commontator's application.js
204
+ in your `application.js` as explained in the Javascripts section.
205
+ Then enable mentions in Commontator's initializer:
179
206
 
180
207
  ```rb
181
208
  config.mentions_enabled = true
182
209
  ```
183
210
 
184
- Finally configure the user_mentions_proc, which receives the current user,
185
- the current thread, and the search query inputted by that user and should
186
- return a relation containing the users that can be mentioned and match the
187
- query string:
211
+ Finally configure the user_mentions_proc, which receives the current user, the current thread,
212
+ and the search query inputted by that user and should return a relation containing the users
213
+ that can be mentioned and match the query string:
188
214
 
189
215
  ```rb
190
216
  config.user_mentions_proc = ->(current_user, thread, query) { ... }
@@ -192,11 +218,11 @@ config.user_mentions_proc = ->(current_user, thread, query) { ... }
192
218
 
193
219
  Please be aware that with mentions enabled, any registered user
194
220
  can use the `user_mentions_proc` to search for other users.
195
- Make sure to properly escape SQL in this proc and to not allow searches on sensitive fields.
221
+ Make sure to properly escape SQL in this proc and do not allow searches on sensitive fields.
196
222
 
197
223
  Use '@' with at least three other characters to mention someone in a new/edited comment.
198
224
 
199
- The mentions script assumes that commontator is mounted at `/commontator`,
225
+ The mentions script assumes that Commontator is mounted at `/commontator`,
200
226
  so make sure that is indeed the case if you plan to use mentions.
201
227
 
202
228
  ## Browser Support
@@ -207,40 +233,46 @@ To function properly, this gem requires that visitors to the site have javascrip
207
233
 
208
234
  ## Customization
209
235
 
210
- Copy commontator's files to your app using any of the following commands:
236
+ Copy Commontator's files to your app using any of the following commands:
211
237
 
212
238
  ```sh
213
239
  $ rake commontator:copy:locales
214
240
 
215
241
  $ rake commontator:copy:images
242
+ $ rake commontator:copy:javascripts
216
243
  $ rake commontator:copy:stylesheets
217
244
 
218
245
  $ rake commontator:copy:views
219
- $ rake commontator:copy:mailers
220
246
  $ rake commontator:copy:helpers
221
247
 
222
248
  $ rake commontator:copy:controllers
249
+ $ rake commontator:copy:mailers
250
+
223
251
  $ rake commontator:copy:models
224
252
  ```
225
253
 
226
254
  You are now free to modify them and have any changes made manifest in your application.
255
+ You can safely remove files you do not want to customize.
227
256
 
228
- If copying commontator's locales, please note that by default Rails will not autoload locales in subfolders of `config/locales` (like ours) unless you add the following to your application's configuration file:
257
+ You can customize subscription emails (mailer views) with `rake commontator:copy:views`.
258
+
259
+ If copying Commontator's locales, please note that by default Rails will not autoload locales in
260
+ subfolders of `config/locales` (like ours) unless you add the following to your `application.rb`:
229
261
 
230
262
  ```rb
231
- config.i18n.load_path += Dir[root.join('config', 'locales', '**', '*.{rb,yml}')]
263
+ config.i18n.load_path += Dir[root.join('config', 'locales', '**', '*.yml')]
232
264
  ```
233
265
 
234
266
  ## Contributing
235
267
 
236
- 1. Fork it
237
- 2. Create your feature branch (`git checkout -b my-new-feature`)
238
- 3. Write tests for your feature
239
- 4. Implement your new feature
240
- 5. Test your feature (`rake`)
268
+ 1. Fork the lml/commontator repo on Github
269
+ 2. Create a feature or bugfix branch (`git checkout -b my-new-feature`)
270
+ 3. Write tests for the feature/bugfix
271
+ 4. Implement the new feature/bugfix
272
+ 5. Make sure both new and old tests pass (`rake`)
241
273
  6. Commit your changes (`git commit -am 'Added some feature'`)
242
- 7. Push to the branch (`git push origin my-new-feature`)
243
- 8. Create new Pull Request
274
+ 7. Push the branch (`git push origin my-new-feature`)
275
+ 8. Create a new Pull Request to lml/commontator on Github
244
276
 
245
277
  ## Development Environment Setup
246
278
 
@@ -250,32 +282,20 @@ config.i18n.load_path += Dir[root.join('config', 'locales', '**', '*.{rb,yml}')]
250
282
  $ bundle install
251
283
  ```
252
284
 
253
- 2. Load the schema:
285
+ 2. Setup the database:
254
286
 
255
287
  ```sh
256
- $ rake db:schema:load
257
- ```
258
-
259
- Or if the above fails:
260
-
261
- ```sh
262
- $ bundle exec rake db:schema:load
288
+ $ rails db:setup
263
289
  ```
264
290
 
265
291
  ## Testing
266
292
 
267
- To run all existing tests for commontator, simply execute the following from the main folder:
293
+ To run all existing tests for Commontator, simply execute the following from the main folder:
268
294
 
269
295
  ```sh
270
296
  $ rake
271
297
  ```
272
298
 
273
- Or if the above fails:
274
-
275
- ```sh
276
- $ bundle exec rake
277
- ```
278
-
279
299
  ## License
280
300
 
281
301
  This gem is distributed under the terms of the MIT license.
@@ -1,7 +1,7 @@
1
1
  window.Commontator = {};
2
2
  Commontator._ = window._.noConflict();
3
3
  Commontator.initMentions = function() {
4
- $('.comment_form_field textarea:not(.mentions-added)').each(function(_index, textarea){
4
+ $('.commontator .field textarea:not(.mentions-added)').each(function(_index, textarea){
5
5
  $textarea = $(textarea);
6
6
  $form = $textarea.parents('form');
7
7
  threadId = $textarea.parents('.thread').attr('id').match(/[\d]+/)[0];
@@ -13,7 +13,7 @@ Commontator.initMentions = function() {
13
13
  allowRepeat: true,
14
14
  minChars: 3,
15
15
  onDataRequest:function (mode, query, callback) {
16
- $.getJSON('/commontator/threads/'+threadId+'/mentions.json', {q: query}, function(responseData) {
16
+ $.getJSON('/commontator/threads/' + threadId + '/mentions.json', {q: query}, function(responseData) {
17
17
  callback.call(this, responseData.mentions);
18
18
  });
19
19
  }
@@ -0,0 +1,101 @@
1
+ /*
2
+ *= require mentionsInput/jquery.mentionsInput
3
+ *= require_self
4
+ *= require_tree .
5
+ */
6
+
7
+ .commontator {
8
+ *:not(input):not(textarea) {
9
+ margin: 0;
10
+ border: none;
11
+ padding: 0;
12
+ }
13
+
14
+ .hidden {
15
+ display: none;
16
+ }
17
+
18
+ .header {
19
+ display: block;
20
+
21
+ overflow: hidden;
22
+ }
23
+
24
+ .actions {
25
+ float: right;
26
+
27
+ margin-left: 10px;
28
+ }
29
+
30
+ .status {
31
+ font-size: 120%;
32
+ font-weight: bold;
33
+ font-style: normal;
34
+ }
35
+
36
+ .comment-list {
37
+ background-color: #FFF;
38
+ }
39
+
40
+ /* Modified from: https://www.strangerstudios.com/sandbox/pagination/diggstyle.php */
41
+ .page-entries-info, .will-paginate {
42
+ margin-top: 10px;
43
+ margin-bottom: 10px;
44
+ }
45
+
46
+ .pagination {
47
+ a {
48
+ margin-right: 4px;
49
+ padding: 2px 5px 2px 5px;
50
+ border: 1px solid #999;
51
+
52
+ color: #666;
53
+ text-decoration: none;
54
+
55
+ &:hover, &:active {
56
+ border: 1px solid #555;
57
+
58
+ color: #000;
59
+ }
60
+ }
61
+
62
+ em {
63
+ margin-right: 4px;
64
+ border: 1px solid #555;
65
+ padding: 2px 5px 2px 5px;
66
+
67
+ background-color: #555;
68
+
69
+ font-weight: bold;
70
+ color: #FFF;
71
+ }
72
+
73
+ span {
74
+ margin-right: 4px;
75
+ border: 1px solid #EEE;
76
+ padding: 2px 5px 2px 5px;
77
+
78
+ color: #DDD;
79
+ }
80
+ }
81
+
82
+ .mentions {
83
+ left: -8px;
84
+ top: -8px;
85
+
86
+ font-family: monospace;
87
+ font-size: 13.3333px;
88
+ }
89
+
90
+ .field textarea {
91
+ width: 100%;
92
+
93
+ padding: 0;
94
+
95
+ overflow: auto;
96
+ }
97
+
98
+ .submit {
99
+ margin: 10px 0;
100
+ }
101
+ }
@@ -0,0 +1,103 @@
1
+ .commontator .comment {
2
+ &, .body blockquote {
3
+ border: none;
4
+ border-top: 1px solid;
5
+ border-left: 1px solid;
6
+
7
+ font-weight: normal;
8
+ color: #000;
9
+ }
10
+
11
+ & {
12
+ clear: both;
13
+
14
+ margin: 15px 0;
15
+ border-color: #DDD;
16
+ padding: 0;
17
+
18
+ font-style: normal;
19
+ }
20
+
21
+ .section {
22
+ clear: both;
23
+
24
+ margin: 5px 7px;
25
+ }
26
+
27
+ .author {
28
+ font-size: 110%;
29
+ }
30
+
31
+ .actions {
32
+ font-size: 90%;
33
+ }
34
+
35
+ .avatar {
36
+ float: left;
37
+
38
+ margin-right: 7px;
39
+ }
40
+
41
+ .votes {
42
+ float: right;
43
+
44
+ margin-left: 7px;
45
+
46
+ text-align: center;
47
+
48
+ input, img {
49
+ background-color: transparent;
50
+ }
51
+ }
52
+
53
+ .upvote, .downvote {
54
+ display: block;
55
+
56
+ height: 18px;
57
+
58
+ margin: 5px 0;
59
+ }
60
+
61
+ .like {
62
+ float: left;
63
+
64
+ margin: 0 5px;
65
+ }
66
+
67
+ .vote-count {
68
+ font-size: 110%;
69
+ }
70
+
71
+ .body {
72
+ overflow: hidden;
73
+
74
+ blockquote {
75
+ border-color: #CCC;
76
+ padding: 5px 7px;
77
+
78
+ background-color: #EEE;
79
+
80
+ font-style: italic;
81
+ }
82
+ }
83
+
84
+ .reply, .timestamp {
85
+ font-size: 90%;
86
+ }
87
+
88
+ .timestamp {
89
+ color: #666;
90
+ }
91
+
92
+ .error-explanation {
93
+ margin-bottom: 10px;
94
+
95
+ h3 {
96
+ margin-top: 5px;
97
+ }
98
+
99
+ ul {
100
+ list-style-position: inside;
101
+ }
102
+ }
103
+ }