decidim-participatory_documents 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (559) hide show
  1. checksums.yaml +7 -0
  2. data/.erb-lint.yml +30 -0
  3. data/.eslintignore +3 -0
  4. data/.eslintrc.json +3 -0
  5. data/.github/workflows/lint.yml +43 -0
  6. data/.github/workflows/test.yml +60 -0
  7. data/.gitignore +27 -0
  8. data/.rspec +3 -0
  9. data/.rubocop-disabled.yml +11 -0
  10. data/.rubocop.yml +4 -0
  11. data/.rubocop_rails.yml +91 -0
  12. data/.rubocop_ruby.yml +1768 -0
  13. data/.ruby-version +1 -0
  14. data/.simplecov +13 -0
  15. data/CODE_OF_CONDUCT.md +74 -0
  16. data/Gemfile +39 -0
  17. data/Gemfile.lock +817 -0
  18. data/LICENSE-AGPLv3.txt +661 -0
  19. data/README.md +166 -0
  20. data/Rakefile +44 -0
  21. data/app/cells/decidim/participatory_documents/edit_suggestion_note_modal/show.erb +20 -0
  22. data/app/cells/decidim/participatory_documents/edit_suggestion_note_modal_cell.rb +35 -0
  23. data/app/cells/decidim/participatory_documents/suggestion/admin_answer.erb +7 -0
  24. data/app/cells/decidim/participatory_documents/suggestion/show.erb +11 -0
  25. data/app/cells/decidim/participatory_documents/suggestion_author/avatar.erb +3 -0
  26. data/app/cells/decidim/participatory_documents/suggestion_author/date.erb +1 -0
  27. data/app/cells/decidim/participatory_documents/suggestion_author/name.erb +3 -0
  28. data/app/cells/decidim/participatory_documents/suggestion_author/show.erb +9 -0
  29. data/app/cells/decidim/participatory_documents/suggestion_author_cell.rb +50 -0
  30. data/app/cells/decidim/participatory_documents/suggestion_cell.rb +41 -0
  31. data/app/commands/decidim/participatory_documents/admin/answer_suggestion.rb +62 -0
  32. data/app/commands/decidim/participatory_documents/admin/assign_suggestions_to_valuator.rb +59 -0
  33. data/app/commands/decidim/participatory_documents/admin/create_document.rb +55 -0
  34. data/app/commands/decidim/participatory_documents/admin/create_suggestion_note.rb +49 -0
  35. data/app/commands/decidim/participatory_documents/admin/destroy_annotation.rb +67 -0
  36. data/app/commands/decidim/participatory_documents/admin/notify_suggestion_answer.rb +52 -0
  37. data/app/commands/decidim/participatory_documents/admin/publish_answers.rb +59 -0
  38. data/app/commands/decidim/participatory_documents/admin/publish_document.rb +26 -0
  39. data/app/commands/decidim/participatory_documents/admin/unassign_suggestions_from_valuator.rb +60 -0
  40. data/app/commands/decidim/participatory_documents/admin/update_document.rb +85 -0
  41. data/app/commands/decidim/participatory_documents/admin/update_or_create_annotation.rb +98 -0
  42. data/app/commands/decidim/participatory_documents/admin/update_section.rb +52 -0
  43. data/app/commands/decidim/participatory_documents/admin/update_suggestion_note.rb +36 -0
  44. data/app/commands/decidim/participatory_documents/create_suggestion.rb +65 -0
  45. data/app/controllers/concerns/decidim/participatory_documents/admin/needs_admin_snippets.rb +25 -0
  46. data/app/controllers/concerns/decidim/participatory_documents/needs_pdf_document.rb +105 -0
  47. data/app/controllers/decidim/participatory_documents/admin/annotations_controller.rb +51 -0
  48. data/app/controllers/decidim/participatory_documents/admin/application_controller.rb +18 -0
  49. data/app/controllers/decidim/participatory_documents/admin/documents_controller.rb +104 -0
  50. data/app/controllers/decidim/participatory_documents/admin/sections_controller.rb +39 -0
  51. data/app/controllers/decidim/participatory_documents/admin/suggestion_notes_controller.rb +59 -0
  52. data/app/controllers/decidim/participatory_documents/admin/suggestions_controller.rb +160 -0
  53. data/app/controllers/decidim/participatory_documents/admin/valuation_assignments_controller.rb +58 -0
  54. data/app/controllers/decidim/participatory_documents/application_controller.rb +14 -0
  55. data/app/controllers/decidim/participatory_documents/document_suggestions_controller.rb +40 -0
  56. data/app/controllers/decidim/participatory_documents/documents_controller.rb +18 -0
  57. data/app/controllers/decidim/participatory_documents/section_suggestions_controller.rb +40 -0
  58. data/app/events/decidim/participatory_documents/suggestion_answer_event.rb +43 -0
  59. data/app/forms/decidim/participatory_documents/admin/annotation_form.rb +26 -0
  60. data/app/forms/decidim/participatory_documents/admin/answer_suggestion_form.rb +21 -0
  61. data/app/forms/decidim/participatory_documents/admin/document_form.rb +29 -0
  62. data/app/forms/decidim/participatory_documents/admin/section_form.rb +17 -0
  63. data/app/forms/decidim/participatory_documents/admin/suggestion_note_form.rb +15 -0
  64. data/app/forms/decidim/participatory_documents/admin/valuation_assignment_form.rb +38 -0
  65. data/app/forms/decidim/participatory_documents/suggestion_form.rb +39 -0
  66. data/app/helpers/decidim/participatory_documents/admin/button_helper.rb +17 -0
  67. data/app/helpers/decidim/participatory_documents/admin/documents_helper.rb +71 -0
  68. data/app/helpers/decidim/participatory_documents/admin/suggestion_helper.rb +54 -0
  69. data/app/helpers/decidim/participatory_documents/documents_helper.rb +41 -0
  70. data/app/models/concerns/decidim/participatory_documents/participatory_space_user_role_override.rb +19 -0
  71. data/app/models/concerns/decidim/participatory_documents/valuator_override.rb +18 -0
  72. data/app/models/decidim/participatory_documents/annotation.rb +28 -0
  73. data/app/models/decidim/participatory_documents/application_record.rb +10 -0
  74. data/app/models/decidim/participatory_documents/document.rb +67 -0
  75. data/app/models/decidim/participatory_documents/section.rb +44 -0
  76. data/app/models/decidim/participatory_documents/suggestion.rb +167 -0
  77. data/app/models/decidim/participatory_documents/suggestion_note.rb +18 -0
  78. data/app/models/decidim/participatory_documents/valuation_assignment.rb +21 -0
  79. data/app/packs/entrypoints/decidim_participatory_documents.js +6 -0
  80. data/app/packs/entrypoints/decidim_participatory_documents.scss +18 -0
  81. data/app/packs/entrypoints/decidim_participatory_documents_admin.js +7 -0
  82. data/app/packs/entrypoints/decidim_participatory_documents_admin.scss +69 -0
  83. data/app/packs/entrypoints/decidim_participatory_documents_editor.js +12 -0
  84. data/app/packs/entrypoints/decidim_participatory_documents_editor.scss +33 -0
  85. data/app/packs/entrypoints/decidim_participatory_documents_viewer.js +6 -0
  86. data/app/packs/entrypoints/decidim_participatory_documents_viewer.scss +11 -0
  87. data/app/packs/images/.keep +0 -0
  88. data/app/packs/images/badge.svg +6 -0
  89. data/app/packs/images/fullscreen.svg +6 -0
  90. data/app/packs/images/fullscreen_exit.svg +14 -0
  91. data/app/packs/images/group.svg +1 -0
  92. data/app/packs/images/move.svg +49 -0
  93. data/app/packs/images/participatory_documents.svg +14 -0
  94. data/app/packs/src/decidim/participatory_documents/admin/manage_bulk_suggestions.js +133 -0
  95. data/app/packs/src/decidim/participatory_documents/admin/preview_box_color.js +14 -0
  96. data/app/packs/src/decidim/participatory_documents/global.js +22 -0
  97. data/app/packs/src/decidim/participatory_documents/pdf/box.js +234 -0
  98. data/app/packs/src/decidim/participatory_documents/pdf/box_control_group.js +80 -0
  99. data/app/packs/src/decidim/participatory_documents/pdf/box_control_move.js +55 -0
  100. data/app/packs/src/decidim/participatory_documents/pdf/box_controls.js +18 -0
  101. data/app/packs/src/decidim/participatory_documents/pdf/pdf_modal_manager.js +129 -0
  102. data/app/packs/src/decidim/participatory_documents/pdf/pdf_state_manager.js +141 -0
  103. data/app/packs/src/decidim/participatory_documents/pdf/polygon_editor.js +99 -0
  104. data/app/packs/src/decidim/participatory_documents/pdf/polygon_viewer.js +55 -0
  105. data/app/packs/src/decidim/participatory_documents/pdf/suggestion_form.js +142 -0
  106. data/app/packs/src/decidim/participatory_documents/pdf.js +37 -0
  107. data/app/packs/src/decidim/participatory_documents/pdf_admin.js +60 -0
  108. data/app/packs/src/decidim/participatory_documents/pdf_notifications.js +20 -0
  109. data/app/packs/src/decidim/participatory_documents/skip_cookie_warning.js +10 -0
  110. data/app/packs/stylesheets/decidim/participatory_documents/decidim_admin_classes.scss +13 -0
  111. data/app/packs/stylesheets/decidim/participatory_documents/pdf/admin_modals.scss +41 -0
  112. data/app/packs/stylesheets/decidim/participatory_documents/pdf/admin_polygons.scss +131 -0
  113. data/app/packs/stylesheets/decidim/participatory_documents/pdf/admin_tweaks.scss +44 -0
  114. data/app/packs/stylesheets/decidim/participatory_documents/pdf/defaults.scss +7 -0
  115. data/app/packs/stylesheets/decidim/participatory_documents/pdf/document.scss +7 -0
  116. data/app/packs/stylesheets/decidim/participatory_documents/pdf/modals.scss +152 -0
  117. data/app/packs/stylesheets/decidim/participatory_documents/pdf/notifications.scss +31 -0
  118. data/app/packs/stylesheets/decidim/participatory_documents/pdf/polygons.scss +80 -0
  119. data/app/packs/stylesheets/decidim/participatory_documents/pdf/tweaks.scss +147 -0
  120. data/app/permissions/decidim/participatory_documents/admin/permissions.rb +118 -0
  121. data/app/permissions/decidim/participatory_documents/permissions.rb +16 -0
  122. data/app/presenters/decidim/participatory_documents/admin_log/annotation_presenter.rb +25 -0
  123. data/app/presenters/decidim/participatory_documents/admin_log/document_presenter.rb +13 -0
  124. data/app/presenters/decidim/participatory_documents/admin_log/section_presenter.rb +25 -0
  125. data/app/presenters/decidim/participatory_documents/admin_log/suggestion_note_presenter.rb +49 -0
  126. data/app/serializers/decidim/participatory_documents/suggestion_serializer.rb +67 -0
  127. data/app/uploaders/decidim/participatory_documents/pdf_document_uploader.rb +11 -0
  128. data/app/views/decidim/admin/exports/_dropdown.html.erb +16 -0
  129. data/app/views/decidim/participatory_documents/admin/documents/_editor_modal.html.erb +3 -0
  130. data/app/views/decidim/participatory_documents/admin/documents/_form.html.erb +39 -0
  131. data/app/views/decidim/participatory_documents/admin/documents/_title.html.erb +7 -0
  132. data/app/views/decidim/participatory_documents/admin/documents/edit.html.erb +18 -0
  133. data/app/views/decidim/participatory_documents/admin/documents/edit_pdf.html.erb +15 -0
  134. data/app/views/decidim/participatory_documents/admin/documents/index.html.erb +11 -0
  135. data/app/views/decidim/participatory_documents/admin/documents/new.html.erb +17 -0
  136. data/app/views/decidim/participatory_documents/admin/documents/pdf_viewer.html.erb +105 -0
  137. data/app/views/decidim/participatory_documents/admin/sections/_form.html.erb +24 -0
  138. data/app/views/decidim/participatory_documents/admin/suggestion_notes/_editing_suggestion_note.html.erb +18 -0
  139. data/app/views/decidim/participatory_documents/admin/suggestion_notes/_form.html.erb +8 -0
  140. data/app/views/decidim/participatory_documents/admin/suggestion_notes/_suggestion_notes.html.erb +46 -0
  141. data/app/views/decidim/participatory_documents/admin/suggestions/_add_valuators.html.erb +17 -0
  142. data/app/views/decidim/participatory_documents/admin/suggestions/_bulk-actions.html.erb +7 -0
  143. data/app/views/decidim/participatory_documents/admin/suggestions/_form.html.erb +30 -0
  144. data/app/views/decidim/participatory_documents/admin/suggestions/_js-callout.html.erb +6 -0
  145. data/app/views/decidim/participatory_documents/admin/suggestions/_suggestion.html.erb +33 -0
  146. data/app/views/decidim/participatory_documents/admin/suggestions/_valuators.html.erb +43 -0
  147. data/app/views/decidim/participatory_documents/admin/suggestions/bulk_actions/_assign_to_valuator.html.erb +15 -0
  148. data/app/views/decidim/participatory_documents/admin/suggestions/bulk_actions/_dropdown.html.erb +36 -0
  149. data/app/views/decidim/participatory_documents/admin/suggestions/bulk_actions/_publish_answers.html.erb +14 -0
  150. data/app/views/decidim/participatory_documents/admin/suggestions/bulk_actions/_unassign_from_valuator.html.erb +15 -0
  151. data/app/views/decidim/participatory_documents/admin/suggestions/index.html.erb +45 -0
  152. data/app/views/decidim/participatory_documents/admin/suggestions/publish_answers.js.erb +17 -0
  153. data/app/views/decidim/participatory_documents/admin/suggestions/show.html.erb +55 -0
  154. data/app/views/decidim/participatory_documents/document_suggestions/_form.html.erb +29 -0
  155. data/app/views/decidim/participatory_documents/document_suggestions/index.html.erb +14 -0
  156. data/app/views/decidim/participatory_documents/documents/_pdfjs_base.html.erb +428 -0
  157. data/app/views/decidim/participatory_documents/documents/index.html.erb +27 -0
  158. data/app/views/decidim/participatory_documents/documents/pdf_viewer.html.erb +63 -0
  159. data/app/views/decidim/participatory_documents/section_suggestions/_form.html.erb +8 -0
  160. data/app/views/decidim/participatory_documents/section_suggestions/index.html.erb +14 -0
  161. data/babel.config.json +25 -0
  162. data/bin/bundle +62 -0
  163. data/bin/rails +6 -0
  164. data/bin/webpack-dev-server +6 -0
  165. data/codecov.yml +11 -0
  166. data/config/assets.rb +11 -0
  167. data/config/i18n-tasks.yml +12 -0
  168. data/config/locales/en.yml +266 -0
  169. data/crowdin.yml +45 -0
  170. data/db/migrate/20221018112720_create_decidim_participatory_documents_document.rb +17 -0
  171. data/db/migrate/20221115233021_create_decidim_participatory_documents_participation_sections.rb +12 -0
  172. data/db/migrate/20221115233022_create_decidim_participatory_documents_annotations.rb +13 -0
  173. data/db/migrate/20221115233023_create_decidim_participatory_documents_suggestions.rb +17 -0
  174. data/db/migrate/20221115233024_create_decidim_participatory_documents_suggestion_notes.rb +15 -0
  175. data/db/migrate/20221115233024_create_decidim_participatory_documents_valuation_assignments.rb +12 -0
  176. data/db/migrate/20230616100340_add_published_at_to_decidim_participatory_documents_documents.rb +8 -0
  177. data/db/migrate/20230622081831_add_decidim_participatory_documents_box_positions.rb +37 -0
  178. data/decidim-participatory_documents.gemspec +30 -0
  179. data/lib/decidim/participatory_documents/admin.rb +8 -0
  180. data/lib/decidim/participatory_documents/admin_engine.rb +45 -0
  181. data/lib/decidim/participatory_documents/component.rb +202 -0
  182. data/lib/decidim/participatory_documents/engine.rb +46 -0
  183. data/lib/decidim/participatory_documents/seeds/Exampledocument.pdf +0 -0
  184. data/lib/decidim/participatory_documents/test/factories.rb +144 -0
  185. data/lib/decidim/participatory_documents/version.rb +9 -0
  186. data/lib/decidim/participatory_documents.rb +29 -0
  187. data/lib/tasks/decidim_participatory_documents.rake +27 -0
  188. data/package-lock.json +12687 -0
  189. data/package.json +52 -0
  190. data/pdfjs/LICENSE +177 -0
  191. data/pdfjs/README.md +12 -0
  192. data/pdfjs/build/pdf.js +15629 -0
  193. data/pdfjs/build/pdf.js.map +1 -0
  194. data/pdfjs/build/pdf.sandbox.js +280 -0
  195. data/pdfjs/build/pdf.sandbox.js.map +1 -0
  196. data/pdfjs/build/pdf.worker.js +64496 -0
  197. data/pdfjs/build/pdf.worker.js.map +1 -0
  198. data/pdfjs/web/cmaps/78-EUC-H.bcmap +0 -0
  199. data/pdfjs/web/cmaps/78-EUC-V.bcmap +0 -0
  200. data/pdfjs/web/cmaps/78-H.bcmap +0 -0
  201. data/pdfjs/web/cmaps/78-RKSJ-H.bcmap +0 -0
  202. data/pdfjs/web/cmaps/78-RKSJ-V.bcmap +0 -0
  203. data/pdfjs/web/cmaps/78-V.bcmap +0 -0
  204. data/pdfjs/web/cmaps/78ms-RKSJ-H.bcmap +0 -0
  205. data/pdfjs/web/cmaps/78ms-RKSJ-V.bcmap +0 -0
  206. data/pdfjs/web/cmaps/83pv-RKSJ-H.bcmap +0 -0
  207. data/pdfjs/web/cmaps/90ms-RKSJ-H.bcmap +0 -0
  208. data/pdfjs/web/cmaps/90ms-RKSJ-V.bcmap +0 -0
  209. data/pdfjs/web/cmaps/90msp-RKSJ-H.bcmap +0 -0
  210. data/pdfjs/web/cmaps/90msp-RKSJ-V.bcmap +0 -0
  211. data/pdfjs/web/cmaps/90pv-RKSJ-H.bcmap +0 -0
  212. data/pdfjs/web/cmaps/90pv-RKSJ-V.bcmap +0 -0
  213. data/pdfjs/web/cmaps/Add-H.bcmap +0 -0
  214. data/pdfjs/web/cmaps/Add-RKSJ-H.bcmap +0 -0
  215. data/pdfjs/web/cmaps/Add-RKSJ-V.bcmap +0 -0
  216. data/pdfjs/web/cmaps/Add-V.bcmap +0 -0
  217. data/pdfjs/web/cmaps/Adobe-CNS1-0.bcmap +0 -0
  218. data/pdfjs/web/cmaps/Adobe-CNS1-1.bcmap +0 -0
  219. data/pdfjs/web/cmaps/Adobe-CNS1-2.bcmap +0 -0
  220. data/pdfjs/web/cmaps/Adobe-CNS1-3.bcmap +0 -0
  221. data/pdfjs/web/cmaps/Adobe-CNS1-4.bcmap +0 -0
  222. data/pdfjs/web/cmaps/Adobe-CNS1-5.bcmap +0 -0
  223. data/pdfjs/web/cmaps/Adobe-CNS1-6.bcmap +0 -0
  224. data/pdfjs/web/cmaps/Adobe-CNS1-UCS2.bcmap +0 -0
  225. data/pdfjs/web/cmaps/Adobe-GB1-0.bcmap +0 -0
  226. data/pdfjs/web/cmaps/Adobe-GB1-1.bcmap +0 -0
  227. data/pdfjs/web/cmaps/Adobe-GB1-2.bcmap +0 -0
  228. data/pdfjs/web/cmaps/Adobe-GB1-3.bcmap +0 -0
  229. data/pdfjs/web/cmaps/Adobe-GB1-4.bcmap +0 -0
  230. data/pdfjs/web/cmaps/Adobe-GB1-5.bcmap +0 -0
  231. data/pdfjs/web/cmaps/Adobe-GB1-UCS2.bcmap +0 -0
  232. data/pdfjs/web/cmaps/Adobe-Japan1-0.bcmap +0 -0
  233. data/pdfjs/web/cmaps/Adobe-Japan1-1.bcmap +0 -0
  234. data/pdfjs/web/cmaps/Adobe-Japan1-2.bcmap +0 -0
  235. data/pdfjs/web/cmaps/Adobe-Japan1-3.bcmap +0 -0
  236. data/pdfjs/web/cmaps/Adobe-Japan1-4.bcmap +0 -0
  237. data/pdfjs/web/cmaps/Adobe-Japan1-5.bcmap +0 -0
  238. data/pdfjs/web/cmaps/Adobe-Japan1-6.bcmap +0 -0
  239. data/pdfjs/web/cmaps/Adobe-Japan1-UCS2.bcmap +0 -0
  240. data/pdfjs/web/cmaps/Adobe-Korea1-0.bcmap +0 -0
  241. data/pdfjs/web/cmaps/Adobe-Korea1-1.bcmap +0 -0
  242. data/pdfjs/web/cmaps/Adobe-Korea1-2.bcmap +0 -0
  243. data/pdfjs/web/cmaps/Adobe-Korea1-UCS2.bcmap +0 -0
  244. data/pdfjs/web/cmaps/B5-H.bcmap +0 -0
  245. data/pdfjs/web/cmaps/B5-V.bcmap +0 -0
  246. data/pdfjs/web/cmaps/B5pc-H.bcmap +0 -0
  247. data/pdfjs/web/cmaps/B5pc-V.bcmap +0 -0
  248. data/pdfjs/web/cmaps/CNS-EUC-H.bcmap +0 -0
  249. data/pdfjs/web/cmaps/CNS-EUC-V.bcmap +0 -0
  250. data/pdfjs/web/cmaps/CNS1-H.bcmap +0 -0
  251. data/pdfjs/web/cmaps/CNS1-V.bcmap +0 -0
  252. data/pdfjs/web/cmaps/CNS2-H.bcmap +0 -0
  253. data/pdfjs/web/cmaps/CNS2-V.bcmap +3 -0
  254. data/pdfjs/web/cmaps/ETHK-B5-H.bcmap +0 -0
  255. data/pdfjs/web/cmaps/ETHK-B5-V.bcmap +0 -0
  256. data/pdfjs/web/cmaps/ETen-B5-H.bcmap +0 -0
  257. data/pdfjs/web/cmaps/ETen-B5-V.bcmap +0 -0
  258. data/pdfjs/web/cmaps/ETenms-B5-H.bcmap +3 -0
  259. data/pdfjs/web/cmaps/ETenms-B5-V.bcmap +0 -0
  260. data/pdfjs/web/cmaps/EUC-H.bcmap +0 -0
  261. data/pdfjs/web/cmaps/EUC-V.bcmap +0 -0
  262. data/pdfjs/web/cmaps/Ext-H.bcmap +0 -0
  263. data/pdfjs/web/cmaps/Ext-RKSJ-H.bcmap +0 -0
  264. data/pdfjs/web/cmaps/Ext-RKSJ-V.bcmap +0 -0
  265. data/pdfjs/web/cmaps/Ext-V.bcmap +0 -0
  266. data/pdfjs/web/cmaps/GB-EUC-H.bcmap +0 -0
  267. data/pdfjs/web/cmaps/GB-EUC-V.bcmap +0 -0
  268. data/pdfjs/web/cmaps/GB-H.bcmap +4 -0
  269. data/pdfjs/web/cmaps/GB-V.bcmap +0 -0
  270. data/pdfjs/web/cmaps/GBK-EUC-H.bcmap +0 -0
  271. data/pdfjs/web/cmaps/GBK-EUC-V.bcmap +0 -0
  272. data/pdfjs/web/cmaps/GBK2K-H.bcmap +0 -0
  273. data/pdfjs/web/cmaps/GBK2K-V.bcmap +0 -0
  274. data/pdfjs/web/cmaps/GBKp-EUC-H.bcmap +0 -0
  275. data/pdfjs/web/cmaps/GBKp-EUC-V.bcmap +0 -0
  276. data/pdfjs/web/cmaps/GBT-EUC-H.bcmap +0 -0
  277. data/pdfjs/web/cmaps/GBT-EUC-V.bcmap +0 -0
  278. data/pdfjs/web/cmaps/GBT-H.bcmap +0 -0
  279. data/pdfjs/web/cmaps/GBT-V.bcmap +0 -0
  280. data/pdfjs/web/cmaps/GBTpc-EUC-H.bcmap +0 -0
  281. data/pdfjs/web/cmaps/GBTpc-EUC-V.bcmap +0 -0
  282. data/pdfjs/web/cmaps/GBpc-EUC-H.bcmap +0 -0
  283. data/pdfjs/web/cmaps/GBpc-EUC-V.bcmap +0 -0
  284. data/pdfjs/web/cmaps/H.bcmap +0 -0
  285. data/pdfjs/web/cmaps/HKdla-B5-H.bcmap +0 -0
  286. data/pdfjs/web/cmaps/HKdla-B5-V.bcmap +0 -0
  287. data/pdfjs/web/cmaps/HKdlb-B5-H.bcmap +0 -0
  288. data/pdfjs/web/cmaps/HKdlb-B5-V.bcmap +0 -0
  289. data/pdfjs/web/cmaps/HKgccs-B5-H.bcmap +0 -0
  290. data/pdfjs/web/cmaps/HKgccs-B5-V.bcmap +0 -0
  291. data/pdfjs/web/cmaps/HKm314-B5-H.bcmap +0 -0
  292. data/pdfjs/web/cmaps/HKm314-B5-V.bcmap +0 -0
  293. data/pdfjs/web/cmaps/HKm471-B5-H.bcmap +0 -0
  294. data/pdfjs/web/cmaps/HKm471-B5-V.bcmap +0 -0
  295. data/pdfjs/web/cmaps/HKscs-B5-H.bcmap +0 -0
  296. data/pdfjs/web/cmaps/HKscs-B5-V.bcmap +0 -0
  297. data/pdfjs/web/cmaps/Hankaku.bcmap +0 -0
  298. data/pdfjs/web/cmaps/Hiragana.bcmap +0 -0
  299. data/pdfjs/web/cmaps/KSC-EUC-H.bcmap +0 -0
  300. data/pdfjs/web/cmaps/KSC-EUC-V.bcmap +0 -0
  301. data/pdfjs/web/cmaps/KSC-H.bcmap +0 -0
  302. data/pdfjs/web/cmaps/KSC-Johab-H.bcmap +0 -0
  303. data/pdfjs/web/cmaps/KSC-Johab-V.bcmap +0 -0
  304. data/pdfjs/web/cmaps/KSC-V.bcmap +0 -0
  305. data/pdfjs/web/cmaps/KSCms-UHC-H.bcmap +0 -0
  306. data/pdfjs/web/cmaps/KSCms-UHC-HW-H.bcmap +0 -0
  307. data/pdfjs/web/cmaps/KSCms-UHC-HW-V.bcmap +0 -0
  308. data/pdfjs/web/cmaps/KSCms-UHC-V.bcmap +0 -0
  309. data/pdfjs/web/cmaps/KSCpc-EUC-H.bcmap +0 -0
  310. data/pdfjs/web/cmaps/KSCpc-EUC-V.bcmap +0 -0
  311. data/pdfjs/web/cmaps/Katakana.bcmap +0 -0
  312. data/pdfjs/web/cmaps/LICENSE +36 -0
  313. data/pdfjs/web/cmaps/NWP-H.bcmap +0 -0
  314. data/pdfjs/web/cmaps/NWP-V.bcmap +0 -0
  315. data/pdfjs/web/cmaps/RKSJ-H.bcmap +0 -0
  316. data/pdfjs/web/cmaps/RKSJ-V.bcmap +0 -0
  317. data/pdfjs/web/cmaps/Roman.bcmap +0 -0
  318. data/pdfjs/web/cmaps/UniCNS-UCS2-H.bcmap +0 -0
  319. data/pdfjs/web/cmaps/UniCNS-UCS2-V.bcmap +0 -0
  320. data/pdfjs/web/cmaps/UniCNS-UTF16-H.bcmap +0 -0
  321. data/pdfjs/web/cmaps/UniCNS-UTF16-V.bcmap +0 -0
  322. data/pdfjs/web/cmaps/UniCNS-UTF32-H.bcmap +0 -0
  323. data/pdfjs/web/cmaps/UniCNS-UTF32-V.bcmap +0 -0
  324. data/pdfjs/web/cmaps/UniCNS-UTF8-H.bcmap +0 -0
  325. data/pdfjs/web/cmaps/UniCNS-UTF8-V.bcmap +0 -0
  326. data/pdfjs/web/cmaps/UniGB-UCS2-H.bcmap +0 -0
  327. data/pdfjs/web/cmaps/UniGB-UCS2-V.bcmap +0 -0
  328. data/pdfjs/web/cmaps/UniGB-UTF16-H.bcmap +0 -0
  329. data/pdfjs/web/cmaps/UniGB-UTF16-V.bcmap +0 -0
  330. data/pdfjs/web/cmaps/UniGB-UTF32-H.bcmap +0 -0
  331. data/pdfjs/web/cmaps/UniGB-UTF32-V.bcmap +0 -0
  332. data/pdfjs/web/cmaps/UniGB-UTF8-H.bcmap +0 -0
  333. data/pdfjs/web/cmaps/UniGB-UTF8-V.bcmap +0 -0
  334. data/pdfjs/web/cmaps/UniJIS-UCS2-H.bcmap +0 -0
  335. data/pdfjs/web/cmaps/UniJIS-UCS2-HW-H.bcmap +0 -0
  336. data/pdfjs/web/cmaps/UniJIS-UCS2-HW-V.bcmap +0 -0
  337. data/pdfjs/web/cmaps/UniJIS-UCS2-V.bcmap +0 -0
  338. data/pdfjs/web/cmaps/UniJIS-UTF16-H.bcmap +0 -0
  339. data/pdfjs/web/cmaps/UniJIS-UTF16-V.bcmap +0 -0
  340. data/pdfjs/web/cmaps/UniJIS-UTF32-H.bcmap +0 -0
  341. data/pdfjs/web/cmaps/UniJIS-UTF32-V.bcmap +0 -0
  342. data/pdfjs/web/cmaps/UniJIS-UTF8-H.bcmap +0 -0
  343. data/pdfjs/web/cmaps/UniJIS-UTF8-V.bcmap +0 -0
  344. data/pdfjs/web/cmaps/UniJIS2004-UTF16-H.bcmap +0 -0
  345. data/pdfjs/web/cmaps/UniJIS2004-UTF16-V.bcmap +0 -0
  346. data/pdfjs/web/cmaps/UniJIS2004-UTF32-H.bcmap +0 -0
  347. data/pdfjs/web/cmaps/UniJIS2004-UTF32-V.bcmap +0 -0
  348. data/pdfjs/web/cmaps/UniJIS2004-UTF8-H.bcmap +0 -0
  349. data/pdfjs/web/cmaps/UniJIS2004-UTF8-V.bcmap +0 -0
  350. data/pdfjs/web/cmaps/UniJISPro-UCS2-HW-V.bcmap +0 -0
  351. data/pdfjs/web/cmaps/UniJISPro-UCS2-V.bcmap +0 -0
  352. data/pdfjs/web/cmaps/UniJISPro-UTF8-V.bcmap +0 -0
  353. data/pdfjs/web/cmaps/UniJISX0213-UTF32-H.bcmap +0 -0
  354. data/pdfjs/web/cmaps/UniJISX0213-UTF32-V.bcmap +0 -0
  355. data/pdfjs/web/cmaps/UniJISX02132004-UTF32-H.bcmap +0 -0
  356. data/pdfjs/web/cmaps/UniJISX02132004-UTF32-V.bcmap +0 -0
  357. data/pdfjs/web/cmaps/UniKS-UCS2-H.bcmap +0 -0
  358. data/pdfjs/web/cmaps/UniKS-UCS2-V.bcmap +0 -0
  359. data/pdfjs/web/cmaps/UniKS-UTF16-H.bcmap +0 -0
  360. data/pdfjs/web/cmaps/UniKS-UTF16-V.bcmap +0 -0
  361. data/pdfjs/web/cmaps/UniKS-UTF32-H.bcmap +0 -0
  362. data/pdfjs/web/cmaps/UniKS-UTF32-V.bcmap +0 -0
  363. data/pdfjs/web/cmaps/UniKS-UTF8-H.bcmap +0 -0
  364. data/pdfjs/web/cmaps/UniKS-UTF8-V.bcmap +0 -0
  365. data/pdfjs/web/cmaps/V.bcmap +0 -0
  366. data/pdfjs/web/cmaps/WP-Symbol.bcmap +0 -0
  367. data/pdfjs/web/compressed.tracemonkey-pldi-09.pdf +0 -0
  368. data/pdfjs/web/debugger.css +113 -0
  369. data/pdfjs/web/debugger.js +612 -0
  370. data/pdfjs/web/images/annotation-check.svg +11 -0
  371. data/pdfjs/web/images/annotation-comment.svg +16 -0
  372. data/pdfjs/web/images/annotation-help.svg +26 -0
  373. data/pdfjs/web/images/annotation-insert.svg +10 -0
  374. data/pdfjs/web/images/annotation-key.svg +11 -0
  375. data/pdfjs/web/images/annotation-newparagraph.svg +11 -0
  376. data/pdfjs/web/images/annotation-noicon.svg +7 -0
  377. data/pdfjs/web/images/annotation-note.svg +42 -0
  378. data/pdfjs/web/images/annotation-paperclip.svg +6 -0
  379. data/pdfjs/web/images/annotation-paragraph.svg +16 -0
  380. data/pdfjs/web/images/annotation-pushpin.svg +7 -0
  381. data/pdfjs/web/images/cursor-editorFreeText.svg +3 -0
  382. data/pdfjs/web/images/cursor-editorInk.svg +4 -0
  383. data/pdfjs/web/images/findbarButton-next.svg +3 -0
  384. data/pdfjs/web/images/findbarButton-previous.svg +3 -0
  385. data/pdfjs/web/images/loading-dark.svg +24 -0
  386. data/pdfjs/web/images/loading-icon.gif +0 -0
  387. data/pdfjs/web/images/loading.svg +1 -0
  388. data/pdfjs/web/images/secondaryToolbarButton-documentProperties.svg +3 -0
  389. data/pdfjs/web/images/secondaryToolbarButton-firstPage.svg +3 -0
  390. data/pdfjs/web/images/secondaryToolbarButton-handTool.svg +3 -0
  391. data/pdfjs/web/images/secondaryToolbarButton-lastPage.svg +3 -0
  392. data/pdfjs/web/images/secondaryToolbarButton-rotateCcw.svg +3 -0
  393. data/pdfjs/web/images/secondaryToolbarButton-rotateCw.svg +3 -0
  394. data/pdfjs/web/images/secondaryToolbarButton-scrollHorizontal.svg +3 -0
  395. data/pdfjs/web/images/secondaryToolbarButton-scrollPage.svg +3 -0
  396. data/pdfjs/web/images/secondaryToolbarButton-scrollVertical.svg +3 -0
  397. data/pdfjs/web/images/secondaryToolbarButton-scrollWrapped.svg +3 -0
  398. data/pdfjs/web/images/secondaryToolbarButton-selectTool.svg +3 -0
  399. data/pdfjs/web/images/secondaryToolbarButton-spreadEven.svg +3 -0
  400. data/pdfjs/web/images/secondaryToolbarButton-spreadNone.svg +3 -0
  401. data/pdfjs/web/images/secondaryToolbarButton-spreadOdd.svg +3 -0
  402. data/pdfjs/web/images/shadow.png +0 -0
  403. data/pdfjs/web/images/toolbarButton-bookmark.svg +3 -0
  404. data/pdfjs/web/images/toolbarButton-currentOutlineItem.svg +3 -0
  405. data/pdfjs/web/images/toolbarButton-download.svg +4 -0
  406. data/pdfjs/web/images/toolbarButton-editorFreeText.svg +3 -0
  407. data/pdfjs/web/images/toolbarButton-editorInk.svg +4 -0
  408. data/pdfjs/web/images/toolbarButton-menuArrow.svg +3 -0
  409. data/pdfjs/web/images/toolbarButton-openFile.svg +3 -0
  410. data/pdfjs/web/images/toolbarButton-pageDown.svg +3 -0
  411. data/pdfjs/web/images/toolbarButton-pageUp.svg +3 -0
  412. data/pdfjs/web/images/toolbarButton-presentationMode.svg +3 -0
  413. data/pdfjs/web/images/toolbarButton-print.svg +3 -0
  414. data/pdfjs/web/images/toolbarButton-search.svg +3 -0
  415. data/pdfjs/web/images/toolbarButton-secondaryToolbarToggle.svg +3 -0
  416. data/pdfjs/web/images/toolbarButton-sidebarToggle.svg +3 -0
  417. data/pdfjs/web/images/toolbarButton-viewAttachments.svg +3 -0
  418. data/pdfjs/web/images/toolbarButton-viewLayers.svg +3 -0
  419. data/pdfjs/web/images/toolbarButton-viewOutline.svg +3 -0
  420. data/pdfjs/web/images/toolbarButton-viewThumbnail.svg +3 -0
  421. data/pdfjs/web/images/toolbarButton-zoomIn.svg +3 -0
  422. data/pdfjs/web/images/toolbarButton-zoomOut.svg +3 -0
  423. data/pdfjs/web/images/treeitem-collapsed.svg +1 -0
  424. data/pdfjs/web/images/treeitem-expanded.svg +1 -0
  425. data/pdfjs/web/locale/ach/viewer.properties +200 -0
  426. data/pdfjs/web/locale/af/viewer.properties +177 -0
  427. data/pdfjs/web/locale/an/viewer.properties +243 -0
  428. data/pdfjs/web/locale/ar/viewer.properties +247 -0
  429. data/pdfjs/web/locale/ast/viewer.properties +207 -0
  430. data/pdfjs/web/locale/az/viewer.properties +243 -0
  431. data/pdfjs/web/locale/be/viewer.properties +274 -0
  432. data/pdfjs/web/locale/bg/viewer.properties +235 -0
  433. data/pdfjs/web/locale/bn/viewer.properties +239 -0
  434. data/pdfjs/web/locale/bo/viewer.properties +238 -0
  435. data/pdfjs/web/locale/br/viewer.properties +247 -0
  436. data/pdfjs/web/locale/brx/viewer.properties +205 -0
  437. data/pdfjs/web/locale/bs/viewer.properties +194 -0
  438. data/pdfjs/web/locale/ca/viewer.properties +251 -0
  439. data/pdfjs/web/locale/cak/viewer.properties +249 -0
  440. data/pdfjs/web/locale/ckb/viewer.properties +234 -0
  441. data/pdfjs/web/locale/cs/viewer.properties +274 -0
  442. data/pdfjs/web/locale/cy/viewer.properties +274 -0
  443. data/pdfjs/web/locale/da/viewer.properties +274 -0
  444. data/pdfjs/web/locale/de/viewer.properties +274 -0
  445. data/pdfjs/web/locale/dsb/viewer.properties +274 -0
  446. data/pdfjs/web/locale/el/viewer.properties +274 -0
  447. data/pdfjs/web/locale/en-CA/viewer.properties +274 -0
  448. data/pdfjs/web/locale/en-GB/viewer.properties +274 -0
  449. data/pdfjs/web/locale/en-US/viewer.properties +253 -0
  450. data/pdfjs/web/locale/eo/viewer.properties +274 -0
  451. data/pdfjs/web/locale/es-AR/viewer.properties +274 -0
  452. data/pdfjs/web/locale/es-CL/viewer.properties +274 -0
  453. data/pdfjs/web/locale/es-ES/viewer.properties +274 -0
  454. data/pdfjs/web/locale/es-MX/viewer.properties +274 -0
  455. data/pdfjs/web/locale/et/viewer.properties +262 -0
  456. data/pdfjs/web/locale/eu/viewer.properties +272 -0
  457. data/pdfjs/web/locale/fa/viewer.properties +216 -0
  458. data/pdfjs/web/locale/ff/viewer.properties +235 -0
  459. data/pdfjs/web/locale/fi/viewer.properties +274 -0
  460. data/pdfjs/web/locale/fr/viewer.properties +274 -0
  461. data/pdfjs/web/locale/fy-NL/viewer.properties +274 -0
  462. data/pdfjs/web/locale/ga-IE/viewer.properties +202 -0
  463. data/pdfjs/web/locale/gd/viewer.properties +249 -0
  464. data/pdfjs/web/locale/gl/viewer.properties +249 -0
  465. data/pdfjs/web/locale/gn/viewer.properties +274 -0
  466. data/pdfjs/web/locale/gu-IN/viewer.properties +235 -0
  467. data/pdfjs/web/locale/he/viewer.properties +274 -0
  468. data/pdfjs/web/locale/hi-IN/viewer.properties +235 -0
  469. data/pdfjs/web/locale/hr/viewer.properties +249 -0
  470. data/pdfjs/web/locale/hsb/viewer.properties +274 -0
  471. data/pdfjs/web/locale/hu/viewer.properties +274 -0
  472. data/pdfjs/web/locale/hy-AM/viewer.properties +239 -0
  473. data/pdfjs/web/locale/hye/viewer.properties +252 -0
  474. data/pdfjs/web/locale/ia/viewer.properties +274 -0
  475. data/pdfjs/web/locale/id/viewer.properties +274 -0
  476. data/pdfjs/web/locale/is/viewer.properties +274 -0
  477. data/pdfjs/web/locale/it/viewer.properties +215 -0
  478. data/pdfjs/web/locale/ja/viewer.properties +274 -0
  479. data/pdfjs/web/locale/ka/viewer.properties +274 -0
  480. data/pdfjs/web/locale/kab/viewer.properties +274 -0
  481. data/pdfjs/web/locale/kk/viewer.properties +274 -0
  482. data/pdfjs/web/locale/km/viewer.properties +210 -0
  483. data/pdfjs/web/locale/kn/viewer.properties +187 -0
  484. data/pdfjs/web/locale/ko/viewer.properties +274 -0
  485. data/pdfjs/web/locale/lij/viewer.properties +235 -0
  486. data/pdfjs/web/locale/lo/viewer.properties +145 -0
  487. data/pdfjs/web/locale/locale.properties +327 -0
  488. data/pdfjs/web/locale/lt/viewer.properties +260 -0
  489. data/pdfjs/web/locale/ltg/viewer.properties +213 -0
  490. data/pdfjs/web/locale/lv/viewer.properties +235 -0
  491. data/pdfjs/web/locale/meh/viewer.properties +111 -0
  492. data/pdfjs/web/locale/mk/viewer.properties +139 -0
  493. data/pdfjs/web/locale/mr/viewer.properties +231 -0
  494. data/pdfjs/web/locale/ms/viewer.properties +235 -0
  495. data/pdfjs/web/locale/my/viewer.properties +191 -0
  496. data/pdfjs/web/locale/nb-NO/viewer.properties +274 -0
  497. data/pdfjs/web/locale/ne-NP/viewer.properties +218 -0
  498. data/pdfjs/web/locale/nl/viewer.properties +274 -0
  499. data/pdfjs/web/locale/nn-NO/viewer.properties +274 -0
  500. data/pdfjs/web/locale/oc/viewer.properties +274 -0
  501. data/pdfjs/web/locale/pa-IN/viewer.properties +285 -0
  502. data/pdfjs/web/locale/pl/viewer.properties +274 -0
  503. data/pdfjs/web/locale/pt-BR/viewer.properties +274 -0
  504. data/pdfjs/web/locale/pt-PT/viewer.properties +274 -0
  505. data/pdfjs/web/locale/rm/viewer.properties +274 -0
  506. data/pdfjs/web/locale/ro/viewer.properties +241 -0
  507. data/pdfjs/web/locale/ru/viewer.properties +274 -0
  508. data/pdfjs/web/locale/sat/viewer.properties +198 -0
  509. data/pdfjs/web/locale/sc/viewer.properties +240 -0
  510. data/pdfjs/web/locale/scn/viewer.properties +101 -0
  511. data/pdfjs/web/locale/sco/viewer.properties +249 -0
  512. data/pdfjs/web/locale/si/viewer.properties +237 -0
  513. data/pdfjs/web/locale/sk/viewer.properties +274 -0
  514. data/pdfjs/web/locale/sl/viewer.properties +274 -0
  515. data/pdfjs/web/locale/son/viewer.properties +173 -0
  516. data/pdfjs/web/locale/sq/viewer.properties +267 -0
  517. data/pdfjs/web/locale/sr/viewer.properties +253 -0
  518. data/pdfjs/web/locale/sv-SE/viewer.properties +274 -0
  519. data/pdfjs/web/locale/szl/viewer.properties +245 -0
  520. data/pdfjs/web/locale/ta/viewer.properties +194 -0
  521. data/pdfjs/web/locale/te/viewer.properties +237 -0
  522. data/pdfjs/web/locale/tg/viewer.properties +274 -0
  523. data/pdfjs/web/locale/th/viewer.properties +274 -0
  524. data/pdfjs/web/locale/tl/viewer.properties +243 -0
  525. data/pdfjs/web/locale/tr/viewer.properties +274 -0
  526. data/pdfjs/web/locale/trs/viewer.properties +206 -0
  527. data/pdfjs/web/locale/uk/viewer.properties +274 -0
  528. data/pdfjs/web/locale/ur/viewer.properties +239 -0
  529. data/pdfjs/web/locale/uz/viewer.properties +163 -0
  530. data/pdfjs/web/locale/vi/viewer.properties +274 -0
  531. data/pdfjs/web/locale/wo/viewer.properties +123 -0
  532. data/pdfjs/web/locale/xh/viewer.properties +177 -0
  533. data/pdfjs/web/locale/zh-CN/viewer.properties +274 -0
  534. data/pdfjs/web/locale/zh-TW/viewer.properties +274 -0
  535. data/pdfjs/web/standard_fonts/FoxitDingbats.pfb +0 -0
  536. data/pdfjs/web/standard_fonts/FoxitFixed.pfb +0 -0
  537. data/pdfjs/web/standard_fonts/FoxitFixedBold.pfb +0 -0
  538. data/pdfjs/web/standard_fonts/FoxitFixedBoldItalic.pfb +0 -0
  539. data/pdfjs/web/standard_fonts/FoxitFixedItalic.pfb +0 -0
  540. data/pdfjs/web/standard_fonts/FoxitSans.pfb +0 -0
  541. data/pdfjs/web/standard_fonts/FoxitSansBold.pfb +0 -0
  542. data/pdfjs/web/standard_fonts/FoxitSansBoldItalic.pfb +0 -0
  543. data/pdfjs/web/standard_fonts/FoxitSansItalic.pfb +0 -0
  544. data/pdfjs/web/standard_fonts/FoxitSerif.pfb +0 -0
  545. data/pdfjs/web/standard_fonts/FoxitSerifBold.pfb +0 -0
  546. data/pdfjs/web/standard_fonts/FoxitSerifBoldItalic.pfb +0 -0
  547. data/pdfjs/web/standard_fonts/FoxitSerifItalic.pfb +0 -0
  548. data/pdfjs/web/standard_fonts/FoxitSymbol.pfb +0 -0
  549. data/pdfjs/web/standard_fonts/LICENSE_FOXIT +27 -0
  550. data/pdfjs/web/standard_fonts/LICENSE_LIBERATION +102 -0
  551. data/pdfjs/web/standard_fonts/LiberationSans-Bold.ttf +0 -0
  552. data/pdfjs/web/standard_fonts/LiberationSans-BoldItalic.ttf +0 -0
  553. data/pdfjs/web/standard_fonts/LiberationSans-Italic.ttf +0 -0
  554. data/pdfjs/web/standard_fonts/LiberationSans-Regular.ttf +0 -0
  555. data/pdfjs/web/viewer.css +3029 -0
  556. data/pdfjs/web/viewer.html +433 -0
  557. data/pdfjs/web/viewer.js +13566 -0
  558. data/pdfjs/web/viewer.js.map +1 -0
  559. metadata +643 -0
