mongoid_sortable_tree 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (269) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +162 -0
  4. data/Rakefile +35 -0
  5. data/app/assets/javascripts/mongoid_sortable_tree.coffee +73 -0
  6. data/app/controllers/mongoid_sortable_tree_controller.rb +97 -0
  7. data/app/helpers/mongoid_sortable_tree_helper.rb +96 -0
  8. data/app/helpers/render_sortable_tree_helper.rb +36 -0
  9. data/config/routes.rb +2 -0
  10. data/lib/mongoid_sortable_tree/engine.rb +7 -0
  11. data/lib/mongoid_sortable_tree/version.rb +3 -0
  12. data/lib/mongoid_sortable_tree.rb +57 -0
  13. data/lib/tasks/mongoid_sortable_tree_tasks.rake +4 -0
  14. data/test/dummy/README.rdoc +28 -0
  15. data/test/dummy/Rakefile +6 -0
  16. data/test/dummy/app/assets/javascripts/application.js +17 -0
  17. data/test/dummy/app/assets/javascripts/tags.js +5 -0
  18. data/test/dummy/app/assets/stylesheets/application.css +16 -0
  19. data/test/dummy/app/assets/stylesheets/tags.css +4 -0
  20. data/test/dummy/app/controllers/application_controller.rb +5 -0
  21. data/test/dummy/app/controllers/tags_controller.rb +6 -0
  22. data/test/dummy/app/helpers/application_helper.rb +2 -0
  23. data/test/dummy/app/helpers/tags_helper.rb +2 -0
  24. data/test/dummy/app/models/tag.rb +4 -0
  25. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  26. data/test/dummy/app/views/tags/index.html.erb +3 -0
  27. data/test/dummy/bin/bundle +3 -0
  28. data/test/dummy/bin/rails +4 -0
  29. data/test/dummy/bin/rake +4 -0
  30. data/test/dummy/bin/setup +29 -0
  31. data/test/dummy/config/application.rb +29 -0
  32. data/test/dummy/config/boot.rb +5 -0
  33. data/test/dummy/config/environment.rb +5 -0
  34. data/test/dummy/config/environments/development.rb +38 -0
  35. data/test/dummy/config/environments/production.rb +76 -0
  36. data/test/dummy/config/environments/test.rb +42 -0
  37. data/test/dummy/config/initializers/assets.rb +11 -0
  38. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  39. data/test/dummy/config/initializers/cookies_serializer.rb +3 -0
  40. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  41. data/test/dummy/config/initializers/inflections.rb +16 -0
  42. data/test/dummy/config/initializers/mime_types.rb +4 -0
  43. data/test/dummy/config/initializers/session_store.rb +3 -0
  44. data/test/dummy/config/initializers/wrap_parameters.rb +9 -0
  45. data/test/dummy/config/locales/en.yml +23 -0
  46. data/test/dummy/config/mongoid.yml +31 -0
  47. data/test/dummy/config/mongoid.yml.example +16 -0
  48. data/test/dummy/config/routes.rb +61 -0
  49. data/test/dummy/config/secrets.yml +22 -0
  50. data/test/dummy/config.ru +4 -0
  51. data/test/dummy/log/development.log +0 -0
  52. data/test/dummy/log/test.log +5743 -0
  53. data/test/dummy/public/404.html +67 -0
  54. data/test/dummy/public/422.html +67 -0
  55. data/test/dummy/public/500.html +66 -0
  56. data/test/dummy/public/favicon.ico +0 -0
  57. data/test/dummy/test/controllers/tags_controller_test.rb +7 -0
  58. data/test/dummy/test/factories/tags.rb +5 -0
  59. data/test/dummy/test/models/tag_test.rb +7 -0
  60. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/-8QgiuqJNyx7584K7NHwpoZ-1CHc5K6D8vO5a76W-Mk.cache +0 -0
  61. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/-FF9YZZk3MBqmM5MmhHAKLA44HdgkqdV_DVwPN6b0IQ.cache +0 -0
  62. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/-YETADVGs9UiLSY_AaYnavuJ4DhlDTAGJ1_gWV_m1ac.cache +1 -0
  63. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/-hU_05LUo9nL_I84j2nRwUzotmHOIDZPz7S0mo_pw6A.cache +0 -0
  64. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/0cSPF0GnqGK2gT6WrARJflvshWkZzMtaOsituc7uH5I.cache +0 -0
  65. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/1lWHyPuxBbGEfZcnMATWvLOM7Rr5DebvZH25L8qfHQo.cache +1 -0
  66. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/1spSyD3OikScWv9J-BHxLwoIyoc50Ie4Wod4p2Li1x0.cache +2 -0
  67. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/2Hv3UttI050UOWJ7WwZePZLPamAOXzUUZNW3qLWL2BQ.cache +1 -0
  68. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/2KMM2fwI0y0fxEqgqal7l4dgDFcFM0pbLMfxlEHZ1pc.cache +1 -0
  69. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/2hJ4zq-UI-ilzv3WKQjB9enBpu4hZgPRATcFOOCYqNg.cache +1 -0
  70. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/3XunDrGHcn8r5fK4kNwWR7kBC0pqNvJ_IYlHawtiiOk.cache +1 -0
  71. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/5AE8ZmejamsLuGJ-uliVvGLFd03rYfK2F_kPR5P5F08.cache +1 -0
  72. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/5Lly_CA8DZvPhQV2jDQx-Y6P_y3Ygra9t5jfSlGhHDA.cache +2 -0
  73. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/5bppl0UuQaBv-elQ0tAypOzARtiqn3WxL6VTL_lc5lM.cache +0 -0
  74. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/5dwH57t4G1f3AjO-KHJaoIFi0EJkRkBH_whufzp2zyI.cache +0 -0
  75. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/5fCD86lA3q0EFoaIZk5EF67JrnYvZBE659n8vwEvfQQ.cache +0 -0
  76. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/5uddwDeoNUSzQXNr4x4rWZkDfvQcYzuZ1MuZq0hIrpc.cache +0 -0
  77. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/5wtbA9MhSh_NGzq01VGz3-ZILb9UmMj4NS6acnjhGkA.cache +0 -0
  78. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/67JfKHaonSIx3bnYswsP0g8Vw2aIIdvxgzauecopZJ4.cache +1 -0
  79. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/693LYlns796uzyM_KSyOgHBKoNUZRs-LL49ciULfH2c.cache +1 -0
  80. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/6D1diGFqY1kA9O6ilKEvbVkm8tip3mxKZI3WafwH4jQ.cache +0 -0
  81. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/6ZSjWB8Af4WoK9tyMmBaGlKIiGR9wB6TbMlyIuQTDLg.cache +0 -0
  82. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/6qra6k98bkRDlZAfwlIwhJhWYfpslFLS6XkP0saIqhs.cache +1 -0
  83. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/7-rneT3H46gDfX-wasQTDtoGPCA0qjD2eKCRxFH0_e0.cache +0 -0
  84. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/7OJOjN8EyWrkfnqj_AUsJXVJYVa9ykbrqT2W4lB4h74.cache +0 -0
  85. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/7RoKHeQQ4Mbu-d5eDnUWEpexu9sK0VTdmmaCaX1Zg50.cache +1 -0
  86. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/7ZDe_ZWIuNNq_anrL61geXVF-RkYxpDaautJZ4PNRMU.cache +0 -0
  87. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/9LTAmtfXMuj74tfL2YMoJYgAFmk_d5C0dA3BUrqgdio.cache +1 -0
  88. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/9iayo4GYzOaSyGhYSCMdRzfaPUiGuRfroAroZTlPtl8.cache +0 -0
  89. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/9zwfK5pW6ZUsVvP85wvhUCjqGD4Wuq4V_VHNJgYr5-E.cache +1 -0
  90. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/A3I4iwdPfuMe5QUvb3LeKFCydBznKwRi17BppdPuWwQ.cache +1 -0
  91. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/AQFKEtOzeisjBiVFSSU91rKphpWQPunLwNpVfKRnd6w.cache +0 -0
  92. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/AxjixA6-9f4n8ME-cf9gJjeMmnC-Kxg5_nA4U1_hUfE.cache +1 -0
  93. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/B287FpA2uegWtn28rzQvD5phOc305pMqubvxJTTI02g.cache +1 -0
  94. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/BbJzQmzK2GaM17AePvMzBbzj1lORCGWH8YZ4udacs_E.cache +1 -0
  95. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/C3-GmW_WSqr8Rjx_iv5TGEwbf5prtzzuNlmveOKM_bM.cache +1 -0
  96. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/DpkEssOZUAIdPlXq6WOYMUPLGNEF-EyHY4wQMEXEEqc.cache +0 -0
  97. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/EP0L8J9jzZ3jHHjufSqjEUijYKCo7mXhjOiOgcrQqAw.cache +3 -0
  98. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/EV-CiPMKub1wavxvvFXfs1pFQhxUsy_nbAwvkv47QmA.cache +97 -0
  99. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/EVwSpiVM_Ou6acLUeBjY9goEOwTWQh64dwrz048_lck.cache +0 -0
  100. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/Ew9hxtjkJFDwkGvq_-VU0MBboOib3F5V51HUq8NmmKE.cache +1 -0
  101. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/F1RpGZ90fbOvKy_PW9pw4yG5uBQyddUJkIOUTDuKcus.cache +0 -0
  102. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/FistDi7CZvBJrCuXvtY39nIonI3BANgSpsW3vsGPpfE.cache +0 -0
  103. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/FlFzT5xcfC4NlFVUsPbolKt2JIjbbgCTM78FWeh7cps.cache +0 -0
  104. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/FlLJOCERbDUYQr1KcYw5jqwQJ2KWM6HPHUIeMDY69Ak.cache +1 -0
  105. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/GeXpdMboQdcoXlNvlZfkbOGsLkLdbCDpKFb0Zrd5kkM.cache +1 -0
  106. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/Gzo84GbDWTzDnnmr2BG34a4-WILka2kHDX8odeJ-vhQ.cache +1 -0
  107. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/H8yPRDyPh__z5XPO3W7kvAR9RrZG4qvPcpQvfiQ2KDI.cache +1 -0
  108. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/ICwObrv8-G4aM6lUtm5iiLuj_RiBJwhytm5eqcLsgRo.cache +0 -0
  109. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/IPGXQQCD2AnwsjikA5a5l5AAhkqpO1FD9zVl5Eukdqk.cache +1 -0
  110. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/IXoeq_TTNKaSGoeqkrGKKiY_3RoIzrI24scBiLx1QhY.cache +4 -0
  111. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/IeJHUBQYriiq23EJHAFLENacqIIf5YodrL9MhBjJU3w.cache +3 -0
  112. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/JOaeOEkP615RFZqkkkbGmKPMivNPIfMFYeHm2qqGnmk.cache +0 -0
  113. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/JnRPK4kBTSpoGwRDqzsCtKp5yRPqNY-Ava27hKdRj9s.cache +1 -0
  114. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/KJfVEWLoeIP21tpHCs5IbSECrMFy2iIQDZlZUPMSAuc.cache +96 -0
  115. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/Kb71IVT-T3cp9Aw_ZONJzrWnb6K6JTUIA_C7LxC6o10.cache +1 -0
  116. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/KltXsy5Zh6r4nzw5qTO_7IjFM_RkArZXVA-2ktS4A4s.cache +3 -0
  117. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/KojpFgEnwHw8_al_n5nZqHrXjxpjyc86XfBeXwcWxcU.cache +1 -0
  118. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/L175VLDL_rDCflZugn63HDKEYCiL1Xi-4d_IrO9oV0c.cache +0 -0
  119. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/LJzDjyjymoPCmmbRIVvFnNj7L8vhCVKKogLc9GVyKYY.cache +0 -0
  120. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/LRgLZIjClyRe1BkQAUjLKnv_7vEFMpjCOhWzYVytZoo.cache +0 -0
  121. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/LsbBsOQ6Vt8RF6oNjddwMWedE6IlEI2cxRWTLd8VTy4.cache +3 -0
  122. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/MT36lG90yTAaHBb7hmeiTwaObnUB6CEuH37HALxliXs.cache +0 -0
  123. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/MTfeX7i9zOHjCifDgjQWroMa26GCNtubn4ougGjT3Ko.cache +1 -0
  124. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/MVZjJSGC2FiQQ9Kg2lQ4kUVafhJZslEwrnSdQxg6Vvc.cache +0 -0
  125. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/MsX6mv2EkE6XeXQfA1HG3M48qz-3MCz1yB0weQNi7L0.cache +0 -0
  126. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/Mvcn3LcfYUo25UpZ7eFOZnjfotjAHA20sgmZRYn36lY.cache +1 -0
  127. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/N-_1aBMWWrovDFoafhaGQjAkVzFq7YE5XGdqD7IoNCw.cache +0 -0
  128. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/N0P_6teb_KbdBYAZhN5dFKoeRufvjvFzTxqpNrxwMjg.cache +0 -0
  129. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/N5gSDb63c1wKeW2XMLVxmZ9fjZcpAOGQOvkl9ti5kFo.cache +0 -0
  130. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/NCJG9F7gI-hlavcsxx4jeFTMbpN-99G1GN9QfeLU8tM.cache +1 -0
  131. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/NM0G1hMfa6YGYOBhtVEDtijHaDPaX6lvkcLojWi4ywY.cache +3 -0
  132. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/NSqJPSQZBTP-86CFB2qBCBbHiGyb_jZwb89QWjAzQEs.cache +0 -0
  133. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/Ndvkef-A85MEszJ4XnG08eBP4Gl1En3yc8ngmtAF4Gk.cache +3 -0
  134. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/Nj6cGxzs1Bv1mG5CqM6LfluF8V0-pQ0PvfnLNM7s7tk.cache +0 -0
  135. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/OD_qu5nnv4ddKeOm_8JABsWl96MWzAtbp0gNjlBiz2s.cache +0 -0
  136. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/OI6uxGcnsKavdWTtwDAasU3wPx8QXhzBgV0X2n1KjMQ.cache +2 -0
  137. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/OMpVv-h3jA8Jc1fb9tN5lLHzSJSH357lEO-R-RKHBwY.cache +0 -0
  138. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/OhBEVS4zNQVBmr0jEVZG1o-o0EYV02uPM3FH6eMtoW4.cache +1 -0
  139. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/OsUNhbO_177BDYSaJmuFNRGDfM-yNchIna6n4Oa87N4.cache +1 -0
  140. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/OvadU8uwG8k0e3bob9SkIaHj0CFUlpwfKdQHDFbvWh0.cache +0 -0
  141. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/P0ToEH3e7G5h4Ca08grSq5s40W5GHXbJ95b7MTDVQyw.cache +0 -0
  142. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/Q7_XN_KVeReZVJf7QxdFujOctL33VSbSJJw--OkUAoM.cache +2 -0
  143. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/QXnZ8Pgyj2eWztLE6-JmNXukZH0Mus4Enld_fG18mKo.cache +1 -0
  144. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/RC8D_0C8Fqr9Vo5aIpgrKIYPtu8-Y2ObwFt080PZdXc.cache +1 -0
  145. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/RM_WhaK_VXHrExK4aaL_H5W6VXMH4L3OtgxTMXIO64E.cache +0 -0
  146. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/RdOhmz4a9IXNXAq_JDEsmGkhBcqCHjE-TrYY0TuXKcE.cache +0 -0
  147. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/S1PivaNFawelFjnmH0FnwvNqCUqB6hpN3PfZ6UZgr7Q.cache +1 -0
  148. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/SUO0pOjSacw1MehqL-uFms4tmim8XvMqjZX2dwVFRB0.cache +0 -0
  149. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/SdbSUE2iq3c5MJK8lw2ILJY8Y6jrBDvdl3DEJaPee5I.cache +0 -0
  150. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/T-ryfC01VPWQMRmd1LjtTHt7ySfnOu6mhr-oCpXIH3k.cache +1 -0
  151. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/T7z527JBZtBmyN7L8TmAmi-yLQgCv1jSpRX454pn1no.cache +0 -0
  152. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/TJaYWHALCAo41xoR7iUALAvdbjCKGrrdo6XfL4oMADY.cache +1 -0
  153. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/TOUQkNZACmIqM2aaB31Tc3A7n6RB40E2uxnU4sRtgtA.cache +1 -0
  154. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/TioCv1rcY3rKmAbAQh_uAkI_HdcgYTde4A3xzFHUhec.cache +1 -0
  155. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/UJ1g7gZhpf0NzSHgO9YORzMaZc1o1JnUNVbtCVNrCOs.cache +1 -0
  156. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/UREjRSE4FtfJ8oLE3XlMHO7XDiXPF4npcD8Mu6fb1Nw.cache +3 -0
  157. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/UqaeZyoPtWXuMo-uv-TwznoWQCGo-AwHO61HtdJm46Y.cache +0 -0
  158. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/V4y_VwMrvIOrtk46HTsAJ2VBmeYlAbYIwzA6C-5_-mM.cache +0 -0
  159. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/VMYOr-P28T7uLDd6psr1lrAZFTyiZX_x8okSf2eBSy8.cache +0 -0
  160. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/VPbbyxpjGwpPubVqeL7Yw8cN1Q-lAnCYYyibl6ynDjc.cache +1 -0
  161. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/VgQcvFtqYGDvZdYQYaGGKdmIPQBtleLpWo2vYW9WXOI.cache +2 -0
  162. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/Vtm4P6joFaIQJulmA9kk5koqQc67nwlVNz31TeXROfo.cache +2 -0
  163. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/WDLtVqsTwhrIitEVPGjqVlEGVIxx1ggcBupfSrApP0c.cache +1 -0
  164. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/X3WyHJ-ZJGmO3lM7qHo-pdYStNdKQ4Knl6zvxSgeOcc.cache +0 -0
  165. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/XH2xCR82erPt2uXD-lbA02Tp9U71JR-e9rQdog0pRIY.cache +1 -0
  166. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/Y-_h6jGIGVTJtZSvyS6fANLACrl-m3WVnMomVDENGuI.cache +1 -0
  167. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/YF6jtYkSzf630l-hXlaN0qX76w3sgapgZj5nXN88rnw.cache +3 -0
  168. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/YHvDdEuZhvl6_AsWhMLxo5LkyfiOjnenGX8PCO1Ykd4.cache +1 -0
  169. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/Ycl1W3bSHE9zjTulbRUpNUxuCs_Ftm2DUbWVDtgsYN8.cache +2 -0
  170. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/YyXbluihycr-JsL-_oef5wByg7zcKNtIR-DUswxDswo.cache +1 -0
  171. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/Zk5gWfebX72f8NdUBUCHE2SVwKvjLU1jTXY_mZuqkYI.cache +0 -0
  172. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/ZkzgZAc5oo5rx9kltxEvkM_ViUyjr1LKsH7lrYcoV48.cache +1 -0
  173. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/_Lu1XYWqZx6MsRmPL-MOi6sHlEg_g11-iKtf8JBDdr8.cache +1 -0
  174. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/_Nb1U0I-n82rc9Pwd2qMJXuL9Wkn5qlV4mC1Ud6ikj4.cache +1 -0
  175. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/_QE7HINNqiWAEHBSxydiBY-c5yYDSNhx1AHtytjVkos.cache +0 -0
  176. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/_mxDPJ2y8cJgpgqMgPvdXsFCFVqug6HSs9R-T739diM.cache +1 -0
  177. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/_rw2s46VzILFWqa4gPD6AYo_RqLmPfQFCWYqYr5DgcA.cache +0 -0
  178. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/aAMwXVMthBPsleeqieBnyAavwsI1w8IrYQS26rmHZQk.cache +1 -0
  179. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/aU-srtEIeuhft3P34XNmil6_3cWMT3dbDCk6Mvf3v5s.cache +1 -0
  180. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/aaKrJ450YBrn3N7on5RzuwGJBRSYXCLhPkQtfQsBqYE.cache +1 -0
  181. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/axzFWEMnqovcg5LtJ_dcbw3FBmBITR-q0xH8NWYU_go.cache +1 -0
  182. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/b7E-diodANePNuqym4DVNGh0BiszsuQfPvI6_gAm_Ag.cache +1 -0
  183. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/bCtmHD0AL8eRgix_TYEdj9i1hZeifzTnmlIJhQys19w.cache +0 -0
  184. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/bD3UL88a88S4Bmc4HP63UbKIG86InCVaeGiy1FWw-PU.cache +1 -0
  185. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/bFUR2Omf2G6NcLw3wKr0JmCvH5lgF9ntzuxF4GLBk80.cache +1 -0
  186. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/btkJezvRlgIM9G0VYB97XUfaNeWHzdWScOnldlAEHLA.cache +0 -0
  187. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/cNvHu4em4H9CNeEFoz2lOObbbsvXAQszojzu0s1kp1s.cache +1 -0
  188. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/cRMBsxC60IDlza6IDT9cO2HzPQJOxTUqMglR5fwq4sU.cache +0 -0
  189. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/cbAiNkExRCpgYNOmJNYuMWICW7wKt2_eS9YjVuUYlGY.cache +1 -0
  190. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/cyYEgXu1E5u1b74wuQ3kijGfNe0TVcxhOu3-nx4U8-U.cache +1 -0
  191. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/dRu_cnaSrPLKMVLtgBN4DtIKznTzrGLl16lORVaJVbc.cache +0 -0
  192. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/dTNn4pAZIhhw36SXghp5474OOZOv21bGCD2nq6ua7kc.cache +0 -0
  193. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/e-arvbPaFkeZ9B7o-onbdguRbQqFQpuZNH7nLAUJqGQ.cache +0 -0
  194. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/eAigv8xMpEekwOdypxuClq-KRm1wpu8sl5_SpSTborY.cache +1 -0
  195. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/eHTNaWizKMR3YaAJTyeN3V43u14wi5OmY_ixp1Y1RiU.cache +1 -0
  196. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/eRN_1hdGyKxqn8_HbOjTkDW25vhRrlcwlG1HKxb3GA4.cache +0 -0
  197. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/eV_tYWcj9O3zgRpVqaUQ1HlTUNTyDxESczL4VC-LdZo.cache +1 -0
  198. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/eeMztePKGLtZFBrb_559lHbTbJwtY42ND-gSmbl3LOE.cache +1 -0
  199. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/er0IRVU2U_khvRMijMVgOG6q17Z-GbwAE_VsSIEkTp4.cache +0 -0
  200. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/fK8xKwPwmbU37gxgXP1VN0cY9g0xm_mrS3oj-UWaRiU.cache +1 -0
  201. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/fVFpKVXbA25ytjL6Zp23HmLBiDlBxfN1qbP_D8AIqSw.cache +1 -0
  202. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/fjJQqpcEfELzcB6V0ieXnjY2zc_Yse1-2XWK8pbSqr8.cache +0 -0
  203. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/fp1l3wDEsUPdtcpANzFUctJKuoRkytb7R3sLaduwdfY.cache +1 -0
  204. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/g4hY1cd1DWJ88Oe3aHZQmIbRu4l06GPtJJpuzs2vQJY.cache +0 -0
  205. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/g6XXikpWMmBuQ28xYipvnbvnje47mfJUk4d32D-ZG4c.cache +1 -0
  206. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/g7WrKVzpLP4dUi9WyFy2Ix82q4wAjG4hrc1HdGUsIFM.cache +1 -0
  207. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/gUBr9oHx7e5vnIZCL8lBaQnn2rWy2IiTOIEGxP_qMDo.cache +1 -0
  208. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/gf4Eb4r2dW7JADD_n8ZYWxBDnJCCH9RMcQl00DveQfM.cache +1 -0
  209. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/gfyR7hpkb1WAryrJNQXDGVomJ9p_Ur5knGixbzGrOog.cache +1 -0
  210. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/gucXNG3Sosc088-cVctx503X048SFjf3zMhp5_Jd_wE.cache +2 -0
  211. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/hDe_nkZTEwkMOSzjHj050TqzKzwk9BnpuUPWlyO0EmE.cache +1 -0
  212. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/hKwY0whr7_oldglWvPWsvRjVXYujLyEoWWpBaI-FbRA.cache +0 -0
  213. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/hZi1k6tpxxCGYxRe7zY74ItcOI8gZrREOpGuA8JSpGg.cache +2 -0
  214. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/iIMOCpAcBPM3jCjb3JTM6Wnr2JfpVsdlzqhSJcyjvm0.cache +1 -0
  215. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/iZVQRrkdYA-2EK1p4IcEttC47bzph4qgevoFZg6ZxZc.cache +1 -0
  216. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/i_to4G0G_oLDWXN1hTi6VV-pguaAkfSN87vC3IvX7Z0.cache +0 -0
  217. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/jZOzxGdjMmjfn9s2GVPXUpU8_zR5o-SNhXn5P8bDLNg.cache +1 -0
  218. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/juBb11YuRIjdAwD4-1KZKO0U73RUzPucELyppe4LOqo.cache +0 -0
  219. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/kAfX40y33x5c6YJ0MQLW1xinOEilSdxEDPja9ZQz5Ok.cache +0 -0
  220. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/kDg0fD2pfL8G1V6VG1ZTMLV8DD6ocdy-pPrKheEAT_s.cache +1 -0
  221. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/kIjU1tm15Jx_3pXXRvrgh10bAoafj3dDEbIBM4LbdNY.cache +1 -0
  222. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/kLIrMBvxyPY6fxho7jns90Rc34SdZKG2kXuywK85B_c.cache +0 -0
  223. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/kbKj8cRyZ07pnaBlzjTeMCjz4pH86Rk90E2AfaZiXdk.cache +1 -0
  224. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/lSLUB0PJ--GOjV3s6Vui9LykagBC2jw30Qdkm3pLk5U.cache +1 -0
  225. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/lkW2cnYDnK6G8lSR_pC5ILL9kG3sNWOt5w7m_3JwJ7k.cache +1 -0
  226. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/lqEnb92B-ANq_ZPdfvowQCSb2IX0cChwZEx0H4a9VXE.cache +1 -0
  227. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/lv4WYFQHEw-HlKvIPwc1RtT0fM3Bfdc1Zrc_Vp7wN3c.cache +0 -0
  228. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/m4mPhmupn7kj6Osamqa-49rvE3c6geAnJ8GucWdM1gE.cache +97 -0
  229. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/m9FCb3sWtW32btaTzfVN0S-Sb42UVrIblwXAQP91dyM.cache +1 -0
  230. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/mLS9Yp_-EA9f3B0LdE1btwL2RrtL8x85w7MNmlGHubA.cache +1 -0
  231. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/mW4iWNEi6BN-Zt7xgfxUR-qUCHS4YEc4SqSTd1DiPrg.cache +1 -0
  232. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/mn4P1ss9trYWr1QdxzxUAb5A9n0gvGiYGDWpYi-sJlE.cache +0 -0
  233. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/nMB9Uk_N5Gc43z8ElSLE0v1izew9E0M9U-Mp7l_Js_E.cache +1 -0
  234. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/n_0JCDAdx-Y1VFi9BY1Xt9_6aXJzdf0gwq1JEzB9K7c.cache +0 -0
  235. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/ng7kpSWAAo5my5jbvNQKHqrfAbCo_gyrDNELtrjxnw0.cache +1 -0
  236. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/oIaF-n7uYcXkx0lCV5y1Mv2JY6RRNFoB8v1Y9vufb3k.cache +2 -0
  237. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/p-uzj3SHmGWpYQX6fzTHc4VZ0ykWujHIPuuCFFwPong.cache +1 -0
  238. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/pEhaat2KBd5SrT7szC_8R1_6hK17FTpvoRFkmCRSD3M.cache +2 -0
  239. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/pMCYAjtPyFtbKFn-p3QblcflmvaG0k6urng9hbxLwNc.cache +0 -0
  240. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/pfn94KX3naIgb5CWjfrBgHzPB7EIVX66pSOuHlq8TkY.cache +0 -0
  241. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/ph17nHPguZgYv0qjLjMq7Gnd_tR40PvlfBCNuD5S1kA.cache +97 -0
  242. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/qMXNmgety4YRTlGVx864sRot9befOEvrHTudcpwdR5g.cache +1 -0
  243. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/qa2DSDx2tZUMd3CdfH4LA3fMfMEyfTNHLY-Q0vHvp8U.cache +1 -0
  244. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/rhxK59rrB67ynokQoxFeoWzBfVRujzwDjvLSD1UShB0.cache +1 -0
  245. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/sYkFmQdzKBPi5ghxf3ACAbIrcBcPCG47HlhsPa0DGiw.cache +1 -0
  246. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/tBBb6EHZ17CdPorvaw9HA5Isp5emKHyv4w6dVYNeA64.cache +0 -0
  247. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/ttqajwO8HhrZ3Fa6huTMcLeXhAoRC3ROR4ZoHdq_51s.cache +0 -0
  248. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/u3zehXrT4vrHpY9Na0G4uGcHpd26EmsR69bbOT57PJQ.cache +1 -0
  249. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/uni5BDM9xZKnI84Ml1sSGDSMCW5pLxHZgBgdyB4Aups.cache +0 -0
  250. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/uqVUgjcVwnNAtF1kmjqY0cu8LXrdoJZ0pahd0Rsk_QE.cache +0 -0
  251. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/vIZuweF69AMLh4zZp2t4TM3kYZ5NkNL0XT7RsY-ts0E.cache +1 -0
  252. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/vidGRiYTk3QPfWWADiWuFo28IBg_5uJh7tQTMB7GWT8.cache +0 -0
  253. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/vpBHN9aoEUGl1kH1GVx2kbXKNFIm7p-uxa47H3N3h94.cache +0 -0
  254. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/w5zybg8qAtXTOtdbHKxpl3HnI2ohml4BfJ_q2zuj0SQ.cache +1 -0
  255. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/wGGGcuFWnjoSVpTUFjeSXxfHFi4_deeSD9B2JxVUDH4.cache +1 -0
  256. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/wejJn1Ta6jmcF_Ni4fmiaMmuaSwlwCsQsini15GWNrA.cache +1 -0
  257. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/wpBd-Le6tc4Aw2sxW1XgmGtLkbKshvAvlF2ksL_CznQ.cache +2 -0
  258. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/wwMIRrXQ9sGUjiTA5m5uUOUUKFDXcZTMwJgltzo2k7Y.cache +1 -0
  259. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/xdK6V43TFhV2h7UcTH5epqOvX_n8lWYjlm3fgvk51Ks.cache +2 -0
  260. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/xgsXc2QY67gybXOWtv_F1wGodqa0hEWG4NpoEY6C3xQ.cache +0 -0
  261. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/xguGNc7W4NMTgZjVlR5c-x2sbNDVt1A3L20Cn09l9Bw.cache +1 -0
  262. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/yjm041vwlqdXxKwRYd4bk1owgJq0XrdLsbYFANOyXXY.cache +1 -0
  263. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/z2cf2QPxjU-LDQstaaPQ-uLVFSuNhor0whlHNePP6kg.cache +0 -0
  264. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/zL8TZx4Q6zXK9n1l5tEdlYbx-EV3w1JSN9XsylkfLqU.cache +1 -0
  265. data/test/features/can_crud_test.rb +74 -0
  266. data/test/helpers/mongoid_sortable_tree_helper_test.rb +77 -0
  267. data/test/mongoid_sortable_tree_test.rb +136 -0
  268. data/test/test_helper.rb +41 -0
  269. metadata +622 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 3d0d0b62424845c6976a125c591e60dc87865327
