iqvoc 4.4.0 → 4.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (375) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +10 -0
  3. data/app/assets/javascripts/framework.js +1 -2
  4. data/app/assets/javascripts/iqvoc/iqvoc.js +2 -15
  5. data/app/assets/javascripts/iqvoc/manifest.js +1 -0
  6. data/app/assets/javascripts/iqvoc/treeview.js +218 -0
  7. data/app/assets/stylesheets/framework.css.scss +0 -1
  8. data/app/assets/stylesheets/iqvoc/components/_components.css.scss +5 -6
  9. data/app/assets/stylesheets/iqvoc/components/_treeview.css.scss.erb +119 -0
  10. data/app/assets/stylesheets/iqvoc/manifest.css.scss +1 -0
  11. data/app/concerns/versioning.rb +60 -47
  12. data/app/controllers/concepts/hierarchical_controller.rb +14 -6
  13. data/app/controllers/concepts_controller.rb +72 -7
  14. data/app/helpers/application_helper.rb +5 -0
  15. data/app/helpers/concepts_helper.rb +2 -2
  16. data/app/models/concept/relation/base.rb +15 -5
  17. data/app/models/concept/skos/scheme.rb +10 -0
  18. data/app/views/concepts/hierarchical/_treeview.html.erb +22 -9
  19. data/app/views/concepts/hierarchical/index.html.erb +5 -1
  20. data/app/views/concepts/notifications/_referenced_concepts.html.erb +1 -1
  21. data/app/views/concepts/scheme/show.html.erb +1 -1
  22. data/app/views/concepts/sidebars/_plural.html.erb +8 -2
  23. data/app/views/imports/index.html.erb +7 -4
  24. data/app/views/partials/concept/relation/skos/_narrower.html.erb +5 -1
  25. data/app/views/user_sessions/_form.html.erb +1 -1
  26. data/config/database.yml +5 -10
  27. data/config/initializers/secret_token.rb +1 -1
  28. data/config/locales/de.yml +3 -0
  29. data/config/locales/en.yml +3 -0
  30. data/config/routes.rb +2 -0
  31. data/db/schema.rb +137 -137
  32. data/iqvoc.gemspec +2 -2
  33. data/lib/iqvoc/controller_extensions.rb +9 -0
  34. data/lib/iqvoc/version.rb +1 -1
  35. data/public/export/{10110.nt → 11675.nt} +0 -0
  36. data/public/export/{10528.nt → 12378.nt} +0 -0
  37. data/public/export/{11105.nt → 13928.nt} +0 -0
  38. data/public/export/{11353.nt → 14233.nt} +0 -0
  39. data/public/export/{11790.nt → 15471.nt} +0 -0
  40. data/public/export/{1385.nt → 16691.nt} +0 -0
  41. data/public/export/180238082990743925532091752298210254386.ttl +470 -0
  42. data/public/export/{15083.nt → 18316.nt} +0 -0
  43. data/public/export/{16538.nt → 18336.nt} +0 -0
  44. data/public/export/{1879.nt → 19728.nt} +0 -0
  45. data/public/export/{19834.nt → 20118.nt} +0 -0
  46. data/public/export/{21183.nt → 20817.nt} +0 -0
  47. data/public/export/{21512.nt → 21021.nt} +0 -0
  48. data/public/export/{22034.nt → 21039.nt} +0 -0
  49. data/public/export/{2434.nt → 21966.nt} +0 -0
  50. data/public/export/{24841.nt → 22148.nt} +0 -0
  51. data/public/export/{12931.nt → 25252.nt} +0 -0
  52. data/public/export/{26109.nt → 27018.nt} +0 -0
  53. data/public/export/{27784.nt → 27593.nt} +0 -0
  54. data/public/export/{28422.nt → 30422.nt} +0 -0
  55. data/public/export/{28627.nt → 31379.nt} +0 -0
  56. data/public/export/{29185.nt → 31999.nt} +0 -0
  57. data/public/export/{30124.nt → 32249.nt} +0 -0
  58. data/public/export/{31250.nt → 33102.nt} +0 -0
  59. data/public/export/{31272.nt → 35009.nt} +0 -0
  60. data/public/export/{31875.nt → 37470.nt} +0 -0
  61. data/public/export/{32197.nt → 38228.nt} +0 -0
  62. data/public/export/{3118.nt → 38776.nt} +0 -0
  63. data/public/export/{32223.nt → 4327.nt} +0 -0
  64. data/public/export/{32324.nt → 44072.nt} +0 -0
  65. data/public/export/{33084.nt → 44188.nt} +0 -0
  66. data/public/export/{33257.nt → 44373.nt} +0 -0
  67. data/public/export/{33545.nt → 45748.nt} +0 -0
  68. data/public/export/{34179.nt → 46455.nt} +0 -0
  69. data/public/export/{35271.nt → 46500.nt} +0 -0
  70. data/public/export/{36234.nt → 47766.nt} +0 -0
  71. data/public/export/{36363.nt → 47860.nt} +0 -0
  72. data/public/export/{36559.nt → 49334.nt} +0 -0
  73. data/public/export/{37333.nt → 5014.nt} +0 -0
  74. data/public/export/{38332.nt → 50228.nt} +0 -0
  75. data/public/export/{38461.nt → 51194.nt} +0 -0
  76. data/public/export/{38721.nt → 53315.nt} +0 -0
  77. data/public/export/{39469.nt → 53780.nt} +0 -0
  78. data/public/export/{40637.nt → 53933.nt} +0 -0
  79. data/public/export/{40746.nt → 54514.nt} +0 -0
  80. data/public/export/{4297.nt → 54628.nt} +0 -0
  81. data/public/export/{43236.nt → 5529.nt} +0 -0
  82. data/public/export/{43644.nt → 55499.nt} +0 -0
  83. data/public/export/{45021.nt → 56400.nt} +0 -0
  84. data/public/export/{45552.nt → 56918.nt} +0 -0
  85. data/public/export/{46172.nt → 56928.nt} +0 -0
  86. data/public/export/{46739.nt → 58349.nt} +0 -0
  87. data/public/export/{4929.nt → 58850.nt} +0 -0
  88. data/public/export/{50335.nt → 61125.nt} +0 -0
  89. data/public/export/{51428.nt → 64061.nt} +0 -0
  90. data/public/export/{51494.nt → 64176.nt} +0 -0
  91. data/public/export/{5359.nt → 64631.nt} +0 -0
  92. data/public/export/{53989.nt → 64716.nt} +0 -0
  93. data/public/export/{54563.nt → 64866.nt} +0 -0
  94. data/public/export/{54634.nt → 6956.nt} +0 -0
  95. data/public/export/iqvoc_dump-2014-05-21_10-57.ttl +457 -0
  96. data/public/export/iqvoc_dump-2014-05-21_10-58.nt +445 -0
  97. data/public/uploads/import/{01cb889ac483ce809435db5e37d01010.nt → 0a196a06d3070f1a3c8945543c7b50c9.nt} +0 -0
  98. data/public/uploads/import/{05c5e3cc92a18a3ce176065485caafeb.nt → 130dc4f9fa8abeb11ec1f6b58dcd328b.nt} +0 -0
  99. data/public/uploads/import/1326b6cb32770c5cda8307fb89ec95df.nt +260 -0
  100. data/public/uploads/import/{0d199979d7a157c89b517b0121f220de.nt → 16cc058f85d9d1f68d1d01dc1d828bfd.nt} +0 -0
  101. data/public/uploads/import/{1146b2566f01d412f53aefb921b8abf6.nt → 182c3304c71b88045df31677a33fae87.nt} +0 -0
  102. data/public/uploads/import/{12f08c2e20a05620666d39cabb148b90.nt → 19a09865f0f7f4b5f21b2e95b874a4ef.nt} +0 -0
  103. data/public/uploads/import/{136c72e86af49d44b885c609a97050e5.nt → 23825e7ae3e36cdcffa540b108d6162d.nt} +0 -0
  104. data/public/uploads/import/{1406b0ff2e1b68d38bdafe54a54e7981.nt → 28ae19af26643a34ca902ddd18ccbd6a.nt} +0 -0
  105. data/public/uploads/import/{142764b92a63f20feb0e6d1398517394.nt → 2b79db4bb7339fe5a572cf631f83c4b2.nt} +0 -0
  106. data/public/uploads/import/{1618cd8f36abb0d25d5cee9eef4162dd.nt → 30fac98c95c34b3711b4ab299b9aa0a7.nt} +0 -0
  107. data/public/uploads/import/{1838327ebac2c062a9036e0187d8c607.nt → 3a1d917725f09b076f16e7ca96afd740.nt} +0 -0
  108. data/public/uploads/import/{1be9a54bb74a467fbd6321190e10a23b.nt → 410b1af4b92ee575a5880a32e372ad4f.nt} +0 -0
  109. data/public/uploads/import/{0a539be7eb44e0aa1f4eebe485e67d32.nt → 420dd350f5f168db9819f5615e7771c0.nt} +0 -0
  110. data/public/uploads/import/{1eb3eabccf76ddb2a6bba92eac8b84b9.nt → 4370ea02aa094a56863382095c0e7187.nt} +0 -0
  111. data/public/uploads/import/{1f147a50c4203690ea4b1ac66f748537.nt → 45be2ea3017c3cb7e1d6b42e4020136e.nt} +0 -0
  112. data/public/uploads/import/{22be1db3763deeafb6e9bdc8af7de52f.nt → 46882dfcda4a4e3977f9a018d3cf66ce.nt} +0 -0
  113. data/public/uploads/import/{24ed4b1b10f4c9facb797d8055f3cc59.nt → 4c2125ce64bd257bf4b5dc7bb603d5dc.nt} +0 -0
  114. data/public/uploads/import/{25634d3f1c727c79e47104d45a169d22.nt → 555854f47dac3eb9cf211fd3becd8612.nt} +0 -0
  115. data/public/uploads/import/{0ceccdec88406d5de2f9c91d6c32bd63.nt → 58a9c7ca4d1538a8ada0f66aafaf291c.nt} +0 -0
  116. data/public/uploads/import/{25eb335ad83136428eedfd427409f5bb.nt → 58ae97ef1c7d1ed92caf54d6116a0d5b.nt} +0 -0
  117. data/public/uploads/import/{283e799cc2342cf33550a1668e760021.nt → 5a2e5f1e93cd5d27f3f5c1b9a9bbdce7.nt} +0 -0
  118. data/public/uploads/import/{28848fff43a56cba0924478a015e4c8e.nt → 5b9ba35d13ab6f57d341dfc6b862ec8e.nt} +0 -0
  119. data/public/uploads/import/{2b0de64784aa4f574c74bd7a5ca67e81.nt → 607cb5e807c6b40cca7a95f9ae755cf6.nt} +0 -0
  120. data/public/uploads/import/{2be31e7e2493319f9cb7e210eabb84b6.nt → 699f14f838ccc381ebd47c3c50fd4a3e.nt} +0 -0
  121. data/public/uploads/import/{3025f07688ed08e81c430eed8e5e2b2c.nt → 6a491b96f717e4e71eca8c4f03d45829.nt} +0 -0
  122. data/public/uploads/import/{3062df55d07d30a0db0b00fc59a066ef.nt → 6e2243068ebab9d2643b073916f95988.nt} +0 -0
  123. data/public/uploads/import/{35901d7daa6f90eb09b508eab2f19f97.nt → 7500be0de2d7d5a134d1196b45d44162.nt} +0 -0
  124. data/public/uploads/import/{3a39842a235c47d341390bb5ff76b013.nt → 7cc1fdc8146d7a7f4c62cd0fdb649665.nt} +0 -0
  125. data/public/uploads/import/{4217de34967f03696a2d1c4ec832b395.nt → 7ef390c5f24d4edcc052f4715670d9c7.nt} +0 -0
  126. data/public/uploads/import/{432a521429991340c75d39069672f200.nt → 8101cd106dc1e723a2598422d65cc52c.nt} +0 -0
  127. data/public/uploads/import/{0d1cb3a3c90c406735065c39ccf36882.nt → 8d131dd08127109c594d19309fb79569.nt} +0 -0
  128. data/public/uploads/import/{44f43bafabc21e6a080bb820b86c8efa.nt → 8ee3768e65e09cf20576270576e1449c.nt} +0 -0
  129. data/public/uploads/import/{4910bf38577bcef7ca835225a22d04cf.nt → 906595928ece6a9279bc8ffeadce250e.nt} +0 -0
  130. data/public/uploads/import/{4a1092bfdd2c3e6cd684d00f2ebb48a0.nt → 912725f40116f4a53c4029c33f43e5be.nt} +0 -0
  131. data/public/uploads/import/{4a924fe4d94485b794a0ac4ae2dbe7b2.nt → 932b712423b14c110fa43b3bad9f0aa9.nt} +0 -0
  132. data/public/uploads/import/{4d8c90b9e5b7a06e40dc9b426f19d762.nt → 970eda95c403ceb162943d694a83bc90.nt} +0 -0
  133. data/public/uploads/import/{503e198ce4ec0e311db1d06fc2b6962a.nt → 9764d02bf8bd44cc49111dff48fe471a.nt} +0 -0
  134. data/public/uploads/import/{51fcfdd1ba9e57f7afd8bfb3135b18be.nt → 97bc2cca1e89efa7046153293e826bc0.nt} +0 -0
  135. data/public/uploads/import/{525b24358e3b1a5afd18bbbe930bcb35.nt → 99a84702352ceab4b6c116294c459214.nt} +0 -0
  136. data/public/uploads/import/{542a2a3b0a62b9599922a67a5085c625.nt → 9abee9b0456c46ca0da883ee118840b3.nt} +0 -0
  137. data/public/uploads/import/{5572705385339b834e975f5d7f26f89a.nt → 9b9fb94bc6896028347510fb6c127258.nt} +0 -0
  138. data/public/uploads/import/{28a2a5974b1eed79e85d92046fe58d22.nt → a0ff7e4bc10cb30de16334f85a594ee6.nt} +0 -0
  139. data/public/uploads/import/{56aafaf5adcdd148722aeaf0b37a2ba3.nt → a21c2828241073241a23ff51783bb94a.nt} +0 -0
  140. data/public/uploads/import/{59b6122c9a524891ae8dadf34e04f925.nt → a24b5b72713423e964b73545bec1d38c.nt} +0 -0
  141. data/public/uploads/import/{5d4578b7bb3e3f2067f354be5b68d08f.nt → a30fa12f7c61642a94077b41a54cff93.nt} +0 -0
  142. data/public/uploads/import/a5a2ff38cd07078a3a8932bcf4e47fc4.nt +260 -0
  143. data/public/uploads/import/{296bea9c560bb915222cb892124c9bab.nt → a9e8888606ce487aca224f8f7b27e83a.nt} +0 -0
  144. data/public/uploads/import/{645eb1a598ae7003b45b29176587088b.nt → ade1b9fb83a3027bb40ac7d62a6d9ef9.nt} +0 -0
  145. data/public/uploads/import/{64cea1620f460841301aa57d23e6223c.nt → b8e2c68c1c5c850dc1147c8f19c6218f.nt} +0 -0
  146. data/public/uploads/import/{6bee752d1b71422389551999e1c29af9.nt → b9e012058e4c34e18ab8890203d4b013.nt} +0 -0
  147. data/public/uploads/import/{6c03e1aa271ca4613340130d16722850.nt → c63eb6926fdc889768f20ef082d43148.nt} +0 -0
  148. data/public/uploads/import/{6d829ce927bca0d0291d3ca94c87d47d.nt → c72f93d3a3330c8c87566ef93c616a99.nt} +0 -0
  149. data/public/uploads/import/{2ac22cf493b3991b6524e7bf7c9c9483.nt → c8966a0221ecbc33e827c285db50b731.nt} +0 -0
  150. data/public/uploads/import/{7019eec0ddbd6deccfa69f564e03007d.nt → c99ba72a7425eba3fadb2c1b0a460cd9.nt} +0 -0
  151. data/public/uploads/import/{70dcaf9bcb39a21172db26e20ef3abb1.nt → d2f5fe4de6c1ddc71187f0d13b07b088.nt} +0 -0
  152. data/public/uploads/import/{7c7f872865d77373f4e5d12d3b46c6d1.nt → d4caf6d797b1c0d4aea497aa4ca9a0e2.nt} +0 -0
  153. data/public/uploads/import/{7e2154e0fb9ecfa38d7d1791ba1f91e2.nt → db4eaaa2353dfe380b3ca1bd86506f7b.nt} +0 -0
  154. data/public/uploads/import/{7f5864cd2bb3608a478b6cacf213b6ef.nt → dfebb7929fbda930719a7e23f11db6ca.nt} +0 -0
  155. data/public/uploads/import/{7fd575d1e51e867294cc3c55dd7b86d3.nt → e6beda7fa6c2fa582581a1885d5e6922.nt} +0 -0
  156. data/public/uploads/import/{81e614eb844d0a6e07724df0e0a391af.nt → efbefa10108a047fc471d32a6b12b4f7.nt} +0 -0
  157. data/public/uploads/import/{2f7a5213d7e134237b69cbdc9c8e0985.nt → f0284471f4014e8fd5119852d4d4d679.nt} +0 -0
  158. data/public/uploads/import/{8635fc73b0ad52e5531f6542cf73aab0.nt → f5ecff98370466cafe19a5c8de986888.nt} +0 -0
  159. data/public/uploads/import/{87e8ab3b30135925cd296a4f105fdf28.nt → f9c20e1974cfb7f646caa7529bd40b18.nt} +0 -0
  160. data/public/uploads/import/{88f3ede5c716bcdc9ac4b16361f6014c.nt → ff8caa734bf94f7f7bb710d293433cc4.nt} +0 -0
  161. data/public/uploads/tmp/{1399391854-10068-6618 → 1400136441-8909-1864}/hobbies.nt +0 -0
  162. data/public/uploads/tmp/{1399391911-10213-8446 → 1400136457-8954-9980}/hobbies.nt +0 -0
  163. data/public/uploads/tmp/{1399392015-10496-2495 → 1400136538-9106-0637}/hobbies.nt +0 -0
  164. data/public/uploads/tmp/{1399465936-82819-2227 → 1400155776-22890-8133}/hobbies.nt +0 -0
  165. data/public/uploads/tmp/{1399562287-11058-4844 → 1400156580-24010-0098}/hobbies.nt +0 -0
  166. data/public/uploads/tmp/{1399562349-11220-5006 → 1400575004-53088-8128}/hobbies.nt +0 -0
  167. data/public/uploads/tmp/1400664724-92335-7096/hobbies.nt +260 -0
  168. data/public/uploads/tmp/1400664807-92408-6915/hobbies.nt +260 -0
  169. data/public/uploads/tmp/{1400683232-10539-5676 → 1400665873-95353-8270}/hobbies.nt +0 -0
  170. data/public/uploads/tmp/{1400683420-10634-8312 → 1400683850-3037-4034}/hobbies.nt +0 -0
  171. data/public/uploads/tmp/{1400683468-10666-6540 → 1400686016-3800-6238}/hobbies.nt +0 -0
  172. data/public/uploads/tmp/{1400684714-11424-9829 → 1400686448-4179-9946}/hobbies.nt +0 -0
  173. data/public/uploads/tmp/{1400846672-62648-9413 → 1400686559-4219-0427}/hobbies.nt +0 -0
  174. data/public/uploads/tmp/{1400846766-62697-7073 → 1400686598-4240-9258}/hobbies.nt +0 -0
  175. data/public/uploads/tmp/{1401180379-3162-2871 → 1400686723-4290-5978}/hobbies.nt +0 -0
  176. data/public/uploads/tmp/{1401185202-4377-2768 → 1401257122-7735-8414}/hobbies.nt +0 -0
  177. data/public/uploads/tmp/{1401192012-6573-2832 → 1401258388-8294-1832}/hobbies.nt +0 -0
  178. data/public/uploads/tmp/{1401194508-7699-9522 → 1401258461-8320-6936}/hobbies.nt +0 -0
  179. data/public/uploads/tmp/{1401194627-7742-0813 → 1401802495-9554-8946}/hobbies.nt +0 -0
  180. data/public/uploads/tmp/{1401194954-7841-9994 → 1401873631-14485-9619}/hobbies.nt +0 -0
  181. data/public/uploads/tmp/{1401195326-7932-3790 → 1401901913-25054-7929}/hobbies.nt +0 -0
  182. data/public/uploads/tmp/{1401206318-10643-2808 → 1401901971-25132-6654}/hobbies.nt +0 -0
  183. data/public/uploads/tmp/{1401292131-92601-6112 → 1401902595-26069-7978}/hobbies.nt +0 -0
  184. data/public/uploads/tmp/{1401292181-92670-8615 → 1401902753-26355-3620}/hobbies.nt +0 -0
  185. data/public/uploads/tmp/{1401292252-92839-0886 → 1401902841-26526-6201}/hobbies.nt +0 -0
  186. data/public/uploads/tmp/{1401292294-92900-5587 → 1401902924-26767-2345}/hobbies.nt +0 -0
  187. data/public/uploads/tmp/{1401292390-92976-9639 → 1401951168-31767-8671}/hobbies.nt +0 -0
  188. data/public/uploads/tmp/{1401701949-3140-4347 → 1402039970-20044-5832}/hobbies.nt +0 -0
  189. data/public/uploads/tmp/{1401702355-40904-9058 → 1402040206-20373-9283}/hobbies.nt +0 -0
  190. data/public/uploads/tmp/{1401702361-40926-1371 → 1402040781-21399-3672}/hobbies.nt +0 -0
  191. data/public/uploads/tmp/{1401702406-40992-5615 → 1402403722-54150-0143}/hobbies.nt +0 -0
  192. data/public/uploads/tmp/{1401702475-41050-2716 → 1402904030-3645-4762}/hobbies.nt +0 -0
  193. data/public/uploads/tmp/{1401702625-41136-3304 → 1402909552-7277-1590}/hobbies.nt +0 -0
  194. data/public/uploads/tmp/{1401702771-41202-1777 → 1403085398-22253-1966}/hobbies.nt +0 -0
  195. data/public/uploads/tmp/{1401704263-41803-0906 → 1403086253-23163-6328}/hobbies.nt +0 -0
  196. data/public/uploads/tmp/{1401704312-41845-2277 → 1403092843-25514-4894}/hobbies.nt +0 -0
  197. data/public/uploads/tmp/{1401704455-41906-3348 → 1403107450-31294-9405}/hobbies.nt +0 -0
  198. data/public/uploads/tmp/{1401704517-41941-3825 → 1403246567-40664-7567}/hobbies.nt +0 -0
  199. data/public/uploads/tmp/{1401704557-42078-2926 → 1403246819-40874-6180}/hobbies.nt +0 -0
  200. data/public/uploads/tmp/{1401704659-42140-2026 → 1403246926-40970-5820}/hobbies.nt +0 -0
  201. data/public/uploads/tmp/{1401704727-42194-2926 → 1403246969-41016-9015}/hobbies.nt +0 -0
  202. data/public/uploads/tmp/{1401704810-42233-0719 → 1403247007-41106-1107}/hobbies.nt +0 -0
  203. data/public/uploads/tmp/{1401704877-42346-6423 → 1405499354-16678-0536}/hobbies.nt +0 -0
  204. data/public/uploads/tmp/{1401704969-42396-2636 → 1405507965-18359-1136}/hobbies.nt +0 -0
  205. data/public/uploads/tmp/{1401706200-42741-9489 → 1405665751-36134-1680}/hobbies.nt +0 -0
  206. data/public/uploads/tmp/{1401706505-42885-6630 → 1405666008-36190-0640}/hobbies.nt +0 -0
  207. data/public/uploads/tmp/{1401706579-42925-3938 → 1405666068-36238-4803}/hobbies.nt +0 -0
  208. data/public/uploads/tmp/{1401706998-43068-7269 → 1405666124-36304-9496}/hobbies.nt +0 -0
  209. data/public/uploads/tmp/{1401707073-43147-4480 → 1405666623-36363-4960}/hobbies.nt +0 -0
  210. data/public/uploads/tmp/{1401707148-43190-8990 → 1405668160-53225-8420}/hobbies.nt +0 -0
  211. data/public/uploads/tmp/{1401707185-43233-6339 → 1405668259-53254-3943}/hobbies.nt +0 -0
  212. data/public/uploads/tmp/{1401707525-43306-5760 → 1405950788-70170-9817}/hobbies.nt +0 -0
  213. data/public/uploads/tmp/{1401716194-45552-4247 → 1406035464-78105-0726}/hobbies.nt +0 -0
  214. data/public/uploads/tmp/{1401716269-45634-6256 → 1406037081-78776-6363}/hobbies.nt +0 -0
  215. data/public/uploads/tmp/{1401716431-45713-6690 → 1406102345-80502-3431}/hobbies.nt +0 -0
  216. data/public/uploads/tmp/{1401717803-46392-3771 → 1406104079-81087-0096}/hobbies.nt +0 -0
  217. data/public/uploads/tmp/{1401717970-46482-3771 → 1406107061-82344-3430}/hobbies.nt +0 -0
  218. data/public/uploads/tmp/{1401719163-46906-3771 → 1406187436-86466-6421}/hobbies.nt +0 -0
  219. data/public/uploads/tmp/{1401719307-46967-3771 → 1406207261-97327-1775}/hobbies.nt +0 -0
  220. data/public/uploads/tmp/{1401719376-47013-3771 → 1406207477-97714-7976}/hobbies.nt +0 -0
  221. data/public/uploads/tmp/{1401719630-47114-3771 → 1406207785-98095-9895}/hobbies.nt +0 -0
  222. data/public/uploads/tmp/{1401719982-47199-3873 → 1406210125-425-7547}/hobbies.nt +0 -0
  223. data/test/controllers/concepts_controller_test.rb +219 -0
  224. data/test/controllers/hierarchy_test.rb +2 -2
  225. data/test/controllers/rdf_rendering_test.rb +0 -3
  226. data/test/integration/client_augmentation_test.rb +1 -1
  227. data/vendor/assets/javascripts/tree.jquery.js +3046 -0
  228. metadata +198 -331
  229. data/public/export/305768326302831570152374795088739069204.nt +0 -447
  230. data/public/export/34582.nt +0 -1
  231. data/public/export/35426.nt +0 -36
  232. data/public/export/45120.nt +0 -1
  233. data/public/export/51877.nt +0 -1
  234. data/public/export/54759.nt +0 -28
  235. data/public/export/54895.nt +0 -28
  236. data/public/export/55279.nt +0 -28
  237. data/public/export/5567.nt +0 -28
  238. data/public/export/57502.nt +0 -28
  239. data/public/export/58015.nt +0 -28
  240. data/public/export/58964.nt +0 -28
  241. data/public/export/60674.nt +0 -28
  242. data/public/export/61265.nt +0 -28
  243. data/public/export/61895.nt +0 -28
  244. data/public/export/62372.nt +0 -28
  245. data/public/export/62469.nt +0 -28
  246. data/public/export/62880.nt +0 -28
  247. data/public/export/63673.nt +0 -28
  248. data/public/export/64151.nt +0 -28
  249. data/public/export/64891.nt +0 -28
  250. data/public/export/7089.nt +0 -28
  251. data/public/export/7365.nt +0 -28
  252. data/public/export/7473.nt +0 -28
  253. data/public/export/7939.nt +0 -28
  254. data/public/export/8509.nt +0 -28
  255. data/public/export/9370.nt +0 -28
  256. data/public/export/9600.nt +0 -28
  257. data/public/uploads/import/35943ba240eb26dc43092746316a666a.nt +0 -260
  258. data/public/uploads/import/4410370b7349278a941ec73edc506afb.nt +0 -260
  259. data/public/uploads/import/4ab869eeeec7deaf5840548196350ffe.nt +0 -260
  260. data/public/uploads/import/4f884498309031e9a3b75c5d7c59b353.nt +0 -260
  261. data/public/uploads/import/7d630e4ae70fcdef7a26a5f54be1c87d.nt +0 -260
  262. data/public/uploads/import/8a09903d5ce62375eb315fb5a28cfb1e.nt +0 -259
  263. data/public/uploads/import/8dd67edd0888cc10c181b0cb13f114a5.nt +0 -260
  264. data/public/uploads/import/945e467cd3b86903a712322622403350.nt +0 -259
  265. data/public/uploads/import/947fc847742818ad2f8946150fa68280.nt +0 -259
  266. data/public/uploads/import/9668f439f7429886747a4981c53d2f7b.nt +0 -259
  267. data/public/uploads/import/97bf213b1827e1b3fe4a93f660cd297b.nt +0 -260
  268. data/public/uploads/import/9cc1c8c8530900bb42723b35a85c997a.nt +0 -260
  269. data/public/uploads/import/a34ebe5f52348d8e0690efbbd7dbb29b.nt +0 -259
  270. data/public/uploads/import/a6362a3aa7b0154ee5881aa4e97e4fc1.nt +0 -259
  271. data/public/uploads/import/acfb67a494ba87573b3cdd7997c7aba2.nt +0 -259
  272. data/public/uploads/import/ae888974bc1697ae1949a95dbcaa104b.nt +0 -259
  273. data/public/uploads/import/b238195b0159fd1aca793e33ea179b1d.nt +0 -259
  274. data/public/uploads/import/b36159aad53d09f5e6ca12e0dcea000c.nt +0 -259
  275. data/public/uploads/import/b42cf56722b79ef7e6730d19130d9dfd.nt +0 -259
  276. data/public/uploads/import/b54ffcb43a4c939b339fca358223177d.nt +0 -260
  277. data/public/uploads/import/bc140bce0ab1818edd55350b793eb36c.nt +0 -259
  278. data/public/uploads/import/bdfe458413c233f7c2e96041b8c2aa9d.nt +0 -259
  279. data/public/uploads/import/bf0168c5d5f472442707ff76115480b0.nt +0 -259
  280. data/public/uploads/import/c0479e6569a5cbd8fc74702c165f71b5.nt +0 -259
  281. data/public/uploads/import/c2c0372e27f625ca1ce1aa527059d6d2.nt +0 -259
  282. data/public/uploads/import/c43fbad62457debced3e2b5f175b633a.nt +0 -259
  283. data/public/uploads/import/c4d8f635e4bb5601713bbf9bc456c797.nt +0 -259
  284. data/public/uploads/import/c61960b982b3a8308e41de6cf094255d.nt +0 -259
  285. data/public/uploads/import/c63faf859a988775b27acb8e8712f13b.nt +0 -259
  286. data/public/uploads/import/cb1b6b27edfcc404ca469fa3ec6b0664.nt +0 -259
  287. data/public/uploads/import/cb37615bf36a26ecbfd6e0f738302d17.nt +0 -259
  288. data/public/uploads/import/d0369e2cb8216ddc3858a5ae93307da2.nt +0 -259
  289. data/public/uploads/import/d395b7bd9126c74ee3586b849768ef14.nt +0 -260
  290. data/public/uploads/import/d5d835b59eae82a208653c1b30ad74c9.nt +0 -259
  291. data/public/uploads/import/d82612b6c9d65e2f2dcfbda202b59a90.nt +0 -259
  292. data/public/uploads/import/df361efdd673094c731454a91d925850.nt +0 -259
  293. data/public/uploads/import/df66a381628757d745ae3b60642c3746.nt +0 -260
  294. data/public/uploads/import/e1c59deb5c9119a65787bc5c2d71d678.nt +0 -259
  295. data/public/uploads/import/e2242e8bc7216edacba54071db90e2f7.nt +0 -259
  296. data/public/uploads/import/e3d2d0b824f8c45aae697261a4dbe891.nt +0 -259
  297. data/public/uploads/import/e59bb2aced9152cc0c9a8b1be30bf7b0.nt +0 -259
  298. data/public/uploads/import/e9a6f6db0a5a7e13b6eb576a8f724347.nt +0 -259
  299. data/public/uploads/import/ea69b273df07fb624312cbf853c434f4.nt +0 -259
  300. data/public/uploads/import/eaa64a373eab2b1ccf3a0caf4b9a9b36.nt +0 -259
  301. data/public/uploads/import/eaec06e06215273b63df2bfbfcd1be1f.nt +0 -260
  302. data/public/uploads/import/ed37994c6a8c15cc9dfcc5f0fc98d25e.nt +0 -259
  303. data/public/uploads/import/ef8c5b07b56a2f5bfd0818d146b54ad0.nt +0 -259
  304. data/public/uploads/import/f02c74ffa5f9b0247ed608654d69afbe.nt +0 -260
  305. data/public/uploads/import/f19ecbe95745af34dc11c7ee3a185250.nt +0 -260
  306. data/public/uploads/import/f1f6bbcef457c577c6cf8a41c332ed52.nt +0 -259
  307. data/public/uploads/import/f24e1405527ac90b18fc4b9103b0356b.nt +0 -259
  308. data/public/uploads/import/f324628e42cd2165e0befb2dc9e19ec3.nt +0 -259
  309. data/public/uploads/import/f4f4b5eb4283efc264b2e29b728b45ce.nt +0 -259
  310. data/public/uploads/import/f6cda0379fadb6b9ed88b59b04d1544a.nt +0 -259
  311. data/public/uploads/import/f8eb5272e6cc4b691765b370685b634e.nt +0 -260
  312. data/public/uploads/import/f92c5202d53cf595d63051016ebe2aed.nt +0 -259
  313. data/public/uploads/import/f9948cb7e270f1582313d9d64a0013f4.nt +0 -259
  314. data/public/uploads/tmp/1399562606-12081-8172/hobbies.nt +0 -260
  315. data/public/uploads/tmp/1399562663-12419-6959/hobbies.nt +0 -260
  316. data/public/uploads/tmp/1399562758-12675-1044/hobbies.nt +0 -260
  317. data/public/uploads/tmp/1399563325-14184-4165/hobbies.nt +0 -260
  318. data/public/uploads/tmp/1399563511-14691-1597/hobbies.nt +0 -260
  319. data/public/uploads/tmp/1399563577-14899-9811/hobbies.nt +0 -260
  320. data/public/uploads/tmp/1399563654-15101-9704/hobbies.nt +0 -260
  321. data/public/uploads/tmp/1399563789-15465-3853/hobbies.nt +0 -260
  322. data/public/uploads/tmp/1399564038-16136-7758/hobbies.nt +0 -260
  323. data/public/uploads/tmp/1399564391-17273-4324/hobbies.nt +0 -260
  324. data/public/uploads/tmp/1399565011-19048-6725/hobbies.nt +0 -260
  325. data/public/uploads/tmp/1399565066-19204-6162/hobbies.nt +0 -260
  326. data/public/uploads/tmp/1399639727-33218-9866/hobbies.nt +0 -260
  327. data/public/uploads/tmp/1399642528-42021-8916/hobbies.nt +0 -260
  328. data/public/uploads/tmp/1399642763-42734-7348/hobbies.nt +0 -260
  329. data/public/uploads/tmp/1399886894-13606-2429/hobbies.nt +0 -260
  330. data/public/uploads/tmp/1401720178-47285-9163/hobbies.nt +0 -259
  331. data/public/uploads/tmp/1401720378-47376-3771/hobbies.nt +0 -259
  332. data/public/uploads/tmp/1401720550-47464-3771/hobbies.nt +0 -259
  333. data/public/uploads/tmp/1401720661-47532-3771/hobbies.nt +0 -259
  334. data/public/uploads/tmp/1401721032-47662-3771/hobbies.nt +0 -259
  335. data/public/uploads/tmp/1401721110-47707-3771/hobbies.nt +0 -259
  336. data/public/uploads/tmp/1401722057-48025-3771/hobbies.nt +0 -259
  337. data/public/uploads/tmp/1401722131-48079-3771/hobbies.nt +0 -259
  338. data/public/uploads/tmp/1401722177-48112-3771/hobbies.nt +0 -259
  339. data/public/uploads/tmp/1401722330-48176-3771/hobbies.nt +0 -259
  340. data/public/uploads/tmp/1401722430-48237-4227/hobbies.nt +0 -259
  341. data/public/uploads/tmp/1401722732-48343-4227/hobbies.nt +0 -259
  342. data/public/uploads/tmp/1401722909-48424-1412/hobbies.nt +0 -259
  343. data/public/uploads/tmp/1401723009-48482-7948/hobbies.nt +0 -259
  344. data/public/uploads/tmp/1401723431-48680-9071/hobbies.nt +0 -259
  345. data/public/uploads/tmp/1401724808-49229-3988/hobbies.nt +0 -259
  346. data/public/uploads/tmp/1401725005-49344-4227/hobbies.nt +0 -259
  347. data/public/uploads/tmp/1401801415-57643-7508/hobbies.nt +0 -259
  348. data/public/uploads/tmp/1401801470-57683-1511/hobbies.nt +0 -259
  349. data/public/uploads/tmp/1401801589-57766-6716/hobbies.nt +0 -259
  350. data/public/uploads/tmp/1401801648-57810-6653/hobbies.nt +0 -259
  351. data/public/uploads/tmp/1401801703-57902-1218/hobbies.nt +0 -259
  352. data/public/uploads/tmp/1401801780-57957-6963/hobbies.nt +0 -259
  353. data/public/uploads/tmp/1401801876-58010-6576/hobbies.nt +0 -259
  354. data/public/uploads/tmp/1401801925-58061-5018/hobbies.nt +0 -259
  355. data/public/uploads/tmp/1401801966-58088-4598/hobbies.nt +0 -259
  356. data/public/uploads/tmp/1401802064-58134-0309/hobbies.nt +0 -259
  357. data/public/uploads/tmp/1401802128-58183-5882/hobbies.nt +0 -259
  358. data/public/uploads/tmp/1401802254-58261-9292/hobbies.nt +0 -259
  359. data/public/uploads/tmp/1401802305-58305-0716/hobbies.nt +0 -259
  360. data/public/uploads/tmp/1401802559-58393-8087/hobbies.nt +0 -259
  361. data/public/uploads/tmp/1401802603-58429-5414/hobbies.nt +0 -259
  362. data/public/uploads/tmp/1401802704-58494-3176/hobbies.nt +0 -259
  363. data/public/uploads/tmp/1401876393-11719-7974/hobbies.nt +0 -259
  364. data/public/uploads/tmp/1401880994-13325-5134/hobbies.nt +0 -259
  365. data/public/uploads/tmp/1401881408-13497-2210/hobbies.nt +0 -259
  366. data/public/uploads/tmp/1402407940-72993-0117/hobbies.nt +0 -259
  367. data/public/uploads/tmp/1403276908-17566-3335/hobbies.nt +0 -259
  368. data/public/uploads/tmp/1403276972-17606-3705/hobbies.nt +0 -259
  369. data/public/uploads/tmp/1403277054-17662-2528/hobbies.nt +0 -259
  370. data/public/uploads/tmp/1405605924-28482-6761/hobbies.nt +0 -259
  371. data/public/uploads/tmp/1405606039-28627-4530/hobbies.nt +0 -259
  372. data/public/uploads/tmp/1405606796-29190-4080/hobbies.nt +0 -259
  373. data/vendor/assets/javascripts/jquery.treeview.async.js +0 -82
  374. data/vendor/assets/javascripts/jquery.treeview.js +0 -251
  375. data/vendor/assets/stylesheets/jquery.treeview.css.erb +0 -75
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 623d42ba4d2c0e1074415d733d13e055920a5b86
4
- data.tar.gz: 6d023b4d743db296457cc3d32a66dcda7432ccc1
3
+ metadata.gz: 99bea7894088f98e903840ee975f4ce1106657a5
4
+ data.tar.gz: 10c07f875139b1efc2abff513f12fd4e20385a1c
5
5
  SHA512:
