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
@@ -0,0 +1,67 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module ParticipatoryDocuments
|
5
|
+
# This class serializes a Suggestion so can be exported to CSV, JSON or other
|
6
|
+
# formats.
|
7
|
+
class SuggestionSerializer < Decidim::Exporters::Serializer
|
8
|
+
include Decidim::ApplicationHelper
|
9
|
+
include Decidim::TranslationsHelper
|
10
|
+
include Decidim::ParticipatoryDocuments::Admin::SuggestionHelper
|
11
|
+
include ActionView::Helpers::TextHelper
|
12
|
+
|
13
|
+
# Public: Initializes the serializer with a suggestion.
|
14
|
+
def initialize(suggestion)
|
15
|
+
@suggestion = suggestion
|
16
|
+
end
|
17
|
+
|
18
|
+
# Public: Exports a hash with the serialized data for this suggestion.
|
19
|
+
def serialize
|
20
|
+
{
|
21
|
+
id: suggestion.id,
|
22
|
+
body: suggestion_body(suggestion),
|
23
|
+
author: suggestion.try(:normalized_author).try(:name),
|
24
|
+
state: humanize_suggestion_state(suggestion.state),
|
25
|
+
answer: answer_text(suggestion),
|
26
|
+
section: section(suggestion),
|
27
|
+
valuators: suggestion.valuation_assignments.count,
|
28
|
+
submitted_on: submitted_on(suggestion)
|
29
|
+
}
|
30
|
+
end
|
31
|
+
|
32
|
+
private
|
33
|
+
|
34
|
+
attr_reader :suggestion
|
35
|
+
|
36
|
+
def section(suggestion)
|
37
|
+
if suggestion.suggestable.is_a?(Decidim::ParticipatoryDocuments::Document)
|
38
|
+
I18n.t("global", scope: "decidim.participatory_documents.admin.suggestions.suggestion")
|
39
|
+
else
|
40
|
+
translated_attribute(suggestion.suggestable.title)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
def submitted_on(suggestion)
|
45
|
+
I18n.l(suggestion.created_at, format: :decidim_short)
|
46
|
+
end
|
47
|
+
|
48
|
+
def prepare_text(suggestion, attribute)
|
49
|
+
text_length = Decidim::ParticipatoryDocuments.max_export_text_length
|
50
|
+
|
51
|
+
if text_length.positive?
|
52
|
+
truncate(translated_attribute(suggestion.public_send(attribute)), length: text_length)
|
53
|
+
else
|
54
|
+
translated_attribute(suggestion.public_send(attribute))
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
def suggestion_body(suggestion)
|
59
|
+
prepare_text(suggestion, :body)
|
60
|
+
end
|
61
|
+
|
62
|
+
def answer_text(suggestion)
|
63
|
+
prepare_text(suggestion, :answer)
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<span class="<%= component.manifest_name == "participatory_documents" ? "exports dropdown button small light" : "exports dropdown tiny button button--simple" %>" data-toggle="export-dropdown">
|
2
|
+
<%= t "actions.export", scope: "decidim.admin" %>
|
3
|
+
</span>
|
4
|
+
<div class="dropdown-pane" id="export-dropdown" data-dropdown data-position=bottom data-alignment=right data-auto-focus="true" data-close-on-click="true">
|
5
|
+
<ul class="vertical menu add-components">
|
6
|
+
<% component.manifest.export_manifests.each do |manifest| %>
|
7
|
+
<% manifest.formats.each do |format| %>
|
8
|
+
<li class="exports--format--<%= format.downcase %> exports--<%= manifest.name %>">
|
9
|
+
<%= link_to t("decidim.admin.exports.export_as", name: t("decidim.#{component.manifest.name}.admin.exports.#{manifest.name}"), export_format: t("decidim.admin.exports.formats.#{format}")),
|
10
|
+
exports_path(component, id: manifest.name, format: format, resource_id: resource_id),
|
11
|
+
method: :post %>
|
12
|
+
</li>
|
13
|
+
<% end %>
|
14
|
+
<% end %>
|
15
|
+
</ul>
|
16
|
+
</div>
|
@@ -0,0 +1,39 @@
|
|
1
|
+
<div class="row column">
|
2
|
+
<%= form.translated :text_field, :title, autofocus: true %>
|
3
|
+
</div>
|
4
|
+
|
5
|
+
<div class="row column">
|
6
|
+
<%= form.translated :editor, :description %>
|
7
|
+
</div>
|
8
|
+
|
9
|
+
<div class="row column">
|
10
|
+
<fieldset class="fieldset">
|
11
|
+
<% if document&.sections&.any? || document&.has_suggestions? %>
|
12
|
+
<div class="callout alert" style="margin:-1em -1em 1em -1em;"><%= t document&.has_suggestions? ? ".alert_suggestions_html" : ".warning_sections_html" %></div>
|
13
|
+
<% end %>
|
14
|
+
<%= form.upload :file, optional: !current_component.published?, help_i18n_messages: "pdf_message" %>
|
15
|
+
</fieldset>
|
16
|
+
</div>
|
17
|
+
|
18
|
+
<div class="row column">
|
19
|
+
<%= form.color_field :box_color %>
|
20
|
+
</div>
|
21
|
+
|
22
|
+
<div class="row column">
|
23
|
+
<%= form.number_field :box_opacity, min: 0, max: 100 %>
|
24
|
+
</div>
|
25
|
+
|
26
|
+
<div class="row column box-preview">
|
27
|
+
<fieldset class="fieldset">
|
28
|
+
<h4><%= t ".box_style_preview" %></h4>
|
29
|
+
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam lectus. Sed sit amet ipsum mauris. Maecenas congue ligula ac quam viverra nec consectetur ante hendrerit. Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean ut gravida lorem. Ut turpis felis, pulvinar a semper sed, adipiscing id dolor. Pellentesque auctor nisi id magna consequat sagittis. Curabitur dapibus enim sit amet elit pharetra tincidunt feugiat nisl imperdiet.</p>
|
30
|
+
<p>Ut convallis libero in urna ultrices accumsan. Donec sed odio eros. Donec viverra mi quis quam pulvinar at malesuada arcu rhoncus. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. In rutrum accumsan ultricies. Mauris vitae nisi at sem facilisis semper ac in est.</p>
|
31
|
+
<div class="box" data-section-number="<%= rand(1..9) %>">
|
32
|
+
<div class="box-controls">
|
33
|
+
<div class="control move"></div>
|
34
|
+
<div class="control group"></div>
|
35
|
+
</div>
|
36
|
+
</div>
|
37
|
+
</fieldset>
|
38
|
+
</div>
|
39
|
+
<%= pdf_custom_style %>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<div class="card full-height">
|
2
|
+
<div class="card-divider">
|
3
|
+
<h2 class="card-title flex--sbc">
|
4
|
+
<%= translated_attribute(current_component.name) %>
|
5
|
+
<%= render "title", button: :back %>
|
6
|
+
</h2>
|
7
|
+
</div>
|
8
|
+
<div class="card-section">
|
9
|
+
|
10
|
+
<%= decidim_form_for(@form, url: { action: "update" }, html: { class: "form documents_form edit_document" }) do |f| %>
|
11
|
+
<%= render partial: "form", object: f, locals: { form: f, title: t(".title") } %>
|
12
|
+
|
13
|
+
<div class="button--double form-general-submit">
|
14
|
+
<%= f.submit t(".update") %>
|
15
|
+
</div>
|
16
|
+
<% end %>
|
17
|
+
</div>
|
18
|
+
</div>
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<div class="card full-height">
|
2
|
+
<div class="card-divider">
|
3
|
+
<h2 class="card-title flex--sbc">
|
4
|
+
<%= translated_attribute(current_component.name) %>
|
5
|
+
<%= render "title", button: :back %>
|
6
|
+
</h2>
|
7
|
+
</div>
|
8
|
+
<div class="card-section pdf-viewer-container">
|
9
|
+
<iframe src="<%= pdf_viewer_documents_path(file: document.attached_uploader(:file).path) %>" width="100%" height="100%" id="pdf-iframe" frameborder="0" allowfullscreen_="" webkitallowfullscreen_="true" mozallowfullscreen_="true" oallowfullscreen_="true" msallowfullscreen_="true">
|
10
|
+
<noscript>
|
11
|
+
<h3 class="text-center"><%= t("decidim.participatory_documents.documents.not_supported") %></h3>
|
12
|
+
</noscript>
|
13
|
+
</iframe>
|
14
|
+
</div>
|
15
|
+
</div>
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<div class="card full-height">
|
2
|
+
<div class="card-divider">
|
3
|
+
<h2 class="card-title flex--sbc">
|
4
|
+
<%= translated_attribute(current_component.name) %>
|
5
|
+
<%= render "title" %>
|
6
|
+
</h2>
|
7
|
+
</div>
|
8
|
+
<div class="card-section">
|
9
|
+
<p class="text-large text-center mt-s"><%= t(".start") %></p>
|
10
|
+
</div>
|
11
|
+
</div>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<div class="card full-height">
|
2
|
+
<div class="card-divider">
|
3
|
+
<h2 class="card-title flex--sbc">
|
4
|
+
<%= translated_attribute(current_component.name) %>
|
5
|
+
<%= render "title", button: :back %>
|
6
|
+
</h2>
|
7
|
+
</div>
|
8
|
+
<div class="card-section">
|
9
|
+
<%= decidim_form_for(@form, html: { class: "form documents_form new_document" }) do |f| %>
|
10
|
+
<%= render partial: "form", object: f, locals: { title: t(".title") } %>
|
11
|
+
|
12
|
+
<div class="button--double form-general-submit">
|
13
|
+
<%= f.submit t(".create") %>
|
14
|
+
</div>
|
15
|
+
<% end %>
|
16
|
+
</div>
|
17
|
+
</div>
|
@@ -0,0 +1,105 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html dir="ltr" mozdisallowselectionprint>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
6
|
+
<meta name="google" content="notranslate">
|
7
|
+
<title>PDF.js viewer</title>
|
8
|
+
|
9
|
+
<link rel="stylesheet" href="/pdfjs/web/viewer.css">
|
10
|
+
|
11
|
+
<script src="/pdfjs/build/pdf.js"></script>
|
12
|
+
|
13
|
+
<!-- This snippet is used in production (included from viewer.html) -->
|
14
|
+
<link rel="resource" type="application/l10n" href="/pdfjs/web/locale/locale.properties">
|
15
|
+
<script src="/pdfjs/web/viewer.js"></script>
|
16
|
+
<%= javascript_pack_tag "decidim_participatory_documents_editor" %>
|
17
|
+
<%= stylesheet_pack_tag "decidim_participatory_documents_editor" %>
|
18
|
+
<%= organization_colors %>
|
19
|
+
<%= pdf_custom_style %>
|
20
|
+
<%= csrf_meta_tags %>
|
21
|
+
</head>
|
22
|
+
|
23
|
+
<body tabindex="1">
|
24
|
+
<%= render "decidim/participatory_documents/documents/pdfjs_base", displaySave: true, globalSuggestions: false %>
|
25
|
+
|
26
|
+
<%= render "decidim/participatory_documents/admin/documents/editor_modal" %>
|
27
|
+
|
28
|
+
<div id="notifications"></div>
|
29
|
+
|
30
|
+
<script>
|
31
|
+
var AnnotationsPath = '<%= document_annotations_path(document).split("?")[0] %>';
|
32
|
+
var SectionPath = '<%= document_sections_path(document).split("?")[0] %>';
|
33
|
+
var CurrentBoxes = <%= document.annotations.collect(&:serialize).to_json.html_safe %>;
|
34
|
+
var I18n = <%= I18n.t("decidim.participatory_documents.ui_messages").to_json.html_safe %>;
|
35
|
+
|
36
|
+
var pages = {};
|
37
|
+
PDFViewerApplication.initializedPromise.then(function() {
|
38
|
+
var options = {
|
39
|
+
i18n: I18n,
|
40
|
+
editSectionPath: function(group) { return SectionPath + `/${group}/edit`; },
|
41
|
+
sectionPath: function(group) { return SectionPath + `/${group}`; },
|
42
|
+
newSectionPath: SectionPath + "/new",
|
43
|
+
annotationsPath: AnnotationsPath,
|
44
|
+
pdfViewer: PDFViewerApplication.pdfViewer,
|
45
|
+
saveButton: document.getElementById("DecidimPDSaveButton"),
|
46
|
+
csrfToken: document.getElementsByName("csrf-token")[0].content,
|
47
|
+
showInfo: window.showInfo,
|
48
|
+
showAlert: window.showAlert
|
49
|
+
};
|
50
|
+
window.InitDocumentManagers(options);
|
51
|
+
|
52
|
+
window.showInfo(I18n.startEditing, {delay: 5000});
|
53
|
+
|
54
|
+
PDFViewerApplication.eventBus.on('annotationeditorlayerrendered', function (doc) {
|
55
|
+
console.log("rendered", doc)
|
56
|
+
var page = PDFViewerApplication.pdfViewer._pages[doc.pageNumber - 1];
|
57
|
+
var annotationsLayer = page.annotationEditorLayer && page.annotationEditorLayer.div;
|
58
|
+
var savedPage = pages[doc.pageNumber];
|
59
|
+
var boxChanged = function(box) {
|
60
|
+
// reorder box numbers according to page, x position, and y position
|
61
|
+
var boxes = Array.from(document.querySelectorAll(".polygon-ready .box"));
|
62
|
+
boxes.sort(function(a, b) {
|
63
|
+
var aPage = parseInt(a.parentElement.dataset.pageNumber, 10);
|
64
|
+
var bPage = parseInt(b.parentElement.dataset.pageNumber, 10)
|
65
|
+
var aLeft = parseInt(a.style.left, 10);
|
66
|
+
var bLeft = parseInt(b.style.left, 10);
|
67
|
+
var aTop = parseInt(a.style.top, 10);
|
68
|
+
var bTop = parseInt(b.style.top, 10);
|
69
|
+
if(aPage === bPage) {
|
70
|
+
if(aTop === bTop) {
|
71
|
+
return aLeft - bLeft;
|
72
|
+
} else {
|
73
|
+
return aTop - bTop;
|
74
|
+
}
|
75
|
+
} else {
|
76
|
+
return aPage - bPage;
|
77
|
+
}
|
78
|
+
});
|
79
|
+
var sectionNumber = 0;
|
80
|
+
var allSections = {};
|
81
|
+
boxes.forEach(function(box, index) {
|
82
|
+
box.dataset.position = index + 1;
|
83
|
+
box.querySelector("span").innerText = index + 1;
|
84
|
+
if(allSections[box.dataset.section]) {
|
85
|
+
box.dataset.sectionNumber = allSections[box.dataset.section];
|
86
|
+
} else {
|
87
|
+
sectionNumber++;
|
88
|
+
box.dataset.sectionNumber = sectionNumber;
|
89
|
+
}
|
90
|
+
allSections[box.dataset.section] = sectionNumber;
|
91
|
+
});
|
92
|
+
};
|
93
|
+
|
94
|
+
// Let's render the object only if not already existing.
|
95
|
+
// Note that the PDF library might redraw the annotation layer, if this happens we need to re-render the areas.
|
96
|
+
if(annotationsLayer && (!savedPage || savedPage.boxEditor.div !== annotationsLayer)) {
|
97
|
+
annotationsLayer.dataset.pageNumber = doc.pageNumber;
|
98
|
+
page.boxEditor = window.InitPolygonEditor(annotationsLayer, CurrentBoxes.filter(function(box) { return box.page_number === doc.pageNumber; }), options, boxChanged);
|
99
|
+
pages[doc.pageNumber] = page;
|
100
|
+
}
|
101
|
+
});
|
102
|
+
});
|
103
|
+
</script>
|
104
|
+
</body>
|
105
|
+
</html>
|
@@ -0,0 +1,24 @@
|
|
1
|
+
|
2
|
+
|
3
|
+
<div class="reveal-overlay">
|
4
|
+
<div class="reveal" id="editor-modal">
|
5
|
+
<%= decidim_form_for([document, @form], html: { class: "form" }) do |form| %>
|
6
|
+
<div class="card">
|
7
|
+
<div class="card-divider">
|
8
|
+
<h2 class="card-title" id="editor-modal-title">Card title</h2>
|
9
|
+
</div>
|
10
|
+
<div class="card-section" id="editor-modal-content">
|
11
|
+
<%= form.translated :text_field, :title, autofocus: true %>
|
12
|
+
</div>
|
13
|
+
</div>
|
14
|
+
<% end %>
|
15
|
+
<div class="button--double form-general-submit">
|
16
|
+
<button class="button" id="editor-modal-save">Save</button>
|
17
|
+
<button class="button alert" id="editor-modal-remove">Delete</button>
|
18
|
+
</div>
|
19
|
+
|
20
|
+
<button class="close-button" id="editor-modal-close" data-close aria-label="Close" type="button">
|
21
|
+
<span aria-hidden="true">×</span>
|
22
|
+
</button>
|
23
|
+
</div>
|
24
|
+
</div>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<% if note.author == current_user %>
|
2
|
+
<%= cell("decidim/participatory_documents/edit_suggestion_note_modal", note, modal_id: "editNoteModal#{note.id}", note: note, suggestion: suggestion) %>
|
3
|
+
<button type="button" class="link-alt m-xs"
|
4
|
+
data-open="<%= current_user.present? ? "editNoteModal#{note.id}" : "loginModal" %>"
|
5
|
+
title="<%= t("modal.title", scope: "decidim.participatory_documents.admin.suggestion_notes") %>"
|
6
|
+
aria-controls="<%= current_user.present? ? "editNoteModal#{note.id}" : "loginModal" %>"
|
7
|
+
aria-haspopup="true"
|
8
|
+
tabindex="0"
|
9
|
+
style="color:#97a2b2; cursor: pointer">
|
10
|
+
<%= icon "pencil", aria_hidden: true, class: "action-icon--preview", role: "img", "aria-hidden": true %>
|
11
|
+
</button>
|
12
|
+
<% end %>
|
13
|
+
<% if note.created_at != note.updated_at %>
|
14
|
+
<span class="text-muted">
|
15
|
+
<%= t("update.edited", scope: "decidim.participatory_documents.admin.suggestion_notes") %>
|
16
|
+
<%= l note.updated_at, format: :short %>
|
17
|
+
</span>
|
18
|
+
<% end %>
|
@@ -0,0 +1,8 @@
|
|
1
|
+
<%= decidim_form_for(notes_form, url: document_suggestion_suggestion_notes_path(document, suggestion, notes_form), html: { class: "form new_suggestion_note" }) do |f| %>
|
2
|
+
<div class="row column">
|
3
|
+
<%= f.text_area :body, rows: 10, label: t(".note") %>
|
4
|
+
</div>
|
5
|
+
<div class="button--double form-general-submit">
|
6
|
+
<%= f.submit t(".submit") %>
|
7
|
+
</div>
|
8
|
+
<% end %>
|
data/app/views/decidim/participatory_documents/admin/suggestion_notes/_suggestion_notes.html.erb
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
<section class="comments">
|
2
|
+
<div class="card">
|
3
|
+
<div class="card-divider">
|
4
|
+
<h2 class="card-title"><%= t("title", scope: "decidim.participatory_documents.admin.suggestion_notes") %></h2>
|
5
|
+
</div>
|
6
|
+
|
7
|
+
<div class="card-section">
|
8
|
+
<div class="comment-thread">
|
9
|
+
<% suggestion.notes.each do |note| %>
|
10
|
+
<div class="card">
|
11
|
+
<div class="card-divider">
|
12
|
+
<div class="comment">
|
13
|
+
<div class="comment__header">
|
14
|
+
<div class="author-data">
|
15
|
+
<div class="author-data__main">
|
16
|
+
<div class="author author--inline">
|
17
|
+
<strong><span class="author__name"><%= note.author.name %></span></strong>
|
18
|
+
<span><%= l note.created_at, format: :decidim_short %></span>
|
19
|
+
<%= render partial: "decidim/participatory_documents/admin/suggestion_notes/editing_suggestion_note", locals: { note: note } %>
|
20
|
+
</div>
|
21
|
+
</div>
|
22
|
+
</div>
|
23
|
+
</div>
|
24
|
+
<div class="comment__content">
|
25
|
+
<%= simple_format Decidim::ContentRenderers::LinkRenderer.new(note.body).render.html_safe %>
|
26
|
+
</div>
|
27
|
+
</div>
|
28
|
+
</div>
|
29
|
+
</div>
|
30
|
+
<% end %>
|
31
|
+
</div>
|
32
|
+
</div>
|
33
|
+
<div class="card-section">
|
34
|
+
<div class="add-comment">
|
35
|
+
<div class="card">
|
36
|
+
<div class="card-divider">
|
37
|
+
<h2 class="card-title"><%= t("leave_your_note", scope: "decidim.participatory_documents.admin.suggestion_notes") %></h2>
|
38
|
+
</div>
|
39
|
+
<div class="card-section">
|
40
|
+
<%= render "decidim/participatory_documents/admin/suggestion_notes/form" %>
|
41
|
+
</div>
|
42
|
+
</div>
|
43
|
+
</div>
|
44
|
+
</div>
|
45
|
+
</div>
|
46
|
+
</section>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<% if allowed_to? :assign_to_valuator, :suggestions %>
|
2
|
+
<div id="js-assign-suggestion-to-valuator-actions" class="form-single-suggestion"
|
3
|
+
style="max-width:400px">
|
4
|
+
<%= form_tag(document_valuation_assignment_path(document), method: :post, id: "js-form-assign-suggestion-to-valuator",
|
5
|
+
class: "flex--lc flex-gap--1") do %>
|
6
|
+
<div class="checkboxes hide">
|
7
|
+
<%= check_box_tag "suggestion_ids[]", suggestion.id, true,
|
8
|
+
class: "js-check-all-suggestion js-suggestion-id-#{suggestion.id}" %>
|
9
|
+
</div>
|
10
|
+
|
11
|
+
<%= bulk_valuators_select(current_participatory_space, t("decidim.participatory_documents.admin.suggestions.index.actions.assign_to_valuator")) %>
|
12
|
+
<%= submit_tag(t("decidim.participatory_documents.admin.suggestions.index.actions.assign_to_valuator_button"),
|
13
|
+
id: "js-submit-assign-suggestion-to-valuator",
|
14
|
+
class: "button small button--simple float-left") %>
|
15
|
+
<% end %>
|
16
|
+
</div>
|
17
|
+
<% end %>
|
@@ -0,0 +1,7 @@
|
|
1
|
+
<div class="flex--cc flex-gap--1">
|
2
|
+
<%= render "decidim/participatory_documents/admin/suggestions/bulk_actions/dropdown" %>
|
3
|
+
<%= export_dropdown %>
|
4
|
+
<%= render partial: "decidim/participatory_documents/admin/suggestions/bulk_actions/assign_to_valuator" %>
|
5
|
+
<%= render partial: "decidim/participatory_documents/admin/suggestions/bulk_actions/unassign_from_valuator" %>
|
6
|
+
<%= render partial: "decidim/participatory_documents/admin/suggestions/bulk_actions/publish_answers" %>
|
7
|
+
</div>
|
@@ -0,0 +1,30 @@
|
|
1
|
+
<%= decidim_form_for(@form, url: answer_document_suggestion_path(document, suggestion), html: { class: "form edit_suggestion suggestion_form_admin" }) do |form| %>
|
2
|
+
<div class="card" id="suggestion-answer">
|
3
|
+
<div class="card-divider">
|
4
|
+
<h2 class="card-title"><%= t ".title" %></h2>
|
5
|
+
</div>
|
6
|
+
<div class="card-section">
|
7
|
+
<div class="row column">
|
8
|
+
<%= form.collection_radio_buttons :state, [
|
9
|
+
["not_answered", t("not_answered", scope: "decidim.participatory_documents.suggestions.answers")],
|
10
|
+
["accepted", t("accepted", scope: "decidim.participatory_documents.suggestions.answers")],
|
11
|
+
["rejected", t("rejected", scope: "decidim.participatory_documents.suggestions.answers")],
|
12
|
+
["evaluating", t("evaluating", scope: "decidim.participatory_documents.suggestions.answers")]
|
13
|
+
], :first, :last, prompt: true %>
|
14
|
+
</div>
|
15
|
+
|
16
|
+
<div class="row column">
|
17
|
+
<%= form.translated :text_area, :answer, autofocus: true, rows: 15 %>
|
18
|
+
</div>
|
19
|
+
|
20
|
+
<div class="row column">
|
21
|
+
<%= form.check_box :answer_is_published, label: t(".answer_is_published") %>
|
22
|
+
</div>
|
23
|
+
|
24
|
+
</div>
|
25
|
+
</div>
|
26
|
+
|
27
|
+
<div class="button--double form-general-submit">
|
28
|
+
<%= form.submit t(".answer") %>
|
29
|
+
</div>
|
30
|
+
<% end %>
|
@@ -0,0 +1,33 @@
|
|
1
|
+
<tr <%= "data-published-state=false" if suggestion.has_answer? && suggestion.not_not_answered? && !suggestion.answer_is_published? %>>
|
2
|
+
<td>
|
3
|
+
<%= check_box_tag "suggestions_ids_s[]", suggestion.id, false, class: "js-check-all-suggestion js-suggestion-list-check js-suggestion-id-#{suggestion.id}" %><br>
|
4
|
+
</td>
|
5
|
+
<td><%= suggestion.id %></td>
|
6
|
+
<td>
|
7
|
+
<%= truncate(suggestion_content(suggestion)[:text], length: 50) %>
|
8
|
+
<% if suggestion_content(suggestion)[:file_link] %>
|
9
|
+
<%= suggestion_content(suggestion)[:file_link] %>
|
10
|
+
<% end %>
|
11
|
+
</td>
|
12
|
+
<td><%= suggestion.try(:normalized_author).try(:name) %></td>
|
13
|
+
<td><%= suggestion.suggestable.is_a?(Decidim::ParticipatoryDocuments::Document) ? t(".global") : translated_attribute(suggestion.suggestable.title) %></td>
|
14
|
+
<td>
|
15
|
+
<% if suggestion.has_answer? %>
|
16
|
+
<%= humanize_boolean suggestion.answered? && suggestion.answer_is_published? %>
|
17
|
+
<% else %>
|
18
|
+
-
|
19
|
+
<% end %>
|
20
|
+
</td>
|
21
|
+
<td><%= humanize_suggestion_state(suggestion.state) %></td>
|
22
|
+
<td class="valuators-count">
|
23
|
+
<% count = suggestion.valuation_assignments.size %>
|
24
|
+
<% if count.zero? %>
|
25
|
+
0
|
26
|
+
<% else %>
|
27
|
+
<%= suggestion.valuation_assignments.first&.valuator_role&.user&.name %>
|
28
|
+
<%= "(+#{(count - 1)})" if count > 1 %>
|
29
|
+
<% end %>
|
30
|
+
</td>
|
31
|
+
<td><%= l suggestion.created_at, format: :decidim_short %></td>
|
32
|
+
<td><%= icon_with_link_to_suggestion(document, suggestion) %></td>
|
33
|
+
</tr>
|
@@ -0,0 +1,43 @@
|
|
1
|
+
|
2
|
+
<% if suggestion.valuators.any? || allowed_to?(:assign_to_valuator, :suggestions) %>
|
3
|
+
<div class="card">
|
4
|
+
<div class="card-divider">
|
5
|
+
<h2 class="card-title">
|
6
|
+
<%= t ".valuators" %>
|
7
|
+
</h2>
|
8
|
+
</div>
|
9
|
+
|
10
|
+
<div class="card-section">
|
11
|
+
<div class="row column">
|
12
|
+
<% if suggestion.valuators.any? %>
|
13
|
+
<strong><%= t ".assigned_valuators" %>:</strong>
|
14
|
+
<ul id="valuators">
|
15
|
+
<% suggestion.valuation_assignments.each do |assignment| %>
|
16
|
+
<% presented_valuator = present(assignment.valuator) %>
|
17
|
+
<li>
|
18
|
+
<%= link_to(
|
19
|
+
presented_valuator.name,
|
20
|
+
presented_valuator.profile_path,
|
21
|
+
target: :blank
|
22
|
+
) %>
|
23
|
+
|
24
|
+
<% if allowed_to? :unassign_from_valuator, :suggestions, valuator: assignment.valuator %>
|
25
|
+
<%= icon_link_to(
|
26
|
+
"circle-x",
|
27
|
+
document_suggestion_valuation_assignment_path(document, suggestion, assignment.valuator_role),
|
28
|
+
t(".remove_assignment"),
|
29
|
+
method: :delete,
|
30
|
+
data: { confirm: t(".remove_assignment_confirmation") },
|
31
|
+
class: "red-icon"
|
32
|
+
) %>
|
33
|
+
<% end %>
|
34
|
+
</li>
|
35
|
+
<% end %>
|
36
|
+
</ul>
|
37
|
+
<% end %>
|
38
|
+
<%= render "decidim/participatory_documents/admin/suggestions/add_valuators" %>
|
39
|
+
|
40
|
+
</div>
|
41
|
+
</div>
|
42
|
+
</div>
|
43
|
+
<% end %>
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<div id="js-assign-suggestions-to-valuator-actions" class="hide js-bulk-action-form">
|
2
|
+
<%= form_tag(document_valuation_assignment_path(document), method: :post, id: "js-form-assign-suggestions-to-valuator", class: "flex--cc flex-gap--1") do %>
|
3
|
+
<div class="checkboxes hide">
|
4
|
+
<% suggestions.each do |suggestion| %>
|
5
|
+
<%= check_box_tag "suggestion_ids[]", suggestion.id, false, class: "js-check-all-suggestion js-suggestion-id-#{suggestion.id}" %>
|
6
|
+
<% end %>
|
7
|
+
</div>
|
8
|
+
|
9
|
+
<%= bulk_valuators_select(current_participatory_space, t("decidim.participatory_documents.admin.suggestions.index.actions.assign_to_valuator")) %>
|
10
|
+
|
11
|
+
<%= submit_tag(t("decidim.participatory_documents.admin.suggestions.index.actions.assign_to_valuator_button"), id: "js-submit-assign-suggestion-to-valuator", class: "button small button--simple float-left") %>
|
12
|
+
|
13
|
+
<button id="js-cancel-assign-suggestion-to-valuator" class="button tiny clear compact js-cancel-bulk-action" type="button"><%= t("decidim.participatory_documents.admin.suggestions.index.actions.cancel") %></button>
|
14
|
+
<% end %>
|
15
|
+
</div>
|
data/app/views/decidim/participatory_documents/admin/suggestions/bulk_actions/_dropdown.html.erb
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
<div id="js-bulk-actions-wrapper">
|
2
|
+
<button
|
3
|
+
id="js-bulk-actions-button"
|
4
|
+
class="button button--nomargin small success light dropdown hide"
|
5
|
+
type="button"
|
6
|
+
data-toggle="js-bulk-actions-dropdown">
|
7
|
+
<%= t("decidim.participatory_documents.admin.suggestions.index.actions.title") %>
|
8
|
+
</button>
|
9
|
+
|
10
|
+
<div
|
11
|
+
id="js-bulk-actions-dropdown"
|
12
|
+
class="dropdown-pane"
|
13
|
+
data-position="bottom"
|
14
|
+
data-alignment="right"
|
15
|
+
data-dropdown="dropdown"
|
16
|
+
data-auto-focus="false"
|
17
|
+
data-events="resize">
|
18
|
+
<ul class="list-reset">
|
19
|
+
<li>
|
20
|
+
<button type="button" data-action="assign-suggestions-to-valuator">
|
21
|
+
<%= t("decidim.participatory_documents.admin.suggestions.index.actions.assign_to_valuator") %>
|
22
|
+
</button>
|
23
|
+
</li>
|
24
|
+
<li>
|
25
|
+
<button type="button" data-action="unassign-suggestions-from-valuator">
|
26
|
+
<%= t("decidim.participatory_documents.admin.suggestions.index.actions.unassign_from_valuator") %>
|
27
|
+
</button>
|
28
|
+
</li>
|
29
|
+
<li>
|
30
|
+
<button type="button" data-action="publish-answers">
|
31
|
+
<%= t("decidim.participatory_documents.admin.suggestions.index.actions.publish_answers") %>
|
32
|
+
</button>
|
33
|
+
</li>
|
34
|
+
</ul>
|
35
|
+
</div>
|
36
|
+
</div>
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<div id="js-publish-answers-actions" class="hide js-bulk-action-form">
|
2
|
+
<%= form_tag(publish_answers_document_suggestions_path(document), method: :post, remote: true, id: "js-form-publish-answers", class: "flex--cc flex-gap--1") do %>
|
3
|
+
<div class="checkboxes hide">
|
4
|
+
<% suggestions.each do |suggestion| %>
|
5
|
+
<%= check_box_tag "suggestion_ids[]", suggestion.id, false, class: "js-check-all-suggestion js-suggestion-id-#{suggestion.id}" %>
|
6
|
+
<% end %>
|
7
|
+
</div>
|
8
|
+
<p><%= t("decidim.participatory_documents.admin.suggestions.publish_answers.number_of_suggestions", number: '<span id="js-form-publish-answers-number"></span>').html_safe %></p>
|
9
|
+
|
10
|
+
<%= submit_tag(t("decidim.participatory_documents.admin.suggestions.index.actions.publish"), id: "js-submit-publish-answers", class: "button small button--simple float-left") %>
|
11
|
+
|
12
|
+
<button id="js-cancel-publish-answers" class="button tiny clear compact js-cancel-bulk-action" type="button"><%= t("decidim.participatory_documents.admin.suggestions.index.actions.cancel") %></button>
|
13
|
+
<% end %>
|
14
|
+
</div>
|