data/README.md ADDED
@@ -0,0 +1,166 @@
1
+ # Decidim Participatory Documents
2
+
3
+ [![[CI] Lint](https://github.com/openpoke/decidim-module-participatory-documents/actions/workflows/lint.yml/badge.svg)](https://github.com/openpoke/decidim-module-participatory-documents/actions/workflows/lint.yml)
4
+ [![[CI] Test](https://github.com/openpoke/decidim-module-participatory-documents/actions/workflows/test.yml/badge.svg)](https://github.com/openpoke/decidim-module-participatory-documents/actions/workflows/test.yml)
5
+ [![Maintainability](https://api.codeclimate.com/v1/badges/b55516d46671ac78a43f/maintainability)](https://codeclimate.com/github/openpoke/decidim-module-participatory-documents/maintainability)
6
+ [![codecov](https://codecov.io/gh/openpoke/decidim-module-participatory-documents/branch/main/graph/badge.svg?token=TMZHD2XO6U)](https://codecov.io/gh/openpoke/decidim-module-participatory-documents)
7
+ [![Gem Version](https://badge.fury.io/rb/decidim-participatory-documents.svg)](https://badge.fury.io/rb/decidim-participatory-documents)
8
+
9
+ This module allows to upload PDF (and possibilty other formats) and define areas on top of it that will become spaces for suggestions, improvements and other participative activities.
10
+
11
+ > NOTE: in development, not ready for production.
12
+
13
+ ## Installation
14
+
15
+ Add this line to your application's Gemfile:
16
+
17
+ ```ruby
18
+ gem 'decidim-participatory_documents', git: "https://github.com/openpoke/decidim-module-participatory-documents"
19
+ ```
20
+
21
+ And then execute:
22
+
23
+ ```
24
+ bundle
25
+ bundle exec rails decidim_participatory_documents:install:migrations
26
+ ```
27
+
28
+ ## Usage
29
+
30
+ TODO...
31
+
32
+
33
+ Options such as `:max_suggestion_length`, `:min_suggestion_length` and etc. are configured at the component level in
34
+ the application. Defaults to the configured in the module:
35
+ ```ruby
36
+ # lib/decidim/participatory_documents.rb
37
+
38
+ module Decidim
39
+ # This namespace holds the logic of the `decidim-participatory_documents` module.
40
+ module ParticipatoryDocuments
41
+ include ActiveSupport::Configurable
42
+
43
+ # Public: The minimum length of a suggestion to be considered valid.
44
+ config_accessor :min_suggestion_length do
45
+ 5
46
+ end
47
+
48
+ # Public: The maximum length of a suggestion to be considered valid.
49
+ config_accessor :max_suggestion_length do
50
+ 500
51
+ end
52
+ end
53
+ end
54
+ ```
55
+
56
+ ```ruby
57
+ # config/initializers/participatory_documents.rb
58
+
59
+ Decidim::ParticipatoryDocuments.configure do |config|
60
+ end
61
+ ```
62
+
63
+ And, of course, having these values in your `config/secrets.yml` file.
64
+
65
+ ## Contributing
66
+
67
+ Bug reports and pull requests are welcome on GitHub at https://github.com/openpoke/decidim-module-participatory-documents.
68
+
69
+ ### Developing
70
+
71
+ To start contributing to this project, first:
72
+
73
+ - Install the basic dependencies (such as Ruby and PostgreSQL)
74
+ - Clone this repository
75
+
76
+ Decidim's main repository also provides a Docker configuration file if you
77
+ prefer to use Docker instead of installing the dependencies locally on your
78
+ machine.
79
+
80
+ You can create the development app by running the following commands after
81
+ cloning this project:
82
+
83
+ ```bash
84
+ $ bundle
85
+ $ DATABASE_USERNAME=<username> DATABASE_PASSWORD=<password> bundle exec rake development_app
86
+ ```
87
+
88
+ Note that the database user has to have rights to create and drop a database in
89
+ order to create the dummy test app database.
90
+
91
+ Then to test how the module works in Decidim, start the development server:
92
+
93
+ ```bash
94
+ $ cd development_app
95
+ $ DATABASE_USERNAME=<username> DATABASE_PASSWORD=<password> bundle exec rails s
96
+ ```
97
+
98
+ In case you are using [rbenv](https://github.com/rbenv/rbenv) and have the
99
+ [rbenv-vars](https://github.com/rbenv/rbenv-vars) plugin installed for it, you
100
+ can add the environment variables to the root directory of the project in a file
101
+ named `.rbenv-vars`. If these are defined for the environment, you can omit
102
+ defining these in the commands shown above.
103
+
104
+ #### Code Styling
105
+
106
+ Please follow the code styling defined by the different linters that ensure we
107
+ are all talking with the same language collaborating on the same project. This
108
+ project is set to follow the same rules that Decidim itself follows.
109
+
110
+ [Rubocop](https://rubocop.readthedocs.io/) linter is used for the Ruby language.
111
+
112
+ You can run the code styling checks by running the following commands from the
113
+ console:
114
+
115
+ ```
116
+ $ bundle exec rubocop
117
+ ```
118
+
119
+ To ease up following the style guide, you should install the plugin to your
120
+ favorite editor, such as:
121
+
122
+ - Atom - [linter-rubocop](https://atom.io/packages/linter-rubocop)
123
+ - Sublime Text - [Sublime RuboCop](https://github.com/pderichs/sublime_rubocop)
124
+ - Visual Studio Code - [Rubocop for Visual Studio Code](https://github.com/misogi/vscode-ruby-rubocop)
125
+
126
+ ### Testing
127
+
128
+ To run the tests run the following in the gem development path:
129
+
130
+ ```bash
131
+ $ bundle
132
+ $ DATABASE_USERNAME=<username> DATABASE_PASSWORD=<password> bundle exec rake test_app
133
+ $ DATABASE_USERNAME=<username> DATABASE_PASSWORD=<password> bundle exec rspec
134
+ ```
135
+
136
+ Note that the database user has to have rights to create and drop a database in
137
+ order to create the dummy test app database.
138
+
139
+ In case you are using [rbenv](https://github.com/rbenv/rbenv) and have the
140
+ [rbenv-vars](https://github.com/rbenv/rbenv-vars) plugin installed for it, you
141
+ can add these environment variables to the root directory of the project in a
142
+ file named `.rbenv-vars`. In this case, you can omit defining these in the
143
+ commands shown above.
144
+
145
+ ### Test code coverage
146
+
147
+ If you want to generate the code coverage report for the tests, you can use
148
+ the `SIMPLECOV=1` environment variable in the rspec command as follows:
149
+
150
+ ```bash
151
+ $ SIMPLECOV=1 bundle exec rspec
152
+ ```
153
+
154
+ This will generate a folder named `coverage` in the project root which contains
155
+ the code coverage report.
156
+
157
+ ### Localization
158
+
159
+ If you would like to see this module in your own language, you can help with its
160
+ translation at Crowdin:
161
+
162
+ https://crowdin.com/project/decidim-participatory-documents
163
+
164
+ ## License
165
+
166
+ See [LICENSE-AGPLv3.txt](LICENSE-AGPLv3.txt).
data/Rakefile ADDED
@@ -0,0 +1,44 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "decidim/dev/common_rake"
4
+ require "fileutils"
5
+
6
+ def install_module(path)
7
+ # maintain until https://github.com/decidim/decidim/commit/51b81b37004708ab72e70993fef4634eef18ee6c is in the decidim version used
8
+ FileUtils.cp("babel.config.json", "#{path}/babel.config.json")
9
+ Dir.chdir(path) do
10
+ system("bundle exec rake decidim_participatory_documents:install:migrations")
11
+ system("bundle exec rake db:migrate")
12
+ system("bundle exec rake decidim_participatory_documents:install_pdf_js")
13
+ end
14
+ end
15
+
16
+ def seed_db(path)
17
+ Dir.chdir(path) do
18
+ system("bundle exec rake db:seed")
19
+ end
20
+ end
21
+
22
+ desc "Generates a dummy app for testing"
23
+ task test_app: "decidim:generate_external_test_app" do
24
+ ENV["RAILS_ENV"] = "test"
25
+ install_module("spec/decidim_dummy_app")
26
+ end
27
+
28
+ desc "Generates a development app."
29
+ task :development_app do
30
+ Bundler.with_original_env do
31
+ generate_decidim_app(
32
+ "development_app",
33
+ "--app_name",
34
+ "#{base_app_name}_development_app",
35
+ "--path",
36
+ "..",
37
+ "--recreate_db",
38
+ "--demo"
39
+ )
40
+ end
41
+
42
+ install_module("development_app")
43
+ seed_db("development_app")
44
+ end
@@ -0,0 +1,20 @@
1
+ <div class="reveal edit-note-modal" id="<%= modal_id %>" data-reveal role="dialog" aria-modal="true"
2
+ aria-labelledby="<%= modal_id %>-label">
3
+ <div class="reveal__header">
4
+ <h3 id="<%= modal_id %>-label" class="reveal__title"><%= t("modal.title", scope: "decidim.participatory_documents.admin.suggestion_notes") %></h3>
5
+ <button class="close-button" data-close aria-label="Close" type="button">
6
+ <span aria-hidden="true">&times;</span>
7
+ </button>
8
+ </div>
9
+ <%= decidim_form_for(notes_form,
10
+ url: note_path,
11
+ method: :patch,
12
+ html: { class: "form edit_suggestion_note" }) do |f| %>
13
+ <div class="row column">
14
+ <%= f.text_area :body, rows: 10, label: t("modal.body", scope: "decidim.participatory_documents.admin.suggestion_notes"), value: note_body %>
15
+ </div>
16
+ <div class="button--double">
17
+ <%= f.submit t("modal.update", scope: "decidim.participatory_documents.admin.suggestion_notes") %>
18
+ </div>
19
+ <% end %>
20
+ </div>
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module ParticipatoryDocuments
5
+ class EditSuggestionNoteModalCell < Decidim::ViewModel
6
+ include ActionView::Helpers::FormOptionsHelper
7
+ include Decidim::ParticipatoryDocuments::AdminEngine.routes.url_helpers
8
+
9
+ def show
10
+ @suggestion = options[:suggestion]
11
+ render if note
12
+ end
13
+
14
+ def note
15
+ model
16
+ end
17
+
18
+ def note_body
19
+ model.body
20
+ end
21
+
22
+ def modal_id
23
+ options[:modal_id] || "editNoteModal"
24
+ end
25
+
26
+ def notes_form
27
+ @notes_form = Decidim::ParticipatoryDocuments::Admin::SuggestionNoteForm.from_model(note)
28
+ end
29
+
30
+ def note_path
31
+ document_suggestion_suggestion_note_path(suggestion_id: @suggestion.id, id: note)
32
+ end
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,7 @@
1
+ <div class="comment__footer">
2
+ <div class="answer__title">
3
+ <strong><%= answered_at %></strong>
4
+ <strong><%= t("suggestion_answer", scope: "decidim.participatory_documents.document") %></strong>
5
+ </div>
6
+ <%= translated_attribute(model.answer) %>
7
+ </div>
@@ -0,0 +1,11 @@
1
+ <div class="comment">
2
+ <div class="comment__content">
3
+ <%= author_cell %>
4
+ <%= suggestion_content(model)[:text] %>
5
+ <% if suggestion_content(model)[:file_link] %>
6
+ <%= suggestion_content(model)[:file_link] %>
7
+ <% end %>
8
+ </div>
9
+ <%= render :admin_answer if has_answer? %>
10
+ </div>
11
+ <hr class="suggestion__bottom-line">
@@ -0,0 +1,3 @@
1
+ <span class="author__avatar">
2
+ <%= image_tag author_avatar_url %>
3
+ </span>
@@ -0,0 +1 @@
1
+ <strong><%= creation_date %></strong>
@@ -0,0 +1,3 @@
1
+ <span>
2
+ <strong> <%= link_to decidim_sanitize(author_name), author_profile_path, class: "author__name", target: "_top" %></strong>
3
+ </span>
@@ -0,0 +1,9 @@
1
+ <div class="author__info flex--sbc">
2
+ <span class="author__data">
3
+ <%= render :avatar %>
4
+ <%= render :name %>
5
+ </span>
6
+ <span class="author__data_date">
7
+ <%= render :date %>
8
+ </span>
9
+ </div>
@@ -0,0 +1,50 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module ParticipatoryDocuments
5
+ class SuggestionAuthorCell < Decidim::ViewModel
6
+ include Decidim::SanitizeHelper
7
+
8
+ def show
9
+ @suggestion = options[:suggestion]
10
+ render
11
+ end
12
+
13
+ def author_avatar_url
14
+ model.author.avatar.attached? ? avatar_url : default_avatar_url(:thumb)
15
+ end
16
+
17
+ def author_name
18
+ model.author.name
19
+ end
20
+
21
+ def avatar
22
+ model.author.avatar.attached? ? model.author.avatar : nil
23
+ end
24
+
25
+ def author_profile_path
26
+ decidim.profile_path(model.author.nickname)
27
+ end
28
+
29
+ def creation_date
30
+ date_at = model.try(:created_at)
31
+
32
+ l date_at, format: :decidim_short
33
+ end
34
+
35
+ def suggestion
36
+ model
37
+ end
38
+
39
+ private
40
+
41
+ def default_avatar_url(_variant = nil)
42
+ ActionController::Base.helpers.asset_pack_path("media/images/default-avatar.svg")
43
+ end
44
+
45
+ def avatar_url
46
+ Rails.application.routes.url_helpers.rails_representation_path(model.author.avatar.variant(resize_to_fit: [30, 30]), only_path: true)
47
+ end
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,41 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module ParticipatoryDocuments
5
+ class SuggestionCell < Decidim::ViewModel
6
+ include Decidim::ParticipatoryDocuments::Admin::SuggestionHelper
7
+ include Decidim::IconHelper
8
+ include Decidim::Admin::IconLinkHelper
9
+
10
+ def show
11
+ render
12
+ end
13
+
14
+ def admin_answer
15
+ render
16
+ end
17
+
18
+ def answered_at
19
+ return unless has_answer?
20
+
21
+ l(model.answered_at, format: :decidim_short)
22
+ end
23
+
24
+ def humanize_suggestion_state
25
+ I18n.t(model.state, scope: "decidim.participatory_documents.suggestions.answers")
26
+ end
27
+
28
+ def author_cell
29
+ cell("decidim/participatory_documents/suggestion_author", model)
30
+ end
31
+
32
+ protected
33
+
34
+ def has_answer?
35
+ return false if %w(not_answered withdrawn).include?(model.state)
36
+
37
+ model.answered? && model.answer_is_published?
38
+ end
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,62 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module ParticipatoryDocuments
5
+ module Admin
6
+ class AnswerSuggestion < Decidim::Command
7
+ # Public: Initializes the command.
8
+ #
9
+ # form - A form object with the params.
10
+ def initialize(form, suggestion)
11
+ @form = form
12
+ @suggestion = suggestion
13
+ end
14
+
15
+ def call
16
+ return broadcast(:invalid) if form.invalid?
17
+
18
+ store_initial_suggestion_state
19
+
20
+ suggestion.assign_attributes(attributes)
21
+ if (%w(state answer answer_is_published) & suggestion.changed).any?
22
+ transaction { answer_suggestion }
23
+ notify_suggestion_answer
24
+ end
25
+
26
+ broadcast(:ok)
27
+ end
28
+
29
+ private
30
+
31
+ attr_reader :form, :suggestion, :initial_state
32
+
33
+ def attributes
34
+ {
35
+ state: form.state,
36
+ answer: form.answer,
37
+ answer_is_published: form.answer_is_published,
38
+ answered_at: %w(not_answered withdrawn).include?(form.state) ? nil : Time.current
39
+ }
40
+ end
41
+
42
+ def answer_suggestion
43
+ Decidim.traceability.perform_action!("answer", suggestion, form.current_user) do
44
+ suggestion.save!
45
+ suggestion
46
+ end
47
+ end
48
+
49
+ def notify_suggestion_answer
50
+ suggestion.reload
51
+ return unless suggestion.has_answer? && suggestion.answered? && suggestion.answer_is_published?
52
+
53
+ NotifySuggestionAnswer.call(suggestion, initial_state)
54
+ end
55
+
56
+ def store_initial_suggestion_state
57
+ @initial_state = suggestion.state
58
+ end
59
+ end
60
+ end
61
+ end
62
+ end
@@ -0,0 +1,59 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module ParticipatoryDocuments
5
+ module Admin
6
+ class AssignSuggestionsToValuator < Decidim::Command
7
+ # Public: Initializes the command.
8
+ #
9
+ # form - A form object with the params.
10
+ def initialize(form)
11
+ @form = form
12
+ end
13
+
14
+ # Executes the command. Broadcasts these events:
15
+ #
16
+ # - :ok when everything is valid.
17
+ # - :invalid if the form wasn't valid and we couldn't proceed.
18
+ #
19
+ # Returns nothing.
20
+ def call
21
+ return broadcast(:invalid) unless form.valid?
22
+
23
+ assign_suggestions
24
+ broadcast(:ok)
25
+ rescue ActiveRecord::RecordInvalid
26
+ broadcast(:invalid)
27
+ end
28
+
29
+ private
30
+
31
+ attr_reader :form
32
+
33
+ def assign_suggestions
34
+ transaction do
35
+ form.suggestions.flat_map do |suggestion|
36
+ find_assignment(suggestion) || assign_suggestion(suggestion)
37
+ end
38
+ end
39
+ end
40
+
41
+ def find_assignment(suggestion)
42
+ Decidim::ParticipatoryDocuments::ValuationAssignment.find_by(
43
+ suggestion: suggestion,
44
+ valuator_role: form.valuator_role
45
+ )
46
+ end
47
+
48
+ def assign_suggestion(suggestion)
49
+ Decidim.traceability.create!(
50
+ Decidim::ParticipatoryDocuments::ValuationAssignment,
51
+ form.current_user,
52
+ suggestion: suggestion,
53
+ valuator_role: form.valuator_role
54
+ )
55
+ end
56
+ end
57
+ end
58
+ end
59
+ end
@@ -0,0 +1,55 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module ParticipatoryDocuments
5
+ module Admin
6
+ class CreateDocument < Decidim::Command
7
+ include ::Decidim::AttachmentAttributesMethods
8
+
9
+ # Public: Initializes the command.
10
+ #
11
+ # form - A form object with the params.
12
+ def initialize(form)
13
+ @form = form
14
+ end
15
+
16
+ def call
17
+ return broadcast(:invalid) if form.invalid?
18
+
19
+ begin
20
+ transaction do
21
+ create_document
22
+ end
23
+ broadcast(:ok, document)
24
+ rescue ActiveRecord::RecordInvalid
25
+ form.errors.add(:file, document.errors[:file]) if document.errors.include? :file
26
+ broadcast(:invalid)
27
+ end
28
+ end
29
+
30
+ private
31
+
32
+ attr_reader :form, :document
33
+
34
+ def attributes
35
+ {
36
+ component: form.current_component,
37
+ author: form.current_user,
38
+ title: form.title,
39
+ description: form.description,
40
+ box_color: form.box_color,
41
+ box_opacity: form.box_opacity
42
+ }.merge(attachment_attributes(:file))
43
+ end
44
+
45
+ def create_document
46
+ @document = Decidim.traceability.create!(
47
+ Decidim::ParticipatoryDocuments::Document,
48
+ form.current_user,
49
+ **attributes
50
+ )
51
+ end
52
+ end
53
+ end
54
+ end
55
+ end
@@ -0,0 +1,49 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module ParticipatoryDocuments
5
+ module Admin
6
+ class CreateSuggestionNote < Decidim::Command
7
+ # Public: Initializes the command.
8
+ #
9
+ # form - A form object with the params.
10
+ # suggestion - the suggestion to relate.
11
+ def initialize(form, suggestion)
12
+ @form = form
13
+ @suggestion = suggestion
14
+ end
15
+
16
+ # Executes the command. Broadcasts these events:
17
+ #
18
+ # - :ok when everything is valid, together with the note proposal.
19
+ # - :invalid if the form wasn't valid and we couldn't proceed.
20
+ #
21
+ # Returns nothing.
22
+ def call
23
+ return broadcast(:invalid) if form.invalid?
24
+
25
+ create_suggestion_note
26
+ # notify_admins_and_valuators
27
+
28
+ broadcast(:ok, suggestion_note)
29
+ end
30
+
31
+ private
32
+
33
+ attr_reader :form, :suggestion_note, :suggestion
34
+
35
+ def create_suggestion_note
36
+ @suggestion_note = Decidim.traceability.create!(
37
+ SuggestionNote,
38
+ form.current_user,
39
+ {
40
+ body: form.body,
41
+ suggestion: suggestion,
42
+ author: form.current_user
43
+ }
44
+ )
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end