6
- metadata.gz: 2a30ce65e733197799371f56014f3b030142b8c01579cf908641b4d78f31c7cffb7777d64eaa86e7dc73ba6ce0aa3ec23b5f90e8b07e51eb72fa7f9d3aa4111b
7
- data.tar.gz: fa250e9bc5deb981412982ea03d28e9582e095b6f58a31400dd4fc191ca50952a48b655da8eeaedf876cb56bb3a5ae24e392a84a513ae925e00ae83204699a2d
6
+ metadata.gz: 99cf4160a2ca89da8ed57c4654e7f64fadc02ced0d12b80abd89a6468ce7d51ac843c517b6426fd07448100e15abce4d050fd8db7cf7b05aa7861c7b6042166f
7
+ data.tar.gz: 0110104c182fcc86ba50df85efb666267ff2bcbaf0fcc4faf8e049926909572a3c60f6f48cba2aa3cb4d5d3234fdbc99842deaae3e1a59f6c551103c1d41c2a3
data/CHANGELOG.md CHANGED
@@ -1,3 +1,13 @@
1
+ ## [4.5.0]
2
+
3
+ 4.5.0 brings drag'n'drop concept editing capabilities and a new hierarchical
4
+ concept draft view. Browse your thesaurus an see where new concepts version
5
+ exists.
6
+
7
+ * Add hierarchical draft view with new concept versions
8
+ * Drag'n'Drop support for moving and copying concepts inside hierarchies
9
+ * Minor bugfixes
10
+
1
11
  ## [4.4.0]