4
+ data.tar.gz: 6eac520710d71a3b356e068bb712ad8d1796d6a2
5
+ SHA512:
6
+ metadata.gz: b4a422a2285d2d69ea76edbb8fc2b03b96014e1424235442bf966474f6df3b49bb51b6e1624833eee1ddd3fd9f0c1d9fda543ee5189d810c93355447b26f0b47
7
+ data.tar.gz: dded03a1b34e41273b2bb303c230c18b13e4a8a66a5cc4e6cd17696c6f287180b354cca4b85ff2178f1d822a001bb383569053c6d6e2dffe6b53844f0e8d2bf2
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright 2015 Chun-Yu, Chen (Aloha Chen)
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,162 @@
1
+ #MongoidSortableTree
2
+
3
+ Mongoid_sortable_tree helps you build views for Mongoid-tree using jstree.
4
+
5
+ This gem is inspired by [the_sortable_tree](https://github.com/the-teacher/the_sortable_tree).
6
+
7
+ > This is my first gem, if there are any problems, please do not hesitate to contact me.
8
+
9
+ ## Table of contents
10
+
11
+ - [Setup](#setup)
12
+ - [What's Done](#demo)
13
+ - [Usage](#how-to-use)
14
+ - [TODO](#todo)
15
+ - [Аcknowledgment](#acknowledgment)
16
+ - [License](#license)
17
+
18
+
19
+ ## Setup
20
+
21
+ To install, add this line to your `Gemfile` and run `bundle install`:
22
+
23
+ ```ruby
24
+ gem 'mongoid_sortable_tree'
25
+ ```
26
+
27
+ Please make sure that you have:
28
+
29
+ ```ruby
30
+ gem "mongoid-tree"
31
+ gem "jstree-rails-4"
32
+ ```
33
+
34
+ ## Demo
35
+
36
+ ![Drag and Drop GUI](https://dl.dropboxusercontent.com/u/22307926/Blog%20Image/mongoid_sortable_tree/Mongoid_Srotable_Tree_example.png)
37
+
38
+ ## How to Use
39
+
40
+ ### Add these lines to your `app/assets/javascripts/application.js`
41
+
42
+ ```ruby
43
+ //= require jquery
44
+ //= require jquery_ujs
45
+ //= require jstree
46
+ //= require mongoid_sortable_tree
47
+ ```
48
+
49
+ ### Add these lines to your `app/assets/stylesheets/application.css`
50
+
51
+ ref: [jstree-rails-4](https://github.com/kesha-antonov/jstree-rails-4)
52
+
53
+ ```ruby
54
+ *= require jstree-default
55
+
56
+ # or
57
+
58
+ *= require jstree-default-dark
59
+ ```
60
+
61
+ ### In Model
62
+
63
+ Assume that you have a model `app/models/tag.rb`
64
+
65
+ ```ruby
66
+ class Tag
67
+ include Mongoid::Document
68
+ include MongoidSortableTree::Tree
69
+ end
70
+ ```
71
+
72
+ after include `MongoidSortableTree::Tree`, you now support these fields and mongoid-tree's methods.
73
+
74
+ ```ruby
75
+ include Mongoid::Tree
76
+ include Mongoid::Tree::Ordering
77
+ include Mongoid::Tree::Traversal
78
+ field :text, :type => String
79
+ field :icon, :type => String
80
+ field :li_attr, :type => String
81
+ field :a_attr, :type => String
82
+ ```
83
+
84
+ ### In Controller
85
+
86
+ Assume that you will use controller `app/controllers/tags_controller.rb`
87
+
88
+ ```ruby
89
+ class TagsController < ApplicationController
90
+ include MongoidSortableTreeController::CRUD
91
+ def index
92
+ @tags = Tag.all
93
+ end
94
+ end
95
+ ```
96
+
97
+ ### In View
98
+
99
+ Assume that you will show tree GUI in `index.html.slim`
100
+
101
+ ```ruby
102
+ #mongoid-sorable-js-tree
103
+ = build_server_tree @tags
104
+ ```
105
+
106
+ ### In Route
107
+
108
+ Add these lines to `config/routes.rb`
109
+
110
+ ```ruby
111
+ resources :tags do
112
+ collection do
113
+ get 'check'
114
+ end
115
+ end
116
+ ```
117
+
118
+ ### Finally, initialize your view for jstree using helper
119
+
120
+ Assume that you have `app/assets/javascripts/tags.js`
121
+
122
+ ```ruby
123
+ $(document).on('ready page:load', function() {
124
+ jstree_helper.init('#mongoid-sorable-js-tree');
125
+ });
126
+ ```
127
+
128
+ ## Todo
129
+
130
+ - Support [Json Data](https://www.jstree.com/docs/json) View
131
+ - More customization supports
132
+ - Travis CI、codeclimate ...etc
133
+
134
+
135
+ ## Acknowledgment
136
+
137
+ 1. [the-teacher/the_sortable_tree](https://github.com/the-teacher/the_sortable_tree)
138
+ 2. [jsTree](https://www.jstree.com/)
139
+ 3. [benedikt/mongoid-tree](https://github.com/benedikt/mongoid-tree)
140
+
141
+ ## License
142
+
143
+ Copyright 2015 Chun-Yu, Chen (Aloha Chen)
144
+
145
+ Permission is hereby granted, free of charge, to any person obtaining
146
+ a copy of this software and associated documentation files (the
147
+ "Software"), to deal in the Software without restriction, including
148
+ without limitation the rights to use, copy, modify, merge, publish,
149
+ distribute, sublicense, and/or sell copies of the Software, and to
150
+ permit persons to whom the Software is furnished to do so, subject to
151
+ the following conditions:
152
+
153
+ The above copyright notice and this permission notice shall be
154
+ included in all copies or substantial portions of the Software.
155
+
156
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
157
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
158
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
159
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
160
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
161
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
162
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/Rakefile ADDED
@@ -0,0 +1,35 @@
1
+ begin
2
+ require 'bundler/setup'
3
+ rescue LoadError
4
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
5
+ end
6
+
7
+ require 'rdoc/task'
8
+
9
+ RDoc::Task.new(:rdoc) do |rdoc|
10
+ rdoc.rdoc_dir = 'rdoc'
11
+ rdoc.title = 'MongoidSortableTree'
12
+ rdoc.options << '--line-numbers'
13
+ rdoc.rdoc_files.include('README.rdoc')
14
+ rdoc.rdoc_files.include('lib/**/*.rb')
15
+ end
16
+
17
+
18
+
19
+ load 'rails/tasks/statistics.rake'
20
+
21
+
22
+
23
+ Bundler::GemHelper.install_tasks
24
+
25
+ require 'rake/testtask'
26
+
27
+ Rake::TestTask.new(:test) do |t|
28
+ t.libs << 'lib'
29
+ t.libs << 'test'
30
+ t.pattern = 'test/**/*_test.rb'
31
+ t.verbose = false
32
+ end
33
+
34
+
35
+ task default: :test
@@ -0,0 +1,73 @@
1
+ jQuery ->
2
+ jstree_helper = window.jstree_helper
3
+ if !jstree_helper
4
+ jstree_helper = window.jstree_helper =
5
+ default_setting:
6
+ update_url: '/tags'
7
+ create_url: '/tags'
8
+ show_url: '/tags'
9
+ destroy_url: '/tags'
10
+ index_url: '/tags'
11
+ check_url: '/tags/check'
12
+
13
+ mregeSettings: (optsArr) ->
14
+ setting = @default_setting
15
+ optsArr = if typeof optsArr != 'undefined' then [optsArr] else []
16
+ idx = 0
17
+ len = optsArr.length
18
+ curr = undefined
19
+ key = undefined
20
+ while idx < len
21
+ curr = optsArr[idx]
22
+ for key of curr
23
+ k = key
24
+ setting[k] = curr[k]
25
+ idx++
26
+ setting
27
+
28
+ create: (parent_id,text) ->
29
+ $.ajax
30
+ url: @default_setting.create_url
31
+ data: { "text": data, "parent_id": parent_id}
32
+ type: 'POST'
33
+
34
+ init: (target,args) ->
35
+ settings = @mregeSettings(args)
36
+ $(target).jstree
37
+ 'core':
38
+ 'animation': 0
39
+ 'check_callback': (operation,node,node_parent,info) ->
40
+ if this.get_buffer().mode == 'copy_node'
41
+ operation = 'copy_node'
42
+ $.when(
43
+ $.ajax
44
+ url: settings.check_url
45
+ data: { "operation": operation, "node": node, "node_parent": node_parent, "info": info}
46
+ type: 'GET'
47
+ target: target
48
+ node: node
49
+ node_parent: node_parent
50
+ ).then((data, textStatus, jqXHR) ->
51
+ if textStatus == 'success'
52
+ if data.operation == 'create_node'
53
+ new_node_id = $('#'+this.node_parent.id).find("input[value='"+this.node.text+"']").closest('li').attr('id')
54
+ $.jstree.reference(this.target).set_id(new_node_id,data.id)
55
+ if data.operation == 'copy_node'
56
+ location.reload()
57
+ # new_node_id = $('#'+this.node_parent.id).find("a:contains('"+ this.node.text+"')").closest('li').attr('id')
58
+ # $.jstree.reference(this.target).set_id(new_node_id,data.id)
59
+ true
60
+ ).fail ->
61
+ $.jstree.reference(this.target).refresh()
62
+ false
63
+ 'themes': 'stripes': true
64
+ 'dnd':
65
+ 'check_while_dragging': false
66
+ 'plugins': [
67
+ 'contextmenu'
68
+ 'dnd'
69
+ 'search'
70
+ 'state'
71
+ 'wholerow'
72
+ 'changed'
73
+ ]
@@ -0,0 +1,97 @@
1
+ module MongoidSortableTreeController
2
+ # include MongoidSortableTreeController::CRUD
3
+
4
+ module DefineVariablesMethod
5
+ public
6
+ def the_define_common_variables
7
+ collection = self.class.to_s.split(':').last.sub(/Controller/,'').underscore.downcase # 'recipes'
8
+ collection = self.respond_to?(:sortable_collection) ? self.sortable_collection : collection # 'recipes'
9
+ variable = collection.singularize # 'recipe'
10
+ klass = self.respond_to?(:sortable_model) ? self.sortable_model : variable.classify.constantize # Recipe
11
+ ["@#{variable}", collection, klass]
12
+ end
13
+ end
14
+
15
+ module CRUD
16
+ include DefineVariablesMethod
17
+ def check
18
+ operation = params[:operation]
19
+ node = params[:node]
20
+ node_parent = params[:node_parent]
21
+ info = params[:info]
22
+ return render(nothing: true, status: 406) unless operation && node && node_parent
23
+
24
+ variable, collection, klass = self.the_define_common_variables
25
+ # variable = self.instance_variable_set(variable, klass.find(id))
26
+
27
+ validation = self.send(operation.to_sym, node, node_parent, info)
28
+
29
+ return render json: {id: validation[:id], operation: operation, message: validation[:msg] }, status: validation[:status]
30
+ end
31
+ def create_node(node,node_parent,info)
32
+ variable, collection, klass = self.the_define_common_variables
33
+ variable = self.instance_variable_set(variable, klass.new(text: node[:text]))
34
+ variable.parent = klass.where(:id => node_parent[:id]).first
35
+ if variable.valid?
36
+ variable.save
37
+ return {id: variable.id.to_s, msg: 'created', status: 200}
38
+ else
39
+ return {id: variable.id.to_s, msg: variable.errors.full_messages, status: 406}
40
+ end
41
+ end
42
+
43
+ def rename_node(node,node_parent,info)
44
+ variable, collection, klass = self.the_define_common_variables
45
+ variable = self.instance_variable_set(variable, klass.where(:id => node[:id]).first)
46
+ if variable && variable.update_attributes(:text => info)
47
+ return {id: variable.id.to_s, msg: 'updated', status: 200}
48
+ else
49
+ return {id: variable.try(:id).to_s, msg: variable.try(:errors).try(:full_messages), status: 406}
50
+ end
51
+ end
52
+
53
+ def delete_node(node,node_parent,info)
54
+ variable, collection, klass = self.the_define_common_variables
55
+ variable = self.instance_variable_set(variable, klass.where(:id => node[:id]).first)
56
+ if variable && variable.destroy
57
+ return {id: variable.id.to_s, msg: 'deleted', status: 200}
58
+ else
59
+ return {id: variable.id.to_s, msg: variable.errors.full_messages, status: 406}
60
+ end
61
+ end
62
+
63
+ def move_node(node,node_parent,info)
64
+ variable, collection, klass = self.the_define_common_variables
65
+ variable = self.instance_variable_set(variable, klass.where(:id => node[:id]).first)
66
+ parent = klass.where(:id => node_parent[:id]).first
67
+ if variable && variable.update_attribute(:parent_id,parent.try(:id))
68
+ return {id: variable.id.to_s, msg: 'moved', status: 200}
69
+ else
70
+ return {id: variable.id.to_s, msg: variable.errors.full_messages, status: 406}
71
+ end
72
+ end
73
+
74
+ def copy_node(node,node_parent,info)
75
+ begin
76
+ variable, collection, klass = self.the_define_common_variables
77
+ variable = self.instance_variable_set(variable, klass.where(:id => node[:id]).first)
78
+ parent = klass.where(:id => node_parent[:id]).first
79
+ id_mapping = {}
80
+ variable.traverse(:breadth_first).each_with_index do |node,index|
81
+ copied_item = node.clone
82
+ id_mapping[node.id] = copied_item.id
83
+ if index == 0
84
+ copied_item.update_attribute(:parent_id,parent.try(:id))
85
+ elsif id_mapping[copied_item.parent_id]
86
+ copied_item.update_attribute(:parent_id,id_mapping[copied_item.parent_id])
87
+ end
88
+ end
89
+ return {id: id_mapping.keys.map(&:to_s), msg: 'cpoied', status: 200}
90
+ rescue => e
91
+ return {id: variable.id.to_s, msg: 'Failed to copy', status: 406}
92
+ end
93
+ end
94
+
95
+ end
96
+
97
+ end
@@ -0,0 +1,96 @@
1
+ module MongoidSortableTreeHelper
2
+ # Default renderers
3
+ TREE_RENDERERS = {
4
+ :sortable => RenderSortableTreeHelper
5
+ }
6
+
7
+
8
+ ###############################################
9
+ # Common Base Methods
10
+ ###############################################
11
+ def define_class_of_elements_of node
12
+ case
13
+ when node.is_a?(Array) then node.first.class.to_s.underscore.downcase
14
+ when node.nil? then 'tag'
15
+ else node.class.to_s.underscore.downcase
16
+ end
17
+ end
18
+
19
+ def build_tree_html tree, render_module, options = {}
20
+ render_module::Render::render_node(tree, options)
21
+ end
22
+
23
+ def build_server_tree(tree, options: {})
24
+ result = ''
25
+ tree = Array.wrap tree
26
+ opts = {
27
+ # base options
28
+ :type => :sortable, # tree type
29
+ :id => :id, # id field
30
+ :node => nil, # node
31
+ :title => :text, # title field
32
+ :li_attr => :li_attr,
33
+ :a_attr => :a_attr,
34
+ :root => false, # is it root node?
35
+ :level => 0, # recursion level
36
+ :boost => {}
37
+ }.merge!(options)
38
+
39
+ # Basic vars
40
+ root = opts[:root]
41
+ node = opts[:node]
42
+
43
+ # namespace prepare [Rails require]
44
+ opts[:namespace] = Array.wrap opts[:namespace]
45
+
46
+ # Module with **Render** class
47
+ opts[:render_module] = TREE_RENDERERS[opts[:type]] unless opts[:render_module]
48
+
49
+ opts[:klass] = define_class_of_elements_of(tree) unless opts[:klass]
50
+
51
+ if opts[:boost].empty?
52
+ tree.each do |item|
53
+ num = item.parent_id || 0
54
+ opts[:boost][num.to_s] = [] unless opts[:boost][num.to_s]
55
+ opts[:boost][num.to_s].push item
56
+ end
57
+ end
58
+
59
+ unless node
60
+ # RENDER ROOTS
61
+ roots = opts[:boost]['0']
62
+
63
+ # define roots, if it's need
64
+ if roots.nil? && !tree.empty?
65
+ min_parent_ids = tree.map(&:parent_ids).min { |x,y| x.size <=> y.size }
66
+ roots = tree.select{ |elem| elem.parent_ids == min_parent_ids }
67
+ end
68
+
69
+ # children rendering
70
+ if roots
71
+ roots.each do |root|
72
+ _opts = opts.merge({ :node => root, :root => true, :level => opts[:level].next, :boost => opts[:boost] })
73
+ result << build_server_tree(tree, options: _opts)
74
+ end
75
+ end
76
+ else
77
+ # RENDER NODE'S CHILDREN
78
+ children_res = ''
79
+ # has parent_id which mean it has children
80
+ children = opts[:boost][node.id.to_s]
81
+
82
+ opts.merge!({ :has_children => children.blank? })
83
+
84
+ unless children.nil?
85
+ children.each do |elem|
86
+ _opts = opts.merge({ :node => elem, :root => false, :level => opts[:level].next, :boost => opts[:boost] })
87
+ children_res << build_server_tree(tree, options: _opts)
88
+ end
89
+ end
90
+
91
+ result << build_tree_html(self, opts[:render_module], opts.merge({ :root => root, :node => node, :children => children_res }))
92
+ end
93
+ raw result
94
+ end
95
+
96
+ end
@@ -0,0 +1,36 @@
1
+ module RenderSortableTreeHelper
2
+ module Render
3
+ class << self
4
+ attr_accessor :helper, :options
5
+
6
+ def render_node(helper, options)
7
+ @helper, @options = helper, options
8
+ node = options[:node]
9
+ id_field = options[:id]
10
+ li_attr_field = options[:li_attr]
11
+ "
12
+ <ul>
13
+ <li id='#{ node.send(id_field) }' #{node.send(li_attr_field)} >
14
+ #{ show_link }
15
+ #{ children }
16
+ </li>
17
+ </ul>
18
+ "
19
+ end
20
+
21
+ def show_link
22
+ node = options[:node]
23
+ title_field = options[:title]
24
+ a_attr_field = options[:a_attr]
25
+ "<a #{node.send(a_attr_field)}>#{node.send(title_field)}</a>"
26
+ end
27
+
28
+ def children
29
+ unless options[:children].blank?
30
+ options[:children]
31
+ end
32
+ end
33
+
34
+ end
35
+ end
36
+ end
data/config/routes.rb ADDED
@@ -0,0 +1,2 @@
1
+ Rails.application.routes.draw do
2
+ end
@@ -0,0 +1,7 @@
1
+ module MongoidSortableTree
2
+ class Engine < ::Rails::Engine
3
+ config.generators do |g|
4
+ g.fixture_replacement :factory_girl, dir: "test/test/factories"
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,3 @@
1
+ module MongoidSortableTree
2
+ VERSION = "0.0.2"
3
+ end
@@ -0,0 +1,57 @@
1
+ require "mongoid_sortable_tree/engine"
2
+
3
+ module MongoidSortableTree
4
+ module Tree
5
+ extend ActiveSupport::Concern
6
+ included do
7
+ include Mongoid::Tree
8
+ include Mongoid::Tree::Ordering
9
+ include Mongoid::Tree::Traversal
10
+ field :text, :type => String
11
+ field :icon, :type => String
12
+ field :li_attr, :type => String
13
+ field :a_attr, :type => String
14
+ index :text => 1
15
+ end
16
+
17
+ ##
18
+ # This module implements class methods that will be available
19
+ # on the document that includes MongoidSortableTree::Tree
20
+ module ClassMethods
21
+ def build_materialized_path(tailored_hierarchy_data: [], from_root: false, category_hierarchy: nil, klass: nil)
22
+ target = from_root ? (klass.nil? ? self.roots : klass.classify.constantize.roots) : category_hierarchy.children
23
+ target.each do |data|
24
+ custom_display_data = {
25
+ :id => data.id.to_s,
26
+ :text => data.text,
27
+ :icon => data.icon,
28
+ :li_attr => data.li_attr,
29
+ :a_attr => data.a_attr,
30
+ :klass => klass,
31
+ :children => build_materialized_path(category_hierarchy: data, klass: klass)
32
+ }
33
+ tailored_hierarchy_data << custom_display_data
34
+ end
35
+ tailored_hierarchy_data
36
+ end
37
+
38
+ def build_tree_from_root(options={})
39
+ build_materialized_path(from_root: true, klass: options[:klass])
40
+ end
41
+
42
+ def build_tree_from_node(node,options={})
43
+ return_array = []
44
+ custom_display_data = {
45
+ :id => node.id.to_s,
46
+ :text => node.text,
47
+ :icon => node.icon,
48
+ :li_attr => node.li_attr,
49
+ :a_attr => node.a_attr,
50
+ :klass => options[:klass],
51
+ :children => build_materialized_path(category_hierarchy: node, klass: options[:klass])
52
+ }
53
+ return_array << custom_display_data
54
+ end
55
+ end
56
+ end
57
+ end
@@ -0,0 +1,4 @@
1
+ # desc "Explaining what the task does"
2
+ # task :mongoid_sortable_tree do
3
+ # # Task goes here
4
+ # end
@@ -0,0 +1,28 @@
1
+ == README
2
+
3
+ This README would normally document whatever steps are necessary to get the
4
+ application up and running.
5
+
6
+ Things you may want to cover:
7
+
8
+ * Ruby version
9
+
10
+ * System dependencies
11
+
12
+ * Configuration
13
+
14
+ * Database creation
15
+
16
+ * Database initialization
17
+
18
+ * How to run the test suite
19
+
20
+ * Services (job queues, cache servers, search engines, etc.)
21
+
22
+ * Deployment instructions
23
+
24
+ * ...
25
+
26
+
27
+ Please feel free to use a different markup language if you do not plan to run
28
+ <tt>rake doc:app</tt>.
@@ -0,0 +1,6 @@
1
+ # Add your own tasks in files placed in lib/tasks ending in .rake,
2
+ # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
+
4
+ require File.expand_path('../config/application', __FILE__)
5
+
6
+ Rails.application.load_tasks
@@ -0,0 +1,17 @@
1
+ // This is a manifest file that'll be compiled into application.js, which will include all the files
2
+ // listed below.
3
+ //
4
+ // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
+ // or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
6
+ //
7
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
+ // compiled file.
9
+ //
10
+ // Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
11
+ // about supported directives.
12
+ //
13
+ //= require jquery
14
+ //= require jquery_ujs
15
+ //= require jstree
16
+ //= require mongoid_sortable_tree
17
+ //= require_tree .
@@ -0,0 +1,5 @@
1
+ // Place all the behaviors and hooks related to the matching controller here.
2
+ // All this logic will automatically be available in application.js.
3
+ $(document).on('ready page:load', function() {
4
+ return jstree_helper.init('#mongoid-sorable-js-tree');
5
+ });