decidim-participatory_documents 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.erb-lint.yml +30 -0
- data/.eslintignore +3 -0
- data/.eslintrc.json +3 -0
- data/.github/workflows/lint.yml +43 -0
- data/.github/workflows/test.yml +60 -0
- data/.gitignore +27 -0
- data/.rspec +3 -0
- data/.rubocop-disabled.yml +11 -0
- data/.rubocop.yml +4 -0
- data/.rubocop_rails.yml +91 -0
- data/.rubocop_ruby.yml +1768 -0
- data/.ruby-version +1 -0
- data/.simplecov +13 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +39 -0
- data/Gemfile.lock +817 -0
- data/LICENSE-AGPLv3.txt +661 -0
- data/README.md +166 -0
- data/Rakefile +44 -0
- data/app/cells/decidim/participatory_documents/edit_suggestion_note_modal/show.erb +20 -0
- data/app/cells/decidim/participatory_documents/edit_suggestion_note_modal_cell.rb +35 -0
- data/app/cells/decidim/participatory_documents/suggestion/admin_answer.erb +7 -0
- data/app/cells/decidim/participatory_documents/suggestion/show.erb +11 -0
- data/app/cells/decidim/participatory_documents/suggestion_author/avatar.erb +3 -0
- data/app/cells/decidim/participatory_documents/suggestion_author/date.erb +1 -0
- data/app/cells/decidim/participatory_documents/suggestion_author/name.erb +3 -0
- data/app/cells/decidim/participatory_documents/suggestion_author/show.erb +9 -0
- data/app/cells/decidim/participatory_documents/suggestion_author_cell.rb +50 -0
- data/app/cells/decidim/participatory_documents/suggestion_cell.rb +41 -0
- data/app/commands/decidim/participatory_documents/admin/answer_suggestion.rb +62 -0
- data/app/commands/decidim/participatory_documents/admin/assign_suggestions_to_valuator.rb +59 -0
- data/app/commands/decidim/participatory_documents/admin/create_document.rb +55 -0
- data/app/commands/decidim/participatory_documents/admin/create_suggestion_note.rb +49 -0
- data/app/commands/decidim/participatory_documents/admin/destroy_annotation.rb +67 -0
- data/app/commands/decidim/participatory_documents/admin/notify_suggestion_answer.rb +52 -0
- data/app/commands/decidim/participatory_documents/admin/publish_answers.rb +59 -0
- data/app/commands/decidim/participatory_documents/admin/publish_document.rb +26 -0
- data/app/commands/decidim/participatory_documents/admin/unassign_suggestions_from_valuator.rb +60 -0
- data/app/commands/decidim/participatory_documents/admin/update_document.rb +85 -0
- data/app/commands/decidim/participatory_documents/admin/update_or_create_annotation.rb +98 -0
- data/app/commands/decidim/participatory_documents/admin/update_section.rb +52 -0
- data/app/commands/decidim/participatory_documents/admin/update_suggestion_note.rb +36 -0
- data/app/commands/decidim/participatory_documents/create_suggestion.rb +65 -0
- data/app/controllers/concerns/decidim/participatory_documents/admin/needs_admin_snippets.rb +25 -0
- data/app/controllers/concerns/decidim/participatory_documents/needs_pdf_document.rb +105 -0
- data/app/controllers/decidim/participatory_documents/admin/annotations_controller.rb +51 -0
- data/app/controllers/decidim/participatory_documents/admin/application_controller.rb +18 -0
- data/app/controllers/decidim/participatory_documents/admin/documents_controller.rb +104 -0
- data/app/controllers/decidim/participatory_documents/admin/sections_controller.rb +39 -0
- data/app/controllers/decidim/participatory_documents/admin/suggestion_notes_controller.rb +59 -0
- data/app/controllers/decidim/participatory_documents/admin/suggestions_controller.rb +160 -0
- data/app/controllers/decidim/participatory_documents/admin/valuation_assignments_controller.rb +58 -0
- data/app/controllers/decidim/participatory_documents/application_controller.rb +14 -0
- data/app/controllers/decidim/participatory_documents/document_suggestions_controller.rb +40 -0
- data/app/controllers/decidim/participatory_documents/documents_controller.rb +18 -0
- data/app/controllers/decidim/participatory_documents/section_suggestions_controller.rb +40 -0
- data/app/events/decidim/participatory_documents/suggestion_answer_event.rb +43 -0
- data/app/forms/decidim/participatory_documents/admin/annotation_form.rb +26 -0
- data/app/forms/decidim/participatory_documents/admin/answer_suggestion_form.rb +21 -0
- data/app/forms/decidim/participatory_documents/admin/document_form.rb +29 -0
- data/app/forms/decidim/participatory_documents/admin/section_form.rb +17 -0
- data/app/forms/decidim/participatory_documents/admin/suggestion_note_form.rb +15 -0
- data/app/forms/decidim/participatory_documents/admin/valuation_assignment_form.rb +38 -0
- data/app/forms/decidim/participatory_documents/suggestion_form.rb +39 -0
- data/app/helpers/decidim/participatory_documents/admin/button_helper.rb +17 -0
- data/app/helpers/decidim/participatory_documents/admin/documents_helper.rb +71 -0
- data/app/helpers/decidim/participatory_documents/admin/suggestion_helper.rb +54 -0
- data/app/helpers/decidim/participatory_documents/documents_helper.rb +41 -0
- data/app/models/concerns/decidim/participatory_documents/participatory_space_user_role_override.rb +19 -0
- data/app/models/concerns/decidim/participatory_documents/valuator_override.rb +18 -0
- data/app/models/decidim/participatory_documents/annotation.rb +28 -0
- data/app/models/decidim/participatory_documents/application_record.rb +10 -0
- data/app/models/decidim/participatory_documents/document.rb +67 -0
- data/app/models/decidim/participatory_documents/section.rb +44 -0
- data/app/models/decidim/participatory_documents/suggestion.rb +167 -0
- data/app/models/decidim/participatory_documents/suggestion_note.rb +18 -0
- data/app/models/decidim/participatory_documents/valuation_assignment.rb +21 -0
- data/app/packs/entrypoints/decidim_participatory_documents.js +6 -0
- data/app/packs/entrypoints/decidim_participatory_documents.scss +18 -0
- data/app/packs/entrypoints/decidim_participatory_documents_admin.js +7 -0
- data/app/packs/entrypoints/decidim_participatory_documents_admin.scss +69 -0
- data/app/packs/entrypoints/decidim_participatory_documents_editor.js +12 -0
- data/app/packs/entrypoints/decidim_participatory_documents_editor.scss +33 -0
- data/app/packs/entrypoints/decidim_participatory_documents_viewer.js +6 -0
- data/app/packs/entrypoints/decidim_participatory_documents_viewer.scss +11 -0
- data/app/packs/images/.keep +0 -0
- data/app/packs/images/badge.svg +6 -0
- data/app/packs/images/fullscreen.svg +6 -0
- data/app/packs/images/fullscreen_exit.svg +14 -0
- data/app/packs/images/group.svg +1 -0
- data/app/packs/images/move.svg +49 -0
- data/app/packs/images/participatory_documents.svg +14 -0
- data/app/packs/src/decidim/participatory_documents/admin/manage_bulk_suggestions.js +133 -0
- data/app/packs/src/decidim/participatory_documents/admin/preview_box_color.js +14 -0
- data/app/packs/src/decidim/participatory_documents/global.js +22 -0
- data/app/packs/src/decidim/participatory_documents/pdf/box.js +234 -0
- data/app/packs/src/decidim/participatory_documents/pdf/box_control_group.js +80 -0
- data/app/packs/src/decidim/participatory_documents/pdf/box_control_move.js +55 -0
- data/app/packs/src/decidim/participatory_documents/pdf/box_controls.js +18 -0
- data/app/packs/src/decidim/participatory_documents/pdf/pdf_modal_manager.js +129 -0
- data/app/packs/src/decidim/participatory_documents/pdf/pdf_state_manager.js +141 -0
- data/app/packs/src/decidim/participatory_documents/pdf/polygon_editor.js +99 -0
- data/app/packs/src/decidim/participatory_documents/pdf/polygon_viewer.js +55 -0
- data/app/packs/src/decidim/participatory_documents/pdf/suggestion_form.js +142 -0
- data/app/packs/src/decidim/participatory_documents/pdf.js +37 -0
- data/app/packs/src/decidim/participatory_documents/pdf_admin.js +60 -0
- data/app/packs/src/decidim/participatory_documents/pdf_notifications.js +20 -0
- data/app/packs/src/decidim/participatory_documents/skip_cookie_warning.js +10 -0
- data/app/packs/stylesheets/decidim/participatory_documents/decidim_admin_classes.scss +13 -0
- data/app/packs/stylesheets/decidim/participatory_documents/pdf/admin_modals.scss +41 -0
- data/app/packs/stylesheets/decidim/participatory_documents/pdf/admin_polygons.scss +131 -0
- data/app/packs/stylesheets/decidim/participatory_documents/pdf/admin_tweaks.scss +44 -0
- data/app/packs/stylesheets/decidim/participatory_documents/pdf/defaults.scss +7 -0
- data/app/packs/stylesheets/decidim/participatory_documents/pdf/document.scss +7 -0
- data/app/packs/stylesheets/decidim/participatory_documents/pdf/modals.scss +152 -0
- data/app/packs/stylesheets/decidim/participatory_documents/pdf/notifications.scss +31 -0
- data/app/packs/stylesheets/decidim/participatory_documents/pdf/polygons.scss +80 -0
- data/app/packs/stylesheets/decidim/participatory_documents/pdf/tweaks.scss +147 -0
- data/app/permissions/decidim/participatory_documents/admin/permissions.rb +118 -0
- data/app/permissions/decidim/participatory_documents/permissions.rb +16 -0
- data/app/presenters/decidim/participatory_documents/admin_log/annotation_presenter.rb +25 -0
- data/app/presenters/decidim/participatory_documents/admin_log/document_presenter.rb +13 -0
- data/app/presenters/decidim/participatory_documents/admin_log/section_presenter.rb +25 -0
- data/app/presenters/decidim/participatory_documents/admin_log/suggestion_note_presenter.rb +49 -0
- data/app/serializers/decidim/participatory_documents/suggestion_serializer.rb +67 -0
- data/app/uploaders/decidim/participatory_documents/pdf_document_uploader.rb +11 -0
- data/app/views/decidim/admin/exports/_dropdown.html.erb +16 -0
- data/app/views/decidim/participatory_documents/admin/documents/_editor_modal.html.erb +3 -0
- data/app/views/decidim/participatory_documents/admin/documents/_form.html.erb +39 -0
- data/app/views/decidim/participatory_documents/admin/documents/_title.html.erb +7 -0
- data/app/views/decidim/participatory_documents/admin/documents/edit.html.erb +18 -0
- data/app/views/decidim/participatory_documents/admin/documents/edit_pdf.html.erb +15 -0
- data/app/views/decidim/participatory_documents/admin/documents/index.html.erb +11 -0
- data/app/views/decidim/participatory_documents/admin/documents/new.html.erb +17 -0
- data/app/views/decidim/participatory_documents/admin/documents/pdf_viewer.html.erb +105 -0
- data/app/views/decidim/participatory_documents/admin/sections/_form.html.erb +24 -0
- data/app/views/decidim/participatory_documents/admin/suggestion_notes/_editing_suggestion_note.html.erb +18 -0
- data/app/views/decidim/participatory_documents/admin/suggestion_notes/_form.html.erb +8 -0
- data/app/views/decidim/participatory_documents/admin/suggestion_notes/_suggestion_notes.html.erb +46 -0
- data/app/views/decidim/participatory_documents/admin/suggestions/_add_valuators.html.erb +17 -0
- data/app/views/decidim/participatory_documents/admin/suggestions/_bulk-actions.html.erb +7 -0
- data/app/views/decidim/participatory_documents/admin/suggestions/_form.html.erb +30 -0
- data/app/views/decidim/participatory_documents/admin/suggestions/_js-callout.html.erb +6 -0
- data/app/views/decidim/participatory_documents/admin/suggestions/_suggestion.html.erb +33 -0
- data/app/views/decidim/participatory_documents/admin/suggestions/_valuators.html.erb +43 -0
- data/app/views/decidim/participatory_documents/admin/suggestions/bulk_actions/_assign_to_valuator.html.erb +15 -0
- data/app/views/decidim/participatory_documents/admin/suggestions/bulk_actions/_dropdown.html.erb +36 -0
- data/app/views/decidim/participatory_documents/admin/suggestions/bulk_actions/_publish_answers.html.erb +14 -0
- data/app/views/decidim/participatory_documents/admin/suggestions/bulk_actions/_unassign_from_valuator.html.erb +15 -0
- data/app/views/decidim/participatory_documents/admin/suggestions/index.html.erb +45 -0
- data/app/views/decidim/participatory_documents/admin/suggestions/publish_answers.js.erb +17 -0
- data/app/views/decidim/participatory_documents/admin/suggestions/show.html.erb +55 -0
- data/app/views/decidim/participatory_documents/document_suggestions/_form.html.erb +29 -0
- data/app/views/decidim/participatory_documents/document_suggestions/index.html.erb +14 -0
- data/app/views/decidim/participatory_documents/documents/_pdfjs_base.html.erb +428 -0
- data/app/views/decidim/participatory_documents/documents/index.html.erb +27 -0
- data/app/views/decidim/participatory_documents/documents/pdf_viewer.html.erb +63 -0
- data/app/views/decidim/participatory_documents/section_suggestions/_form.html.erb +8 -0
- data/app/views/decidim/participatory_documents/section_suggestions/index.html.erb +14 -0
- data/babel.config.json +25 -0
- data/bin/bundle +62 -0
- data/bin/rails +6 -0
- data/bin/webpack-dev-server +6 -0
- data/codecov.yml +11 -0
- data/config/assets.rb +11 -0
- data/config/i18n-tasks.yml +12 -0
- data/config/locales/en.yml +266 -0
- data/crowdin.yml +45 -0
- data/db/migrate/20221018112720_create_decidim_participatory_documents_document.rb +17 -0
- data/db/migrate/20221115233021_create_decidim_participatory_documents_participation_sections.rb +12 -0
- data/db/migrate/20221115233022_create_decidim_participatory_documents_annotations.rb +13 -0
- data/db/migrate/20221115233023_create_decidim_participatory_documents_suggestions.rb +17 -0
- data/db/migrate/20221115233024_create_decidim_participatory_documents_suggestion_notes.rb +15 -0
- data/db/migrate/20221115233024_create_decidim_participatory_documents_valuation_assignments.rb +12 -0
- data/db/migrate/20230616100340_add_published_at_to_decidim_participatory_documents_documents.rb +8 -0
- data/db/migrate/20230622081831_add_decidim_participatory_documents_box_positions.rb +37 -0
- data/decidim-participatory_documents.gemspec +30 -0
- data/lib/decidim/participatory_documents/admin.rb +8 -0
- data/lib/decidim/participatory_documents/admin_engine.rb +45 -0
- data/lib/decidim/participatory_documents/component.rb +202 -0
- data/lib/decidim/participatory_documents/engine.rb +46 -0
- data/lib/decidim/participatory_documents/seeds/Exampledocument.pdf +0 -0
- data/lib/decidim/participatory_documents/test/factories.rb +144 -0
- data/lib/decidim/participatory_documents/version.rb +9 -0
- data/lib/decidim/participatory_documents.rb +29 -0
- data/lib/tasks/decidim_participatory_documents.rake +27 -0
- data/package-lock.json +12687 -0
- data/package.json +52 -0
- data/pdfjs/LICENSE +177 -0
- data/pdfjs/README.md +12 -0
- data/pdfjs/build/pdf.js +15629 -0
- data/pdfjs/build/pdf.js.map +1 -0
- data/pdfjs/build/pdf.sandbox.js +280 -0
- data/pdfjs/build/pdf.sandbox.js.map +1 -0
- data/pdfjs/build/pdf.worker.js +64496 -0
- data/pdfjs/build/pdf.worker.js.map +1 -0
- data/pdfjs/web/cmaps/78-EUC-H.bcmap +0 -0
- data/pdfjs/web/cmaps/78-EUC-V.bcmap +0 -0
- data/pdfjs/web/cmaps/78-H.bcmap +0 -0
- data/pdfjs/web/cmaps/78-RKSJ-H.bcmap +0 -0
- data/pdfjs/web/cmaps/78-RKSJ-V.bcmap +0 -0
- data/pdfjs/web/cmaps/78-V.bcmap +0 -0
- data/pdfjs/web/cmaps/78ms-RKSJ-H.bcmap +0 -0
- data/pdfjs/web/cmaps/78ms-RKSJ-V.bcmap +0 -0
- data/pdfjs/web/cmaps/83pv-RKSJ-H.bcmap +0 -0
- data/pdfjs/web/cmaps/90ms-RKSJ-H.bcmap +0 -0
- data/pdfjs/web/cmaps/90ms-RKSJ-V.bcmap +0 -0
- data/pdfjs/web/cmaps/90msp-RKSJ-H.bcmap +0 -0
- data/pdfjs/web/cmaps/90msp-RKSJ-V.bcmap +0 -0
- data/pdfjs/web/cmaps/90pv-RKSJ-H.bcmap +0 -0
- data/pdfjs/web/cmaps/90pv-RKSJ-V.bcmap +0 -0
- data/pdfjs/web/cmaps/Add-H.bcmap +0 -0
- data/pdfjs/web/cmaps/Add-RKSJ-H.bcmap +0 -0
- data/pdfjs/web/cmaps/Add-RKSJ-V.bcmap +0 -0
- data/pdfjs/web/cmaps/Add-V.bcmap +0 -0
- data/pdfjs/web/cmaps/Adobe-CNS1-0.bcmap +0 -0
- data/pdfjs/web/cmaps/Adobe-CNS1-1.bcmap +0 -0
- data/pdfjs/web/cmaps/Adobe-CNS1-2.bcmap +0 -0
- data/pdfjs/web/cmaps/Adobe-CNS1-3.bcmap +0 -0
- data/pdfjs/web/cmaps/Adobe-CNS1-4.bcmap +0 -0
- data/pdfjs/web/cmaps/Adobe-CNS1-5.bcmap +0 -0
- data/pdfjs/web/cmaps/Adobe-CNS1-6.bcmap +0 -0
- data/pdfjs/web/cmaps/Adobe-CNS1-UCS2.bcmap +0 -0
- data/pdfjs/web/cmaps/Adobe-GB1-0.bcmap +0 -0
- data/pdfjs/web/cmaps/Adobe-GB1-1.bcmap +0 -0
- data/pdfjs/web/cmaps/Adobe-GB1-2.bcmap +0 -0
- data/pdfjs/web/cmaps/Adobe-GB1-3.bcmap +0 -0
- data/pdfjs/web/cmaps/Adobe-GB1-4.bcmap +0 -0
- data/pdfjs/web/cmaps/Adobe-GB1-5.bcmap +0 -0
- data/pdfjs/web/cmaps/Adobe-GB1-UCS2.bcmap +0 -0
- data/pdfjs/web/cmaps/Adobe-Japan1-0.bcmap +0 -0
- data/pdfjs/web/cmaps/Adobe-Japan1-1.bcmap +0 -0
- data/pdfjs/web/cmaps/Adobe-Japan1-2.bcmap +0 -0
- data/pdfjs/web/cmaps/Adobe-Japan1-3.bcmap +0 -0
- data/pdfjs/web/cmaps/Adobe-Japan1-4.bcmap +0 -0
- data/pdfjs/web/cmaps/Adobe-Japan1-5.bcmap +0 -0
- data/pdfjs/web/cmaps/Adobe-Japan1-6.bcmap +0 -0
- data/pdfjs/web/cmaps/Adobe-Japan1-UCS2.bcmap +0 -0
- data/pdfjs/web/cmaps/Adobe-Korea1-0.bcmap +0 -0
- data/pdfjs/web/cmaps/Adobe-Korea1-1.bcmap +0 -0
- data/pdfjs/web/cmaps/Adobe-Korea1-2.bcmap +0 -0
- data/pdfjs/web/cmaps/Adobe-Korea1-UCS2.bcmap +0 -0
- data/pdfjs/web/cmaps/B5-H.bcmap +0 -0
- data/pdfjs/web/cmaps/B5-V.bcmap +0 -0
- data/pdfjs/web/cmaps/B5pc-H.bcmap +0 -0
- data/pdfjs/web/cmaps/B5pc-V.bcmap +0 -0
- data/pdfjs/web/cmaps/CNS-EUC-H.bcmap +0 -0
- data/pdfjs/web/cmaps/CNS-EUC-V.bcmap +0 -0
- data/pdfjs/web/cmaps/CNS1-H.bcmap +0 -0
- data/pdfjs/web/cmaps/CNS1-V.bcmap +0 -0
- data/pdfjs/web/cmaps/CNS2-H.bcmap +0 -0
- data/pdfjs/web/cmaps/CNS2-V.bcmap +3 -0
- data/pdfjs/web/cmaps/ETHK-B5-H.bcmap +0 -0
- data/pdfjs/web/cmaps/ETHK-B5-V.bcmap +0 -0
- data/pdfjs/web/cmaps/ETen-B5-H.bcmap +0 -0
- data/pdfjs/web/cmaps/ETen-B5-V.bcmap +0 -0
- data/pdfjs/web/cmaps/ETenms-B5-H.bcmap +3 -0
- data/pdfjs/web/cmaps/ETenms-B5-V.bcmap +0 -0
- data/pdfjs/web/cmaps/EUC-H.bcmap +0 -0
- data/pdfjs/web/cmaps/EUC-V.bcmap +0 -0
- data/pdfjs/web/cmaps/Ext-H.bcmap +0 -0
- data/pdfjs/web/cmaps/Ext-RKSJ-H.bcmap +0 -0
- data/pdfjs/web/cmaps/Ext-RKSJ-V.bcmap +0 -0
- data/pdfjs/web/cmaps/Ext-V.bcmap +0 -0
- data/pdfjs/web/cmaps/GB-EUC-H.bcmap +0 -0
- data/pdfjs/web/cmaps/GB-EUC-V.bcmap +0 -0
- data/pdfjs/web/cmaps/GB-H.bcmap +4 -0
- data/pdfjs/web/cmaps/GB-V.bcmap +0 -0
- data/pdfjs/web/cmaps/GBK-EUC-H.bcmap +0 -0
- data/pdfjs/web/cmaps/GBK-EUC-V.bcmap +0 -0
- data/pdfjs/web/cmaps/GBK2K-H.bcmap +0 -0
- data/pdfjs/web/cmaps/GBK2K-V.bcmap +0 -0
- data/pdfjs/web/cmaps/GBKp-EUC-H.bcmap +0 -0
- data/pdfjs/web/cmaps/GBKp-EUC-V.bcmap +0 -0
- data/pdfjs/web/cmaps/GBT-EUC-H.bcmap +0 -0
- data/pdfjs/web/cmaps/GBT-EUC-V.bcmap +0 -0
- data/pdfjs/web/cmaps/GBT-H.bcmap +0 -0
- data/pdfjs/web/cmaps/GBT-V.bcmap +0 -0
- data/pdfjs/web/cmaps/GBTpc-EUC-H.bcmap +0 -0
- data/pdfjs/web/cmaps/GBTpc-EUC-V.bcmap +0 -0
- data/pdfjs/web/cmaps/GBpc-EUC-H.bcmap +0 -0
- data/pdfjs/web/cmaps/GBpc-EUC-V.bcmap +0 -0
- data/pdfjs/web/cmaps/H.bcmap +0 -0
- data/pdfjs/web/cmaps/HKdla-B5-H.bcmap +0 -0
- data/pdfjs/web/cmaps/HKdla-B5-V.bcmap +0 -0
- data/pdfjs/web/cmaps/HKdlb-B5-H.bcmap +0 -0
- data/pdfjs/web/cmaps/HKdlb-B5-V.bcmap +0 -0
- data/pdfjs/web/cmaps/HKgccs-B5-H.bcmap +0 -0
- data/pdfjs/web/cmaps/HKgccs-B5-V.bcmap +0 -0
- data/pdfjs/web/cmaps/HKm314-B5-H.bcmap +0 -0
- data/pdfjs/web/cmaps/HKm314-B5-V.bcmap +0 -0
- data/pdfjs/web/cmaps/HKm471-B5-H.bcmap +0 -0
- data/pdfjs/web/cmaps/HKm471-B5-V.bcmap +0 -0
- data/pdfjs/web/cmaps/HKscs-B5-H.bcmap +0 -0
- data/pdfjs/web/cmaps/HKscs-B5-V.bcmap +0 -0
- data/pdfjs/web/cmaps/Hankaku.bcmap +0 -0
- data/pdfjs/web/cmaps/Hiragana.bcmap +0 -0
- data/pdfjs/web/cmaps/KSC-EUC-H.bcmap +0 -0
- data/pdfjs/web/cmaps/KSC-EUC-V.bcmap +0 -0
- data/pdfjs/web/cmaps/KSC-H.bcmap +0 -0
- data/pdfjs/web/cmaps/KSC-Johab-H.bcmap +0 -0
- data/pdfjs/web/cmaps/KSC-Johab-V.bcmap +0 -0
- data/pdfjs/web/cmaps/KSC-V.bcmap +0 -0
- data/pdfjs/web/cmaps/KSCms-UHC-H.bcmap +0 -0
- data/pdfjs/web/cmaps/KSCms-UHC-HW-H.bcmap +0 -0
- data/pdfjs/web/cmaps/KSCms-UHC-HW-V.bcmap +0 -0
- data/pdfjs/web/cmaps/KSCms-UHC-V.bcmap +0 -0
- data/pdfjs/web/cmaps/KSCpc-EUC-H.bcmap +0 -0
- data/pdfjs/web/cmaps/KSCpc-EUC-V.bcmap +0 -0
- data/pdfjs/web/cmaps/Katakana.bcmap +0 -0
- data/pdfjs/web/cmaps/LICENSE +36 -0
- data/pdfjs/web/cmaps/NWP-H.bcmap +0 -0
- data/pdfjs/web/cmaps/NWP-V.bcmap +0 -0
- data/pdfjs/web/cmaps/RKSJ-H.bcmap +0 -0
- data/pdfjs/web/cmaps/RKSJ-V.bcmap +0 -0
- data/pdfjs/web/cmaps/Roman.bcmap +0 -0
- data/pdfjs/web/cmaps/UniCNS-UCS2-H.bcmap +0 -0
- data/pdfjs/web/cmaps/UniCNS-UCS2-V.bcmap +0 -0
- data/pdfjs/web/cmaps/UniCNS-UTF16-H.bcmap +0 -0
- data/pdfjs/web/cmaps/UniCNS-UTF16-V.bcmap +0 -0
- data/pdfjs/web/cmaps/UniCNS-UTF32-H.bcmap +0 -0
- data/pdfjs/web/cmaps/UniCNS-UTF32-V.bcmap +0 -0
- data/pdfjs/web/cmaps/UniCNS-UTF8-H.bcmap +0 -0
- data/pdfjs/web/cmaps/UniCNS-UTF8-V.bcmap +0 -0
- data/pdfjs/web/cmaps/UniGB-UCS2-H.bcmap +0 -0
- data/pdfjs/web/cmaps/UniGB-UCS2-V.bcmap +0 -0
- data/pdfjs/web/cmaps/UniGB-UTF16-H.bcmap +0 -0
- data/pdfjs/web/cmaps/UniGB-UTF16-V.bcmap +0 -0
- data/pdfjs/web/cmaps/UniGB-UTF32-H.bcmap +0 -0
- data/pdfjs/web/cmaps/UniGB-UTF32-V.bcmap +0 -0
- data/pdfjs/web/cmaps/UniGB-UTF8-H.bcmap +0 -0
- data/pdfjs/web/cmaps/UniGB-UTF8-V.bcmap +0 -0
- data/pdfjs/web/cmaps/UniJIS-UCS2-H.bcmap +0 -0
- data/pdfjs/web/cmaps/UniJIS-UCS2-HW-H.bcmap +0 -0
- data/pdfjs/web/cmaps/UniJIS-UCS2-HW-V.bcmap +0 -0
- data/pdfjs/web/cmaps/UniJIS-UCS2-V.bcmap +0 -0
- data/pdfjs/web/cmaps/UniJIS-UTF16-H.bcmap +0 -0
- data/pdfjs/web/cmaps/UniJIS-UTF16-V.bcmap +0 -0
- data/pdfjs/web/cmaps/UniJIS-UTF32-H.bcmap +0 -0
- data/pdfjs/web/cmaps/UniJIS-UTF32-V.bcmap +0 -0
- data/pdfjs/web/cmaps/UniJIS-UTF8-H.bcmap +0 -0
- data/pdfjs/web/cmaps/UniJIS-UTF8-V.bcmap +0 -0
- data/pdfjs/web/cmaps/UniJIS2004-UTF16-H.bcmap +0 -0
- data/pdfjs/web/cmaps/UniJIS2004-UTF16-V.bcmap +0 -0
- data/pdfjs/web/cmaps/UniJIS2004-UTF32-H.bcmap +0 -0
- data/pdfjs/web/cmaps/UniJIS2004-UTF32-V.bcmap +0 -0
- data/pdfjs/web/cmaps/UniJIS2004-UTF8-H.bcmap +0 -0
- data/pdfjs/web/cmaps/UniJIS2004-UTF8-V.bcmap +0 -0
- data/pdfjs/web/cmaps/UniJISPro-UCS2-HW-V.bcmap +0 -0
- data/pdfjs/web/cmaps/UniJISPro-UCS2-V.bcmap +0 -0
- data/pdfjs/web/cmaps/UniJISPro-UTF8-V.bcmap +0 -0
- data/pdfjs/web/cmaps/UniJISX0213-UTF32-H.bcmap +0 -0
- data/pdfjs/web/cmaps/UniJISX0213-UTF32-V.bcmap +0 -0
- data/pdfjs/web/cmaps/UniJISX02132004-UTF32-H.bcmap +0 -0
- data/pdfjs/web/cmaps/UniJISX02132004-UTF32-V.bcmap +0 -0
- data/pdfjs/web/cmaps/UniKS-UCS2-H.bcmap +0 -0
- data/pdfjs/web/cmaps/UniKS-UCS2-V.bcmap +0 -0
- data/pdfjs/web/cmaps/UniKS-UTF16-H.bcmap +0 -0
- data/pdfjs/web/cmaps/UniKS-UTF16-V.bcmap +0 -0
- data/pdfjs/web/cmaps/UniKS-UTF32-H.bcmap +0 -0
- data/pdfjs/web/cmaps/UniKS-UTF32-V.bcmap +0 -0
- data/pdfjs/web/cmaps/UniKS-UTF8-H.bcmap +0 -0
- data/pdfjs/web/cmaps/UniKS-UTF8-V.bcmap +0 -0
- data/pdfjs/web/cmaps/V.bcmap +0 -0
- data/pdfjs/web/cmaps/WP-Symbol.bcmap +0 -0
- data/pdfjs/web/compressed.tracemonkey-pldi-09.pdf +0 -0
- data/pdfjs/web/debugger.css +113 -0
- data/pdfjs/web/debugger.js +612 -0
- data/pdfjs/web/images/annotation-check.svg +11 -0
- data/pdfjs/web/images/annotation-comment.svg +16 -0
- data/pdfjs/web/images/annotation-help.svg +26 -0
- data/pdfjs/web/images/annotation-insert.svg +10 -0
- data/pdfjs/web/images/annotation-key.svg +11 -0
- data/pdfjs/web/images/annotation-newparagraph.svg +11 -0
- data/pdfjs/web/images/annotation-noicon.svg +7 -0
- data/pdfjs/web/images/annotation-note.svg +42 -0
- data/pdfjs/web/images/annotation-paperclip.svg +6 -0
- data/pdfjs/web/images/annotation-paragraph.svg +16 -0
- data/pdfjs/web/images/annotation-pushpin.svg +7 -0
- data/pdfjs/web/images/cursor-editorFreeText.svg +3 -0
- data/pdfjs/web/images/cursor-editorInk.svg +4 -0
- data/pdfjs/web/images/findbarButton-next.svg +3 -0
- data/pdfjs/web/images/findbarButton-previous.svg +3 -0
- data/pdfjs/web/images/loading-dark.svg +24 -0
- data/pdfjs/web/images/loading-icon.gif +0 -0
- data/pdfjs/web/images/loading.svg +1 -0
- data/pdfjs/web/images/secondaryToolbarButton-documentProperties.svg +3 -0
- data/pdfjs/web/images/secondaryToolbarButton-firstPage.svg +3 -0
- data/pdfjs/web/images/secondaryToolbarButton-handTool.svg +3 -0
- data/pdfjs/web/images/secondaryToolbarButton-lastPage.svg +3 -0
- data/pdfjs/web/images/secondaryToolbarButton-rotateCcw.svg +3 -0
- data/pdfjs/web/images/secondaryToolbarButton-rotateCw.svg +3 -0
- data/pdfjs/web/images/secondaryToolbarButton-scrollHorizontal.svg +3 -0
- data/pdfjs/web/images/secondaryToolbarButton-scrollPage.svg +3 -0
- data/pdfjs/web/images/secondaryToolbarButton-scrollVertical.svg +3 -0
- data/pdfjs/web/images/secondaryToolbarButton-scrollWrapped.svg +3 -0
- data/pdfjs/web/images/secondaryToolbarButton-selectTool.svg +3 -0
- data/pdfjs/web/images/secondaryToolbarButton-spreadEven.svg +3 -0
- data/pdfjs/web/images/secondaryToolbarButton-spreadNone.svg +3 -0
- data/pdfjs/web/images/secondaryToolbarButton-spreadOdd.svg +3 -0
- data/pdfjs/web/images/shadow.png +0 -0
- data/pdfjs/web/images/toolbarButton-bookmark.svg +3 -0
- data/pdfjs/web/images/toolbarButton-currentOutlineItem.svg +3 -0
- data/pdfjs/web/images/toolbarButton-download.svg +4 -0
- data/pdfjs/web/images/toolbarButton-editorFreeText.svg +3 -0
- data/pdfjs/web/images/toolbarButton-editorInk.svg +4 -0
- data/pdfjs/web/images/toolbarButton-menuArrow.svg +3 -0
- data/pdfjs/web/images/toolbarButton-openFile.svg +3 -0
- data/pdfjs/web/images/toolbarButton-pageDown.svg +3 -0
- data/pdfjs/web/images/toolbarButton-pageUp.svg +3 -0
- data/pdfjs/web/images/toolbarButton-presentationMode.svg +3 -0
- data/pdfjs/web/images/toolbarButton-print.svg +3 -0
- data/pdfjs/web/images/toolbarButton-search.svg +3 -0
- data/pdfjs/web/images/toolbarButton-secondaryToolbarToggle.svg +3 -0
- data/pdfjs/web/images/toolbarButton-sidebarToggle.svg +3 -0
- data/pdfjs/web/images/toolbarButton-viewAttachments.svg +3 -0
- data/pdfjs/web/images/toolbarButton-viewLayers.svg +3 -0
- data/pdfjs/web/images/toolbarButton-viewOutline.svg +3 -0
- data/pdfjs/web/images/toolbarButton-viewThumbnail.svg +3 -0
- data/pdfjs/web/images/toolbarButton-zoomIn.svg +3 -0
- data/pdfjs/web/images/toolbarButton-zoomOut.svg +3 -0
- data/pdfjs/web/images/treeitem-collapsed.svg +1 -0
- data/pdfjs/web/images/treeitem-expanded.svg +1 -0
- data/pdfjs/web/locale/ach/viewer.properties +200 -0
- data/pdfjs/web/locale/af/viewer.properties +177 -0
- data/pdfjs/web/locale/an/viewer.properties +243 -0
- data/pdfjs/web/locale/ar/viewer.properties +247 -0
- data/pdfjs/web/locale/ast/viewer.properties +207 -0
- data/pdfjs/web/locale/az/viewer.properties +243 -0
- data/pdfjs/web/locale/be/viewer.properties +274 -0
- data/pdfjs/web/locale/bg/viewer.properties +235 -0
- data/pdfjs/web/locale/bn/viewer.properties +239 -0
- data/pdfjs/web/locale/bo/viewer.properties +238 -0
- data/pdfjs/web/locale/br/viewer.properties +247 -0
- data/pdfjs/web/locale/brx/viewer.properties +205 -0
- data/pdfjs/web/locale/bs/viewer.properties +194 -0
- data/pdfjs/web/locale/ca/viewer.properties +251 -0
- data/pdfjs/web/locale/cak/viewer.properties +249 -0
- data/pdfjs/web/locale/ckb/viewer.properties +234 -0
- data/pdfjs/web/locale/cs/viewer.properties +274 -0
- data/pdfjs/web/locale/cy/viewer.properties +274 -0
- data/pdfjs/web/locale/da/viewer.properties +274 -0
- data/pdfjs/web/locale/de/viewer.properties +274 -0
- data/pdfjs/web/locale/dsb/viewer.properties +274 -0
- data/pdfjs/web/locale/el/viewer.properties +274 -0
- data/pdfjs/web/locale/en-CA/viewer.properties +274 -0
- data/pdfjs/web/locale/en-GB/viewer.properties +274 -0
- data/pdfjs/web/locale/en-US/viewer.properties +253 -0
- data/pdfjs/web/locale/eo/viewer.properties +274 -0
- data/pdfjs/web/locale/es-AR/viewer.properties +274 -0
- data/pdfjs/web/locale/es-CL/viewer.properties +274 -0
- data/pdfjs/web/locale/es-ES/viewer.properties +274 -0
- data/pdfjs/web/locale/es-MX/viewer.properties +274 -0
- data/pdfjs/web/locale/et/viewer.properties +262 -0
- data/pdfjs/web/locale/eu/viewer.properties +272 -0
- data/pdfjs/web/locale/fa/viewer.properties +216 -0
- data/pdfjs/web/locale/ff/viewer.properties +235 -0
- data/pdfjs/web/locale/fi/viewer.properties +274 -0
- data/pdfjs/web/locale/fr/viewer.properties +274 -0
- data/pdfjs/web/locale/fy-NL/viewer.properties +274 -0
- data/pdfjs/web/locale/ga-IE/viewer.properties +202 -0
- data/pdfjs/web/locale/gd/viewer.properties +249 -0
- data/pdfjs/web/locale/gl/viewer.properties +249 -0
- data/pdfjs/web/locale/gn/viewer.properties +274 -0
- data/pdfjs/web/locale/gu-IN/viewer.properties +235 -0
- data/pdfjs/web/locale/he/viewer.properties +274 -0
- data/pdfjs/web/locale/hi-IN/viewer.properties +235 -0
- data/pdfjs/web/locale/hr/viewer.properties +249 -0
- data/pdfjs/web/locale/hsb/viewer.properties +274 -0
- data/pdfjs/web/locale/hu/viewer.properties +274 -0
- data/pdfjs/web/locale/hy-AM/viewer.properties +239 -0
- data/pdfjs/web/locale/hye/viewer.properties +252 -0
- data/pdfjs/web/locale/ia/viewer.properties +274 -0
- data/pdfjs/web/locale/id/viewer.properties +274 -0
- data/pdfjs/web/locale/is/viewer.properties +274 -0
- data/pdfjs/web/locale/it/viewer.properties +215 -0
- data/pdfjs/web/locale/ja/viewer.properties +274 -0
- data/pdfjs/web/locale/ka/viewer.properties +274 -0
- data/pdfjs/web/locale/kab/viewer.properties +274 -0
- data/pdfjs/web/locale/kk/viewer.properties +274 -0
- data/pdfjs/web/locale/km/viewer.properties +210 -0
- data/pdfjs/web/locale/kn/viewer.properties +187 -0
- data/pdfjs/web/locale/ko/viewer.properties +274 -0
- data/pdfjs/web/locale/lij/viewer.properties +235 -0
- data/pdfjs/web/locale/lo/viewer.properties +145 -0
- data/pdfjs/web/locale/locale.properties +327 -0
- data/pdfjs/web/locale/lt/viewer.properties +260 -0
- data/pdfjs/web/locale/ltg/viewer.properties +213 -0
- data/pdfjs/web/locale/lv/viewer.properties +235 -0
- data/pdfjs/web/locale/meh/viewer.properties +111 -0
- data/pdfjs/web/locale/mk/viewer.properties +139 -0
- data/pdfjs/web/locale/mr/viewer.properties +231 -0
- data/pdfjs/web/locale/ms/viewer.properties +235 -0
- data/pdfjs/web/locale/my/viewer.properties +191 -0
- data/pdfjs/web/locale/nb-NO/viewer.properties +274 -0
- data/pdfjs/web/locale/ne-NP/viewer.properties +218 -0
- data/pdfjs/web/locale/nl/viewer.properties +274 -0
- data/pdfjs/web/locale/nn-NO/viewer.properties +274 -0
- data/pdfjs/web/locale/oc/viewer.properties +274 -0
- data/pdfjs/web/locale/pa-IN/viewer.properties +285 -0
- data/pdfjs/web/locale/pl/viewer.properties +274 -0
- data/pdfjs/web/locale/pt-BR/viewer.properties +274 -0
- data/pdfjs/web/locale/pt-PT/viewer.properties +274 -0
- data/pdfjs/web/locale/rm/viewer.properties +274 -0
- data/pdfjs/web/locale/ro/viewer.properties +241 -0
- data/pdfjs/web/locale/ru/viewer.properties +274 -0
- data/pdfjs/web/locale/sat/viewer.properties +198 -0
- data/pdfjs/web/locale/sc/viewer.properties +240 -0
- data/pdfjs/web/locale/scn/viewer.properties +101 -0
- data/pdfjs/web/locale/sco/viewer.properties +249 -0
- data/pdfjs/web/locale/si/viewer.properties +237 -0
- data/pdfjs/web/locale/sk/viewer.properties +274 -0
- data/pdfjs/web/locale/sl/viewer.properties +274 -0
- data/pdfjs/web/locale/son/viewer.properties +173 -0
- data/pdfjs/web/locale/sq/viewer.properties +267 -0
- data/pdfjs/web/locale/sr/viewer.properties +253 -0
- data/pdfjs/web/locale/sv-SE/viewer.properties +274 -0
- data/pdfjs/web/locale/szl/viewer.properties +245 -0
- data/pdfjs/web/locale/ta/viewer.properties +194 -0
- data/pdfjs/web/locale/te/viewer.properties +237 -0
- data/pdfjs/web/locale/tg/viewer.properties +274 -0
- data/pdfjs/web/locale/th/viewer.properties +274 -0
- data/pdfjs/web/locale/tl/viewer.properties +243 -0
- data/pdfjs/web/locale/tr/viewer.properties +274 -0
- data/pdfjs/web/locale/trs/viewer.properties +206 -0
- data/pdfjs/web/locale/uk/viewer.properties +274 -0
- data/pdfjs/web/locale/ur/viewer.properties +239 -0
- data/pdfjs/web/locale/uz/viewer.properties +163 -0
- data/pdfjs/web/locale/vi/viewer.properties +274 -0
- data/pdfjs/web/locale/wo/viewer.properties +123 -0
- data/pdfjs/web/locale/xh/viewer.properties +177 -0
- data/pdfjs/web/locale/zh-CN/viewer.properties +274 -0
- data/pdfjs/web/locale/zh-TW/viewer.properties +274 -0
- data/pdfjs/web/standard_fonts/FoxitDingbats.pfb +0 -0
- data/pdfjs/web/standard_fonts/FoxitFixed.pfb +0 -0
- data/pdfjs/web/standard_fonts/FoxitFixedBold.pfb +0 -0
- data/pdfjs/web/standard_fonts/FoxitFixedBoldItalic.pfb +0 -0
- data/pdfjs/web/standard_fonts/FoxitFixedItalic.pfb +0 -0
- data/pdfjs/web/standard_fonts/FoxitSans.pfb +0 -0
- data/pdfjs/web/standard_fonts/FoxitSansBold.pfb +0 -0
- data/pdfjs/web/standard_fonts/FoxitSansBoldItalic.pfb +0 -0
- data/pdfjs/web/standard_fonts/FoxitSansItalic.pfb +0 -0
- data/pdfjs/web/standard_fonts/FoxitSerif.pfb +0 -0
- data/pdfjs/web/standard_fonts/FoxitSerifBold.pfb +0 -0
- data/pdfjs/web/standard_fonts/FoxitSerifBoldItalic.pfb +0 -0
- data/pdfjs/web/standard_fonts/FoxitSerifItalic.pfb +0 -0
- data/pdfjs/web/standard_fonts/FoxitSymbol.pfb +0 -0
- data/pdfjs/web/standard_fonts/LICENSE_FOXIT +27 -0
- data/pdfjs/web/standard_fonts/LICENSE_LIBERATION +102 -0
- data/pdfjs/web/standard_fonts/LiberationSans-Bold.ttf +0 -0
- data/pdfjs/web/standard_fonts/LiberationSans-BoldItalic.ttf +0 -0
- data/pdfjs/web/standard_fonts/LiberationSans-Italic.ttf +0 -0
- data/pdfjs/web/standard_fonts/LiberationSans-Regular.ttf +0 -0
- data/pdfjs/web/viewer.css +3029 -0
- data/pdfjs/web/viewer.html +433 -0
- data/pdfjs/web/viewer.js +13566 -0
- data/pdfjs/web/viewer.js.map +1 -0
- 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">×</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,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 @@
|
|
1
|
+
<strong><%= creation_date %></strong>
|
@@ -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
|