2
12
 
3
13
  * [Asynchronous](https://github.com/innoq/iqvoc#background-jobs) SKOS exporter
@@ -2,8 +2,7 @@
2
2
  //= require rails
3
3
  //= require jquery-ui.custom
4
4
  //= require jquery-ui.datepicker-de
5
- //= require jquery.treeview
6
- //= require jquery.treeview.async
5
+ //= require tree.jquery.js
7
6
  //= require storage
8
7
  //= require bootstrap/transition
9
8
  //= require bootstrap/collapse
@@ -182,20 +182,7 @@ jQuery(document).ready(function($) {
182
182
  $("select.search_type").change();
183
183
 
184
184
  // hierarchical tree view
185
- $("ul.hybrid-treeview").each(function() {
186
- var url = $(this).attr("data-url"),
187
- container = this;
188
- $(this).treeview({
189
- collapsed: true,
190
- toggle: function() {
191
- var el = $(this);
192
- if(el.hasClass("hasChildren")) {
193
- var childList = el.removeClass("hasChildren").find("ul");
194
- $.fn.treeviewLoad({ url: url }, this.id, childList, container);
195
- }
196
- }
197
- });
198
- });
185
+ IQVOC.treeview("ul.hybrid-treeview");
199
186
 
200
187
  // unobtrusive tabs
201
188
  $(".tab-panels").addClass("tab-content"); // the latter is for Bootstrap Tabs
@@ -212,5 +199,5 @@ jQuery(document).ready(function($) {
212
199
  IQVOC.labelResolver();
213
200
  $(document.body).on("concept-label", function(ev, container) {
214
201
  IQVOC.labelResolver(container);
215
- })
202
+ });
216
203
  });
@@ -8,3 +8,4 @@
8
8
  //= require iqvoc/federated_concept_mapper
9
9
  //= require iqvoc/concept_mapping_manager
10
10
  //= require iqvoc/label_resolver
11
+ //= require iqvoc/treeview
@@ -0,0 +1,218 @@
1
+ /*jslint vars: true, browser: true, white: true */
2
+ /*global jQuery, IQVOC */
3
+
4
+ IQVOC.treeview = (function($) {
5
+
6
+ "use strict";
7
+
8
+ function Treeview(container) {
9
+ this.container = container.jquery ? container : $(container);
10
+
11
+ $(container).each(function() {
12
+ var url = $(this).data('url');
13
+ var container = this;
14
+
15
+ var dragabbleSupport = $(container).data('dragabble');
16
+ var polyhierarchySupport = $(container).data('polyhierarchy-support');
17
+ var saveLabel = $(container).data('save-label');
18
+ var copyLabel = $(container).data('copy-label');
19
+ var undoLabel = $(container).data('undo-label');
20
+
21
+ // build tree data from html markup
22
+ var data = $(this).children('li').map(function() {
23
+ var item = $(this);
24
+
25
+ return {
26
+ label: item.children('a').html(),
27
+ load_on_demand: item.data('has-children'),
28
+ id: item.attr('id'),
29
+ url: item.children('a').attr('href'),
30
+ update_url: item.data('update-url'),
31
+ published: item.data('published')
32
+ };
33
+ });
34
+
35
+ $(this).tree({
36
+ dragAndDrop: dragabbleSupport ? true : false,
37
+ autoEscape: false,
38
+ selectable: false,
39
+ closedIcon: $('<i class="fa fa-plus-square-o"></i>'),
40
+ openedIcon: $('<i class="fa fa-minus-square-o"></i>'),
41
+ data: data,
42
+ dataUrl: function(node) {
43
+ // build ajax url (add root param)
44
+ // FIXME: uggly url concatenation
45
+ if (url.indexOf('published') < 0) {
46
+ return node ? url + '?root=' + node.id : url;
47
+ }
48
+ else {
49
+ return node ? url + '&root=' + node.id : url;
50
+ }
51
+ },
52
+ onCreateLi: function(node, $li) {
53
+ // TODO: add additionalText if present
54
+ var link = $('<a href="' + node.url +'">' + node.name + '</a>');
55
+ $li.find('.jqtree-title').replaceWith(link);
56
+
57
+ // mark published/unpublished items
58
+ if (typeof node.published !== 'undefined' && !node.published) {
59
+ // modify draft link
60
+ if (link.attr('href').indexOf('published') < 0) {
61
+ link.attr('href', link.attr('href')+'?published=0'); // FIXME: implicit knowledge
62
+ }
63
+ link.addClass('unpublished');
64
+ } else {
65
+ link.addClass('published');
66
+ }
67
+
68
+ if (dragabbleSupport) {
69
+ // mark locked items
70
+ if (typeof node.locked !== 'undefined' && node.locked) {
71
+ link.after(' <i class="fa fa-lock"/>');
72
+ } else {
73
+ link.after(' <i class="fa fa-arrows"/>');
74
+ }
75
+ }
76
+
77
+ if(node.moved) {
78
+ $li.data('node-id', node.id);
79
+ $li.data('old-parent-node-id', node.old_parent_id);
80
+ $li.data('new-parent-node-id', node.target_node_id);
81
+ $li.data('old-previous-sibling-id', node.old_previous_sibling_id);
82
+ $li.data('update-url', node.update_url);
83
+
84
+ var saveButton = $('<button type="button" class="btn btn-primary btn-xs node-btn" data-tree-action="move"><i class="fa fa-save"></i> ' + saveLabel + '</button>');
85
+ var copyButton = $('<button type="button" class="btn btn-primary btn-xs node-btn" data-tree-action="copy"><i class="fa fa-copy"></i> ' + copyLabel + '</button>');
86
+ var undoButton = $('<button type="button" class="btn btn-primary btn-xs reset-node-btn"><i class="fa fa-undo"></i> ' + undoLabel + '</button>');
87
+ link.after(saveButton, undoButton);
88
+
89
+ if(polyhierarchySupport) {
90
+ saveButton.after(copyButton);
91
+ }
92
+ }
93
+ },
94
+ onIsMoveHandle: function($element) {
95
+ // dom element which acts as move handle
96
+ return ($element.is('.fa-arrows'));
97
+ },
98
+ onCanMoveTo: function(moved_node, target_node, position){
99
+ // prevent node movement inside parent node
100
+ if (moved_node.parent === target_node.parent && position === 'after'){
101
+ return false;
102
+ }
103
+ // prevent locked node movement
104
+ else if (moved_node.locked === true || target_node.locked === true) {
105
+ return false;
106
+ }
107
+ // only drop node inside nodes, no ordering
108
+ else if (position === 'after') {
109
+ return false;
110
+ } else {
111
+ return true;
112
+ }
113
+ }
114
+ });
115
+ });
116
+
117
+ // mark moved nodes
118
+ $('ul.hybrid-treeview').on('tree.move', function(event) {
119
+ var moved_node = event.move_info.moved_node;
120
+
121
+ $(this).tree('updateNode', moved_node, {
122
+ moved: true,
123
+ target_node_id: event.move_info.target_node.id
124
+ });
125
+
126
+ if (moved_node.getPreviousSibling() !== null) {
127
+ $(this).tree('updateNode', moved_node, {old_previous_sibling_id: moved_node.getPreviousSibling().id});
128
+ }
129
+ if (typeof moved_node.parent.id !== 'undefined') {
130
+ $(this).tree('updateNode', moved_node, {old_parent_id: moved_node.parent.id});
131
+ }
132
+ });
133
+
134
+ // save/copy moved node
135
+ $('ul.hybrid-treeview').on('click', 'button.node-btn', function(event) {
136
+ var $tree = $('ul.hybrid-treeview');
137
+ var treeAction = $(this).data('tree-action');
138
+ var updateUrl = $(this).closest('li').data('update-url');
139
+
140
+ var movedNodeId = $(this).closest('li').data('node-id');
141
+ var oldParentNodeId = $(this).closest('li').data('old-parent-node-id');
142
+ var oldPreviousSiblingId = $(this).closest('li').data('old-previous-sibling-id');
143
+ var newParentNodeId = $(this).closest('li').data('new-parent-node-id');
144
+
145
+ $.ajax({
146
+ url : updateUrl,
147
+ type : 'PATCH',
148
+ data : {
149
+ tree_action: treeAction,
150
+ moved_node_id: movedNodeId,
151
+ old_parent_node_id: oldParentNodeId,
152
+ new_parent_node_id: newParentNodeId
153
+ },
154
+ statusCode: {
155
+ 200: function() {
156
+ [movedNodeId, newParentNodeId, oldParentNodeId].forEach(function(nodeId){
157
+ setToDraft(nodeId, $tree);
158
+ });
159
+
160
+ // add node to old parent, necessary to see both node directly after movement,
161
+ // this is not necessary if you refresh the page
162
+ if (treeAction === 'copy') {
163
+ var node = $tree.tree('getNodeById', movedNodeId);
164
+ if (typeof oldPreviousSiblingId !== 'undefined') {
165
+ var old_previous_sibling = $tree.tree('getNodeById', oldPreviousSiblingId);
166
+ $tree.tree('addNodeAfter', node, old_previous_sibling);
167
+ } else if (typeof oldParentNodeId !== 'undefined') {
168
+ var old_parent_node = $tree.tree('getNodeById', oldParentNodeId);
169
+ $tree.tree('appendNode', node, old_parent_node);
170
+ }
171
+ }
172
+ }
173
+ }
174
+ });
175
+ });
176
+
177
+ // reset moved node
178
+ $('ul.hybrid-treeview').on('click', 'button.reset-node-btn', function(event) {
179
+ var $tree = $('ul.hybrid-treeview');
180
+ var nodeId = $(this).closest('li').data('node-id');
181
+ var oldPreviousSiblingId = $(this).closest('li').data('old-previous-sibling-id');
182
+ var oldParentNodeId = $(this).closest('li').data('old-parent-node-id');
183
+
184
+ moveToOldPosition(nodeId, oldPreviousSiblingId, oldParentNodeId, $tree);
185
+ });
186
+
187
+ function setToDraft(nodeId, $tree) {
188
+ if (typeof nodeId !== 'undefined') {
189
+ var moved_node = $tree.tree('getNodeById', nodeId);
190
+ $tree.tree('updateNode', moved_node, {
191
+ moved: false,
192
+ published: false
193
+ });
194
+ }
195
+ }
196
+
197
+ function moveToOldPosition(nodeId, oldPreviousSiblingId, oldParentNodeId, $tree) {
198
+
199
+ var node = $tree.tree('getNodeById', nodeId);
200
+
201
+ if (typeof oldPreviousSiblingId !== 'undefined') {
202
+ var old_previous_sibling = $tree.tree('getNodeById', oldPreviousSiblingId);
203
+ $tree.tree('moveNode', node, old_previous_sibling, 'after');
204
+ }
205
+ else if (typeof oldParentNodeId !== 'undefined') {
206
+ var oldParentNode = $tree.tree('getNodeById', oldParentNodeId);
207
+ $tree.tree('moveNode', node, oldParentNode, 'inside');
208
+ }
209
+ $tree.tree('updateNode', node, {moved: false});
210
+ }
211
+
212
+ }
213
+
214
+ return function(selector) {
215
+ return new Treeview(selector);
216
+ };
217
+
218
+ }(jQuery));
@@ -1,4 +1,3 @@
1
- @import 'jquery.treeview';
2
1
  @import 'jquery-ui-1.10.3.custom';
3
2
 
4
3
  @import 'bootstrap';
@@ -1,8 +1,3 @@
1
- .navbar {
2
- .quicksearch {
3
- }
4
- }
5
-
6
1
  .onebox {
7
2
  padding-top: 80px;
8
3
  margin-top: 2em;
@@ -74,7 +69,7 @@ tr.highlightable {
74
69
  margin: 0;
75
70
  li {
76
71
  a {
77
- color: #BFBFBF;
72
+ color: #bfbfbf;
78
73
  font-weight: bold;
79
74
  }
80
75
  border-radius: 4px;
@@ -245,3 +240,7 @@ tr.highlightable {
245
240
  color: $muted-color;
246
241
  }
247
242
  }
243
+
244
+ a.unpublished {
245
+ color: #bfbfbf;
246
+ }
@@ -0,0 +1,119 @@
1
+ ul.hybrid-treeview { padding: 0;}
2
+
3
+ ul.jqtree-tree {
4
+ margin-left: 0;
5
+
6
+ li {
7
+ background: url(asset_path('treeview-default-line.gif')) no-repeat;
8
+ background-position: 2px -1px;
9
+ line-height: 1.8em;
10
+ padding-left: 18px;
11
+
12
+ &.jqtree-closed > ul.jqtree_common {
13
+ display: none;
14
+ }
15
+
16
+ &.jqtree_common {
17
+ clear: both;
18
+ list-style-type: none;
19
+ }
20
+
21
+ &.jqtree-folder {
22
+ background-position: 2px -190px;
23
+
24
+ &.jqtree-closed { margin-bottom: 1px;}
25
+ &:last-of-type { background: 0;}
26
+ }
27
+
28
+ &.jqtree-ghost {
29
+ margin-right: 10px;
30
+ position: relative;
31
+ z-index: 10;
32
+
33
+ span {
34
+ display: block;
35
+
36
+ &.jqtree-circle {
37
+ -moz-border-radius: 100px;
38
+ -webkit-border-radius: 100px;
39
+ border-radius: 100px;
40
+ border: solid 2px #000;
41
+ height: 8px;
42
+ left: -6px;
43
+ position: absolute;
44
+ top: -4px;
45
+ width: 8px;
46
+ }
47
+
48
+ &.jqtree-line {
49
+ background-color: #000;
50
+ height: 2px;
51
+ left: 2px;
52
+ padding: 0;
53
+ position: absolute;
54
+ top: -1px;
55
+ width: 100%;
56
+ }
57
+ }
58
+ }
59
+
60
+ &:last-of-type { background-position: 2px -1766px;}
61
+
62
+ .jqtree-element { position: relative;}
63
+ }
64
+
65
+ ul.jqtree_common {
66
+ display: block;
67
+ margin-right: 0;
68
+ }
69
+
70
+ .jqtree-toggler {
71
+ background-color: #fff;
72
+ border-bottom: 0;
73
+ color: #333;
74
+ cursor: pointer;
75
+ margin-left: -14px;
76
+ margin-right: .5em;
77
+ text-decoration: none;
78
+ }
79
+
80
+ span {
81
+ &.jqtree-border {
82
+ border: solid 2px #000;
83
+ box-sizing: content-box;
84
+ display: block;
85
+ left: -2px;
86
+ margin: 0;
87
+ position: absolute;
88
+ top: 0;
89
+ }
90
+ }
91
+
92
+ .fa-arrows { cursor: move;}
93
+
94
+ .jqtree-loading > div.jqtree-element.jqtree_common:after {
95
+ content: url(asset_path('ajax-loader.gif'));
96
+ margin-left: 8px;
97
+ }
98
+
99
+ }
100
+
101
+ ul.jqtree-tree,
102
+ ul.jqtree-tree ul.jqtree_common {
103
+ list-style: none outside;
104
+ margin-bottom: 0;
105
+ padding: 0;
106
+ }
107
+
108
+ span.jqtree-dragging {
109
+ background: #000;
110
+ color: #fff;
111
+ cursor: pointer;
112
+ opacity: .6;
113
+ padding: 2px 8px;
114
+ }
115
+
116
+ .node-btn,
117
+ .reset-node-btn {
118
+ margin: 0 3px;
119
+ }
@@ -1,6 +1,7 @@
1
1
  @import 'iqvoc/settings';
2
2
  @import 'iqvoc/hacks/bootstrap_extensions';
3
3
  @import 'iqvoc/hacks/jquery-ui_extensions';
4
+ @import 'iqvoc/components/treeview';
4
5
  @import 'iqvoc/components/components';
5
6
  @import 'iqvoc/components/panels';
6
7
  @import 'iqvoc/components/sidebars';
@@ -28,53 +28,66 @@ module Versioning
28
28
 
29
29
  module ClassMethods
30
30
  def by_origin(origin)
31
- where(origin: origin)
32
- end
33
-
34
- def published
35
- where(arel_table[:published_at].not_eq(nil))
36
- end
37
-
38
- def unpublished
39
- where(published_at: nil)
40
- end
41
-
42
- # The following method returns all objects which should be selectable by the editor
43
- def editor_selectable
44
- where(
45
- arel_table[:published_at].not_eq(nil).or( # == published (is there a way to OR combine two scopes? `published OR where(...)`)
46
- arel_table[:published_at].eq(nil).and(arel_table[:published_version_id].eq(nil)) # this are all unpublished with no published version
47
- )
48
- )
49
- end
50
-
51
- def in_edit_mode
52
- where(arel_table[:locked_by].not_eq(nil))
53
- end
54
-
55
- def unpublished_or_follow_up
56
- where(
57
- arel_table[:published_at].eq(nil).or(
58
- arel_table[:follow_up].not_eq(nil)
59
- )
60
- )
61
- end
62
-
63
- def unsynced
64
- where(rdf_updated_at: nil)
65
- end
66
-
67
- def include_to_deep_cloning(*association_names)
68
- (@@include_to_deep_cloning ||= {})[self] ||= []
69
- association_names.each do |association_name|
70
- @@include_to_deep_cloning[self] << association_name
71
- end
72
- end
73
-
74
- def includes_to_deep_cloning
75
- (@@include_to_deep_cloning ||= {})[self] ||= []
76
- (@@include_to_deep_cloning.keys & self.ancestors).map{ |c| @@include_to_deep_cloning[c] }.flatten.compact
77
- end
31
+ where(origin: origin)
32
+ end
33
+
34
+ def published
35
+ where(arel_table[:published_at].not_eq(nil))
36
+ end
37
+
38
+ def unpublished
39
+ where(published_at: nil)
40
+ end
41
+
42
+ def locked
43
+ where(arel_table[:locked_by].not_eq(nil))
44
+ end
45
+
46
+ def published_with_newer_versions
47
+ # published objects without objects which have a new one in editing
48
+ published_objects = arel_table[:published_at].not_eq(nil).and(arel_table[:origin].not_in(unpublished.map(&:origin)))
49
+ # only unpublished objects
50
+ unpublished_objects = arel_table[:published_at].eq(nil)
51
+
52
+ where(published_objects.or(unpublished_objects))
53
+ end
54
+
55
+ # The following method returns all objects which should be selectable by the editor
56
+ def editor_selectable
57
+ where(
58
+ arel_table[:published_at].not_eq(nil).or( # == published (is there a way to OR combine two scopes? `published OR where(...)`)
59
+ arel_table[:published_at].eq(nil).and(arel_table[:published_version_id].eq(nil)) # this are all unpublished with no published version
60
+ )
61
+ )
62
+ end
63
+
64
+ def in_edit_mode
65
+ where(arel_table[:locked_by].not_eq(nil))
66
+ end
67
+
68
+ def unpublished_or_follow_up
69
+ where(
70
+ arel_table[:published_at].eq(nil).or(
71
+ arel_table[:follow_up].not_eq(nil)
72
+ )
73
+ )
74
+ end
75
+
76
+ def unsynced
77
+ where(rdf_updated_at: nil)
78
+ end
79
+
80
+ def include_to_deep_cloning(*association_names)
81
+ (@@include_to_deep_cloning ||= {})[self] ||= []
82
+ association_names.each do |association_name|
83
+ @@include_to_deep_cloning[self] << association_name
84
+ end
85
+ end
86
+
87
+ def includes_to_deep_cloning
88
+ (@@include_to_deep_cloning ||= {})[self] ||= []
89
+ (@@include_to_deep_cloning.keys & self.ancestors).map{|c| @@include_to_deep_cloning[c]}.flatten.compact
90
+ end
78
91
  end
79
92
 
80
93
  def branch(user)
@@ -16,10 +16,14 @@
16
16
 
17
17
  class Concepts::HierarchicalController < ConceptsController
18
18
  def index
19
- authorize! :read, Iqvoc::Concept.base_class
19
+ if params[:published] == '0'
20
+ authorize! :update, Iqvoc::Concept.base_class
21
+ else
22
+ authorize! :read, Iqvoc::Concept.base_class
23
+ end
20
24
 
21
25
  scope = Iqvoc::Concept.base_class
22
- scope = params[:published] == '0' ? scope.editor_selectable : scope.published
26
+ scope = params[:published] == '0' ? scope.published_with_newer_versions : scope.published
23
27
 
24
28
  # only select unexpired concepts
25
29
  scope = scope.not_expired
@@ -55,12 +59,16 @@ class Concepts::HierarchicalController < ConceptsController
55
59
  format.html
56
60
  format.json do # Treeview data
57
61
  concepts = @concepts.select { |c| can? :read, c }.map do |c|
62
+ url = (c.published?) ? concept_path(id: c, format: :html) : concept_path(id: c, format: :html, published: 0)
58
63
  {
59
64
  id: c.id,
60
- url: concept_path(id: c, format: :html),
61
- text: CGI.escapeHTML(c.pref_label.to_s),
62
- hasChildren: (params[:broader] ? c.broader_relations.any? : c.narrower_relations.any?),
63
- additionalText: (" (#{c.additional_info})" if c.additional_info.present?)
65
+ label: CGI.escapeHTML(c.pref_label.to_s),
66
+ additionalText: (" (#{c.additional_info})" if c.additional_info.present?),
67
+ load_on_demand: (params[:broader] ? c.broader_relations.any? : c.narrower_relations.any?),
68
+ url: url,
69
+ update_url: move_concept_url(c),
70
+ published: (c.published?) ? true : false,
71
+ locked: (can?(:branch, c) || can?(:update, c) ? false : true)
64
72
  }
65
73
  end
66
74
  render json: concepts