From 759c49d9c591014962eb68b0019a46fdfb18a01e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=20Bol=C3=ADvar?= Date: Tue, 24 Sep 2024 10:59:55 +0200 Subject: [PATCH] Bump decidim from 0.27.5 to 0.28.3 (#536) * Upgrade to 0.28.0 disabling modules and customizations * Enable instance modules and fix overrides from ephemeral module * Fix CI pipelines and lint * Add Procfile support * Include ephemeral participation specs in the CI and fix them * Install decidim-term_customizer * Include census sms specs in the CI and fix them * Include valid auth specs in the CI * Include stats specs in the CI and fix all of them but one * Lint * Fix followers spec * Split test modules in a different CI workflow * Change array assertion methods * Update dockerization * Remove unused scripts * Remove initiative header steps customization It's not needed at all as it was changing the date separator from a dash to an arrow and the redesign uses an arrow * Remove widget layout customization It has been removed in the redesign * Remove unused partial * Rename monkey-patched views from decidim as they are pending to be reviewed * Change workflow names * Adapt accountability pages to redesign * Reorder routes * Remove decidim-dataviz from Gemfile * Add 'rexml' gem for production * Add 'matrix' gem for production * Add yarn to engines * Do not include polyfill for punycode * Add Procfile * Fix system specs * Comment overrides to be reviewed * Update user_profile_cell_override * Add route-line icon * Update activities override * Lint * Update proposal presenter override * Update questionnaire user answers override * Update join meeting button cell override * Update zero duration meeting agenda items override * Update BCN meeting iframe height override * Update initiatives admin permission override * Update permission to view not published meetings for space admins override * Update custom initiatives supports required for specific ones override * Update search resource fields mapper override * Remove initiative card override to hide support button The support button is not present in the redesigned cards * Update accountability customization overrides * Update join meeting button override * Update form questionnaire answer index override * Update initiative fill personal data override * Exclude file from codeclimate * Run workflow from module only on change * Make modules compatible only to instance decidim version * Update email override * Remove project list item overrides The cell has been replaced in 0.28.0 and now it shows the project budget amount in mobile by default so the override functionality is not needed anymore * Update import results views * Remove app.json as it's no longer needed * Update and install decidim-dataviz * Fix status cell error 'undefined local variable or method current_scope for Decidim::Accountability::StatusCell' * Cleanup gems * Cleanup styles * Remove carrierwave initializer * Downgrade wicked_pdf See: https://github.com/mileszs/wicked_pdf/issues/1102 * Install decidim-kids module * Install decidim-decidim_awesome module (beta) * Install decidim-navigation_maps module (beta) * Add extra argument to SMS gateway * Show 20 assemblies per page * Lint * Fix tests * Use main branch of decidim-navigation_maps module * Bump decidim from 0.28.0 to 0.28.1 * Remove workflow for decidim ephemeral participation module * Run all workflows always * Fix append stylesheet * Skip tests failing because of Capybara driver * Bump decidim from 0.28.1 to 0.28.2 * Specify zeitwerk autoloader * Bump decidim-decidim_awesome version * Add .node-version * Bump decidim-decidim_awesome version * Bump decidim from 0.28.2 to 0.28.3 * Fix overrides spec and lint erb files * Update overrides_spec.rb * Force cell cache expiration time * Decrease cache expiry time to match the one provided by AWS * Avoid segmentation fault from PostgreSQL on MacOS * Script to populate hero images from scoped resources banner images * Rescue error in content block hero image migration script --- .codeclimate.yml | 1 + .github/workflows/lint.yml | 6 +- .github/workflows/test.yml | 19 +- .github/workflows/test_census_sms.yml | 49 + .github/workflows/test_stats.yml | 49 + .github/workflows/test_valid_auth.yml | 49 + .gitignore | 10 +- .node-version | 1 + .rubocop.yml | 29 +- .rubocop_rails.yml | 87 - .rubocop_ruby.yml | 1757 --- .rubocop_todo.yml | 24 + .ruby-version | 2 +- Dockerfile | 31 +- Gemfile | 47 +- Gemfile.lock | 1001 +- Procfile.dev | 2 + README.md | 4 + Rakefile | 8 +- app.json | 38 - .../accountability/status_cell_override.rb | 18 + .../initiative_metadata_g_cell_override.rb | 27 + .../decidim/user_profile_cell_override.rb | 2 +- .../accountability/result_l/extra_data.erb | 3 + .../decidim/accountability/status/status.erb | 20 + .../project_list_item/project_data.erb | 23 - .../project_list_item/project_text.erb | 22 - .../initiatives/initiative_m/footer.erb | 28 - .../meetings/join_meeting_button/show.erb | 6 +- .../meetings/online_meeting_link/show.erb | 59 +- .../admin/conflicts_controller_override.rb | 19 - .../assemblies_controller_override.rb | 22 + .../admin/import_results_controller.rb | 2 +- app/controllers/export_results_controller.rb | 2 +- app/controllers/static_controller.rb | 22 + .../decidim/paginate_helper_override.rb | 25 + .../admin/import_results_csv_job.rb | 4 +- .../initiatives/initiative_m_cell.rb | 15 - .../results/_form/external_id.html.erb.deface | 7 - .../results/index/import_csv.html.erb.deface | 2 - .../download_button.html.erb.deface | 6 - app/packs/src/decidim/.keep | 0 .../stylesheets/_global_accountability.scss | 142 - app/packs/stylesheets/barcelona.scss | 10 - app/packs/stylesheets/decidim/.keep | 0 .../decidim/decidim_application.scss | 25 +- app/packs/stylesheets/email.scss | 12 +- .../stylesheets/theme-barcelona/_budgets.scss | 16 - .../stylesheets/theme-barcelona/_cards.scss | 48 - .../theme-barcelona/_event-days.scss | 88 - .../stylesheets/theme-barcelona/_footer.scss | 118 - .../theme-barcelona/_hero-custom.scss | 52 - .../stylesheets/theme-barcelona/_navbar.scss | 476 - .../theme-barcelona/_process-nav.scss | 179 - .../theme-barcelona/_section-heading.scss | 9 - .../theme-barcelona/_special-process.scss | 57 - .../theme-barcelona/_variables.scss | 4 - app/services/census_authorization_handler.rb | 4 +- .../accountability/results_csv_exporter.rb | 2 +- .../accountability/results_csv_importer.rb | 4 +- app/services/pdf_signature_barcelona.rb | 10 +- app/services/sms_gateway.rb | 7 +- .../census16_authorization/_form.html.erb | 56 +- app/views/census_authorization/_form.html.erb | 56 +- .../census_kids_authorization/_form.html.erb | 56 +- .../admin/import_results/new.html.erb | 39 +- .../admin/results/_form.html.erb | 79 + .../admin/results/index.html.erb | 131 + .../import_mailer/import.html.erb | 2 - .../results/_home_categories.html.erb | 187 +- .../results/_home_scopes.html.erb | 56 +- .../results/_results_leaf.html.erb | 47 - .../results/_scope_filters.html.erb | 32 + .../results/_show_leaf.html.erb | 83 - .../results/_stats_box.html.erb | 79 + .../accountability/results/home.html.erb | 65 +- .../accountability/results/index.html.erb | 17 + .../questionnaires/answers/show.html.erb | 33 +- .../fill_personal_data.html.erb | 63 +- .../initiatives/_progress_bar.html.erb | 26 +- .../meetings/_meeting_agenda.html.erb | 55 +- .../participatory_spaces/_result.html.erb | 32 + .../decidim/_initiative_header_steps.html.erb | 14 - app/views/layouts/decidim/mailer.html.erb | 28 +- app/views/layouts/decidim/widget.html.erb | 31 - app/views/layouts/mailer.html.erb | 2 +- app/views/pages/home/_extended.html.erb | 48 - .../static/_accountability_graph_ca.html.erb | 16 +- .../static/_accountability_graph_es.html.erb | 16 +- app/views/static/accountability.html.erb | 214 +- .../static/accountability_sections.html.erb | 168 +- .../api/docs/directive/deprecated/index.html | 35 + .../api/docs/directive/include/index.html | 35 + .../static/api/docs/directive/index.html | 35 + .../api/docs/directive/oneof/index.html | 1081 ++ .../static/api/docs/directive/skip/index.html | 35 + .../docs/enum/__directivelocation/index.html | 40 + .../api/docs/enum/__typekind/index.html | 35 + app/views/static/api/docs/enum/index.html | 35 + app/views/static/api/docs/index.html | 107 +- .../input_object/categoryfilter/index.html | 35 + .../input_object/componentfilter/index.html | 35 + .../input_object/componentsort/index.html | 35 + .../static/api/docs/input_object/index.html | 35 + .../participatoryprocessfilter/index.html | 35 + .../participatoryprocesssort/index.html | 35 + .../docs/input_object/postfilter/index.html | 35 + .../api/docs/input_object/postsort/index.html | 35 + .../input_object/proposalfilter/index.html | 35 + .../docs/input_object/proposalsort/index.html | 35 + .../input_object/userentityfilter/index.html | 35 + .../input_object/userentitysort/index.html | 35 + .../amendableentityinterface/index.html | 35 + .../interface/amendableinterface/index.html | 35 + .../interface/attachableinterface/index.html | 35 + .../api/docs/interface/author/index.html | 35 + .../interface/authorableinterface/index.html | 35 + .../categoriescontainerinterface/index.html | 35 + .../categorizableinterface/index.html | 35 + .../coauthorableinterface/index.html | 35 + .../interface/commentableinterface/index.html | 35 + .../interface/componentinterface/index.html | 36 +- .../interface/endorsableinterface/index.html | 35 + .../interface/fingerprintinterface/index.html | 35 + .../static/api/docs/interface/index.html | 35 + .../initiativetypeinterface/index.html | 35 + .../index.html | 35 + .../participatoryspaceinterface/index.html | 41 + .../index.html | 35 + .../questionnaireentityinterface/index.html | 35 + .../interface/scopableinterface/index.html | 35 + .../interface/servicesinterface/index.html | 35 + .../interface/timestampsinterface/index.html | 35 + .../interface/traceableinterface/index.html | 35 + .../api/docs/mutation/comment/index.html | 35 + .../api/docs/mutation/commentable/index.html | 35 + .../api/docs/object/__directive/index.html | 40 + .../api/docs/object/__enumvalue/index.html | 35 + .../static/api/docs/object/__field/index.html | 35 + .../api/docs/object/__inputvalue/index.html | 35 + .../api/docs/object/__schema/index.html | 40 + .../static/api/docs/object/__type/index.html | 45 + .../api/docs/object/accountability/index.html | 83 +- .../api/docs/object/amendment/index.html | 35 + .../api/docs/object/answeroption/index.html | 35 + .../static/api/docs/object/area/index.html | 35 + .../api/docs/object/areatype/index.html | 35 + .../api/docs/object/assembliestype/index.html | 35 + .../api/docs/object/assembly/index.html | 221 +- .../api/docs/object/assemblymember/index.html | 35 + .../api/docs/object/attachment/index.html | 49 +- .../static/api/docs/object/blogs/index.html | 83 +- .../static/api/docs/object/budget/index.html | 71 +- .../docs/object/budgetconnection/index.html | 47 +- .../api/docs/object/budgetedge/index.html | 43 +- .../static/api/docs/object/budgets/index.html | 83 +- .../api/docs/object/category/index.html | 35 + .../static/api/docs/object/comment/index.html | 175 +- .../api/docs/object/commentable/index.html | 35 + .../object/commentablemutation/index.html | 35 + .../docs/object/commentmutation/index.html | 35 + .../api/docs/object/component/index.html | 35 + .../api/docs/object/coordinates/index.html | 35 + .../static/api/docs/object/debate/index.html | 175 +- .../docs/object/debateconnection/index.html | 47 +- .../api/docs/object/debateedge/index.html | 43 +- .../static/api/docs/object/debates/index.html | 83 +- .../static/api/docs/object/decidim/index.html | 35 + .../api/docs/object/fingerprint/index.html | 35 + .../api/docs/object/hashtagtype/index.html | 35 + app/views/static/api/docs/object/index.html | 35 + .../api/docs/object/initiative/index.html | 207 +- .../initiativecommitteemembertype/index.html | 37 +- .../api/docs/object/initiativetype/index.html | 35 + .../object/localizedcustomfields/index.html | 1096 ++ .../docs/object/localizedstring/index.html | 35 + .../static/api/docs/object/meeting/index.html | 267 +- .../api/docs/object/meetingagenda/index.html | 35 + .../docs/object/meetingagendaitem/index.html | 35 + .../docs/object/meetingconnection/index.html | 47 +- .../api/docs/object/meetingedge/index.html | 43 +- .../api/docs/object/meetings/index.html | 83 +- .../api/docs/object/meetingservice/index.html | 35 + .../static/api/docs/object/metric/index.html | 35 + .../api/docs/object/metrichistory/index.html | 35 + .../api/docs/object/organization/index.html | 35 + .../static/api/docs/object/page/index.html | 35 + .../api/docs/object/pageconnection/index.html | 47 +- .../api/docs/object/pageedge/index.html | 43 +- .../api/docs/object/pageinfo/index.html | 35 + .../static/api/docs/object/pages/index.html | 83 +- .../object/participatoryprocess/index.html | 233 +- .../participatoryprocessgroup/index.html | 35 + .../participatoryprocessstep/index.html | 39 +- .../participatoryprocesstype/index.html | 35 + .../docs/object/participatoryspace/index.html | 41 + .../object/participatoryspacelink/index.html | 35 + .../participatoryspacemanifest/index.html | 1090 ++ .../static/api/docs/object/post/index.html | 161 +- .../api/docs/object/postconnection/index.html | 47 +- .../api/docs/object/postedge/index.html | 43 +- .../static/api/docs/object/project/index.html | 127 +- .../api/docs/object/proposal/index.html | 243 +- .../docs/object/proposalconnection/index.html | 47 +- .../api/docs/object/proposaledge/index.html | 43 +- .../api/docs/object/proposals/index.html | 83 +- .../quantifiabletranslatedfield/index.html | 1090 ++ .../api/docs/object/question/index.html | 59 +- .../api/docs/object/questionnaire/index.html | 59 +- .../static/api/docs/object/result/index.html | 204 +- .../docs/object/resultconnection/index.html | 47 +- .../api/docs/object/resultedge/index.html | 43 +- .../static/api/docs/object/scope/index.html | 35 + .../static/api/docs/object/session/index.html | 35 + .../api/docs/object/sortition/index.html | 191 +- .../object/sortitionconnection/index.html | 47 +- .../api/docs/object/sortitionedge/index.html | 43 +- .../api/docs/object/sortitions/index.html | 83 +- .../api/docs/object/statistic/index.html | 35 + .../static/api/docs/object/status/index.html | 35 + .../static/api/docs/object/survey/index.html | 35 + .../docs/object/surveyconnection/index.html | 47 +- .../api/docs/object/surveyedge/index.html | 43 +- .../static/api/docs/object/surveys/index.html | 83 +- .../api/docs/object/timelineentry/index.html | 35 + .../api/docs/object/traceversion/index.html | 35 + .../object/translatedcustomfields/index.html | 1136 ++ .../docs/object/translatedfield/index.html | 35 + .../static/api/docs/object/user/index.html | 43 +- .../api/docs/object/usergroup/index.html | 47 +- .../api/docs/operation/mutation/index.html | 35 + .../api/docs/operation/query/index.html | 153 +- .../static/api/docs/scalar/boolean/index.html | 35 + .../static/api/docs/scalar/date/index.html | 35 + .../api/docs/scalar/datetime/index.html | 35 + .../static/api/docs/scalar/float/index.html | 35 + .../static/api/docs/scalar/id/index.html | 35 + app/views/static/api/docs/scalar/index.html | 35 + .../static/api/docs/scalar/int/index.html | 35 + .../static/api/docs/scalar/json/index.html | 35 + .../static/api/docs/scalar/string/index.html | 35 + app/views/static/api/docs/union/index.html | 35 + bin/decidim_update | 1 - bin/dev | 8 + bin/shakapacker | 17 + bin/shakapacker-dev-server | 17 + bin/webpack | 22 - bin/webpack-dev-server | 22 - config/application.rb | 1 + config/database.yml | 2 + config/environments/development.rb | 2 +- config/environments/production.rb | 4 +- config/initializers/carrierwave.rb | 29 - config/initializers/decidim.rb | 12 + config/initializers/decidim_overrides.rb | 16 +- config/initializers/social_share_button.rb | 8 - config/locales/accountability.ca.yml | 161 +- config/locales/accountability.es.yml | 164 +- config/puma.rb | 1 - config/routes.rb | 17 +- config/secrets.yml | 2 + config/{webpacker.yml => shakapacker.yml} | 28 +- config/webpack/base.js | 6 - config/webpack/custom.js | 35 +- config/webpack/development.js | 7 - config/webpack/production.js | 7 - config/webpack/test.js | 7 - config/webpack/webpack.config.js | 10 + ...decidim_authorization_transfers.decidim.rb | 21 + ...40311160647_rename_terms_of_use.decidim.rb | 24 + ...policy_to_decidim_organizations.decidim.rb | 8 + ...649_change_states_on_amendments.decidim.rb | 35 + ...ange_states_on_reminder_records.decidim.rb | 34 + ..._value_for_decidim_endorsements.decidim.rb | 12 + ...0652_remove_official_img_header.decidim.rb | 12 + ...atetime.decidim_participatory_processes.rb | 9 + ..._collaborative_drafts.decidim_proposals.rb | 35 + ...e_states_on_proposals.decidim_proposals.rb | 35 + ...tion_types_on_meetings.decidim_meetings.rb | 50 + ..._to_decidim_templates.decidim_templates.rb | 22 + ...at_to_decidim_blogs_posts.decidim_blogs.rb | 18 + ..._awesome_config.decidim_decidim_awesome.rb | 19 + ...nter_cache_to_comments.decidim_comments.rb | 22 + ...m_proposals_proposals.decidim_proposals.rb | 17 + ..._private_fields.decidim_decidim_awesome.rb | 30 + ...ate_fields_date.decidim_decidim_awesome.rb | 21 + db/schema.rb | 112 +- .../census_sms/verification/send_code.rb | 2 +- .../verification/authorizations_controller.rb | 20 +- .../decidim/census_sms/verification.scss | 2 +- .../verification/authorizations/edit.html.erb | 43 +- .../verification/authorizations/new.html.erb | 102 +- .../authorizations/reset.html.erb | 35 +- decidim-census_sms/decidim-census_sms.gemspec | 8 +- .../with_census_sms_handler.rb | 4 +- decidim-census_sms/spec/rails_helper.rb | 2 +- .../system/census_sms_authorization_spec.rb | 61 +- .../app/packs/entrypoints/decidim_dataviz.js | 2 - .../app/packs/src}/.keep | 0 .../app/packs/src/decidim/dataviz/dataviz.js | 8 - .../src/vendor/jquery-iframe-auto-height.js | 219 - .../app/packs/src/vendor/jquery.browser.js | 39 - .../stylesheets/decidim/dataviz/dataviz.scss | 46 +- .../dataviz/dataviz/_action_plans.html.erb | 2 +- .../decidim/dataviz/dataviz/_map.html.erb | 2 +- .../dataviz/dataviz/_meetings.html.erb | 2 +- .../dataviz/dataviz/_open_data.html.erb | 4 +- .../dataviz/dataviz/_proposals.html.erb | 2 +- .../decidim/dataviz/dataviz/_summary.html.erb | 2 +- .../dataviz/_total_interactions.html.erb | 2 +- .../decidim/dataviz/dataviz/show.html.erb | 58 +- decidim-dataviz/decidim-dataviz.gemspec | 8 +- decidim-dataviz/lib/decidim/dataviz/engine.rb | 4 +- ...b => project_vote_button_cell_override.rb} | 2 +- .../create_ephemeral_participant.rb | 3 +- .../perform_authorization_step_override.rb | 2 +- ...date_unverifiable_ephemeral_participant.rb | 2 +- .../ephemeral_participable.rb | 2 +- .../ephemeral_participation_paths_helper.rb | 4 +- .../needs_permission_override.rb | 4 +- .../conflicts_controller_override.rb | 4 +- .../ephemeral_participants_controller.rb | 10 +- .../authorization_handler_override.rb | 4 +- .../ephemeral_participant_form.rb | 6 +- .../permissions_form_override.rb | 2 +- ...unverifiable_ephemeral_participant_form.rb | 2 +- .../organization_override.rb | 4 +- .../ephemeral_participation_permissions.rb | 6 +- .../projects/_project_budget_button.html.erb | 30 +- .../_existing_verification_msg.html.erb | 8 +- .../ephemeral_participants/edit.html.erb | 58 +- .../edit_unverifiable.html.erb | 37 +- .../_ephemeral_participation_button.html.erb | 34 +- .../decidim/shared/_login_modal.html.erb | 98 +- .../_authorizations_settings.erb | 23 +- .../system/organizations/edit.html.erb | 48 +- .../decidim/system/organizations/new.html.erb | 84 +- .../views/layouts/decidim/_user_menu.html.erb | 14 - .../_user_menu.html.erb | 31 - .../decidim/footer/_main_links.html.erb | 40 + .../header/_main_links_dropdown.html.erb | 67 + .../decidim-ephemeral_participation.gemspec | 8 +- .../decidim_form_helper_override.rb | 2 +- .../decidim/ephemeral_participation/engine.rb | 2 +- .../ephemeral_participation/test/factories.rb | 2 +- .../with_ephemerable_participation.rb | 39 +- .../spec/rails_helper.rb | 2 +- .../spec/system/admin/component_spec.rb | 60 +- .../spec/system/admin/conflicts_spec.rb | 18 +- .../spec/system/admin/organization_spec.rb | 10 +- .../system/user/complete_registration_spec.rb | 18 +- .../ephemeral_participation_button_spec.rb | 12 +- .../spec/system/user/flash_messages_spec.rb | 34 +- .../spec/system/user/permissions_spec.rb | 46 +- .../spec/system/user/session_spec.rb | 6 +- .../user/successful_verification_spec.rb | 8 +- .../spec/system/user/user_menu_spec.rb | 24 +- .../user/verification_conflicts_spec.rb | 29 +- .../app/jobs/decidim/stats/stats_job.rb | 2 +- .../queries/decidim/stats/actions/comment.rb | 4 +- .../decidim/stats/actions/endorsement.rb | 4 +- .../queries/decidim/stats/actions/follow.rb | 4 +- .../stats/actions/proposal_creation.rb | 2 +- .../decidim/stats/actions/proposal_vote.rb | 2 +- .../app/services/decidim/stats/runner.rb | 2 +- decidim-stats/decidim-stats.gemspec | 12 +- .../decidim/stats/actions/comment_spec.rb | 17 +- .../decidim/stats/actions/endorsement_spec.rb | 13 +- .../decidim/stats/actions/follow_spec.rb | 17 +- .../stats/actions/proposal_creation_spec.rb | 10 +- .../stats/actions/proposal_vote_spec.rb | 10 +- .../stats/performers/age_group_spec.rb | 8 +- .../decidim/stats/performers/district_spec.rb | 8 +- .../decidim/stats/performers/gender_spec.rb | 12 +- decidim-stats/spec/rails_helper.rb | 3 + .../services/decidim/stats/runner_spec.rb | 25 +- decidim-valid_auth/config/locales/ca.yml | 2 +- decidim-valid_auth/decidim-valid_auth.gemspec | 8 +- .../valid_auth/validate_valid_auth_spec.rb | 6 +- .../valid_auth/valid_auth_form_spec.rb | 14 +- decidim-valid_auth/spec/rails_helper.rb | 3 + docker-compose.yml | 6 +- lib/budgets_workflow_pam2020.rb | 2 +- lib/budgets_workflow_pam2021.rb | 2 +- lib/tasks/anonymize.rake | 6 +- lib/tasks/budget_stats.rake | 8 +- .../projects_proposals_relations_csv.rake | 2 +- .../migrate_hero_image_from_banner_image.rake | 41 + package-lock.json | 12835 ++++++++++------ package.json | 56 +- postcss.config.js | 6 +- public/favicon.ico | 0 public/robots.txt | 44 +- spec/factories.rb | 1 + spec/lib/overrides_spec.rb | 121 +- spec/rails_helper.rb | 2 +- spec/routing/redirections_spec.rb | 24 +- .../census16_authorization_handler_spec.rb | 30 +- .../census_authorization_handler_spec.rb | 28 +- .../census_kids_authorization_handler_spec.rb | 30 +- ...sant_gervasi_authorization_handler_spec.rb | 28 +- spec/services/pdf_signature_barcelona_spec.rb | 6 +- spec/services/results_csv_exporter_spec.rb | 14 +- spec/services/results_csv_importer_spec.rb | 24 +- spec/services/timestamp_service_spec.rb | 6 +- spec/system/assemblies_spec.rb | 29 + spec/system/budget_spec.rb | 12 +- .../budgets_ephemeral_participation_spec.rb | 12 +- spec/system/census16_authorization_spec.rb | 24 +- spec/system/census_authorization_spec.rb | 24 +- spec/system/census_kids_authorization_spec.rb | 24 +- ..._sarria_sant_gervasi_authorization_spec.rb | 20 +- spec/system/initiatives_spec.rb | 16 +- ...roposal_safe_content_allowed_users_spec.rb | 12 +- 414 files changed, 24202 insertions(+), 12179 deletions(-) create mode 100644 .github/workflows/test_census_sms.yml create mode 100644 .github/workflows/test_stats.yml create mode 100644 .github/workflows/test_valid_auth.yml create mode 100644 .node-version delete mode 100644 .rubocop_rails.yml delete mode 100644 .rubocop_ruby.yml create mode 100644 .rubocop_todo.yml create mode 100644 Procfile.dev delete mode 100644 app.json create mode 100644 app/cells/concerns/decidim/accountability/status_cell_override.rb create mode 100644 app/cells/concerns/decidim/initiatives/initiative_metadata_g_cell_override.rb create mode 100644 app/cells/decidim/accountability/result_l/extra_data.erb create mode 100644 app/cells/decidim/accountability/status/status.erb delete mode 100644 app/cells/decidim/budgets/project_list_item/project_data.erb delete mode 100644 app/cells/decidim/budgets/project_list_item/project_text.erb delete mode 100644 app/cells/decidim/initiatives/initiative_m/footer.erb delete mode 100644 app/controllers/concerns/decidim/admin/conflicts_controller_override.rb create mode 100644 app/controllers/concerns/decidim/assemblies/assemblies_controller_override.rb create mode 100644 app/helpers/concerns/decidim/paginate_helper_override.rb delete mode 100644 app/lib/decidim/overrides/initiatives/initiative_m_cell.rb delete mode 100644 app/overrides/decidim/accountability/admin/results/_form/external_id.html.erb.deface delete mode 100644 app/overrides/decidim/accountability/admin/results/index/import_csv.html.erb.deface delete mode 100644 app/overrides/decidim/accountability/results/_home_header/download_button.html.erb.deface delete mode 100644 app/packs/src/decidim/.keep delete mode 100644 app/packs/stylesheets/_global_accountability.scss delete mode 100644 app/packs/stylesheets/barcelona.scss delete mode 100644 app/packs/stylesheets/decidim/.keep delete mode 100644 app/packs/stylesheets/theme-barcelona/_budgets.scss delete mode 100644 app/packs/stylesheets/theme-barcelona/_cards.scss delete mode 100644 app/packs/stylesheets/theme-barcelona/_event-days.scss delete mode 100644 app/packs/stylesheets/theme-barcelona/_footer.scss delete mode 100644 app/packs/stylesheets/theme-barcelona/_hero-custom.scss delete mode 100644 app/packs/stylesheets/theme-barcelona/_navbar.scss delete mode 100644 app/packs/stylesheets/theme-barcelona/_process-nav.scss delete mode 100644 app/packs/stylesheets/theme-barcelona/_section-heading.scss delete mode 100644 app/packs/stylesheets/theme-barcelona/_special-process.scss delete mode 100644 app/packs/stylesheets/theme-barcelona/_variables.scss create mode 100644 app/views/decidim/accountability/admin/results/_form.html.erb create mode 100644 app/views/decidim/accountability/admin/results/index.html.erb delete mode 100644 app/views/decidim/accountability/results/_results_leaf.html.erb create mode 100644 app/views/decidim/accountability/results/_scope_filters.html.erb delete mode 100644 app/views/decidim/accountability/results/_show_leaf.html.erb create mode 100644 app/views/decidim/accountability/results/_stats_box.html.erb create mode 100644 app/views/decidim/accountability/results/index.html.erb create mode 100644 app/views/decidim/participatory_spaces/_result.html.erb delete mode 100644 app/views/layouts/decidim/_initiative_header_steps.html.erb delete mode 100644 app/views/layouts/decidim/widget.html.erb delete mode 100644 app/views/pages/home/_extended.html.erb create mode 100644 app/views/static/api/docs/directive/oneof/index.html create mode 100644 app/views/static/api/docs/object/localizedcustomfields/index.html create mode 100644 app/views/static/api/docs/object/participatoryspacemanifest/index.html create mode 100644 app/views/static/api/docs/object/quantifiabletranslatedfield/index.html create mode 100644 app/views/static/api/docs/object/translatedcustomfields/index.html delete mode 100755 bin/decidim_update create mode 100755 bin/dev create mode 100755 bin/shakapacker create mode 100755 bin/shakapacker-dev-server delete mode 100755 bin/webpack delete mode 100755 bin/webpack-dev-server delete mode 100644 config/initializers/carrierwave.rb delete mode 100644 config/initializers/social_share_button.rb rename config/{webpacker.yml => shakapacker.yml} (61%) delete mode 100644 config/webpack/base.js delete mode 100644 config/webpack/development.js delete mode 100644 config/webpack/production.js delete mode 100644 config/webpack/test.js create mode 100644 config/webpack/webpack.config.js create mode 100644 db/migrate/20240311160646_create_decidim_authorization_transfers.decidim.rb create mode 100644 db/migrate/20240311160647_rename_terms_of_use.decidim.rb create mode 100644 db/migrate/20240311160648_add_content_policy_to_decidim_organizations.decidim.rb create mode 100644 db/migrate/20240311160649_change_states_on_amendments.decidim.rb create mode 100644 db/migrate/20240311160650_change_states_on_reminder_records.decidim.rb create mode 100644 db/migrate/20240311160651_change_default_value_for_decidim_endorsements.decidim.rb create mode 100644 db/migrate/20240311160652_remove_official_img_header.decidim.rb create mode 100644 db/migrate/20240311160653_change_steps_dates_to_datetime.decidim_participatory_processes.rb create mode 100644 db/migrate/20240311160654_change_states_on_collaborative_drafts.decidim_proposals.rb create mode 100644 db/migrate/20240311160655_change_states_on_proposals.decidim_proposals.rb create mode 100644 db/migrate/20240311160656_change_types_and_registration_types_on_meetings.decidim_meetings.rb create mode 100644 db/migrate/20240311160657_add_field_values_and_target_to_decidim_templates.decidim_templates.rb create mode 100644 db/migrate/20240311160658_add_published_at_to_decidim_blogs_posts.decidim_blogs.rb create mode 100644 db/migrate/20240327123826_rename_editor_images_awesome_config.decidim_decidim_awesome.rb create mode 100644 db/migrate/20240611125821_add_comment_vote_counter_cache_to_comments.decidim_comments.rb create mode 100644 db/migrate/20240611125822_add_valuation_assignments_count_to_decidim_proposals_proposals.decidim_proposals.rb create mode 100644 db/migrate/20240813060358_add_decidim_awesome_proposal_private_fields.decidim_decidim_awesome.rb create mode 100644 db/migrate/20240813060359_add_decidim_awesome_proposal_private_fields_date.decidim_decidim_awesome.rb rename {app/packs/images => decidim-dataviz/app/packs/src}/.keep (100%) delete mode 100644 decidim-dataviz/app/packs/src/decidim/dataviz/dataviz.js delete mode 100644 decidim-dataviz/app/packs/src/vendor/jquery-iframe-auto-height.js delete mode 100644 decidim-dataviz/app/packs/src/vendor/jquery.browser.js rename decidim-ephemeral_participation/app/cells/decidim/ephemeral_participation/{project_list_item_cell_override.rb => project_vote_button_cell_override.rb} (86%) delete mode 100644 decidim-ephemeral_participation/app/views/layouts/decidim/_user_menu.html.erb delete mode 100644 decidim-ephemeral_participation/app/views/layouts/decidim/ephemeral_participation/_user_menu.html.erb create mode 100644 decidim-ephemeral_participation/app/views/layouts/decidim/footer/_main_links.html.erb create mode 100644 decidim-ephemeral_participation/app/views/layouts/decidim/header/_main_links_dropdown.html.erb create mode 100644 decidim-stats/spec/rails_helper.rb create mode 100644 decidim-valid_auth/spec/rails_helper.rb create mode 100644 lib/tasks/upgrade/migrate_hero_image_from_banner_image.rake delete mode 100644 public/favicon.ico create mode 100644 spec/system/assemblies_spec.rb diff --git a/.codeclimate.yml b/.codeclimate.yml index 021ce62616..65826a4e12 100644 --- a/.codeclimate.yml +++ b/.codeclimate.yml @@ -62,3 +62,4 @@ exclude_paths: - "config/initializers/decidim.rb" - "decidim-ephemeral_participation/app/permissions/decidim/ephemeral_participation/ephemeral_participation_permissions.rb" - "app/services/decidim_legacy_routes.rb" +- "app/helpers/concerns/decidim/paginate_helper_override.rb" diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index e4db3763dc..858340b647 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -2,13 +2,13 @@ name: Lint on: [push] env: - RUBY_VERSION: 3.0.2 - NODE_VERSION: 16.9.1 + RUBY_VERSION: 3.1.1 + NODE_VERSION: 18.17.1 jobs: lint: name: Lint code - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest env: DATABASE_USERNAME: postgres DATABASE_PASSWORD: postgres diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cd4fdc3f0f..1aa98c1a30 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,13 +2,13 @@ name: Test on: [push] env: - RUBY_VERSION: 3.0.2 - NODE_VERSION: 16.9.1 + RUBY_VERSION: 3.1.1 + NODE_VERSION: 18.17.1 jobs: test: name: Test - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest services: postgres: image: postgres:11 @@ -37,20 +37,13 @@ jobs: ruby-version: ${{ env.RUBY_VERSION }} bundler-cache: true - uses: nanasess/setup-chromedriver@v2 - with: - chromedriver-version: 119.0.6045.105 - - name: List Chrome - run: apt list --installed | grep chrome - - name: Remove Chrome - run: sudo apt remove google-chrome-stable - - uses: browser-actions/setup-chrome@v1 - with: - chrome-version: 119.0.6045.105 - run: bundle exec rake db:test:prepare name: Setup database - name: Precompile assets run: | npm install bundle exec rake assets:precompile - - run: bundle exec rspec + - run: | + mkdir node_modules + bundle exec rspec name: Run specs diff --git a/.github/workflows/test_census_sms.yml b/.github/workflows/test_census_sms.yml new file mode 100644 index 0000000000..700b6a936c --- /dev/null +++ b/.github/workflows/test_census_sms.yml @@ -0,0 +1,49 @@ +name: Test Census SMS +on: [push] + +env: + RUBY_VERSION: 3.1.1 + NODE_VERSION: 18.17.1 + +jobs: + test: + name: Test Census SMS + runs-on: ubuntu-latest + services: + postgres: + image: postgres:11 + ports: ["5432:5432"] + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + env: + POSTGRES_PASSWORD: postgres + redis: + image: redis:3.2-alpine + ports: ["6379:6379"] + env: + DATABASE_USERNAME: postgres + DATABASE_PASSWORD: postgres + DATABASE_HOST: localhost + RAILS_ENV: test + steps: + - uses: actions/checkout@v2.0.0 + with: + fetch-depth: 1 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ env.RUBY_VERSION }} + bundler-cache: true + - uses: nanasess/setup-chromedriver@v2 + - run: bundle exec rake db:test:prepare + name: Setup database + - name: Precompile assets + run: | + npm install + bundle exec rake assets:precompile + - run: | + mkdir node_modules + bundle exec rspec decidim-census_sms + name: Run specs diff --git a/.github/workflows/test_stats.yml b/.github/workflows/test_stats.yml new file mode 100644 index 0000000000..a4254bc6da --- /dev/null +++ b/.github/workflows/test_stats.yml @@ -0,0 +1,49 @@ +name: Test Stats +on: [push] + +env: + RUBY_VERSION: 3.1.1 + NODE_VERSION: 18.17.1 + +jobs: + test: + name: Test Stats + runs-on: ubuntu-latest + services: + postgres: + image: postgres:11 + ports: ["5432:5432"] + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + env: + POSTGRES_PASSWORD: postgres + redis: + image: redis:3.2-alpine + ports: ["6379:6379"] + env: + DATABASE_USERNAME: postgres + DATABASE_PASSWORD: postgres + DATABASE_HOST: localhost + RAILS_ENV: test + steps: + - uses: actions/checkout@v2.0.0 + with: + fetch-depth: 1 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ env.RUBY_VERSION }} + bundler-cache: true + - uses: nanasess/setup-chromedriver@v2 + - run: bundle exec rake db:test:prepare + name: Setup database + - name: Precompile assets + run: | + npm install + bundle exec rake assets:precompile + - run: | + mkdir node_modules + bundle exec rspec decidim-stats + name: Run specs diff --git a/.github/workflows/test_valid_auth.yml b/.github/workflows/test_valid_auth.yml new file mode 100644 index 0000000000..1c302645d5 --- /dev/null +++ b/.github/workflows/test_valid_auth.yml @@ -0,0 +1,49 @@ +name: Test Valid Auth +on: [push] + +env: + RUBY_VERSION: 3.1.1 + NODE_VERSION: 18.17.1 + +jobs: + test: + name: Test Valid Auth + runs-on: ubuntu-latest + services: + postgres: + image: postgres:11 + ports: ["5432:5432"] + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + env: + POSTGRES_PASSWORD: postgres + redis: + image: redis:3.2-alpine + ports: ["6379:6379"] + env: + DATABASE_USERNAME: postgres + DATABASE_PASSWORD: postgres + DATABASE_HOST: localhost + RAILS_ENV: test + steps: + - uses: actions/checkout@v2.0.0 + with: + fetch-depth: 1 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ env.RUBY_VERSION }} + bundler-cache: true + - uses: nanasess/setup-chromedriver@v2 + - run: bundle exec rake db:test:prepare + name: Setup database + - name: Precompile assets + run: | + npm install + bundle exec rake assets:precompile + - run: | + mkdir node_modules + bundle exec rspec decidim-valid_auth + name: Run specs diff --git a/.gitignore b/.gitignore index 70a79da459..c52db995e7 100644 --- a/.gitignore +++ b/.gitignore @@ -39,11 +39,9 @@ yarn-debug.log* .yarn-integrity .rbenv-vars -public/sw.js -public/sw.js.map -public/sw.js.br -public/sw.js.map.br -public/sw.js.gz -public/sw.js.map.gz +public/sw.js* coverage/ + +.nvmrc +tailwind.config.js diff --git a/.node-version b/.node-version new file mode 100644 index 0000000000..4a1f488b6c --- /dev/null +++ b/.node-version @@ -0,0 +1 @@ +18.17.1 diff --git a/.rubocop.yml b/.rubocop.yml index 870c0b9fff..c80dd735d8 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,3 +1,26 @@ -inherit_from: - - .rubocop_ruby.yml - - .rubocop_rails.yml +inherit_from: .rubocop_todo.yml + +inherit_gem: + decidim-dev: rubocop-decidim.yml + +inherit_mode: + merge: + - Exclude + +AllCops: + Include: + - "**/*.rb" + - "**/*.rake" + - "**/*.ru" + - "**/Gemfile" + - "**/Rakefile" + Exclude: + - "spec/decidim_dummy_app/**/*" + - "**/spec/decidim_dummy_app/**/*" + - "bin/**/*" + - "node_modules/**/*" + - "**/node_modules/**/*" + - "db/schema.rb" + - "db/migrate/*" + - "vendor/**/*" + - "**/vendor/**/*" diff --git a/.rubocop_rails.yml b/.rubocop_rails.yml deleted file mode 100644 index 0cf3b441c1..0000000000 --- a/.rubocop_rails.yml +++ /dev/null @@ -1,87 +0,0 @@ -require: rubocop-rails - -Rails: - Enabled: true - -Rails/ActionFilter: - Include: - - app/controllers/**/*.rb - -Rails/ContentTag: - Enabled: false - -Rails/CreateTableWithTimestamps: - Enabled: false - -Rails/EnumUniqueness: - Include: - - app/models/**/*.rb - -Rails/Exit: - Include: - - app/**/*.rb - - config/**/*.rb - - lib/**/*.rb - Exclude: - - lib/**/*.rake - -Rails/FindBy: - Include: - - "**/*.rb" - -Rails/FindEach: - Include: - - app/models/**/*.rb - -Rails/HasAndBelongsToMany: - Include: - - app/models/**/*.rb - -Rails/HasManyOrHasOneDependent: - Include: - - app/models/**/*.rb - -Rails/InverseOf: - Enabled: false - -Rails/LexicallyScopedActionFilter: - Include: - - app/controllers/**/*.rb - -Rails/NotNullColumn: - Enabled: false - -Rails/Output: - Include: - - app/**/*.rb - - config/**/*.rb - - db/**/*.rb - - lib/**/*.rb - Exclude: - - db/seeds.rb -Rails/OutputSafety: - Enabled: false - -Rails/Pluck: - Enabled: false - -Rails/RakeEnvironment: - Enabled: false - -Rails/ReadWriteAttribute: - Include: - - app/models/**/*.rb - -Rails/ReversibleMigration: - Enabled: false - -Rails/ScopeArgs: - Include: - - app/models/**/*.rb - -Rails/SkipsModelValidations: - Enabled: true - -Rails/Validation: - Include: - - app/models/**/*.rb diff --git a/.rubocop_ruby.yml b/.rubocop_ruby.yml deleted file mode 100644 index 8341346fe6..0000000000 --- a/.rubocop_ruby.yml +++ /dev/null @@ -1,1757 +0,0 @@ -require: - - rubocop-rspec - - rubocop-faker - -# Common configuration. -AllCops: - Include: - - .simplecov - - "**/*.rb" - - "**/*.rake" - - "**/*.gemspec" - - "**/*.ru" - - "**/Gemfile" - - "**/Rakefile" - Exclude: - - "**/node_modules/**/*" - - "**/vendor/**/*" - - "development_app/**/*" - - "spec/decidim_dummy_app/**/*" - - "node_modules/**/*" - - "db/migrate/*" - - "db/schema.rb" - # Default formatter will be used if no -f/--format option is given. - DefaultFormatter: progress - # Cop names are not displayed in offense messages by default. Change behavior - # by overriding DisplayCopNames, or by giving the -D/--display-cop-names - # option. - DisplayCopNames: true - # Style guide URLs are not displayed in offense messages by default. Change - # behavior by overriding DisplayStyleGuide, or by giving the - # -S/--display-style-guide option. - DisplayStyleGuide: false - # Extra details are not displayed in offense messages by default. Change - # behavior by overriding ExtraDetails, or by giving the - # -E/--extra-details option. - ExtraDetails: false - NewCops: enable - # Additional cops that do not reference a style guide rule may be enabled by - # default. Change behavior by overriding StyleGuideCopsOnly, or by giving - # the --only-guide-cops option. - StyleGuideCopsOnly: false - # All cops except the ones in disabled.yml are enabled by default. Change - # this behavior by overriding DisabledByDefault. When DisabledByDefault is - # true, all cops in the default configuration are disabled, and and only cops - # in user configuration are enabled. This makes cops opt-in instead of - # opt-out. Note that when DisabledByDefault is true, cops in user - # configuration will be enabled even if they don't set the Enabled parameter. - DisabledByDefault: false - # Enables the result cache if true. Can be overridden by the --cache command - # line option. - UseCache: true - # Threshold for how many files can be stored in the result cache before some - # of the files are automatically removed. - MaxFilesInCache: 20000 - # The cache will be stored in "rubocop_cache" under this directory. The name - # "/tmp" is special and will be converted to the system temporary directory, - # which is "/tmp" on Unix-like systems, but could be something else on other - # systems. - CacheRootDirectory: /tmp - # The default cache root directory is /tmp, which on most systems is - # writable by any system user. This means that it is possible for a - # malicious user to anticipate the location of Rubocop's cache directory, - # and create a symlink in its place that could cause Rubocop to overwrite - # unintended files, or read malicious input. If you are certain that your - # cache location is secure from this kind of attack, and wish to use a - # symlinked cache location, set this value to "true". - AllowSymlinksInCacheRootDirectory: true - # What MRI version of the Ruby interpreter is the inspected code intended to - # run on? (If there is more than one, set this to the lowest version.) - # If a value is specified for TargetRubyVersion then it is used. - # Else if .ruby-version exists and it contains an MRI version it is used. - # Otherwise we fallback to the oldest officially supported Ruby version (2.0). - TargetRubyVersion: 3.0 - - # RSpec: - # Patterns: - # - "(?:^|/)spec/" - # - "(?:^|/)test/" - -# Indent private/protected/public as deep as method definitions -Layout/AccessModifierIndentation: - EnforcedStyle: indent - SupportedStyles: - - outdent - - indent - # By default, the indentation width from Style/IndentationWidth is used - # But it can be overridden by setting this parameter - IndentationWidth: ~ - -Style/Alias: - EnforcedStyle: prefer_alias - SupportedStyles: - - prefer_alias - - prefer_alias_method - -# Align the elements of a hash literal if they span more than one line. -Layout/HashAlignment: - # Alignment of entries using hash rocket as separator. Valid values are: - # - # key - left alignment of keys - # "a" => 2 - # "bb" => 3 - # separator - alignment of hash rockets, keys are right aligned - # "a" => 2 - # "bb" => 3 - # table - left alignment of keys, hash rockets, and values - # "a" => 2 - # "bb" => 3 - EnforcedHashRocketStyle: key - # Alignment of entries using colon as separator. Valid values are: - # - # key - left alignment of keys - # a: 0 - # bb: 1 - # separator - alignment of colons, keys are right aligned - # a: 0 - # bb: 1 - # table - left alignment of keys and values - # a: 0 - # bb: 1 - EnforcedColonStyle: key - # Select whether hashes that are the last argument in a method call should be - # inspected? Valid values are: - # - # always_inspect - Inspect both implicit and explicit hashes. - # Registers an offense for: - # function(a: 1, - # b: 2) - # Registers an offense for: - # function({a: 1, - # b: 2}) - # always_ignore - Ignore both implicit and explicit hashes. - # Accepts: - # function(a: 1, - # b: 2) - # Accepts: - # function({a: 1, - # b: 2}) - # ignore_implicit - Ignore only implicit hashes. - # Accepts: - # function(a: 1, - # b: 2) - # Registers an offense for: - # function({a: 1, - # b: 2}) - # ignore_explicit - Ignore only explicit hashes. - # Accepts: - # function({a: 1, - # b: 2}) - # Registers an offense for: - # function(a: 1, - # b: 2) - EnforcedLastArgumentHashStyle: always_inspect - SupportedLastArgumentHashStyles: - - always_inspect - - always_ignore - - ignore_implicit - - ignore_explicit - -Layout/ParameterAlignment: - # Alignment of parameters in multi-line method calls. - # - # The `with_first_parameter` style aligns the following lines along the same - # column as the first parameter. - # - # method_call(a, - # b) - # - # The `with_fixed_indentation` style aligns the following lines with one - # level of indentation relative to the start of the line with the method call. - # - # method_call(a, - # b) - EnforcedStyle: with_first_parameter - SupportedStyles: - - with_first_parameter - - with_fixed_indentation - # By default, the indentation width from Style/IndentationWidth is used - # But it can be overridden by setting this parameter - IndentationWidth: ~ - -Style/AndOr: - # Whether `and` and `or` are banned only in conditionals (conditionals) - # or completely (always). - EnforcedStyle: always - SupportedStyles: - - always - - conditionals - -Style/AsciiComments: - Enabled: false - -# Checks if usage of %() or %Q() matches configuration. -Style/BarePercentLiterals: - EnforcedStyle: bare_percent - SupportedStyles: - - percent_q - - bare_percent - -Style/BlockDelimiters: - EnforcedStyle: line_count_based - SupportedStyles: - # The `line_count_based` style enforces braces around single line blocks and - # do..end around multi-line blocks. - - line_count_based - # The `semantic` style enforces braces around functional blocks, where the - # primary purpose of the block is to return a value and do..end for - # procedural blocks, where the primary purpose of the block is its - # side-effects. - # - # This looks at the usage of a block's method to determine its type (e.g. is - # the result of a `map` assigned to a variable or passed to another - # method) but exceptions are permitted in the `ProceduralMethods`, - # `FunctionalMethods` and `IgnoredMethods` sections below. - - semantic - # The `braces_for_chaining` style enforces braces around single line blocks - # and do..end around multi-line blocks, except for multi-line blocks whose - # return value is being chained with another method (in which case braces - # are enforced). - - braces_for_chaining - ProceduralMethods: - # Methods that are known to be procedural in nature but look functional from - # their usage, e.g. - # - # time = Benchmark.realtime do - # foo.bar - # end - # - # Here, the return value of the block is discarded but the return value of - # `Benchmark.realtime` is used. - - benchmark - - bm - - bmbm - - create - - each_with_object - - measure - - new - - realtime - - tap - - with_object - FunctionalMethods: - # Methods that are known to be functional in nature but look procedural from - # their usage, e.g. - # - # let(:foo) { Foo.new } - # - # Here, the return value of `Foo.new` is used to define a `foo` helper but - # doesn't appear to be used from the return value of `let`. - - let - - let! - - subject - - watch - IgnoredMethods: - # Methods that can be either procedural or functional and cannot be - # categorised from their usage alone, e.g. - # - # foo = lambda do |x| - # puts "Hello, #{x}" - # end - # - # foo = lambda do |x| - # x * 100 - # end - # - # Here, it is impossible to tell from the return value of `lambda` whether - # the inner block's return value is significant. - - lambda - - proc - - it - -Style/ExplicitBlockArgument: - Enabled: false - -Style/HashEachMethods: - Enabled: false - -Style/HashLikeCase: - MinBranchesCount: 5 - -# Indentation of `when`. -Layout/CaseIndentation: - EnforcedStyle: case - SupportedStyles: - - case - - end - IndentOneStep: false - # By default, the indentation width from Style/IndentationWidth is used - # But it can be overridden by setting this parameter - # This only matters if IndentOneStep is true - IndentationWidth: ~ - -Style/ClassAndModuleChildren: - Enabled: false - # Checks the style of children definitions at classes and modules. - # - # Basically there are two different styles: - # - # `nested` - have each child on a separate line - # class Foo - # class Bar - # end - # end - # - # `compact` - combine definitions as much as possible - # class Foo::Bar - # end - # - # The compact style is only forced, for classes / modules with one child. - EnforcedStyle: nested - SupportedStyles: - - nested - - compact - -Style/ClassCheck: - EnforcedStyle: is_a? - SupportedStyles: - - is_a? - - kind_of? - -# Align with the style guide. -Style/CollectionMethods: - # Mapping from undesired method to desired_method - # e.g. to use `detect` over `find`: - # - # CollectionMethods: - # PreferredMethods: - # find: detect - PreferredMethods: - collect: "map" - collect!: "map!" - inject: "reduce" - detect: "find" - find_all: "select" - -# Use ` or %x around command literals. -Style/CommandLiteral: - EnforcedStyle: backticks - # backticks: Always use backticks. - # percent_x: Always use %x. - # mixed: Use backticks on single-line commands, and %x on multi-line commands. - SupportedStyles: - - backticks - - percent_x - - mixed - # If false, the cop will always recommend using %x if one or more backticks - # are found in the command string. - AllowInnerBackticks: false - -# Checks formatting of special comments -Style/CommentAnnotation: - Keywords: - - TODO - - FIXME - - OPTIMIZE - - HACK - - REVIEW - -Style/ConditionalAssignment: - EnforcedStyle: assign_to_condition - SupportedStyles: - - assign_to_condition - - assign_inside_condition - # When configured to `assign_to_condition`, `SingleLineConditionsOnly` - # will only register an offense when all branches of a condition are - # a single line. - # When configured to `assign_inside_condition`, `SingleLineConditionsOnly` - # will only register an offense for assignment to a condition that has - # at least one multiline branch. - SingleLineConditionsOnly: true - -# Checks that you have put a copyright in a comment before any code. -# -# You can override the default Notice in your .rubocop.yml file. -# -# In order to use autocorrect, you must supply a value for the -# AutocorrectNotice key that matches the regexp Notice. A blank -# AutocorrectNotice will cause an error during autocorrect. -# -# Autocorrect will add a copyright notice in a comment at the top -# of the file immediately after any shebang or encoding comments. -# -# Example rubocop.yml: -# -# Style/Copyright: -# Enabled: true -# Notice: 'Copyright (\(c\) )?2015 Yahoo! Inc' -# AutocorrectNotice: "# Copyright (c) 2015 Yahoo! Inc." -# -Style/Copyright: - Notice: '^Copyright (\(c\) )?2[0-9]{3} .+' - AutocorrectNotice: "" - -Style/DocumentationMethod: - RequireForNonPublicMethods: false - -# Multi-line method chaining should be done with leading dots. -Layout/DotPosition: - EnforcedStyle: leading - SupportedStyles: - - leading - - trailing - -# Warn on empty else statements -# empty - warn only on empty else -# nil - warn on else with nil in it -# both - warn on empty else and else with nil in it -Style/EmptyElse: - EnforcedStyle: both - SupportedStyles: - - empty - - nil - - both - -# Use empty lines between defs. -Layout/EmptyLineBetweenDefs: - # If true, this parameter means that single line method definitions don't - # need an empty line between them. - AllowAdjacentOneLineDefs: false - -Layout/EmptyLinesAroundBlockBody: - EnforcedStyle: no_empty_lines - SupportedStyles: - - empty_lines - - no_empty_lines - -Layout/EmptyLinesAroundClassBody: - EnforcedStyle: no_empty_lines - SupportedStyles: - - empty_lines - - no_empty_lines - -Layout/EmptyLinesAroundModuleBody: - EnforcedStyle: no_empty_lines - SupportedStyles: - - empty_lines - - no_empty_lines - -# Checks whether the source file has a utf-8 encoding comment or not -# AutoCorrectEncodingComment must match the regex -# /#.*coding\s?[:=]\s?(?:UTF|utf)-8/ -Style/Encoding: - Enabled: true - -Layout/ExtraSpacing: - # When true, allows most uses of extra spacing if the intent is to align - # things with the previous or next line, not counting empty lines or comment - # lines. - AllowForAlignment: false - # When true, forces the alignment of = in assignments on consecutive lines. - ForceEqualSignAlignment: false - -Naming/FileName: - Exclude: - - "**/Gemfile" - - "**/Rakefile" - - "**/*.gemspec" - # When true, requires that each source file should define a class or module - # with a name which matches the file name (converted to ... case). - # It further expects it to be nested inside modules which match the names - # of subdirectories in its path. - ExpectMatchingDefinition: false - # If non-nil, expect all source file names to match the following regex. - # Only the file name itself is matched, not the entire file path. - # Use anchors as necessary if you want to match the entire name rather than - # just a part of it. - Regex: ~ - # With `IgnoreExecutableScripts` set to `true`, this cop does not - # report offending filenames for executable scripts (i.e. source - # files with a shebang in the first line). - IgnoreExecutableScripts: true - -Layout/FirstArgumentIndentation: - EnforcedStyle: special_for_inner_method_call_in_parentheses - SupportedStyles: - # The first parameter should always be indented one step more than the - # preceding line. - - consistent - # The first parameter should normally be indented one step more than the - # preceding line, but if it's a parameter for a method call that is itself - # a parameter in a method call, then the inner parameter should be indented - # relative to the inner method. - - special_for_inner_method_call - # Same as special_for_inner_method_call except that the special rule only - # applies if the outer method call encloses its arguments in parentheses. - - special_for_inner_method_call_in_parentheses - # By default, the indentation width from Style/IndentationWidth is used - # But it can be overridden by setting this parameter - IndentationWidth: ~ - -# Checks use of for or each in multiline loops. -Style/For: - EnforcedStyle: each - SupportedStyles: - - for - - each - -# Enforce the method used for string formatting. -Style/FormatString: - EnforcedStyle: format - SupportedStyles: - - format - - sprintf - - percent - -Style/FormatStringToken: - EnforcedStyle: template - -Style/FrozenStringLiteralComment: - EnforcedStyle: always - SupportedStyles: - - never - # `always` will always add the frozen string literal comment to a file - # regardless of the Ruby version or if `freeze` or `<<` are called on a - # string literal. If you run code against multiple versions of Ruby, it is - # possible that this will create errors in Ruby 2.3.0+. - - always - -# Built-in global variables are allowed by default. -Style/GlobalVars: - AllowedVariables: [] - -# `MinBodyLength` defines the number of lines of the a body of an if / unless -# needs to have to trigger this cop -Style/GuardClause: - MinBodyLength: 6 - -Style/HashSyntax: - EnforcedStyle: ruby19 - SupportedStyles: - # checks for 1.9 syntax (e.g. {a: 1}) for all symbol keys - - ruby19 - # checks for hash rocket syntax for all hashes - - hash_rockets - # forbids mixed key syntaxes (e.g. {a: 1, :b => 2}) - - no_mixed_keys - # enforces both ruby19 and no_mixed_keys styles - - ruby19_no_mixed_keys - # Force hashes that have a symbol value to use hash rockets - UseHashRocketsWithSymbolValues: false - # Do not suggest { a?: 1 } over { :a? => 1 } in ruby19 style - PreferHashRocketsForNonAlnumEndingSymbols: false - -Layout/IndentationConsistency: - # The difference between `rails` and `normal` is that the `rails` style - # prescribes that in classes and modules the `protected` and `private` - # modifier keywords shall be indented the same as public methods and that - # protected and private members shall be indented one step more than the - # modifiers. Other than that, both styles mean that entities on the same - # logical depth shall have the same indentation. - EnforcedStyle: normal - SupportedStyles: - - normal - - rails - -Layout/IndentationWidth: - # Number of spaces for each indentation level. - Width: 2 - -# Checks the indentation of the first element in an array literal. -Layout/FirstArrayElementIndentation: - # The value `special_inside_parentheses` means that array literals with - # brackets that have their opening bracket on the same line as a surrounding - # opening round parenthesis, shall have their first element indented relative - # to the first position inside the parenthesis. - # - # The value `consistent` means that the indentation of the first element shall - # always be relative to the first position of the line where the opening - # bracket is. - # - # The value `align_brackets` means that the indentation of the first element - # shall always be relative to the position of the opening bracket. - EnforcedStyle: special_inside_parentheses - SupportedStyles: - - special_inside_parentheses - - consistent - - align_brackets - # By default, the indentation width from Style/IndentationWidth is used - # But it can be overridden by setting this parameter - IndentationWidth: ~ - -# Checks the indentation of assignment RHS, when on a different line from LHS -Layout/AssignmentIndentation: - # By default, the indentation width from Style/IndentationWidth is used - # But it can be overridden by setting this parameter - IndentationWidth: ~ - -# Checks the indentation of the first key in a hash literal. -Layout/FirstHashElementIndentation: - # The value `special_inside_parentheses` means that hash literals with braces - # that have their opening brace on the same line as a surrounding opening - # round parenthesis, shall have their first key indented relative to the - # first position inside the parenthesis. - # - # The value `consistent` means that the indentation of the first key shall - # always be relative to the first position of the line where the opening - # brace is. - # - # The value `align_braces` means that the indentation of the first key shall - # always be relative to the position of the opening brace. - EnforcedStyle: special_inside_parentheses - SupportedStyles: - - special_inside_parentheses - - consistent - - align_braces - # By default, the indentation width from Style/IndentationWidth is used - # But it can be overridden by setting this parameter - IndentationWidth: ~ - -Style/Lambda: - EnforcedStyle: line_count_dependent - SupportedStyles: - - line_count_dependent - - lambda - - literal - Exclude: - - "**/types/**/*" - - "**/*_interface.rb" - -Style/LambdaCall: - EnforcedStyle: call - SupportedStyles: - - call - - braces - -Style/Next: - # With `always` all conditions at the end of an iteration needs to be - # replaced by next - with `skip_modifier_ifs` the modifier if like this one - # are ignored: [1, 2].each { |a| return "yes" if a == 1 } - EnforcedStyle: skip_modifier_ifs - # `MinBodyLength` defines the number of lines of the a body of an if / unless - # needs to have to trigger this cop - MinBodyLength: 3 - SupportedStyles: - - skip_modifier_ifs - - always - -Style/NonNilCheck: - # With `IncludeSemanticChanges` set to `true`, this cop reports offenses for - # `!x.nil?` and autocorrects that and `x != nil` to solely `x`, which is - # **usually** OK, but might change behavior. - # - # With `IncludeSemanticChanges` set to `false`, this cop does not report - # offenses for `!x.nil?` and does no changes that might change behavior. - IncludeSemanticChanges: false - -Style/NumericPredicate: - EnforcedStyle: predicate - SupportedStyles: - - predicate - - comparison - -Style/MethodDefParentheses: - EnforcedStyle: require_parentheses - SupportedStyles: - - require_parentheses - - require_no_parentheses - - require_no_parentheses_except_multiline - -Naming/MethodName: - EnforcedStyle: snake_case - SupportedStyles: - - snake_case - - camelCase - -Style/ModuleFunction: - EnforcedStyle: module_function - SupportedStyles: - - module_function - - extend_self - -Layout/MultilineArrayBraceLayout: - EnforcedStyle: symmetrical - SupportedStyles: - # symmetrical: closing brace is positioned in same way as opening brace - # new_line: closing brace is always on a new line - # same_line: closing brace is always on the same line as last element - - symmetrical - - new_line - - same_line - -Layout/MultilineAssignmentLayout: - # The types of assignments which are subject to this rule. - SupportedTypes: - - block - - case - - class - - if - - kwbegin - - module - EnforcedStyle: new_line - SupportedStyles: - # Ensures that the assignment operator and the rhs are on the same line for - # the set of supported types. - - same_line - # Ensures that the assignment operator and the rhs are on separate lines - # for the set of supported types. - - new_line - -Layout/MultilineHashBraceLayout: - EnforcedStyle: symmetrical - SupportedStyles: - # symmetrical: closing brace is positioned in same way as opening brace - # new_line: closing brace is always on a new line - # same_line: closing brace is always on same line as last element - - symmetrical - - new_line - - same_line - -Layout/MultilineMethodCallBraceLayout: - EnforcedStyle: symmetrical - SupportedStyles: - # symmetrical: closing brace is positioned in same way as opening brace - # new_line: closing brace is always on a new line - # same_line: closing brace is always on the same line as last argument - - symmetrical - - new_line - - same_line - -Layout/MultilineMethodCallIndentation: - EnforcedStyle: aligned - SupportedStyles: - - aligned - - indented - - indented_relative_to_receiver - # By default, the indentation width from Style/IndentationWidth is used - # But it can be overridden by setting this parameter - IndentationWidth: ~ - -Layout/MultilineMethodDefinitionBraceLayout: - EnforcedStyle: symmetrical - SupportedStyles: - # symmetrical: closing brace is positioned in same way as opening brace - # new_line: closing brace is always on a new line - # same_line: closing brace is always on the same line as last parameter - - symmetrical - - new_line - - same_line - -Layout/MultilineOperationIndentation: - EnforcedStyle: aligned - SupportedStyles: - - aligned - - indented - # By default, the indentation width from Style/IndentationWidth is used - # But it can be overridden by setting this parameter - IndentationWidth: ~ - -Style/NumericLiterals: - MinDigits: 5 - -Style/NumericLiteralPrefix: - EnforcedOctalStyle: zero_with_o - SupportedOctalStyles: - - zero_with_o - - zero_only - -Style/OptionHash: - # A list of parameter names that will be flagged by this cop. - SuspiciousParamNames: - - options - - opts - - args - - params - - parameters - -# Allow safe assignment in conditions. -Style/ParenthesesAroundCondition: - AllowSafeAssignment: true - -Style/PercentLiteralDelimiters: - PreferredDelimiters: - "%": () - "%i": () - "%q": () - "%Q": () - "%r": "{}" - "%s": () - "%w": () - "%W": () - "%x": () - -Style/PercentQLiterals: - EnforcedStyle: lower_case_q - SupportedStyles: - - lower_case_q # Use %q when possible, %Q when necessary - - upper_case_q # Always use %Q - -Style/SlicingWithRange: - Enabled: false - -Naming/PredicateName: - # Predicate name prefixes. - NamePrefix: - - is_ - - has_ - - have_ - # Predicate name prefixes that should be removed. - ForbiddenPrefixes: - - is_ - - have_ - # Predicate names which, despite having a blacklisted prefix, or no ?, - # should still be accepted - AllowedMethods: - - is_a? - # Exclude Rspec specs because there is a strong convetion to write spec - # helpers in the form of `have_something` or `be_something`. - Exclude: - - "**/spec/**/*" - - "**/test/**/*" - -Style/PreferredHashMethods: - Enabled: true - EnforcedStyle: verbose - -Style/DateTime: - Enabled: true - -Style/Documentation: - Enabled: false - -Style/RaiseArgs: - EnforcedStyle: exploded - SupportedStyles: - - compact # raise Exception.new(msg) - - exploded # raise Exception, msg - -Style/RedundantReturn: - # When true allows code like `return x, y`. - AllowMultipleReturnValues: false - -# Use / or %r around regular expressions. -Style/RegexpLiteral: - EnforcedStyle: slashes - # slashes: Always use slashes. - # percent_r: Always use %r. - # mixed: Use slashes on single-line regexes, and %r on multi-line regexes. - SupportedStyles: - - slashes - - percent_r - - mixed - # If false, the cop will always recommend using %r if one or more slashes - # are found in the regexp string. - AllowInnerSlashes: false - -Style/SafeNavigation: - Enabled: false - -Style/Semicolon: - # Allow ; to separate several expressions on the same line. - AllowAsExpressionSeparator: false - -Style/SignalException: - EnforcedStyle: only_raise - SupportedStyles: - - only_raise - - only_fail - - semantic - -Style/SingleLineBlockParams: - Methods: - - reduce: - - a - - e - - inject: - - a - - e - -Style/SingleLineMethods: - AllowIfMethodIsEmpty: true - -Layout/SpaceBeforeFirstArg: - # When true, allows most uses of extra spacing if the intent is to align - # things with the previous or next line, not counting empty lines or comment - # lines. - AllowForAlignment: true - -Style/SpecialGlobalVars: - EnforcedStyle: use_english_names - SupportedStyles: - - use_perl_names - - use_english_names - -Style/StabbyLambdaParentheses: - EnforcedStyle: require_parentheses - SupportedStyles: - - require_parentheses - - require_no_parentheses - -Style/StringLiterals: - EnforcedStyle: double_quotes - SupportedStyles: - - single_quotes - - double_quotes - # If true, strings which span multiple lines using \ for continuation must - # use the same type of quotes on each line. - ConsistentQuotesInMultiline: false - -Style/StringLiteralsInInterpolation: - EnforcedStyle: double_quotes - SupportedStyles: - - single_quotes - - double_quotes - -Style/StringMethods: - # Mapping from undesired method to desired_method - # e.g. to use `to_sym` over `intern`: - # - # StringMethods: - # PreferredMethods: - # intern: to_sym - PreferredMethods: - intern: to_sym - -Layout/SpaceAroundBlockParameters: - EnforcedStyleInsidePipes: no_space - -Layout/SpaceAroundEqualsInParameterDefault: - EnforcedStyle: space - SupportedStyles: - - space - - no_space - -Layout/SpaceAroundOperators: - # When true, allows most uses of extra spacing if the intent is to align - # with an operator on the previous or next line, not counting empty lines - # or comment lines. - AllowForAlignment: true - -Layout/SpaceBeforeBlockBraces: - EnforcedStyle: space - SupportedStyles: - - space - - no_space - -Layout/SpaceInsideBlockBraces: - EnforcedStyle: space - SupportedStyles: - - space - - no_space - # Valid values are: space, no_space - EnforcedStyleForEmptyBraces: no_space - # Space between { and |. Overrides EnforcedStyle if there is a conflict. - SpaceBeforeBlockParameters: true - -Layout/SpaceInsideHashLiteralBraces: - EnforcedStyle: space - EnforcedStyleForEmptyBraces: no_space - SupportedStyles: - - space - - no_space - # "compact" normally requires a space inside hash braces, with the exception - # that successive left braces or right braces are collapsed together - - compact - -Layout/SpaceInsideStringInterpolation: - EnforcedStyle: no_space - SupportedStyles: - - space - - no_space - -Style/AccessModifierDeclarations: - Enabled: false - -Style/SymbolArray: - EnforcedStyle: brackets - SupportedStyles: - - percent - - brackets - -Style/SymbolProc: - # A list of method names to be ignored by the check. - # The names should be fairly unique, otherwise you'll end up ignoring lots of code. - IgnoredMethods: - - respond_to - - define_method - -Style/TernaryParentheses: - EnforcedStyle: require_no_parentheses - SupportedStyles: - - require_parentheses - - require_no_parentheses - AllowSafeAssignment: true - -Layout/TrailingEmptyLines: - EnforcedStyle: final_newline - SupportedStyles: - - final_newline - - final_blank_line - -Style/TrailingCommaInArguments: - # If `comma`, the cop requires a comma after the last argument, but only for - # parenthesized method calls where each argument is on its own line. - # If `consistent_comma`, the cop requires a comma after the last argument, - # for all parenthesized method calls with arguments. - EnforcedStyleForMultiline: no_comma - -Style/TrailingCommaInArrayLiteral: - # If `comma`, the cop requires a comma after the last item in an array or - # hash, but only when each item is on its own line. - # If `consistent_comma`, the cop requires a comma after the last item of all - # non-empty array and hash literals. - EnforcedStyleForMultiline: no_comma - -Style/TrailingCommaInHashLiteral: - # If `comma`, the cop requires a comma after the last item in an array or - # hash, but only when each item is on its own line. - # If `consistent_comma`, the cop requires a comma after the last item of all - # non-empty array and hash literals. - EnforcedStyleForMultiline: no_comma - -# TrivialAccessors requires exact name matches and doesn't allow -# predicated methods by default. -Style/TrivialAccessors: - # When set to false the cop will suggest the use of accessor methods - # in situations like: - # - # def name - # @other_name - # end - # - # This way you can uncover "hidden" attributes in your code. - ExactNameMatch: true - AllowPredicates: true - # Allows trivial writers that don't end in an equal sign. e.g. - # - # def on_exception(action) - # @on_exception=action - # end - # on_exception :restart - # - # Commonly used in DSLs - AllowDSLWriters: false - IgnoreClassMethods: false - AllowedMethods: - - to_ary - - to_a - - to_c - - to_enum - - to_h - - to_hash - - to_i - - to_int - - to_io - - to_open - - to_path - - to_proc - - to_r - - to_regexp - - to_str - - to_s - - to_sym - -Naming/VariableName: - EnforcedStyle: snake_case - SupportedStyles: - - snake_case - - camelCase - -Naming/VariableNumber: - EnforcedStyle: normalcase - SupportedStyles: - - snake_case - - normalcase - - non_integer - -# WordArray enforces how array literals of word-like strings should be expressed. -Style/WordArray: - EnforcedStyle: percent - SupportedStyles: - # percent style: %w(word1 word2) - - percent - # bracket style: ["word1", "word2"] - - brackets - # The MinSize option causes the WordArray rule to be ignored for arrays - # smaller than a certain size. The rule is only applied to arrays - # whose element count is greater than or equal to MinSize. - MinSize: 2 - # The regular expression WordRegex decides what is considered a word. - WordRegex: !ruby/regexp '/\A[\p{Word}\n\t]+\z/' - -##################### Metrics ################################## - -Metrics/AbcSize: - # The ABC size is a calculated magnitude, so this number can be an Integer or - # a Float. - Max: 15 - Enabled: false - -Metrics/BlockNesting: - Max: 3 - -Metrics/ClassLength: - CountComments: false # count full line comments? - Max: 100 - Enabled: false - -Metrics/ModuleLength: - CountComments: false # count full line comments? - Max: 100 - Enabled: false - -# Avoid complex methods. -Metrics/CyclomaticComplexity: - Max: 9 - Exclude: - - "bin/bundle" - - "decidim-admin/app/queries/decidim/admin/newsletter_recipients.rb" - - "**/*/dummy_authorization_handler.rb" - - "**/*/permissions.rb" - - "**/*/permissions_override.rb" - -Metrics/MethodLength: - CountComments: false # count full line comments? - Max: 15 - Enabled: false - -Metrics/ParameterLists: - Max: 5 - CountKeywordArgs: true - Exclude: - - "decidim-core/lib/decidim/filter_form_builder.rb" - -Metrics/PerceivedComplexity: - Max: 10 - Exclude: - - "decidim-admin/app/queries/decidim/admin/newsletter_recipients.rb" - - "**/*/dummy_authorization_handler.rb" - - "**/*/permissions.rb" - - "**/*/permissions_override.rb" - -##################### Lint ################################## - -Lint/AmbiguousBlockAssociation: - Enabled: true - Exclude: - - "**/abilities/**/*" - -# Allow safe assignment in conditions. -Lint/AssignmentInCondition: - AllowSafeAssignment: true - -Lint/ConstantDefinitionInBlock: - Enabled: false - -# Call super to initialize state of the parent class. -Lint/MissingSuper: - Enabled: false - -# checks whether the end keywords are aligned properly for `do` `end` blocks. -Layout/BlockAlignment: - # The value `start_of_block` means that the `end` should be aligned with line - # where the `do` keyword appears. - # The value `start_of_line` means it should be aligned with the whole - # expression's starting line. - # The value `either` means both are allowed. - EnforcedStyleAlignWith: either - -# Align ends correctly. -Layout/EndAlignment: - # The value `keyword` means that `end` should be aligned with the matching - # keyword (if, while, etc.). - # The value `variable` means that in assignments, `end` should be aligned - # with the start of the variable on the left hand side of `=`. In all other - # situations, `end` should still be aligned with the keyword. - # The value `start_of_line` means that `end` should be aligned with the start - # of the line which the matching keyword appears on. - EnforcedStyleAlignWith: keyword - AutoCorrect: false - -Layout/DefEndAlignment: - # The value `def` means that `end` should be aligned with the def keyword. - # The value `start_of_line` means that `end` should be aligned with method - # calls like `private`, `public`, etc, if present in front of the `def` - # keyword on the same line. - EnforcedStyleAlignWith: start_of_line - AutoCorrect: false - -Lint/InheritException: - # The default base class in favour of `Exception`. - EnforcedStyle: runtime_error - SupportedStyles: - - runtime_error - - standard_error - -Layout/LineLength: - Max: 180 - # To make it possible to copy or click on URIs in the code, we allow lines - # containing a URI to be longer than Max. - AllowHeredoc: true - AllowURI: true - URISchemes: - - http - - https - Exclude: - - "**/spec/**/*" - -# Checks for unused block arguments -Lint/UnusedBlockArgument: - IgnoreEmptyBlocks: true - AllowUnusedKeywordArguments: false - -# Checks for unused method arguments. -Lint/UnusedMethodArgument: - AllowUnusedKeywordArguments: false - IgnoreEmptyMethods: true - -##################### Performance ############################ - -Metrics/BlockLength: - Enabled: false - -RSpec/BeforeAfterAll: - Enabled: true - -RSpec/ContextWording: - Enabled: true - Prefixes: - - when - - with - - without - - and - -RSpec/DescribeClass: - Exclude: - - spec/gemfiles_spec.rb - - spec/js_bundles_spec.rb - - spec/i18n_spec.rb - - "**/*/spec/**/*_badge_spec.rb" - - decidim-core/spec/lib/global_engines_spec.rb - - "**/tasks/**/*" - -RSpec/EmptyExampleGroup: - Exclude: - - decidim-core/spec/lib/participatory_space_manifest_spec.rb - -RSpec/ExampleLength: - Max: 49 - -RSpec/ExpectInHook: - Enabled: false - -RSpec/IteratedExpectation: - Enabled: true - -RSpec/LetSetup: - Enabled: false - -RSpec/MessageSpies: - Enabled: false - -RSpec/MultipleExpectations: - Enabled: false - -RSpec/MultipleMemoizedHelpers: - Max: 35 - -RSpec/NestedGroups: - Max: 7 - -RSpec/NamedSubject: - Enabled: false - -RSpec/RepeatedExampleGroupDescription: - Enabled: false - -RSpec/RepeatedExampleGroupBody: - Enabled: false -RSpec/VerifiedDoubles: - Enabled: false - -RSpec/LeakyConstantDeclaration: - Enabled: false - -RSpec/DescribedClass: - Enabled: false - -# This is the default configuration file. - -Faker/DeprecatedArguments: - Description: 'Checks that Faker arguments style is based on Faker 2.' - Enabled: true - VersionAdded: '0.1' - Reference: 'https://github.com/faker-ruby/faker/blob/master/CHANGELOG.md#v20-2019-31-07' - ArgumentKeywords: - # - # FakerClassName: - # method_name: - # - keyword_name_for_first_argument - # - keyword_name_for_second_argument - # - keyword_name_for_third_argument - # - Faker::Dune: - quote: - - character - saying: - - source - Faker::Books::Lovecraft: - fhtagn: - - number - sentence: - - word_count - - random_words_to_add - words: - - number - - spaces_allowed - sentences: - - number - paragraph: - - sentence_count - - random_sentences_to_add - paragraphs: - - number - paragraph_by_chars: - - characters - Faker::Address: - city: - - options - street_address: - - include_secondary - zip_code: - - state_abbreviation - country_by_code: - - code - country_name_to_code: - - name - Faker::Alphanumeric: - alpha: - - number - alphanumeric: - - number - Faker::App: - semantic_version: - - major - - minor - - patch - Faker::Avatar: - image: - - slug - - size - - format - - set - - bgset - Faker::Bank: - account_number: - - digits - iban: - - country_code - Faker::Boolean: - boolean: - - true_ratio - Faker::ChileRut: - rut: - - min_rut - - fixed - full_rut: - - min_rut - - fixed - Faker::Code: - isbn: - - base - ean: - - base - nric: - - min_age - - max_age - Faker::Commerce: - promotion_code: - - digits - department: - - max - - fixed_amount - price: - - range - - as_string - Faker::Company: - polish_register_of_national_economy: - - length - brazilian_company_number: - - formatted - Faker::CryptoCoin: - coin_name: - - coin - acronym: - - coin - url_logo: - - coin - Faker::Date: - between: - - from - - to - between_except: - - from - - to - - excepted - forward: - - days - backward: - - days - birthday: - - min_age - - max_age - Faker::Demographic: - height: - - unit - Faker::DrivingLicence: - british_driving_licence: - - last_name - - initials - - gender - - date_of_birth - Faker::File: - dir: - - segment_count - - root - - directory_separator - file_name: - - dir - - name - - ext - - directory_separator - Faker::Fillmurray: - image: - - grayscale - - width - - height - Faker::Finance: - vat_number: - - country - Faker::Hipster: - words: - - number - - supplemental - - spaces_allowed - sentence: - - word_count - - supplemental - - random_words_to_add - sentences: - - number - - supplemental - paragraph: - - sentence_count - - supplemental - - random_sentences_to_add - paragraphs: - - number - - supplemental - paragraph_by_chars: - - characters - - supplemental - Faker::IDNumber: - brazilian_citizen_number: - - formatted - brazilian_id: - - formatted - Faker::Internet: - email: - - name - - separators - free_email: - - name - safe_email: - - name - username: - - specifier - - separators - password: - - min_length - - max_length - - mix_case - - special_characters - domain_name: - - subdomain - fix_umlauts: - - string - mac_address: - - prefix - url: - - host - - path - - scheme - slug: - - words - - glue - user_agent: - - vendor - Faker::Invoice: - amount_between: - - from - - to - creditor_reference: - - ref - reference: - - ref - Faker::Json: - shallow_json: - - width - - options - add_depth_to_json: - - json - - width - - options - Faker::Lorem: - words: - - number - - supplemental - characters: - - number - sentence: - - word_count - - supplemental - - random_words_to_add - sentences: - - number - - supplemental - paragraph: - - sentence_count - - supplemental - - random_sentences_to_add - paragraphs: - - number - - supplemental - paragraph_by_chars: - - number - - supplemental - question: - - word_count - - supplemental - - random_words_to_add - questions: - - number - - supplemental - Faker::LoremFlickr: - image: - - size - - search_terms - - match_all - grayscale_image: - - size - - search_terms - - match_all - pixelated_image: - - size - - search_terms - - match_all - colorized_image: - - size - - color - - search_terms - - match_all - Faker::LoremPixel: - image: - - size - - is_gray - - category - - number - - text - - secure - Faker::Markdown: - sandwich: - - sentences - - repeat - Faker::Measurement: - height: - - amount - length: - - amount - volume: - - amount - weight: - - amount - metric_height: - - amount - metric_length: - - amount - metric_volume: - - amount - metric_weight: - - amount - Faker::Name: - initials: - - number - Faker::NationalHealthService: - check_digit: - - number - Faker::Number: - number: - - digits - leading_zero_number: - - digits - decimal_part: - - digits - decimal: - - l_digits - - r_digits - hexadecimal: - - digits - normal: - - mean - - standard_deviation - between: - - from - - to - within: - - range - positive: - - from - - to - negative: - - from - - to - Faker::Omniauth: - google: - - name - - email - - uid - facebook: - - name - - email - - username - - uid - twitter: - - name - - nickname - - uid - linkedin: - - name - - email - - uid - github: - - name - - email - - uid - Faker::PhoneNumber: - subscriber_number: - - length - Faker::Placeholdit: - image: - - size - - format - - background_color - - text_color - - text - Faker::Relationship: - familial: - - connection - Faker::Source: - hello_world: - - lang - print: - - str - - lang - print_1_to_10: - - lang - Faker::String: - random: - - length - Faker::Stripe: - valid_card: - - card_type - valid_token: - - card_type - invalid_card: - - card_error - ccv: - - card_type - Faker::Time: - between: - - from - - to - - format - between_dates: - - from - - to - - period - - format - forward: - - days - - period - - format - backward: - - days - - period - - format - Faker::Twitter: - user: - - include_status - - include_email - status: - - include_user - - include_photo - status_entities: - - include_photo - Faker::Types: - rb_string: - - words - rb_integer: - - from - - to - rb_hash: - - number - - type - complex_rb_hash: - - number - rb_array: - - len - Faker::Vehicle: - model: - - make_of_model - mileage: - - min - - max - license_plate: - - state_abbreviation - Faker::WorldCup: - group: - - group - roster: - - country - - type - Faker::Dota: - quote: - - hero - Faker::Movies::StarWars: - quote: - - character - Decidim::Faker::Localized: - words: - - number - - supplemental - characters: - - number - sentence: - - word_count - - supplemental - - random_words_to_add - sentences: - - number - - supplemental - paragraph: - - sentence_count - - supplemental - - random_sentences_to_add - paragraphs: - - number - - supplemental - paragraph_by_chars: - - number - - supplemental - question: - - word_count - - supplemental - - random_words_to_add - questions: - - number - - supplemental - diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml new file mode 100644 index 0000000000..5445d7832f --- /dev/null +++ b/.rubocop_todo.yml @@ -0,0 +1,24 @@ +Metrics/CyclomaticComplexity: + Exclude: + - 'app/permissions/concerns/decidim/initiatives/admin/permissions_override.rb' + +Metrics/PerceivedComplexity: + Exclude: + - 'app/permissions/concerns/decidim/initiatives/admin/permissions_override.rb' + +RSpec/DescribeClass: + Exclude: + - 'decidim-census_sms/spec/system/census_sms_authorization_spec.rb' + - 'decidim-ephemeral_participation/spec/system/user/complete_registration_spec.rb' + - 'decidim-ephemeral_participation/spec/system/user/ephemeral_participation_button_spec.rb' + - 'decidim-ephemeral_participation/spec/system/user/flash_messages_spec.rb' + - 'decidim-ephemeral_participation/spec/system/user/session_spec.rb' + - 'decidim-ephemeral_participation/spec/system/user/successful_verification_spec.rb' + - 'decidim-ephemeral_participation/spec/system/user/user_menu_spec.rb' + - 'decidim-ephemeral_participation/spec/system/user/verification_conflicts_spec.rb' + - 'spec/system/census16_authorization_spec.rb' + +RSpec/PendingWithoutReason: + Exclude: + - 'spec/system/budgets_ephemeral_participation_spec.rb' + - 'spec/system/budget_spec.rb' diff --git a/.ruby-version b/.ruby-version index b502146930..94ff29cc4d 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.0.2 +3.1.1 diff --git a/Dockerfile b/Dockerfile index 0209f8d15b..e590c36c7f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,16 +1,9 @@ -# Decidim Application Dockerfile -# This is an image to start an application based on Decidim (https://decidim.org) -# -# +FROM ruby:3.1.1 - -# Starts with a clean ruby image from Debian (slim) -FROM ruby:3.0.2 - -LABEL maintainer="hola@decidim.org" - -# Installs system dependencies ENV DEBIAN_FRONTEND noninteractive +ENV NODE_MAJOR=18 + +# Install system dependencies RUN apt-get update -qq && apt-get install -y \ build-essential \ graphviz \ @@ -20,7 +13,15 @@ RUN apt-get update -qq && apt-get install -y \ nodejs \ && rm -rf /var/lib/apt/lists/* -# Sets workdir as /app +# Install node +RUN mkdir -p /etc/apt/keyrings +RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg +RUN echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list +RUN apt-get update -qq && apt-get install -y \ + nodejs \ + && rm -rf /var/lib/apt/lists/* + +# Create workdir RUN mkdir /app WORKDIR /app @@ -40,8 +41,12 @@ ADD ./decidim-dataviz/decidim-dataviz.gemspec /app/decidim-dataviz/decidim-datav ADD ./decidim-ephemeral_participation/decidim-ephemeral_participation.gemspec /app/decidim-ephemeral_participation/decidim-ephemeral_participation.gemspec ADD ./decidim-stats/decidim-stats.gemspec /app/decidim-stats/decidim-stats.gemspec ADD ./decidim-valid_auth/decidim-valid_auth.gemspec /app/decidim-valid_auth/decidim-valid_auth.gemspec -RUN gem install bundler:2.3.26 +RUN gem install bundler:2.4.14 RUN bundle install # Copy all the code to /app ADD . /app + +# Compile assets +RUN npm i +RUN npm i -g yarn diff --git a/Gemfile b/Gemfile index f50ffea51c..7486bcf9d3 100644 --- a/Gemfile +++ b/Gemfile @@ -2,70 +2,63 @@ source "https://rubygems.org" -DECIDIM_VERSION = { git: "https://github.com/AjuntamentdeBarcelona/decidim", branch: "release/0.27-stable-bcn" }.freeze +DECIDIM_VERSION = "0.28.3" ruby RUBY_VERSION gem "decidim", DECIDIM_VERSION -gem "decidim-census_sms", path: "decidim-census_sms" -gem "decidim-dataviz", path: "decidim-dataviz" -gem "decidim-ephemeral_participation", path: "decidim-ephemeral_participation" gem "decidim-initiatives", DECIDIM_VERSION -gem "decidim-navigation_maps", git: "https://github.com/Platoniq/decidim-module-navigation_maps", branch: "main" gem "decidim-sortitions", DECIDIM_VERSION + +gem "decidim-census_sms", path: "decidim-census_sms" +gem "decidim-dataviz", path: "decidim-dataviz" +gem "decidim-ephemeral_participation", path: "decidim-ephemeral_participation" # Installed but not used anymore gem "decidim-stats", path: "decidim-stats" gem "decidim-valid_auth", path: "decidim-valid_auth" -# Change term_customizer dependency to ruby-gems' when term-customizer is compatible with DECIDIM_VERSION -gem "decidim-decidim_awesome", git: "https://github.com/decidim-ice/decidim-module-decidim_awesome", branch: "main" -gem "decidim-kids", git: "https://github.com/AjuntamentdeBarcelona/decidim-module-kids", branch: "main" -gem "decidim-term_customizer", git: "https://github.com/mainio/decidim-module-term_customizer", branch: "master" +gem "decidim-decidim_awesome", git: "https://github.com/decidim-ice/decidim-module-decidim_awesome" +gem "decidim-kids", git: "https://github.com/AjuntamentdeBarcelona/decidim-module-kids" +gem "decidim-navigation_maps", git: "https://github.com/Platoniq/decidim-module-navigation_maps" +gem "decidim-term_customizer", git: "https://github.com/mainio/decidim-module-term_customizer" -gem "wicked_pdf" +gem "origami" +gem "wicked_pdf", "< 2.8" gem "wkhtmltopdf-binary" -gem "deface" -gem "lograge" -gem "origami" gem "progressbar" gem "puma" -gem "uglifier" - -# Needed to be able to debug Puma status -gem "barnes" group :development, :test do gem "bootsnap" gem "byebug", platform: :mri gem "decidim-dev", DECIDIM_VERSION gem "dotenv-rails" - gem "faker", "~> 2.14" + gem "faker" + gem "mdl" gem "rubocop-faker" end group :development do + gem "foreman" gem "letter_opener_web" gem "listen" gem "rubocop" - gem "spring" - gem "spring-commands-rspec" - gem "spring-watcher-listen" gem "web-console" end group :production do - # Used to restart puma workers every 6h and free memory - gem "puma_worker_killer" - # Let's kill long-running requests after the Heroku router has responded to. - # https://devcenter.heroku.com/articles/h12-request-timeout-in-ruby-mri#rack-timeout gem "aws-sdk-s3", require: false + gem "barnes" # Needed to be able to debug Puma status gem "dalli" - gem "fog-aws" # to remove once image migration is complete + gem "lograge" + gem "matrix" + gem "puma_worker_killer" # Used to restart puma workers every 6h and free memory gem "rack_password" gem "rack-ssl-enforcer" - gem "rack-timeout" + gem "rack-timeout" # Let's kill long-running requests after the Heroku router has responded to gem "rails_12factor" gem "rails_autoscale_agent" + gem "rexml" gem "scout_apm" gem "sentry-rails" gem "sentry-ruby" diff --git a/Gemfile.lock b/Gemfile.lock index cd6479683c..056c28f41e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,295 +1,108 @@ -GIT - remote: https://github.com/AjuntamentdeBarcelona/decidim - revision: 4bab38e05e8f6d29b688eb7880ba43ddbcabb4bb - branch: release/0.27-stable-bcn - specs: - decidim (0.27.5) - decidim-accountability (= 0.27.5) - decidim-admin (= 0.27.5) - decidim-api (= 0.27.5) - decidim-assemblies (= 0.27.5) - decidim-blogs (= 0.27.5) - decidim-budgets (= 0.27.5) - decidim-comments (= 0.27.5) - decidim-core (= 0.27.5) - decidim-debates (= 0.27.5) - decidim-forms (= 0.27.5) - decidim-generators (= 0.27.5) - decidim-meetings (= 0.27.5) - decidim-pages (= 0.27.5) - decidim-participatory_processes (= 0.27.5) - decidim-proposals (= 0.27.5) - decidim-sortitions (= 0.27.5) - decidim-surveys (= 0.27.5) - decidim-system (= 0.27.5) - decidim-templates (= 0.27.5) - decidim-verifications (= 0.27.5) - decidim-accountability (0.27.5) - decidim-comments (= 0.27.5) - decidim-core (= 0.27.5) - decidim-admin (0.27.5) - active_link_to (~> 1.0) - decidim-core (= 0.27.5) - devise (~> 4.7) - devise-i18n (~> 1.2) - devise_invitable (~> 2.0, >= 2.0.9) - decidim-api (0.27.5) - decidim-core (= 0.27.5) - graphql (~> 1.12, < 1.13) - graphql-docs (~> 2.1.0) - rack-cors (~> 1.0) - decidim-assemblies (0.27.5) - decidim-core (= 0.27.5) - decidim-blogs (0.27.5) - decidim-admin (= 0.27.5) - decidim-comments (= 0.27.5) - decidim-core (= 0.27.5) - decidim-budgets (0.27.5) - decidim-comments (= 0.27.5) - decidim-core (= 0.27.5) - decidim-comments (0.27.5) - decidim-core (= 0.27.5) - redcarpet (~> 3.5, >= 3.5.1) - decidim-core (0.27.5) - active_link_to (~> 1.0) - acts_as_list (~> 0.9) - batch-loader (~> 1.2) - browser (~> 2.7) - carrierwave (~> 2.2.5, >= 2.2.5) - cells-erb (~> 0.1.0) - cells-rails (~> 0.1.3) - charlock_holmes (~> 0.7) - date_validator (~> 0.12.0) - devise (~> 4.7) - devise-i18n (~> 1.2) - diffy (~> 3.3) - doorkeeper (~> 5.1) - doorkeeper-i18n (~> 4.0) - file_validators (~> 3.0) - fog-local (~> 0.6) - foundation_rails_helper (~> 4.0) - geocoder (~> 1.8) - hashdiff (>= 0.4.0, < 2.0.0) - invisible_captcha (~> 0.12) - kaminari (~> 1.2, >= 1.2.1) - loofah (~> 2.19.0) - mime-types (>= 1.16, < 4.0) - mini_magick (~> 4.9) - mustache (~> 1.1.0) - omniauth (~> 2.0) - omniauth-facebook (~> 5.0) - omniauth-google-oauth2 (~> 1.0) - omniauth-rails_csrf_protection (~> 1.0) - omniauth-twitter (~> 1.4) - paper_trail (~> 12.0) - pg (~> 1.1.4, < 2) - pg_search (~> 2.2) - premailer-rails (~> 1.10) - rack (~> 2.2, >= 2.2.3) - rack-attack (~> 6.0) - rails (~> 6.1.0) - rails-i18n (~> 6.0) - ransack (~> 2.4.1) - redis (~> 4.1) - request_store (~> 1.5.0) - rubyXL (~> 3.4) - rubyzip (~> 2.0) - seven_zip_ruby (~> 1.3) - social-share-button (~> 1.2, >= 1.2.1) - valid_email2 (~> 2.1) - webpacker (= 6.0.0.rc.5) - webpush (~> 1.1) - wisper (~> 2.0) - decidim-debates (0.27.5) - decidim-comments (= 0.27.5) - decidim-core (= 0.27.5) - decidim-dev (0.27.5) - axe-core-rspec (~> 4.1.0) - byebug (~> 11.0) - capybara (~> 3.24) - db-query-matchers (~> 0.10.0) - decidim (= 0.27.5) - erb_lint (~> 0.0.35) - factory_bot_rails (~> 4.8) - i18n-tasks (~> 0.9.18) - mdl (~> 0.5) - nokogiri (~> 1.13) - parallel_tests (~> 3.7) - puma (~> 5.0) - rails-controller-testing (~> 1.0) - rspec-cells (~> 0.3.7) - rspec-html-matchers (~> 0.9.1) - rspec-rails (~> 4.0) - rspec-retry (~> 0.6.2) - rspec_junit_formatter (~> 0.3.0) - rubocop (~> 1.28.0) - rubocop-rails (~> 2.14) - rubocop-rspec (~> 2.10) - selenium-webdriver (~> 4.1.0) - simplecov (~> 0.21.0) - simplecov-cobertura (~> 2.1.0) - w3c_rspec_validators (~> 0.3.0) - webmock (~> 3.6) - wisper-rspec (~> 1.0) - decidim-forms (0.27.5) - decidim-core (= 0.27.5) - wicked_pdf (~> 2.1) - wkhtmltopdf-binary (~> 0.12) - decidim-generators (0.27.5) - decidim-core (= 0.27.5) - decidim-initiatives (0.27.5) - decidim-admin (= 0.27.5) - decidim-comments (= 0.27.5) - decidim-core (= 0.27.5) - decidim-verifications (= 0.27.5) - origami (~> 2.1) - rexml (~> 3.2.5) - wicked (~> 1.3) - wicked_pdf (~> 2.1) - wkhtmltopdf-binary (~> 0.12) - decidim-meetings (0.27.5) - decidim-core (= 0.27.5) - decidim-forms (= 0.27.5) - icalendar (~> 2.5) - decidim-pages (0.27.5) - decidim-core (= 0.27.5) - decidim-participatory_processes (0.27.5) - decidim-core (= 0.27.5) - decidim-proposals (0.27.5) - decidim-comments (= 0.27.5) - decidim-core (= 0.27.5) - doc2text (~> 0.4.5) - redcarpet (~> 3.5, >= 3.5.1) - decidim-sortitions (0.27.5) - decidim-admin (= 0.27.5) - decidim-comments (= 0.27.5) - decidim-core (= 0.27.5) - decidim-proposals (= 0.27.5) - decidim-surveys (0.27.5) - decidim-core (= 0.27.5) - decidim-forms (= 0.27.5) - decidim-templates (= 0.27.5) - decidim-system (0.27.5) - active_link_to (~> 1.0) - decidim-core (= 0.27.5) - devise (~> 4.7) - devise-i18n (~> 1.2) - devise_invitable (~> 2.0, >= 2.0.9) - decidim-templates (0.27.5) - decidim-core (= 0.27.5) - decidim-forms (= 0.27.5) - decidim-verifications (0.27.5) - decidim-core (= 0.27.5) - GIT remote: https://github.com/AjuntamentdeBarcelona/decidim-module-kids - revision: 072d60aa31091f07d02cbafa30c755cd49f09f23 - branch: main + revision: df16cf4de13c306348761d850d19815c8221874e specs: - decidim-kids (0.1.0) - decidim-core (>= 0.27, < 0.28) - decidim-system (>= 0.27, < 0.28) - decidim-verifications (>= 0.27, < 0.28) + decidim-kids (0.2.0) + decidim-core (>= 0.28, < 0.29) + decidim-system (>= 0.28, < 0.29) + decidim-verifications (>= 0.28, < 0.29) deface (>= 1.5) GIT remote: https://github.com/Platoniq/decidim-module-navigation_maps - revision: 52c7f017ea5e3b3e817b411a6bb445800c45dda7 - branch: main + revision: 7fd50e1368bae4c7955c0ba8ec5ee395273a5329 specs: - decidim-navigation_maps (1.4.0) - decidim-admin (>= 0.27, < 0.28) - decidim-core (>= 0.27, < 0.28) + decidim-navigation_maps (1.5.0) + decidim-admin (>= 0.28, < 0.29) + decidim-core (>= 0.28, < 0.29) GIT remote: https://github.com/decidim-ice/decidim-module-decidim_awesome - revision: 3b43ffd743e78a822b412ff57612e280dcc616d6 - branch: main + revision: 84374037d34a3ac80dc18406834169c65869f11b specs: - decidim-decidim_awesome (0.10.2) - decidim-admin (>= 0.26.0, < 0.28) - decidim-core (>= 0.26.0, < 0.28) + decidim-decidim_awesome (0.11.2) + decidim-admin (>= 0.28.0, < 0.29) + decidim-core (>= 0.28.0, < 0.29) deface (>= 1.5) sassc (~> 2.3) GIT remote: https://github.com/mainio/decidim-module-term_customizer - revision: 5a8d4c67972ef10cd52e774d64a3c7cff9bc9325 - branch: master + revision: 03e6c98e85a00fe47f8db2726f1a1a98e808efda specs: - decidim-term_customizer (0.27.0) - decidim-admin (~> 0.27.0) - decidim-core (~> 0.27.0) + decidim-term_customizer (0.28.0) + decidim-admin (~> 0.28.0) + decidim-core (~> 0.28.0) PATH remote: decidim-census_sms specs: - decidim-census_sms (0.0.2) - decidim-core + decidim-census_sms (0.0.3) + decidim-core (~> 0.28.0) PATH remote: decidim-dataviz specs: - decidim-dataviz (0.0.2) - decidim-core + decidim-dataviz (0.0.3) + decidim-core (~> 0.28.0) PATH remote: decidim-ephemeral_participation specs: - decidim-ephemeral_participation (0.0.3) - decidim-verifications + decidim-ephemeral_participation (0.0.4) + decidim-verifications (~> 0.28.0) PATH remote: decidim-stats specs: - decidim-stats (0.0.2) - decidim-comments - decidim-core - decidim-proposals + decidim-stats (0.0.3) + decidim-comments (~> 0.28.0) + decidim-core (~> 0.28.0) + decidim-proposals (~> 0.28.0) PATH remote: decidim-valid_auth specs: - decidim-valid_auth (0.0.2) - decidim-verifications + decidim-valid_auth (0.0.3) + decidim-verifications (~> 0.28.0) GEM remote: https://rubygems.org/ specs: - actioncable (6.1.7.4) - actionpack (= 6.1.7.4) - activesupport (= 6.1.7.4) + actioncable (6.1.7.8) + actionpack (= 6.1.7.8) + activesupport (= 6.1.7.8) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (6.1.7.4) - actionpack (= 6.1.7.4) - activejob (= 6.1.7.4) - activerecord (= 6.1.7.4) - activestorage (= 6.1.7.4) - activesupport (= 6.1.7.4) + actionmailbox (6.1.7.8) + actionpack (= 6.1.7.8) + activejob (= 6.1.7.8) + activerecord (= 6.1.7.8) + activestorage (= 6.1.7.8) + activesupport (= 6.1.7.8) mail (>= 2.7.1) - actionmailer (6.1.7.4) - actionpack (= 6.1.7.4) - actionview (= 6.1.7.4) - activejob (= 6.1.7.4) - activesupport (= 6.1.7.4) + actionmailer (6.1.7.8) + actionpack (= 6.1.7.8) + actionview (= 6.1.7.8) + activejob (= 6.1.7.8) + activesupport (= 6.1.7.8) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) - actionpack (6.1.7.4) - actionview (= 6.1.7.4) - activesupport (= 6.1.7.4) + actionpack (6.1.7.8) + actionview (= 6.1.7.8) + activesupport (= 6.1.7.8) rack (~> 2.0, >= 2.0.9) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (6.1.7.4) - actionpack (= 6.1.7.4) - activerecord (= 6.1.7.4) - activestorage (= 6.1.7.4) - activesupport (= 6.1.7.4) + actiontext (6.1.7.8) + actionpack (= 6.1.7.8) + activerecord (= 6.1.7.8) + activestorage (= 6.1.7.8) + activesupport (= 6.1.7.8) nokogiri (>= 1.8.5) - actionview (6.1.7.4) - activesupport (= 6.1.7.4) + actionview (6.1.7.8) + activesupport (= 6.1.7.8) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) @@ -297,78 +110,70 @@ GEM active_link_to (1.0.5) actionpack addressable - activejob (6.1.7.4) - activesupport (= 6.1.7.4) + activejob (6.1.7.8) + activesupport (= 6.1.7.8) globalid (>= 0.3.6) - activemodel (6.1.7.4) - activesupport (= 6.1.7.4) - activerecord (6.1.7.4) - activemodel (= 6.1.7.4) - activesupport (= 6.1.7.4) - activestorage (6.1.7.4) - actionpack (= 6.1.7.4) - activejob (= 6.1.7.4) - activerecord (= 6.1.7.4) - activesupport (= 6.1.7.4) + activemodel (6.1.7.8) + activesupport (= 6.1.7.8) + activerecord (6.1.7.8) + activemodel (= 6.1.7.8) + activesupport (= 6.1.7.8) + activestorage (6.1.7.8) + actionpack (= 6.1.7.8) + activejob (= 6.1.7.8) + activerecord (= 6.1.7.8) + activesupport (= 6.1.7.8) marcel (~> 1.0) mini_mime (>= 1.1.0) - activesupport (6.1.7.4) + activesupport (6.1.7.8) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) tzinfo (~> 2.0) zeitwerk (~> 2.3) - acts_as_list (0.9.19) - activerecord (>= 3.0) - addressable (2.8.4) + acts_as_list (1.1.0) + activerecord (>= 4.2) + addressable (2.8.6) public_suffix (>= 2.0.2, < 6.0) ast (2.4.2) - aws-eventstream (1.2.0) - aws-partitions (1.665.0) - aws-sdk-core (3.168.1) - aws-eventstream (~> 1, >= 1.0.2) + aws-eventstream (1.3.0) + aws-partitions (1.896.0) + aws-sdk-core (3.191.3) + aws-eventstream (~> 1, >= 1.3.0) aws-partitions (~> 1, >= 1.651.0) - aws-sigv4 (~> 1.5) + aws-sigv4 (~> 1.8) jmespath (~> 1, >= 1.6.1) - aws-sdk-kms (1.59.0) - aws-sdk-core (~> 3, >= 3.165.0) + aws-sdk-kms (1.77.0) + aws-sdk-core (~> 3, >= 3.191.0) aws-sigv4 (~> 1.1) - aws-sdk-s3 (1.117.1) - aws-sdk-core (~> 3, >= 3.165.0) + aws-sdk-s3 (1.143.0) + aws-sdk-core (~> 3, >= 3.191.0) aws-sdk-kms (~> 1) - aws-sigv4 (~> 1.4) - aws-sigv4 (1.5.2) + aws-sigv4 (~> 1.8) + aws-sigv4 (1.8.0) aws-eventstream (~> 1, >= 1.0.2) - axe-core-api (4.8.2) - dumb_delegator - virtus - axe-core-rspec (4.1.0) - axe-core-api - dumb_delegator - virtus - axiom-types (0.1.1) - descendants_tracker (~> 0.0.4) - ice_nine (~> 0.11.0) - thread_safe (~> 0.3, >= 0.3.1) barnes (0.0.9) multi_json (~> 1) statsd-ruby (~> 1.1) + base64 (0.2.0) batch-loader (1.5.0) - bcrypt (3.1.19) - better_html (1.0.16) - actionview (>= 4.0) - activesupport (>= 4.0) + bcrypt (3.1.20) + better_html (2.0.2) + actionview (>= 6.0) + activesupport (>= 6.0) ast (~> 2.0) erubi (~> 1.4) - html_tokenizer (~> 0.0.6) parser (>= 2.4) smart_properties bigdecimal (3.1.6) bindex (0.8.1) - bootsnap (1.14.0) + bootsnap (1.18.3) msgpack (~> 1.2) browser (2.7.1) builder (3.2.4) + bullet (7.1.6) + activesupport (>= 3.0.0) + uniform_notifier (~> 1.11) byebug (11.1.3) capybara (3.40.0) addressable @@ -399,44 +204,206 @@ GEM actionpack (>= 5.0) cells (>= 4.1.6, < 5.0.0) charlock_holmes (0.7.7) - chef-utils (18.4.2) + chef-utils (18.1.0) concurrent-ruby - childprocess (4.1.0) - codecov (0.6.0) - simplecov (>= 0.15, < 0.22) - coercible (1.0.0) - descendants_tracker (~> 0.0.1) - coffee-rails (5.0.0) - coffee-script (>= 2.2.0) - railties (>= 5.2.0) - coffee-script (2.4.1) - coffee-script-source - execjs - coffee-script-source (1.12.2) + cmdparse (3.0.7) + codecov (0.2.12) + json + simplecov colorize (0.8.1) commonmarker (0.23.10) - concurrent-ruby (1.2.2) + concurrent-ruby (1.2.3) connection_pool (2.4.1) crack (1.0.0) bigdecimal rexml crass (1.0.6) - css_parser (1.14.0) + css_parser (1.16.0) addressable - dalli (3.2.3) - database_cleaner (2.0.1) - database_cleaner-active_record (~> 2.0.0) - database_cleaner-active_record (2.0.1) + dalli (3.2.8) + database_cleaner (2.0.2) + database_cleaner-active_record (>= 2, < 3) + database_cleaner-active_record (2.1.0) activerecord (>= 5.a) database_cleaner-core (~> 2.0.0) database_cleaner-core (2.0.1) - date (3.3.3) + date (3.3.4) date_validator (0.12.0) activemodel (>= 3) activesupport (>= 3) - db-query-matchers (0.10.0) - activesupport (>= 4.0, < 7) - rspec (~> 3.0) + decidim (0.28.3) + decidim-accountability (= 0.28.3) + decidim-admin (= 0.28.3) + decidim-api (= 0.28.3) + decidim-assemblies (= 0.28.3) + decidim-blogs (= 0.28.3) + decidim-budgets (= 0.28.3) + decidim-comments (= 0.28.3) + decidim-core (= 0.28.3) + decidim-debates (= 0.28.3) + decidim-forms (= 0.28.3) + decidim-generators (= 0.28.3) + decidim-meetings (= 0.28.3) + decidim-pages (= 0.28.3) + decidim-participatory_processes (= 0.28.3) + decidim-proposals (= 0.28.3) + decidim-sortitions (= 0.28.3) + decidim-surveys (= 0.28.3) + decidim-system (= 0.28.3) + decidim-verifications (= 0.28.3) + decidim-accountability (0.28.3) + decidim-comments (= 0.28.3) + decidim-core (= 0.28.3) + decidim-admin (0.28.3) + active_link_to (~> 1.0) + decidim-core (= 0.28.3) + devise (~> 4.7) + devise-i18n (~> 1.2) + devise_invitable (~> 2.0, >= 2.0.9) + decidim-api (0.28.3) + commonmarker (~> 0.23.0, >= 0.23.9) + decidim-core (= 0.28.3) + graphql (~> 2.0.0) + graphql-docs (~> 3.0.1) + rack-cors (~> 1.0) + decidim-assemblies (0.28.3) + decidim-core (= 0.28.3) + decidim-blogs (0.28.3) + decidim-admin (= 0.28.3) + decidim-comments (= 0.28.3) + decidim-core (= 0.28.3) + decidim-budgets (0.28.3) + decidim-comments (= 0.28.3) + decidim-core (= 0.28.3) + decidim-comments (0.28.3) + decidim-core (= 0.28.3) + redcarpet (~> 3.5, >= 3.5.1) + decidim-core (0.28.3) + active_link_to (~> 1.0) + acts_as_list (~> 1.0) + batch-loader (~> 1.2) + browser (~> 2.7) + carrierwave (~> 2.2.5, >= 2.2.5) + cells-erb (~> 0.1.0) + cells-rails (~> 0.1.3) + charlock_holmes (~> 0.7) + date_validator (~> 0.12.0) + devise (~> 4.7) + devise-i18n (~> 1.2, < 1.11.1) + diffy (~> 3.3) + doorkeeper (~> 5.6, >= 5.6.6) + doorkeeper-i18n (~> 4.0) + file_validators (~> 3.0) + fog-local (~> 0.6) + foundation_rails_helper (~> 4.0) + geocoder (~> 1.8) + hashdiff (>= 0.4.0, < 2.0.0) + invisible_captcha (~> 0.12) + kaminari (~> 1.2, >= 1.2.1) + loofah (~> 2.19, >= 2.19.1) + mime-types (>= 1.16, < 4.0) + mini_magick (~> 4.9) + net-smtp (~> 0.3.1) + omniauth (~> 2.0) + omniauth-facebook (~> 5.0) + omniauth-google-oauth2 (~> 1.0) + omniauth-rails_csrf_protection (~> 1.0) + omniauth-twitter (~> 1.4) + paper_trail (~> 12.0) + pg (~> 1.4.0, < 2) + pg_search (~> 2.2) + premailer-rails (~> 1.10) + psych (~> 4.0) + rack (~> 2.2, >= 2.2.6.4) + rack-attack (~> 6.0) + rails (~> 6.1.7, >= 6.1.7.4) + rails-i18n (~> 6.0) + ransack (~> 3.2.1) + redis (~> 4.1) + request_store (~> 1.5.0) + rubyXL (~> 3.4) + rubyzip (~> 2.0) + shakapacker (~> 7.1.0) + valid_email2 (~> 4.0) + web-push (~> 3.0) + wisper (~> 2.0) + decidim-debates (0.28.3) + decidim-comments (= 0.28.3) + decidim-core (= 0.28.3) + decidim-dev (0.28.3) + bullet (~> 7.0) + byebug (~> 11.0) + capybara (~> 3.39) + decidim (= 0.28.3) + erb_lint (~> 0.4.0) + factory_bot_rails (~> 6.2) + faker (~> 3.2) + i18n-tasks (~> 1.0) + nokogiri (~> 1.14, >= 1.14.3) + parallel_tests (~> 4.2) + puma (~> 6.2, >= 6.3.1) + rails-controller-testing (~> 1.0) + rspec (~> 3.12) + rspec-cells (~> 0.3.7) + rspec-html-matchers (~> 0.10) + rspec-rails (~> 6.0) + rspec-retry (~> 0.6.2) + rspec_junit_formatter (~> 0.6.0) + rubocop (~> 1.50.0) + rubocop-faker (~> 1.1) + rubocop-rails (~> 2.19) + rubocop-rspec (~> 2.20) + selenium-webdriver (~> 4.9) + simplecov (~> 0.22.0) + simplecov-cobertura (~> 2.1.0) + spring (~> 2.0) + spring-watcher-listen (~> 2.0) + w3c_rspec_validators (~> 0.3.0) + webmock (~> 3.18) + wisper-rspec (~> 1.0) + decidim-forms (0.28.3) + decidim-core (= 0.28.3) + wicked_pdf (~> 2.1) + wkhtmltopdf-binary (~> 0.12) + decidim-generators (0.28.3) + decidim-core (= 0.28.3) + decidim-initiatives (0.28.3) + decidim-admin (= 0.28.3) + decidim-comments (= 0.28.3) + decidim-core (= 0.28.3) + decidim-verifications (= 0.28.3) + hexapdf (~> 0.32.0) + wicked_pdf (~> 2.1) + wkhtmltopdf-binary (~> 0.12) + decidim-meetings (0.28.3) + decidim-core (= 0.28.3) + decidim-forms (= 0.28.3) + icalendar (~> 2.5) + decidim-pages (0.28.3) + decidim-core (= 0.28.3) + decidim-participatory_processes (0.28.3) + decidim-core (= 0.28.3) + decidim-proposals (0.28.3) + decidim-comments (= 0.28.3) + decidim-core (= 0.28.3) + doc2text (~> 0.4.6) + redcarpet (~> 3.5, >= 3.5.1) + decidim-sortitions (0.28.3) + decidim-admin (= 0.28.3) + decidim-comments (= 0.28.3) + decidim-core (= 0.28.3) + decidim-proposals (= 0.28.3) + decidim-surveys (0.28.3) + decidim-core (= 0.28.3) + decidim-forms (= 0.28.3) + decidim-system (0.28.3) + active_link_to (~> 1.0) + decidim-core (= 0.28.3) + devise (~> 4.7) + devise-i18n (~> 1.2) + devise_invitable (~> 2.0, >= 2.0.9) + decidim-verifications (0.28.3) + decidim-core (= 0.28.3) declarative-builder (0.1.0) declarative-option (< 0.2.0) declarative-option (0.1.0) @@ -446,9 +413,7 @@ GEM polyglot railties (>= 5.2) rainbow (>= 2.1.0) - descendants_tracker (0.0.4) - thread_safe (~> 0.3, >= 0.3.1) - devise (4.9.2) + devise (4.9.4) bcrypt (~> 3.0) orm_adapter (~> 0.1) railties (>= 4.1.0) @@ -459,24 +424,22 @@ GEM devise_invitable (2.0.9) actionmailer (>= 5.0) devise (>= 4.6) - diff-lcs (1.5.0) + diff-lcs (1.5.1) diffy (3.4.2) - doc2text (0.4.6) - nokogiri (>= 1.13.2, < 1.15.0) + doc2text (0.4.7) + nokogiri (>= 1.13.2, < 1.17.0) rubyzip (~> 2.3.0) docile (1.4.0) - doorkeeper (5.6.6) + doorkeeper (5.6.9) railties (>= 5) doorkeeper-i18n (4.0.1) - dotenv (2.8.1) - dotenv-rails (2.8.1) - dotenv (= 2.8.1) - railties (>= 3.2) - dumb_delegator (1.0.0) - erb_lint (0.0.37) + dotenv (3.1.0) + dotenv-rails (3.1.0) + dotenv (= 3.1.0) + railties (>= 6.1) + erb_lint (0.4.0) activesupport - better_html (~> 1.0.7) - html_tokenizer + better_html (>= 2.0.1) parser (>= 2.7.1.4) rainbow rubocop @@ -484,43 +447,33 @@ GEM erbse (0.1.4) temple erubi (1.12.0) - escape_utils (1.3.0) - excon (0.100.0) - execjs (2.8.1) + escape_utils (1.2.2) + excon (0.109.0) extended-markdown-filter (0.7.0) html-pipeline (~> 2.9) - factory_bot (4.11.1) - activesupport (>= 3.0.0) - factory_bot_rails (4.11.1) - factory_bot (~> 4.11.1) - railties (>= 3.0.0) - faker (2.23.0) + factory_bot (6.4.6) + activesupport (>= 5.0.0) + factory_bot_rails (6.4.3) + factory_bot (~> 6.4) + railties (>= 5.0.0) + faker (3.2.3) i18n (>= 1.8.11, < 2) - faraday (2.7.10) - faraday-net_http (>= 2.0, < 3.1) - ruby2_keywords (>= 0.0.4) - faraday-net_http (3.0.2) - ffi (1.15.5) + faraday (2.9.0) + faraday-net_http (>= 2.0, < 3.2) + faraday-net_http (3.1.0) + net-http + ffi (1.16.3) file_validators (3.0.0) activemodel (>= 3.2) mime-types (>= 1.0) - fog-aws (3.15.0) - fog-core (~> 2.1) - fog-json (~> 1.1) - fog-xml (~> 0.1) - fog-core (2.3.0) + fog-core (2.4.0) builder excon (~> 0.71) formatador (>= 0.2, < 2.0) mime-types - fog-json (1.2.0) - fog-core - multi_json (~> 1.10) fog-local (0.8.0) fog-core (>= 1.27, < 3.0) - fog-xml (0.1.4) - fog-core - nokogiri (>= 1.5.11, < 2.0.0) + foreman (0.87.2) formatador (1.1.0) foundation_rails_helper (4.0.1) actionpack (>= 4.1, < 7.1) @@ -529,52 +482,57 @@ GEM railties (>= 4.1, < 7.1) gemoji (3.0.1) geocoder (1.8.2) + geom2d (0.4.1) get_process_mem (0.2.7) ffi (~> 1.0) - globalid (1.1.0) - activesupport (>= 5.0) - graphql (1.12.24) - graphql-docs (2.1.0) + globalid (1.2.1) + activesupport (>= 6.1) + graphql (2.0.29) + base64 + graphql-docs (3.0.1) commonmarker (~> 0.16) - escape_utils (~> 1.2) + escape_utils (~> 1.2.2) extended-markdown-filter (~> 0.4) gemoji (~> 3.0) - graphql (~> 1.12) + graphql (~> 2.0) html-pipeline (~> 2.9) sass (~> 3.4) - hashdiff (1.0.1) + hashdiff (1.1.0) hashie (5.0.0) + hexapdf (0.32.2) + cmdparse (~> 3.0, >= 3.0.3) + geom2d (~> 0.3) + openssl (>= 2.2.1) highline (3.0.1) - hkdf (0.3.0) html-pipeline (2.14.3) activesupport (>= 2) nokogiri (>= 1.4) - html_tokenizer (0.0.7) htmlentities (4.3.4) - i18n (1.14.1) + i18n (1.14.4) concurrent-ruby (~> 1.0) - i18n-tasks (0.9.37) + i18n-tasks (1.0.13) activesupport (>= 4.0.2) ast (>= 2.1.0) + better_html (>= 1.0, < 3.0) erubi highline (>= 2.0.0) i18n - parser (>= 2.2.3.0) + parser (>= 3.2.2.1) rails-i18n rainbow (>= 2.2.2, < 4.0) terminal-table (>= 1.5.1) icalendar (2.10.1) ice_cube (~> 0.16) ice_cube (0.16.4) - ice_nine (0.11.2) image_processing (1.12.2) mini_magick (>= 4.9.5, < 5) ruby-vips (>= 2.0.17, < 3) invisible_captcha (0.13.0) rails (>= 3.2.0) - jmespath (1.6.1) + jmespath (1.6.2) json (2.7.1) - jwt (2.7.1) + jwt (2.8.1) + base64 kaminari (1.2.2) activesupport (>= 4.1.0) kaminari-actionview (= 1.2.2) @@ -591,68 +549,71 @@ GEM rexml kramdown-parser-gfm (1.1.0) kramdown (~> 2.0) - launchy (2.5.0) - addressable (~> 2.7) - letter_opener (1.8.1) + launchy (2.5.2) + addressable (~> 2.8) + letter_opener (1.9.0) launchy (>= 2.2, < 3) letter_opener_web (2.0.0) actionmailer (>= 5.2) letter_opener (~> 1.7) railties (>= 5.2) rexml - listen (3.7.1) + listen (3.9.0) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) - lograge (0.12.0) + lograge (0.14.0) actionpack (>= 4) activesupport (>= 4) railties (>= 4) request_store (~> 1.0) - loofah (2.19.1) + loofah (2.22.0) crass (~> 1.0.2) - nokogiri (>= 1.5.9) + nokogiri (>= 1.12.0) mail (2.8.1) mini_mime (>= 0.1.1) net-imap net-pop net-smtp - marcel (1.0.2) + marcel (1.0.4) matrix (0.4.2) - mdl (0.13.0) + mdl (0.12.0) kramdown (~> 2.3) kramdown-parser-gfm (~> 1.1) mixlib-cli (~> 2.1, >= 2.1.1) mixlib-config (>= 2.2.1, < 4) mixlib-shellout method_source (1.0.0) - mime-types (3.4.1) + mime-types (3.5.2) mime-types-data (~> 3.2015) - mime-types-data (3.2023.0218.1) + mime-types-data (3.2024.0305) mini_magick (4.12.0) - mini_mime (1.1.2) - minitest (5.18.1) + mini_mime (1.1.5) + minitest (5.22.3) mixlib-cli (2.1.8) mixlib-config (3.0.27) tomlrb mixlib-shellout (3.2.7) chef-utils - msgpack (1.6.0) + msgpack (1.7.2) multi_json (1.15.0) multi_xml (0.6.0) - mustache (1.1.1) - net-imap (0.3.6) + net-http (0.4.1) + uri + net-imap (0.4.10) date net-protocol net-pop (0.1.2) net-protocol - net-protocol (0.2.1) + net-protocol (0.2.2) timeout - net-smtp (0.3.3) + net-smtp (0.3.4) net-protocol - nio4r (2.5.9) - nokogiri (1.14.5-arm64-darwin) + nio4r (2.7.0) + nokogiri (1.16.2-aarch64-linux) + racc (~> 1.4) + nokogiri (1.16.2-arm64-darwin) racc (~> 1.4) - nokogiri (1.14.5-x86_64-linux) + nokogiri (1.16.2-x86_64-linux) racc (~> 1.4) oauth (1.1.0) oauth-tty (~> 1.0, >= 1.0.1) @@ -667,7 +628,7 @@ GEM rack (>= 1.2, < 4) snaky_hash (~> 2.0) version_gem (~> 1.1) - omniauth (2.1.1) + omniauth (2.1.2) hashie (>= 3.4.6) rack (>= 2.2.3) rack-protection @@ -690,23 +651,25 @@ GEM omniauth-twitter (1.4.0) omniauth-oauth (~> 1.1) rack + openssl (3.2.0) origami (2.1.0) colorize (~> 0.7) orm_adapter (0.5.0) paper_trail (12.3.0) activerecord (>= 5.2) request_store (~> 1.1) - parallel (1.22.1) - parallel_tests (3.13.0) + parallel (1.24.0) + parallel_tests (4.5.2) parallel - parser (3.1.2.1) + parser (3.3.0.5) ast (~> 2.4.1) - pg (1.1.4) + racc + pg (1.4.6) pg_search (2.3.6) activerecord (>= 5.2) activesupport (>= 5.2) polyglot (0.3.5) - premailer (1.21.0) + premailer (1.23.0) addressable css_parser (>= 1.12.0) htmlentities (>= 4.0.0) @@ -714,53 +677,57 @@ GEM actionmailer (>= 3) net-smtp premailer (~> 1.7, >= 1.7.9) - progressbar (1.11.0) - public_suffix (5.0.3) - puma (5.6.5) + progressbar (1.13.0) + psych (4.0.6) + stringio + public_suffix (5.0.4) + puma (6.4.2) nio4r (~> 2.0) puma_worker_killer (0.3.1) get_process_mem (~> 0.2) puma (>= 2.7) - racc (1.7.1) - rack (2.2.8) + racc (1.7.3) + rack (2.2.8.1) rack-attack (6.7.0) rack (>= 1.0, < 4) rack-cors (1.1.1) rack (>= 2.0.0) - rack-protection (3.0.6) - rack - rack-proxy (0.7.6) + rack-protection (3.2.0) + base64 (>= 0.1.0) + rack (~> 2.2, >= 2.2.4) + rack-proxy (0.7.7) rack rack-ssl-enforcer (0.2.9) rack-test (2.1.0) rack (>= 1.3) rack-timeout (0.6.3) rack_password (1.3) - rails (6.1.7.4) - actioncable (= 6.1.7.4) - actionmailbox (= 6.1.7.4) - actionmailer (= 6.1.7.4) - actionpack (= 6.1.7.4) - actiontext (= 6.1.7.4) - actionview (= 6.1.7.4) - activejob (= 6.1.7.4) - activemodel (= 6.1.7.4) - activerecord (= 6.1.7.4) - activestorage (= 6.1.7.4) - activesupport (= 6.1.7.4) + rails (6.1.7.8) + actioncable (= 6.1.7.8) + actionmailbox (= 6.1.7.8) + actionmailer (= 6.1.7.8) + actionpack (= 6.1.7.8) + actiontext (= 6.1.7.8) + actionview (= 6.1.7.8) + activejob (= 6.1.7.8) + activemodel (= 6.1.7.8) + activerecord (= 6.1.7.8) + activestorage (= 6.1.7.8) + activesupport (= 6.1.7.8) bundler (>= 1.15.0) - railties (= 6.1.7.4) + railties (= 6.1.7.8) sprockets-rails (>= 2.0.0) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) actionview (>= 5.0.1.rc1) activesupport (>= 5.0.1.rc1) - rails-dom-testing (2.1.1) + rails-dom-testing (2.2.0) activesupport (>= 5.0.0) minitest nokogiri (>= 1.6) - rails-html-sanitizer (1.5.0) - loofah (~> 2.19, >= 2.19.1) + rails-html-sanitizer (1.6.0) + loofah (~> 2.21) + nokogiri (~> 1.14) rails-i18n (6.0.0) i18n (>= 0.7, < 2) railties (>= 6.0.0, < 7) @@ -770,87 +737,94 @@ GEM rails_autoscale_agent (0.12.0) rails_serve_static_assets (0.0.5) rails_stdout_logging (0.0.5) - railties (6.1.7.4) - actionpack (= 6.1.7.4) - activesupport (= 6.1.7.4) + railties (6.1.7.8) + actionpack (= 6.1.7.8) + activesupport (= 6.1.7.8) method_source rake (>= 12.2) thor (~> 1.0) rainbow (3.1.1) - rake (13.0.6) - ransack (2.4.2) - activerecord (>= 5.2.4) - activesupport (>= 5.2.4) + rake (13.1.0) + ransack (3.2.1) + activerecord (>= 6.1.5) + activesupport (>= 6.1.5) i18n rb-fsevent (0.11.2) rb-inotify (0.10.1) ffi (~> 1.0) redcarpet (3.6.0) redis (4.8.1) - redis-client (0.17.0) + redis-client (0.21.0) connection_pool - regexp_parser (2.6.1) + regexp_parser (2.9.0) request_store (1.5.1) rack (>= 1.4) - responders (3.1.0) + responders (3.1.1) actionpack (>= 5.2) railties (>= 5.2) - rexml (3.2.5) - rspec (3.12.0) - rspec-core (~> 3.12.0) - rspec-expectations (~> 3.12.0) - rspec-mocks (~> 3.12.0) + rexml (3.2.6) + rspec (3.13.0) + rspec-core (~> 3.13.0) + rspec-expectations (~> 3.13.0) + rspec-mocks (~> 3.13.0) rspec-cells (0.3.9) cells (>= 4.0.0, < 6.0.0) rspec-rails (>= 3.0.0, < 6.2.0) - rspec-core (3.12.0) - rspec-support (~> 3.12.0) - rspec-expectations (3.12.0) + rspec-core (3.13.0) + rspec-support (~> 3.13.0) + rspec-expectations (3.13.0) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.12.0) - rspec-html-matchers (0.9.4) + rspec-support (~> 3.13.0) + rspec-html-matchers (0.10.0) nokogiri (~> 1) - rspec (>= 3.0.0.a, < 4) - rspec-mocks (3.12.0) + rspec (>= 3.0.0.a) + rspec-mocks (3.13.0) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.12.0) - rspec-rails (4.1.2) - actionpack (>= 4.2) - activesupport (>= 4.2) - railties (>= 4.2) - rspec-core (~> 3.10) - rspec-expectations (~> 3.10) - rspec-mocks (~> 3.10) - rspec-support (~> 3.10) + rspec-support (~> 3.13.0) + rspec-rails (6.1.1) + actionpack (>= 6.1) + activesupport (>= 6.1) + railties (>= 6.1) + rspec-core (~> 3.12) + rspec-expectations (~> 3.12) + rspec-mocks (~> 3.12) + rspec-support (~> 3.12) rspec-retry (0.6.2) rspec-core (> 3.3) - rspec-support (3.12.0) - rspec_junit_formatter (0.3.0) + rspec-support (3.13.1) + rspec_junit_formatter (0.6.0) rspec-core (>= 2, < 4, != 2.12.0) - rubocop (1.28.2) + rubocop (1.50.2) + json (~> 2.3) parallel (~> 1.10) - parser (>= 3.1.0.0) + parser (>= 3.2.0.0) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) - rexml - rubocop-ast (>= 1.17.0, < 2.0) + rexml (>= 3.2.5, < 4.0) + rubocop-ast (>= 1.28.0, < 2.0) ruby-progressbar (~> 1.7) - unicode-display_width (>= 1.4.0, < 3.0) - rubocop-ast (1.23.0) - parser (>= 3.1.1.0) + unicode-display_width (>= 2.4.0, < 3.0) + rubocop-ast (1.31.2) + parser (>= 3.3.0.4) + rubocop-capybara (2.20.0) + rubocop (~> 1.41) + rubocop-factory_bot (2.25.1) + rubocop (~> 1.41) rubocop-faker (1.1.0) faker (>= 2.12.0) rubocop (>= 0.82.0) - rubocop-rails (2.15.2) + rubocop-rails (2.24.0) activesupport (>= 4.2.0) rack (>= 1.1) - rubocop (>= 1.7.0, < 2.0) - rubocop-rspec (2.11.1) - rubocop (~> 1.19) - ruby-progressbar (1.11.0) - ruby-vips (2.1.4) + rubocop (>= 1.33.0, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) + rubocop-rspec (2.27.1) + rubocop (~> 1.40) + rubocop-capybara (~> 2.17) + rubocop-factory_bot (~> 2.22) + ruby-progressbar (1.13.0) + ruby-vips (2.2.1) ffi (~> 1.12) - ruby2_keywords (0.0.5) rubyXL (3.4.25) nokogiri (>= 1.10.8) rubyzip (>= 1.3.0) @@ -862,12 +836,13 @@ GEM rb-inotify (~> 0.9, >= 0.9.7) sassc (2.4.0) ffi (~> 1.9) - scout_apm (5.3.2) + scout_apm (5.3.7) parser - selenium-webdriver (4.1.0) - childprocess (>= 0.5, < 5.0) + selenium-webdriver (4.18.1) + base64 (~> 0.2) rexml (~> 3.2, >= 3.2.5) - rubyzip (>= 1.2.2) + rubyzip (>= 1.2.2, < 3.0) + websocket (~> 1.0) semantic_range (3.0.0) sentry-rails (5.16.1) railties (>= 5.0) @@ -877,13 +852,17 @@ GEM sentry-sidekiq (5.16.1) sentry-ruby (~> 5.16.1) sidekiq (>= 3.0) - seven_zip_ruby (1.3.0) - sidekiq (7.1.3) + shakapacker (7.1.0) + activesupport (>= 5.2) + rack-proxy (>= 0.6.1) + railties (>= 5.2) + semantic_range (>= 2.3.0) + sidekiq (7.2.2) concurrent-ruby (< 2) connection_pool (>= 2.3.0) rack (>= 2.2.4) - redis-client (>= 0.14.0) - simplecov (0.21.2) + redis-client (>= 0.19.0) + simplecov (0.22.0) docile (~> 1.1) simplecov-html (~> 0.11) simplecov_json_formatter (~> 0.1) @@ -896,46 +875,38 @@ GEM snaky_hash (2.0.1) hashie version_gem (~> 1.1, >= 1.1.1) - social-share-button (1.2.4) - coffee-rails - spring (4.1.0) - spring-commands-rspec (1.0.4) - spring (>= 0.9.1) - spring-watcher-listen (2.1.0) + spring (2.1.1) + spring-watcher-listen (2.0.1) listen (>= 2.7, < 4.0) - spring (>= 4) - sprockets (4.2.0) + spring (>= 1.2, < 3.0) + sprockets (4.2.1) concurrent-ruby (~> 1.0) rack (>= 2.2.4, < 4) sprockets-rails (3.4.2) actionpack (>= 5.2) activesupport (>= 5.2) sprockets (>= 3.0.0) - ssrf_filter (1.1.1) - stackprof (0.2.25) + ssrf_filter (1.1.2) + stackprof (0.2.26) statsd-ruby (1.5.0) - temple (0.10.2) + stringio (3.1.0) + temple (0.10.3) terminal-table (3.0.2) unicode-display_width (>= 1.1.1, < 3) - thor (1.2.2) - thread_safe (0.3.6) - tilt (2.2.0) - timeout (0.4.0) + thor (1.3.1) + tilt (2.3.0) + timeout (0.4.1) tomlrb (2.0.3) tzinfo (2.0.6) concurrent-ruby (~> 1.0) uber (0.1.0) - uglifier (4.2.0) - execjs (>= 0.3.0, < 3) - unicode-display_width (1.8.0) - valid_email2 (2.3.1) + unicode-display_width (2.5.0) + uniform_notifier (1.16.0) + uri (0.13.0) + valid_email2 (4.0.6) activemodel (>= 3.2) mail (~> 2.5) version_gem (1.1.3) - virtus (2.0.0) - axiom-types (~> 0.1) - coercible (~> 1.0) - descendants_tracker (~> 0.0, >= 0.0.3) w3c_rspec_validators (0.3.0) rails rspec @@ -946,39 +917,35 @@ GEM rexml (~> 3.2) warden (1.2.9) rack (>= 2.0.9) - web-console (4.2.0) + web-console (4.2.1) actionview (>= 6.0.0) activemodel (>= 6.0.0) bindex (>= 0.4.0) railties (>= 6.0.0) + web-push (3.0.1) + jwt (~> 2.0) + openssl (~> 3.0) webmock (3.23.0) addressable (>= 2.8.0) crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) - webpacker (6.0.0.rc.5) - activesupport (>= 5.2) - rack-proxy (>= 0.6.1) - railties (>= 5.2) - semantic_range (>= 2.3.0) - webpush (1.1.0) - hkdf (~> 0.2) - jwt (~> 2.0) + websocket (1.2.10) websocket-driver (0.7.6) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) - wicked (1.4.0) - railties (>= 3.0.7) - wicked_pdf (2.6.3) + wicked_pdf (2.7.0) activesupport wisper (2.0.1) wisper-rspec (1.1.0) wkhtmltopdf-binary (0.12.6.6) xpath (3.2.0) nokogiri (~> 1.8) - zeitwerk (2.6.9) + zeitwerk (2.6.13) PLATFORMS + aarch64-linux arm64-darwin-21 + arm64-darwin-23 x86_64-linux DEPENDENCIES @@ -989,26 +956,27 @@ DEPENDENCIES codecov dalli database_cleaner - decidim! + decidim (= 0.28.3) decidim-census_sms! decidim-dataviz! decidim-decidim_awesome! - decidim-dev! + decidim-dev (= 0.28.3) decidim-ephemeral_participation! - decidim-initiatives! + decidim-initiatives (= 0.28.3) decidim-kids! decidim-navigation_maps! - decidim-sortitions! + decidim-sortitions (= 0.28.3) decidim-stats! decidim-term_customizer! decidim-valid_auth! - deface dotenv-rails - faker (~> 2.14) - fog-aws + faker + foreman letter_opener_web listen lograge + matrix + mdl origami progressbar puma @@ -1018,6 +986,7 @@ DEPENDENCIES rack_password rails_12factor rails_autoscale_agent + rexml rspec rubocop rubocop-faker @@ -1026,17 +995,13 @@ DEPENDENCIES sentry-ruby sentry-sidekiq sidekiq - spring - spring-commands-rspec - spring-watcher-listen stackprof - uglifier web-console - wicked_pdf + wicked_pdf (< 2.8) wkhtmltopdf-binary RUBY VERSION - ruby 3.0.2p107 + ruby 3.1.1p18 BUNDLED WITH - 2.3.26 + 2.4.14 diff --git a/Procfile.dev b/Procfile.dev new file mode 100644 index 0000000000..01fcc9f183 --- /dev/null +++ b/Procfile.dev @@ -0,0 +1,2 @@ +web: bin/rails server -b 0.0.0.0 -p 3000 +shakapacker: bin/shakapacker-dev-server diff --git a/README.md b/README.md index e8bed88980..e0f0df906a 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,10 @@ Citizen Participation and Open Government Application. [![[CI] Lint](https://github.com/AjuntamentdeBarcelona/decidim-barcelona/actions/workflows/lint.yml/badge.svg)](https://github.com/AjuntamentdeBarcelona/decidim-barcelona/actions/workflows/lint.yml) [![[CI] Test](https://github.com/AjuntamentdeBarcelona/decidim-barcelona/actions/workflows/test.yml/badge.svg)](https://github.com/AjuntamentdeBarcelona/decidim-barcelona/actions/workflows/test.yml) +[![[CI] Test Census SMS](https://github.com/AjuntamentdeBarcelona/decidim-barcelona/actions/workflows/test_census_sms.yml/badge.svg)](https://github.com/AjuntamentdeBarcelona/decidim-barcelona/actions/workflows/test_census_sms.yml) +[![[CI] Test Ephemeral Participation](https://github.com/AjuntamentdeBarcelona/decidim-barcelona/actions/workflows/test_ephemeral_participation.yml/badge.svg)](https://github.com/AjuntamentdeBarcelona/decidim-barcelona/actions/workflows/test_ephemeral_participation.yml) +[![[CI] Test Stats](https://github.com/AjuntamentdeBarcelona/decidim-barcelona/actions/workflows/test_stats.yml/badge.svg)](https://github.com/AjuntamentdeBarcelona/decidim-barcelona/actions/workflows/test_stats.yml) +[![[CI] Test Valid Auth](https://github.com/AjuntamentdeBarcelona/decidim-barcelona/actions/workflows/test_valid_auth.yml/badge.svg)](https://github.com/AjuntamentdeBarcelona/decidim-barcelona/actions/workflows/test_valid_auth.yml) [![Code Climate](https://codeclimate.com/github/AjuntamentdeBarcelona/decidim-barcelona/badges/gpa.svg)](https://codeclimate.com/github/AjuntamentdeBarcelona/decidim-barcelona) This is the opensource code repository for "decidim-barcelona", based on [Decidim](https://github.com/AjuntamentdeBarcelona/decidim). diff --git a/Rakefile b/Rakefile index db2ebc6e47..bf012913fa 100644 --- a/Rakefile +++ b/Rakefile @@ -68,7 +68,7 @@ namespace :decidim_surveys_patch do puts "Migrating question #{survey_question.id}..." question = Decidim::Forms::Question.create!( - questionnaire: questionnaire, + questionnaire:, position: survey_question.position, question_type: survey_question.question_type, mandatory: survey_question.mandatory, @@ -84,7 +84,7 @@ namespace :decidim_surveys_patch do AnswerOption.where(decidim_survey_question_id: survey_question.id).find_each do |survey_answer_option| answer_option_mapping[survey_answer_option.id] = Decidim::Forms::AnswerOption.create!( - question: question, + question:, body: survey_answer_option.body, free_text: survey_answer_option.free_text ) @@ -92,8 +92,8 @@ namespace :decidim_surveys_patch do Answer.where(decidim_survey_id: survey.id, decidim_survey_question_id: survey_question.id).find_each do |survey_answer| answer = Decidim::Forms::Answer.new( - questionnaire: questionnaire, - question: question, + questionnaire:, + question:, decidim_user_id: survey_answer.decidim_user_id, body: survey_answer.body, created_at: survey_answer.created_at, diff --git a/app.json b/app.json deleted file mode 100644 index 32a957ed0f..0000000000 --- a/app.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "name": "decidim-barcelona", - "description": "TODO: Add a short description about decidim-barcelona", - "keywords": [], - "addons": [ - "heroku-postgresql:hobby-dev", - "heroku-redis:hobby-dev", - "sendgrid:starter" - ], - "stack": "heroku-18", - "scripts": { - "postdeploy":"DISABLE_DATABASE_ENVIRONMENT_CHECK=1 bundle exec rake db:schema:load db:migrate db:seed" - }, - "env": { - "SECRET_KEY_BASE": { - "description": "A secret used by Rails to identify sessions", - "generator": "secret" - }, - "CENSUS_URL": { - "required": true - }, - "AWS_ACCESS_KEY_ID": { - "required": true - }, - "AWS_SECRET_ACCESS_KEY": { - "required": true - }, - "ANALYTICS": { - "required": true - }, - "HERE_API_KEY": { - "required": true - }, - "HEROKU_APP_NAME": { - "required": true - } - } -} diff --git a/app/cells/concerns/decidim/accountability/status_cell_override.rb b/app/cells/concerns/decidim/accountability/status_cell_override.rb new file mode 100644 index 0000000000..f1bc7b4f07 --- /dev/null +++ b/app/cells/concerns/decidim/accountability/status_cell_override.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Decidim + module Accountability + module StatusCellOverride + extend ActiveSupport::Concern + + included do + include Decidim::Accountability::ApplicationHelper + include Decidim::Accountability::BreadcrumbHelper + + def scope + current_scope.presence if defined?(current_scope) + end + end + end + end +end diff --git a/app/cells/concerns/decidim/initiatives/initiative_metadata_g_cell_override.rb b/app/cells/concerns/decidim/initiatives/initiative_metadata_g_cell_override.rb new file mode 100644 index 0000000000..fdb428a0a1 --- /dev/null +++ b/app/cells/concerns/decidim/initiatives/initiative_metadata_g_cell_override.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +module Decidim + module Initiatives + module InitiativeMetadataGCellOverride + extend ActiveSupport::Concern + + included do + def progress_bar_item + return if %w(created validating discarded).include?(initiative.state) + + type_scope = initiative.votable_initiative_type_scopes[0] + + { + cell: "decidim/progress_bar", + args: [initiative.supports_count_for(type_scope.scope), { + total: initiative.supports_required_for(type_scope.scope), + element_id: "initiative-#{initiative.id}-votes-count", + class: "progress-bar__sm" + }], + icon: nil + } + end + end + end + end +end diff --git a/app/cells/concerns/decidim/user_profile_cell_override.rb b/app/cells/concerns/decidim/user_profile_cell_override.rb index b33b2cbf07..c32f9a8493 100644 --- a/app/cells/concerns/decidim/user_profile_cell_override.rb +++ b/app/cells/concerns/decidim/user_profile_cell_override.rb @@ -8,7 +8,7 @@ module UserProfileCellOverride def resource_path return "#" if user.nickname.blank? - decidim.profile_path(user.nickname) + user.try(:profile_url) || decidim.profile_path(user.nickname) end end end diff --git a/app/cells/decidim/accountability/result_l/extra_data.erb b/app/cells/decidim/accountability/result_l/extra_data.erb new file mode 100644 index 0000000000..bdd9e082dc --- /dev/null +++ b/app/cells/decidim/accountability/result_l/extra_data.erb @@ -0,0 +1,3 @@ +<% if component_settings.try(:display_progress_enabled?) && result.progress.present? && !Decidim::Accountability::Result.not_computable_results.include?(result.id) %> +
<%= display_percentage result.progress %>
+<% end %> diff --git a/app/cells/decidim/accountability/status/status.erb b/app/cells/decidim/accountability/status/status.erb new file mode 100644 index 0000000000..1f871a5812 --- /dev/null +++ b/app/cells/decidim/accountability/status/status.erb @@ -0,0 +1,20 @@ +<% if options[:show_category_image] %> + <%= image_pack_tag("media/images/category-#{model.id}.jpg") %> +<% end %> + +

<%= title %>

+ +<% if component_settings.display_progress_enabled? && progress.present? %> +
" aria-valuenow="<%= number_with_precision(progress, separator: ".", precision: 1) %>" aria-valuemin="0" aria-valuemax="100" aria-valuetext="<%= number_to_percentage(progress, precision: 1) %>"> +
+
+<% end %> + +
+ <% if progress.present? %> + <%= display_percentage progress %> + <% end %> + <% if count %> + <%= count %> + <% end %> +
diff --git a/app/cells/decidim/budgets/project_list_item/project_data.erb b/app/cells/decidim/budgets/project_list_item/project_data.erb deleted file mode 100644 index 9948bc4e2f..0000000000 --- a/app/cells/decidim/budgets/project_list_item/project_data.erb +++ /dev/null @@ -1,23 +0,0 @@ -
- <% if voting_finished? %> -
-
- <%= t("decidim.budgets.projects.show.budget") %> - <%= budget_to_currency model.budget_amount %> -
- - <%= cell("decidim/budgets/project_votes_count", model) %> - <%= cell("decidim/budgets/project_voted_hint", model, class: "display-block margin-top-1") %> -
- <% else %> - - <%= budget_to_currency(model.budget_amount) %> - - <%= cell("decidim/budgets/project_votes_count", model, layout: :one_line, class: "display-inline-block") %> - - <%= cell("decidim/budgets/project_voted_hint", model, class: "display-block margin-top-1") if current_order_checked_out? && resource_added? %> - - - <%= cell("decidim/budgets/project_vote_button", model) if !current_order_checked_out? && voting_open? %> - <% end %> -
diff --git a/app/cells/decidim/budgets/project_list_item/project_text.erb b/app/cells/decidim/budgets/project_list_item/project_text.erb deleted file mode 100644 index 662c95e5a2..0000000000 --- a/app/cells/decidim/budgets/project_list_item/project_text.erb +++ /dev/null @@ -1,22 +0,0 @@ -
-
- <%= link_to resource_path, class: "card__link" do %> -
- <%= cell("decidim/budgets/project_selected_status", model) %> - - <%= resource_title %> -
- <% end %> - -
- <%= cell "decidim/budgets/project_tags", model, context: { extra_classes: ["tags--project"] } %> -
- -
- <%= cell("decidim/budgets/project_votes_count", model, layout: :one_line) %> - <%= budget_to_currency(model.budget_amount) %> - - <%= cell("decidim/budgets/project_voted_hint", model, class: "margin-left-1") if current_order_checked_out? && resource_added? %> -
-
-
diff --git a/app/cells/decidim/initiatives/initiative_m/footer.erb b/app/cells/decidim/initiatives/initiative_m/footer.erb deleted file mode 100644 index 7edc001085..0000000000 --- a/app/cells/decidim/initiatives/initiative_m/footer.erb +++ /dev/null @@ -1,28 +0,0 @@ - diff --git a/app/cells/decidim/meetings/join_meeting_button/show.erb b/app/cells/decidim/meetings/join_meeting_button/show.erb index b2a0f00efd..80ef1e302e 100644 --- a/app/cells/decidim/meetings/join_meeting_button/show.erb +++ b/app/cells/decidim/meetings/join_meeting_button/show.erb @@ -9,19 +9,19 @@ disabled: !model.has_available_slots?, ) %> <% else %> - <%= render :registration_confirm %> + <%= render :registration_modal %> <%= action_authorized_button_to( :join, i18n_join_text, "#", class: button_classes, disabled: !model.has_available_slots?, - data: { open: current_user.present? ? "meeting-registration-confirm-#{model.id}" : "loginModal" } + data: { "dialog-open": current_user.present? ? "meeting-registration-confirm-#{model.id}" : "loginModal" } ) %> <% end %> <% end %> <% if shows_remaining_slots? %> - <%= t("remaining_slots", scope: "decidim.meetings.meetings.show", count: model.remaining_slots) %> + <%= render :remaining_slots %> <% end %> <% elsif model.on_different_platform? %> <%= link_to( diff --git a/app/cells/decidim/meetings/online_meeting_link/show.erb b/app/cells/decidim/meetings/online_meeting_link/show.erb index cf689fc4e7..0bdc526da5 100644 --- a/app/cells/decidim/meetings/online_meeting_link/show.erb +++ b/app/cells/decidim/meetings/online_meeting_link/show.erb @@ -1,44 +1,21 @@ -<% if online_meeting_url? %> - <% if live? || future? %> -
-
- <% if live? %> -
- <%= icon "audio", class: "heading4" %> -
-
- <%= t("live_event", scope: "decidim.meetings.meetings.show") %> - <% unless show_embed? %> -

<%= t("micro_camera_permissions_warning", scope: "decidim.meetings.meetings.show") %>

- <% end %> -
- <% end %> +
+ <%= icon "broadcast-line", class: "w-14 h-14 fill-current #{live? && online_meeting_url? ? "text-tertiary" : "text-gray"}" %> - <% if show_embed? && live? %> -
absolutes aspect-ratio-16-9" style="<%= "height: 1100px" if bcn_iframe? %>"> - <%== embed_code(request.host) %> -
- <% elsif live? || future? %> -
- <% if live? %> - <%= link_to t("join", scope: "decidim.meetings.meetings.show"), live_event_url, target: "_blank", class: "button button--sc" %> - <% elsif future? %> - <%= t("link_closed", scope: "decidim.meetings.meetings.show") %> - <% end %> -
- <% end %> + <% if !online_meeting_url? %> +

<%= t("link_available_soon", scope: "decidim.meetings.meetings.show") %>

+ <% elsif future? %> +

<%= t("link_closed", scope: "decidim.meetings.meetings.show") %>

+ <% elsif live? %> +

<%= t("live_event", scope: "decidim.meetings.meetings.show") %>

+ + <% if show_embed? %> + -
+ <% else %> +

<%= t("micro_camera_permissions_warning", scope: "decidim.meetings.meetings.show") %>

+ <% end %> + + <%= link_to t("join_meeting", scope: "decidim.meetings.meetings.meeting"), live_event_url, target: "_blank", class: "button button__xl button__secondary", data: { external_link: "text-only", external_domain_link: false } %> <% end %> -<% else %> -
-
-
- <%= icon "timer", role: "img", "aria-hidden": true, remove_icon_class: true, width: 40, height: 70 %> -
- <%= t("link_available_soon", scope: "decidim.meetings.meetings.show") %> -
-
-
-
-<% end %> +
diff --git a/app/controllers/concerns/decidim/admin/conflicts_controller_override.rb b/app/controllers/concerns/decidim/admin/conflicts_controller_override.rb deleted file mode 100644 index 9987eb30c3..0000000000 --- a/app/controllers/concerns/decidim/admin/conflicts_controller_override.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -module Decidim - module Admin - module ConflictsControllerOverride - extend ActiveSupport::Concern - - included do - def index - enforce_permission_to :index, :impersonatable_user - - @conflicts = Decidim::Verifications::Conflict.joins(:current_user).where( - decidim_users: { decidim_organization_id: current_organization.id, deleted_at: nil } - ) - end - end - end - end -end diff --git a/app/controllers/concerns/decidim/assemblies/assemblies_controller_override.rb b/app/controllers/concerns/decidim/assemblies/assemblies_controller_override.rb new file mode 100644 index 0000000000..cee4182e69 --- /dev/null +++ b/app/controllers/concerns/decidim/assemblies/assemblies_controller_override.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module Decidim + module Assemblies + module AssembliesControllerOverride + extend ActiveSupport::Concern + + included do + def per_page + if Decidim::Paginable::OPTIONS.include?(params[:per_page]) + params[:per_page].to_i + elsif params[:per_page] + sorted = Decidim::Paginable::OPTIONS.sort + params[:per_page].to_i.clamp(sorted.first, sorted.last) + else + 25 + end + end + end + end + end +end diff --git a/app/controllers/decidim/accountability/admin/import_results_controller.rb b/app/controllers/decidim/accountability/admin/import_results_controller.rb index 1a566d232b..3675ee5431 100644 --- a/app/controllers/decidim/accountability/admin/import_results_controller.rb +++ b/app/controllers/decidim/accountability/admin/import_results_controller.rb @@ -13,7 +13,7 @@ def create @csv_file = params[:csv_file] redirect_to(new_import_path) && return if @csv_file.blank? - Decidim::Accountability::Admin::ImportResultsCSVJob.perform_later(current_user, current_component, @csv_file.read.force_encoding("utf-8").encode("utf-8")) + Decidim::Accountability::Admin::ImportResultsCsvJob.perform_later(current_user, current_component, @csv_file.read.force_encoding("utf-8").encode("utf-8")) flash[:notice] = I18n.t("imports.create.success", scope: "decidim.accountability.admin") redirect_to Rails.application.routes.url_helpers.import_results_path(current_participatory_process, current_component) diff --git a/app/controllers/export_results_controller.rb b/app/controllers/export_results_controller.rb index 2a43f3619e..3ccfdf934d 100644 --- a/app/controllers/export_results_controller.rb +++ b/app/controllers/export_results_controller.rb @@ -2,7 +2,7 @@ class ExportResultsController < ApplicationController def csv - send_data Decidim::Accountability::ResultsCSVExporter.new(current_component).export, filename: "results.csv", disposition: "attachment" + send_data Decidim::Accountability::ResultsCsvExporter.new(current_component).export, filename: "results.csv", disposition: "attachment" end private diff --git a/app/controllers/static_controller.rb b/app/controllers/static_controller.rb index 3eae5998f0..b4fb1efbed 100644 --- a/app/controllers/static_controller.rb +++ b/app/controllers/static_controller.rb @@ -1,7 +1,29 @@ # frozen_string_literal: true class StaticController < Decidim::ApplicationController + helper_method :current_section, :sections + before_action :check_section, only: :accountability_sections + def accountability; end def accountability_sections; end + + private + + def check_section + raise ActiveRecord::RecordNotFound unless sections.has_key?(current_section.to_sym) + end + + def current_section + @current_section ||= params[:section] + end + + def sections + @sections ||= { + planificacio: 3, + economia: 4, + serveis: 1, + etica: 4 + } + end end diff --git a/app/helpers/concerns/decidim/paginate_helper_override.rb b/app/helpers/concerns/decidim/paginate_helper_override.rb new file mode 100644 index 0000000000..441ded557d --- /dev/null +++ b/app/helpers/concerns/decidim/paginate_helper_override.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +module Decidim + module PaginateHelperOverride + extend ActiveSupport::Concern + + included do + # Include a condition to force hiding the results per page using a parameter in the paginate_params + def decidim_paginate(collection, paginate_params = {}) + return if collection.total_pages <= 1 + + per_page = (params[:per_page] || paginate_params[:per_page] || Decidim::Paginable::OPTIONS.first).to_i + + content_tag :div, class: "flex flex-col-reverse md:flex-row items-center justify-between gap-1 py-8 md:py-16", data: { pagination: "" } do + template = "" + if collection.total_pages.positive? && !paginate_params.delete(:hide_results_per_page_selector) + template += render partial: "decidim/shared/results_per_page", locals: { per_page: }, formats: [:html] + end + template += paginate collection, window: 2, outer_window: 1, theme: "decidim", params: paginate_params + template.html_safe + end + end + end + end +end diff --git a/app/jobs/decidim/accountability/admin/import_results_csv_job.rb b/app/jobs/decidim/accountability/admin/import_results_csv_job.rb index 58b9d38426..bffe3b7d0e 100644 --- a/app/jobs/decidim/accountability/admin/import_results_csv_job.rb +++ b/app/jobs/decidim/accountability/admin/import_results_csv_job.rb @@ -3,11 +3,11 @@ module Decidim module Accountability module Admin - class ImportResultsCSVJob < ApplicationJob + class ImportResultsCsvJob < ApplicationJob queue_as :default def perform(current_user, current_component, csv_file) - importer = Decidim::Accountability::ResultsCSVImporter.new(current_component, csv_file, current_user) + importer = Decidim::Accountability::ResultsCsvImporter.new(current_component, csv_file, current_user) errors = importer.import! diff --git a/app/lib/decidim/overrides/initiatives/initiative_m_cell.rb b/app/lib/decidim/overrides/initiatives/initiative_m_cell.rb deleted file mode 100644 index e4f7161621..0000000000 --- a/app/lib/decidim/overrides/initiatives/initiative_m_cell.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -module Decidim - module Overrides - module Initiatives - # This cell overrides the Medium (:m) initiative card - # for an given instance of an Initiative - module InitiativeMCell - def statuses - [:creation_date, :comments_count] - end - end - end - end -end diff --git a/app/overrides/decidim/accountability/admin/results/_form/external_id.html.erb.deface b/app/overrides/decidim/accountability/admin/results/_form/external_id.html.erb.deface deleted file mode 100644 index e4b8bc19f2..0000000000 --- a/app/overrides/decidim/accountability/admin/results/_form/external_id.html.erb.deface +++ /dev/null @@ -1,7 +0,0 @@ - -
- <%= form.text_field :external_id %> -
-
- <%= form.text_field :weight %> -
diff --git a/app/overrides/decidim/accountability/admin/results/index/import_csv.html.erb.deface b/app/overrides/decidim/accountability/admin/results/index/import_csv.html.erb.deface deleted file mode 100644 index 5efcd21d15..0000000000 --- a/app/overrides/decidim/accountability/admin/results/index/import_csv.html.erb.deface +++ /dev/null @@ -1,2 +0,0 @@ - -<%= link_to t("decidim.accountability.admin.shared.subnav.import_csv"), Rails.application.routes.url_helpers.import_results_path(current_participatory_space, current_component), class: 'button tiny button--simple' %> diff --git a/app/overrides/decidim/accountability/results/_home_header/download_button.html.erb.deface b/app/overrides/decidim/accountability/results/_home_header/download_button.html.erb.deface deleted file mode 100644 index 203bba427c..0000000000 --- a/app/overrides/decidim/accountability/results/_home_header/download_button.html.erb.deface +++ /dev/null @@ -1,6 +0,0 @@ - -
-
- <%= link_to t(".csv_download"), Rails.application.routes.url_helpers.export_results_path(current_participatory_space, current_component) %> -
-
diff --git a/app/packs/src/decidim/.keep b/app/packs/src/decidim/.keep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/app/packs/stylesheets/_global_accountability.scss b/app/packs/stylesheets/_global_accountability.scss deleted file mode 100644 index 7ca3ebb9dd..0000000000 --- a/app/packs/stylesheets/_global_accountability.scss +++ /dev/null @@ -1,142 +0,0 @@ -.global-accountability { - .row.column { - margin: 0 auto; - - .page-title { - margin-bottom: 1rem; - } - - .section:not(:last-child) { - border-bottom: 1px solid rgba($medium-gray, .5); - padding-bottom: 3rem; - } - - .centered--text { - text-align: left; - margin: 0 auto; - max-width: 600px; - padding-bottom: 2rem; - } - - .centered--text.text-center { - text-align: center; - } - - .intro--text { - @include breakpoint(medium) { - font-size: 1.25rem; - } - } - - .card--accountability { - text-align: left; - - h4 { - padding: 1.5rem 1.5rem 1rem; - border-bottom: 1px solid $medium-gray; - - .icon { - margin-right: .25rem; - } - } - - .card__content { - padding: 0 1.5rem 1.5rem; - - ul { - list-style: none; - border-left: 1px solid $medium-gray; - margin-top: 1rem; - padding-left: 1rem; - margin-left: 0; - - a { - color: $secondary; - - &:hover, - &:focus, - &:active { - color: #4d848f; - } - } - } - } - } - - .card--mini .card__content { - padding: 1.5rem .5rem; - } - - .accountability--graphic { - width: 100%; - height: auto; - max-width: 780px; - } - - .tabbed-container { - .programme--section { - margin-bottom: 1.5rem; - } - - .icon { - margin-right: .25rem; - fill: $secondary; - } - } - } -} - -.accountability .categories .categories--group .card__link .category--scope--line { - background-color: white; - border: 1px solid #ddd; - border-radius: 4px; - min-height: 9rem; - padding: 0; - margin-bottom: 1.875rem; - position: relative; - - strong { - font-size: 1.5rem; - padding-bottom: .5rem; - display: block; - } - - .progress-info { - display: flex; - justify-content: space-between; - align-items: flex-end; - } -} - -.accountability .categories .categories--group .card__link .category--without--children { - height: 11rem; - - strong { - min-height: 5rem; - } -} - -.accountability .categories .categories--group .card__link .category--scope--line .scope--inner { - padding: 1rem; -} - -.accountability .categories a.block--scope:hover { - background: inherit; - text-decoration: inherit; -} - -.accountability .categories .categories--group .card__link:hover .category--count { - color: inherit; -} - -.accountability .categories .categories--group .card__link .category--line .category--count { - color: #aba5b3; -} - -.accountability .categories .categories--group .card__link .category--line strong { - color: #182b71; -} - -.accountability .categories .categories--group .category--title p.heading3 { - font-weight: normal; -} diff --git a/app/packs/stylesheets/barcelona.scss b/app/packs/stylesheets/barcelona.scss deleted file mode 100644 index 5ab323f409..0000000000 --- a/app/packs/stylesheets/barcelona.scss +++ /dev/null @@ -1,10 +0,0 @@ -@import "theme-barcelona/variables"; -@import "theme-barcelona/footer"; -@import "theme-barcelona/navbar"; -@import "theme-barcelona/process-nav"; -@import "theme-barcelona/section-heading"; -@import "theme-barcelona/cards"; -@import "theme-barcelona/hero-custom"; -@import "theme-barcelona/event-days"; -@import "theme-barcelona/special-process"; -@import "theme-barcelona/budgets"; diff --git a/app/packs/stylesheets/decidim/.keep b/app/packs/stylesheets/decidim/.keep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/app/packs/stylesheets/decidim/decidim_application.scss b/app/packs/stylesheets/decidim/decidim_application.scss index 0c2026515d..6a12615776 100644 --- a/app/packs/stylesheets/decidim/decidim_application.scss +++ b/app/packs/stylesheets/decidim/decidim_application.scss @@ -6,5 +6,26 @@ // // By default this is empty. -@import "stylesheets/barcelona"; -@import "stylesheets/global_accountability"; +// Fix for the confirm modal showing behind the modal who generates it +#confirm-modal { + z-index: 100; +} + +.accountability_without_children { + &__grid { + @apply grid md:grid-cols-3 items-start gap-x-10 gap-y-8 md:gap-y-16; + + /* display the titles only for the first row in desktop */ + & > :nth-child(1) &-title { + @apply md:block; + } + + &-title { + @apply block md:hidden mb-8 text-gray-2 uppercase font-semibold; + } + + .flash { + @apply m-0; + } + } +} diff --git a/app/packs/stylesheets/email.scss b/app/packs/stylesheets/email.scss index b53e8d7f0a..dd53605842 100644 --- a/app/packs/stylesheets/email.scss +++ b/app/packs/stylesheets/email.scss @@ -1,4 +1,4 @@ -@import "stylesheets/decidim/variables"; +@import "stylesheets/decidim/legacy/variables"; /* Index: 1 - Foundation settings @@ -217,7 +217,7 @@ th.large-1.last { td.large-1 center, th.large-1 center { - min-width: .33333px; + min-width: 0.33333px; } .body .columns td.large-1, @@ -1426,7 +1426,7 @@ th.callout-inner.alert { .thumbnail { border: solid 4px #fefefe; - box-shadow: 0 0 0 1px rgba(10, 10, 10, .2); + box-shadow: 0 0 0 1px rgba(10, 10, 10, 0.2); display: inline-block; line-height: 0; max-width: 100%; @@ -1437,7 +1437,7 @@ th.callout-inner.alert { .thumbnail:hover, .thumbnail:focus { - box-shadow: 0 0 6px 1px rgba(33, 153, 232, .5); + box-shadow: 0 0 6px 1px rgba(33, 153, 232, 0.5); } table.menu { @@ -1766,12 +1766,12 @@ table.container.main { text-align: center; border-radius: 4px; line-height: 1; - padding: .58em 1em; + padding: 0.58em 1em; background: red; } .button--sc { - letter-spacing: .05em; + letter-spacing: 0.05em; font-weight: 600; text-transform: uppercase; diff --git a/app/packs/stylesheets/theme-barcelona/_budgets.scss b/app/packs/stylesheets/theme-barcelona/_budgets.scss deleted file mode 100644 index afd7aef8f2..0000000000 --- a/app/packs/stylesheets/theme-barcelona/_budgets.scss +++ /dev/null @@ -1,16 +0,0 @@ -.budget-progress { - .progress-meter { - &:not(&--minimum) { - background-color: $red-light; - } - } -} - -#project .card.extra .button_to[action="/follow"] { - display: none; -} - -/* for budgets callouts to not hide text */ -.card__content .callout.flash { - margin-bottom: 1rem; -} diff --git a/app/packs/stylesheets/theme-barcelona/_cards.scss b/app/packs/stylesheets/theme-barcelona/_cards.scss deleted file mode 100644 index 384477b13b..0000000000 --- a/app/packs/stylesheets/theme-barcelona/_cards.scss +++ /dev/null @@ -1,48 +0,0 @@ -//Process cards - home and processes -.card--full__image { - &::after { - content: ""; - display: block; - width: 100%; - height: 100%; - position: absolute; - top: 0; - left: 0; - background: url("images/pattern-big.svg") no-repeat left top; - z-index: 0; - background-size: 32px; - - @include breakpoint(medium) { - background-size: 90px; - } - - @include breakpoint(mediumlarge) { - background-size: 160px; - } - - @include breakpoint(large) { - background-size: 120px; - } - } -} - -.card--process .card__image-top { - position: relative; - - &::after { - content: ""; - display: block; - width: 100%; - height: 100%; - position: absolute; - top: 0; - left: 0; - background: url("images/pattern.svg") no-repeat left bottom; - z-index: 0; - background-size: 40px; - } -} - -.card--process.card--mini .card__image-top::after { - background-size: 32px; -} diff --git a/app/packs/stylesheets/theme-barcelona/_event-days.scss b/app/packs/stylesheets/theme-barcelona/_event-days.scss deleted file mode 100644 index 57329bea3a..0000000000 --- a/app/packs/stylesheets/theme-barcelona/_event-days.scss +++ /dev/null @@ -1,88 +0,0 @@ -.event-days { - margin-top: 2rem; - - @include breakpoint(mediumlarge) { - display: flex; - justify-content: space-between; - } - - &__day { - background-color: $medium-gray; - padding: 1.5rem 2rem; - display: flex; - flex-direction: column; - min-height: 12rem; - margin-bottom: 2rem; - - &:last-child { - margin-bottom: 0; - } - - @include breakpoint(mediumlarge) { - flex-basis: 25rem; - min-height: 15rem; - padding: 2rem; - margin: 0 1rem; - - &:first-child { - margin-left: 0; - } - - &:last-child { - margin-right: 0; - } - } - - @include breakpoint(large) { - margin: 0 2rem; - } - - &--current { - background-color: #22398e; - color: #c2c9e0; - } - } - - &__date { - text-transform: uppercase; - font-size: 1rem; - display: flex; - } - - &__info { - margin-top: auto; - margin-bottom: 0; - font-size: 1.5rem; - line-height: 1.2; - } - - &__number-month { - margin-right: .5rem; - } - - &__number { - font-size: 3rem; - line-height: .6; - } - - &__month { - text-decoration: none; - border-bottom: 0 !important; - display: block; - font-size: 1rem; - letter-spacing: .05em; - line-height: 1; - font-weight: 600; - cursor: default !important; - opacity: .6; - } - - &__separator { - font-size: 1rem; - line-height: 1; - font-weight: 600; - margin-right: .4rem; - opacity: .6; - margin-top: .5em; - } -} diff --git a/app/packs/stylesheets/theme-barcelona/_footer.scss b/app/packs/stylesheets/theme-barcelona/_footer.scss deleted file mode 100644 index 306fc4d59d..0000000000 --- a/app/packs/stylesheets/theme-barcelona/_footer.scss +++ /dev/null @@ -1,118 +0,0 @@ -//Vars -$main-footer-bg: $medium-gray; -$mini-footer-bg: $dark-gray; - -//Common - -//Main footer -.main-footer { - background-color: $main-footer-bg; - position: relative; - padding: 1.5rem 0; - min-height: 76px; - color: $medium-gray; - - a { - color: darken($medium-gray, 60%); - - &:hover { - color: darken($medium-gray, 40%); - } - } -} - -.main-footer__badge { - display: block; - width: 140px; - - @include breakpoint(large) { - position: absolute; - margin-top: -.25rem; - } -} - -.main__footer__nav { - text-align: center; - - @include breakpoint(medium) { - text-align: left; - } - - @include breakpoint(large) { - text-align: center; - } -} - -.footer-nav { - list-style: none; - padding-top: .5rem; - margin: 0 0 0 -1rem; - - li { - display: inline-block; - padding: 0 1rem; - } - - @include breakpoint(large) { - margin-left: 0; - } -} - -.main__footer__social { - text-align: center; - - @include breakpoint(medium) { - text-align: right; - } -} - -.footer-social { - list-style: none; - padding-top: .5rem; - margin: 0; - - li { - display: inline-block; - padding-left: 1rem; - - &:first-child { - padding-left: 0; - } - } -} - -.footer-social__icon .icon { - width: 16px; - height: 16px; -} - -//Mini footer -.mini-footer { - padding: 2rem 0 1.5rem; - background-color: $mini-footer-bg; - color: $medium-gray; - - a { - color: darken($medium-gray, 40%); - - &:hover { - color: darken($medium-gray, 20%); - } - } -} - -.cc-badge { - margin-right: .5rem; -} - -.decidim-logo { - display: block; - width: 140px; - margin-right: auto; - margin-left: auto; - - @include breakpoint(medium) { - margin-top: -9px; - margin-right: 0; - } -} diff --git a/app/packs/stylesheets/theme-barcelona/_hero-custom.scss b/app/packs/stylesheets/theme-barcelona/_hero-custom.scss deleted file mode 100644 index 87e324dece..0000000000 --- a/app/packs/stylesheets/theme-barcelona/_hero-custom.scss +++ /dev/null @@ -1,52 +0,0 @@ -.hero::after { - background-color: rgba(26, 24, 29, .2); -} - -.hero-custom { - background-size: contain; - background-repeat: no-repeat; - background-color: $white; - - &__container { - position: relative; - z-index: 1; - padding: 3rem 0; - - @include breakpoint(medium) { - padding: 4rem 0; - } - - @include breakpoint(mediumlarge) { - padding: 5rem 0; - } - - @include breakpoint(large) { - padding: 6rem 0; - } - } - - &__main { - @include breakpoint(mediumlarge) { - display: flex; - align-items: center; - margin-bottom: 4rem; - } - } - - &__heading { - margin-bottom: 2rem; - font-weight: 800; - } - - &__cta { - padding: 1.2rem 1rem; - margin-top: 2rem; - min-width: 16rem; - } - - &__image { - min-height: 400px; - background-size: contain; - background-repeat: no-repeat; - } -} diff --git a/app/packs/stylesheets/theme-barcelona/_navbar.scss b/app/packs/stylesheets/theme-barcelona/_navbar.scss deleted file mode 100644 index e55a5b0300..0000000000 --- a/app/packs/stylesheets/theme-barcelona/_navbar.scss +++ /dev/null @@ -1,476 +0,0 @@ -/* Variables */ - -$navbar-bg: $white; //$dark-gray; -$navbar-bg-hover: rgba(white, .02); -$navbar-color: $dark-gray; //rgba(white, 0.85); -$navbar-color-hover: $dark-gray; //$white; -$navbar-active-color: $dark-gray; //$white; -$navbar-active-bg: $navbar-bg-hover; -$navbar-active-shadow-small: inset -4px 0 0 0 var(--primary); -$navbar-active-shadow-medium: inset 0 -4px 0 0 var(--primary); - -$titlebar-bg: $white; - -/* Navigation */ - -.navbar { - padding-top: .5rem; - background: $navbar-bg; - border-bottom: 2px solid rgba(black, .075); - font-weight: 600; - - .main-nav { - margin-bottom: -2px; - } -} - -/* Title bar */ - -.title-bar { - background-color: $titlebar-bg; - color: $body-font-color; - position: relative; - - @include breakpoint(smallmedium down) { - border-top: 2.125rem solid $titlebar-bg; - } -} - -.logo-cityhall { - position: absolute; - z-index: 1; - right: 0; - top: 0; - margin-top: -1.95rem; - text-align: right; - - img { - width: auto; - height: 22px !important; - } - - @include breakpoint(medium) { - top: 50%; - margin-top: -19px; - - img { - height: 38px !important; - } - } -} - -.topbar__search { - position: relative; - - input, - input:focus { - color: $navbar-color-hover; - border: 0; - padding-left: $input-padding * 4; - box-shadow: none; - background: $navbar-active-bg; - - &::placeholder { - color: $navbar-color; - } - - @include breakpoint(medium) { - background: $medium-gray; - color: $body-font-color; - - &::placeholder { - color: $dark-gray; - } - } - } - - svg { - color: $navbar-color; - position: absolute; - top: 50%; - left: $input-padding; - transform: translateY(-50%); - opacity: .5; - - @include breakpoint(medium) { - color: $dark-gray; - } - } -} - -/* Top bar */ -.topbar { - display: flex; - align-items: center; - justify-content: flex-end; -} - -.logo-wrapper.logo-wrapper { - display: inline-block; - line-height: 0; - flex-grow: 1; - - a { - display: inline-block; - } - - img { - display: block; - max-height: 33px; - - @include breakpoint(mediumlarge) { - max-height: 45px; - } - } - - span { - color: $navbar-color; - - &::before { - border-color: $navbar-color; - } - } -} - -/* Dropmenus in topbar */ -.topbar__dropmenu { - display: inline-block; - vertical-align: middle; - padding-top: 0; - margin-left: 2rem; - - .dropdown > li > a { - padding-left: 0; - } - - .dropdown { - display: inline-block; - vertical-align: middle; - } - - .is-dropdown-submenu { - z-index: 701; - text-align: left; - padding: 0; - background-color: $white; - border: 1px solid $light-gray; - border-radius: 4px; - box-shadow: 0 3px 5px rgba(0, 0, 0, .3); - min-width: 150px; - - &::after, - &::before { - bottom: 100%; - left: 50%; - border: solid transparent; - content: " "; - height: 0; - width: 0; - position: absolute; - pointer-events: none; - } - - &::after { - border-color: rgba($light-gray, 0); - border-bottom-color: $white; - border-width: 10px; - margin-left: -10px; - } - - &::before { - border-color: rgba($light-gray, 0); - border-bottom-color: $white; - border-width: 11px; - margin-left: -11px; - } - - li { - padding: $global-padding * .5; - - a { - padding: .5rem; - color: $anchor-color; - - &:hover { - color: lighten($body-font-color, 20); - } - } - - &:not(:last-child) { - border-bottom: $border; - } - - &:hover { - cursor: pointer; - background-color: rgba(var(--secondary-rgb), .05); - } - } - } - - // Arrow center position - #topbar__language-choose .is-dropdown-submenu { - transform: translateX(-12%); - top: 110%; - } - - #topbar__user-notifications .is-dropdown-submenu { - transform: translateX(-47%); - top: 110%; - } - - #topbar__user-profile .is-dropdown-submenu { - transform: translateX(-40%); - top: 110%; - } -} - -//Foundation overwrites -.topbar__dropmenu > ul > li > a { - color: $body-font-color; - - &::after { - margin-top: -1px !important; - border-top-color: $dark-gray !important; - } -} - -.language-choose { - @include breakpoint(smallmedium down) { - font-size: .8rem; - position: absolute; - top: -2.2rem; - left: .5rem; - margin-left: 0; - - .dropdown.menu > li.is-dropdown-submenu-parent > a::after { - border-width: 3px; - right: 10px; - margin-top: 0; - } - } -} - -.topbar__user { - display: inline-block; - padding-right: 2.5rem; - margin-left: 2rem; - - @media (min-width: calc(1300 / 16) + em) { - padding-right: 0; - } -} - -.topbar__user__logged { - text-align: right; - padding-right: 2.5rem; - display: none; - - @include breakpoint(medium) { - display: block; - } - - @media (min-width: calc(1300 / 16) + em) { - padding-right: 0; - } - - // hide caret down - .dropdown.menu > li.is-dropdown-submenu-parent > a::after { - display: none; - } -} - -.topbar__user__logged__picture { - width: 2rem; - height: 2rem; - border-radius: 50%; - border: $border; - object-fit: cover; -} - -.topbar__user__logged__name { - color: $body-font-color; - - > * { - display: block; - } -} - -.topbar__notifications, -.topbar__conversations { - margin-right: 1rem; - vertical-align: -4px; - - .icon { - fill: $white; - opacity: .3; - } - - &.is-active .icon { - fill: $warning; - opacity: 1; - } -} - -.topbar__notifications__item { - display: flex; - align-items: center; - justify-content: space-between; - color: $muted; - width: 250px; - - @include flexgap(1rem); - - strong { - color: $anchor-color; - } - - :last-child { - flex: 1; - - > * { - display: block; - } - } -} - -.topbar__notifications__item--more { - text-align: center; - background-color: $light-gray-dark; - color: $anchor-color; - font-size: 90%; -} - -.topbar__user__login { - text-align: right; - line-height: 1.2; - - a { - font-weight: 600; - color: $navbar-color; - - &:hover { - color: $navbar-color-hover; - } - - @include breakpoint(medium) { - color: $body-font-color; - - &:hover { - color: $anchor-color; - } - } - } - - a::before { - content: ""; - margin-left: .5rem; - margin-right: .5rem; - display: inline-block; - width: 1px; - height: 2px; - border-left: $border; - vertical-align: middle; - } - - a:first-of-type::before { - display: none; - } -} - -/* Menu icon and off-canvas */ -.topbar__menu { - text-align: right; - font-size: 20px; - margin-right: .1rem; - - button { - color: inherit; - } -} - -.topbar__edit__link a { - color: $medium-gray; - - &:hover { - background: $navbar-bg-hover; - color: $navbar-color-hover; - } -} - -.usermenu-off-canvas-holder .usermenu-off-canvas { - border-top: 1px solid; - border-bottom: 1px solid; - - &.is-dropdown-submenu { - display: block; - position: static; - background: transparent; - border-left: 0; - border-right: 0; - } - - a { - display: block; - padding: 1em 2em; - color: $navbar-color; - - &:hover { - background: $navbar-bg-hover; - color: $navbar-color-hover; - } - } -} - -.off-canvas .topbar__user__login { - text-align: center; - margin-top: 1rem; - padding-top: 1rem; - padding-bottom: 1rem; - border-top: 1px solid; - border-bottom: 1px solid; -} - -/* Main nav */ -.main-nav ul { - padding: 0; - margin: 0; - list-style: none; - overflow-x: auto; - - @include breakpoint(medium) { - -webkit-overflow-scrolling: touch; - white-space: nowrap; - display: flex; - - > li { - display: inline-block; - flex: 1; - text-align: center; - } - } -} - -.main-nav__link a { - display: block; - padding: 1em 2em; - color: $navbar-color; - - &:hover { - background: $navbar-bg-hover; - color: $navbar-color-hover; - } - - @include breakpoint(medium) { - padding: .75em 2em; - } -} - -.main-nav__link--active a { - box-shadow: $navbar-active-shadow-small; - color: $navbar-active-color; - background: $navbar-active-bg; - - @include breakpoint(medium) { - box-shadow: $navbar-active-shadow-medium; - } -} diff --git a/app/packs/stylesheets/theme-barcelona/_process-nav.scss b/app/packs/stylesheets/theme-barcelona/_process-nav.scss deleted file mode 100644 index 5b86553699..0000000000 --- a/app/packs/stylesheets/theme-barcelona/_process-nav.scss +++ /dev/null @@ -1,179 +0,0 @@ -$nav-border-width: 3px; - -.process-nav { - background-color: $white; - padding: .75rem $container-padding-y; - box-shadow: none; - - ul { - margin: 0; - list-style: none; - } - - .about-link { - font-size: 80%; - } - - @include breakpoint(medium) { - padding: 0; - - ul { - overflow-x: auto; - -webkit-overflow-scrolling: touch; - white-space: nowrap; - display: flex; - align-items: center; - flex-wrap: wrap; - justify-content: space-between; - flex-grow: 1; - } - - ul::-webkit-scrollbar { - display: none; - } - - ul::after { - display: inline-block; - flex-grow: 1; - content: ""; - } - - li { - display: inline-block; - padding: .75rem; - } - - .about-link { - float: right; - margin-right: 0; - margin-left: auto; - } - } -} - -.process-nav__trigger { - display: block; - width: 100%; - text-align: left; - position: relative; -} - -.process-nav__trigger__icon { - position: absolute; - right: .5rem; - top: .55rem; -} - -.process-nav__content { - @include breakpoint(smallmedium down) { - display: none; - } - - &.is-active { - display: block; - } - - display: flex; - justify-content: space-between; - align-items: baseline; -} - -.process-nav__content li { - @include breakpoint(smallmedium down) { - margin-top: 1rem; - } - - &.is-active { - box-shadow: inset 0 (-1 * ($nav-border-width + 1px)) 0 0 var(--primary); - - @include breakpoint(smallmedium down) { - display: none; - } - } -} - -.process-nav__more { - margin: 0; - color: var(--primary); - background-color: rgba(var(--primary-rgb), .1); - text-transform: uppercase; - font-weight: $global-weight-bold; - font-size: rem-calc(14); - - i { - @include square(5px); - - border-radius: 100%; - background-color: var(--primary); - display: inline-block; - vertical-align: middle; - margin-bottom: .1rem; - - &:not(:last-child) { - margin-right: .1rem; - } - } -} - -.process-nav__hidden-content { - background-color: $white; - box-shadow: 0 0 4px 0 rgba($black, .08); - padding: 0; - - ul { - padding: $global-padding * .5 0; - } - - li { - width: 100%; - padding: $global-padding * .5 $global-padding; - } -} - -.process-nav__hidden-content__more { - @extend .process-nav__more; - - background-color: transparent; - text-align: right; - border-bottom: $border; - padding: $global-padding * .5 $global-padding; -} - -.process-nav__link { - color: var(--primary); - text-transform: uppercase; - font-weight: $global-weight-bold; - display: flex; - align-items: center; - - svg { - margin-right: .4em; - width: 25px; - height: 25px; - fill: $muted; - - .stroked-shape { - fill: none; - fill-opacity: 1; - stroke-width: 2.01957917; - stroke-miterlimit: 4; - stroke-dasharray: none; - stroke-dashoffset: 0; - stroke: $muted; - } - } -} - -@include breakpoint(medium) { - .process-nav__link.is-active { - color: var(--primary); - - svg { - fill: var(--primary); - - .stroked-shape { - stroke: var(--primary); - } - } - } -} diff --git a/app/packs/stylesheets/theme-barcelona/_section-heading.scss b/app/packs/stylesheets/theme-barcelona/_section-heading.scss deleted file mode 100644 index a2d670ccf6..0000000000 --- a/app/packs/stylesheets/theme-barcelona/_section-heading.scss +++ /dev/null @@ -1,9 +0,0 @@ -//Section heading -.section-heading.section-heading::before { - //double selector to increase specificity - background: url("images/heading-icon.svg") no-repeat center; - width: .9rem; - height: .9rem; - margin-right: .3rem; - margin-bottom: -.11rem; -} diff --git a/app/packs/stylesheets/theme-barcelona/_special-process.scss b/app/packs/stylesheets/theme-barcelona/_special-process.scss deleted file mode 100644 index f4c1490ea3..0000000000 --- a/app/packs/stylesheets/theme-barcelona/_special-process.scss +++ /dev/null @@ -1,57 +0,0 @@ -.special-process { - @include breakpoint(mediumlarge) { - display: flex; - justify-content: center; - padding-left: 4rem; - padding-right: 4rem; - } - - &__element { - flex-grow: 1; - min-height: 400px; - display: flex; - flex-direction: column; - justify-content: flex-end; - color: $white; - transition: color .3s; - background-size: cover; - background-position: center 10%; - - &:hover, - &:focus { - color: rgba($white, .8); - } - - @include breakpoint(mediumlarge) { - max-width: 50%; - } - } - - &__heading { - font-size: 1.6rem; - font-weight: 800; - line-height: 1.2; - } - - &__cta { - &::after { - content: ""; - display: inline-block; - width: .5em; - height: .5em; - border-top: .2em solid; - border-right: .2em solid; - transform: rotate(45deg); - vertical-align: .05em; - } - } - - &__content { - background-color: rgba(#22398e, .9); - padding: 1rem 2rem; - - &--alt { - background-color: rgba(#e63016, .9); - } - } -} diff --git a/app/packs/stylesheets/theme-barcelona/_variables.scss b/app/packs/stylesheets/theme-barcelona/_variables.scss deleted file mode 100644 index 1f7e836cfa..0000000000 --- a/app/packs/stylesheets/theme-barcelona/_variables.scss +++ /dev/null @@ -1,4 +0,0 @@ -// Additional colors -$red-light: #f9c5be; -$black-warm: #2c120e; -$gray-warm: #f4eeed; diff --git a/app/services/census_authorization_handler.rb b/app/services/census_authorization_handler.rb index 4dde2391c8..41eb625cce 100644 --- a/app/services/census_authorization_handler.rb +++ b/app/services/census_authorization_handler.rb @@ -35,12 +35,12 @@ class CensusAuthorizationHandler < Decidim::AuthorizationHandler def metadata super.merge( date_of_birth: date_of_birth&.strftime("%Y-%m-%d"), - postal_code: postal_code, + postal_code:, scope: scope_name, scope_id: scope&.id, scope_code: scope&.code, extras: { - gender: gender + gender: } ) end diff --git a/app/services/decidim/accountability/results_csv_exporter.rb b/app/services/decidim/accountability/results_csv_exporter.rb index 86d13330e6..b888194230 100644 --- a/app/services/decidim/accountability/results_csv_exporter.rb +++ b/app/services/decidim/accountability/results_csv_exporter.rb @@ -6,7 +6,7 @@ module Decidim module Accountability # This class handles exporting results to a CSV file. # Needs a `current_component` param with a `Decidim::Component` - class ResultsCSVExporter + class ResultsCsvExporter # Public: Initializes the service. # component - A Decidim::component to import the results into. def initialize(component) diff --git a/app/services/decidim/accountability/results_csv_importer.rb b/app/services/decidim/accountability/results_csv_importer.rb index 3a47474b92..1176dc3be6 100644 --- a/app/services/decidim/accountability/results_csv_importer.rb +++ b/app/services/decidim/accountability/results_csv_importer.rb @@ -13,7 +13,7 @@ module Accountability # This class handles importing results from a CSV file. # Needs a `current_component` param with a `Decidim::component` # in order to import the results in that component. - class ResultsCSVImporter + class ResultsCsvImporter include Decidim::FormFactory # Public: Initializes the service. @@ -26,7 +26,7 @@ def initialize(component, csv_file, current_user) @extra_context = { current_component: component, current_organization: component.organization, - current_user: current_user, + current_user:, current_participatory_space: component.participatory_space } end diff --git a/app/services/pdf_signature_barcelona.rb b/app/services/pdf_signature_barcelona.rb index a6f23ab03e..015710900d 100644 --- a/app/services/pdf_signature_barcelona.rb +++ b/app/services/pdf_signature_barcelona.rb @@ -35,9 +35,9 @@ def signed_pdf private_key.key, method: "adbe.pkcs7.detached", annotation: signature_annotation, - location: location, - contact: contact, - issuer: issuer + location:, + contact:, + issuer: ) end extract_signed_pdf(parsed_pdf) @@ -73,7 +73,7 @@ def text_annotation(options = {}) annotation.set_indirect(true) annotation.Matrix = [1, 0, 0, 1, 0, 0] annotation.BBox = [0, 0, width, height] - annotation.write(caption, x: size, y: (height / 2) - (size / 2), size: size) + annotation.write(caption, x: size, y: (height / 2) - (size / 2), size:) end end @@ -85,7 +85,7 @@ def signature_annotation(options = {}) Origami::Annotation::Widget::Signature.new.tap do |annotation| annotation.set_indirect(true) annotation.Rect = Origami::Rectangle[llx: height, lly: width + height, urx: width + height, ury: width] - annotation.set_normal_appearance(text_annotation(width: width, height: height)) + annotation.set_normal_appearance(text_annotation(width:, height:)) end end end diff --git a/app/services/sms_gateway.rb b/app/services/sms_gateway.rb index c1eebe5b5b..c8e762538c 100644 --- a/app/services/sms_gateway.rb +++ b/app/services/sms_gateway.rb @@ -2,11 +2,12 @@ # A Service to send SMS to Barcelona's provider so users can be verified by SMS. class SmsGateway - attr_reader :mobile_phone_number, :code + attr_reader :mobile_phone_number, :code, :context - def initialize(mobile_phone_number, code) + def initialize(mobile_phone_number, code, context = {}) @mobile_phone_number = mobile_phone_number @code = code + @context = context end def deliver_code @@ -32,7 +33,7 @@ def response end def text - I18n.t("decidim.sms.text", code: code) + I18n.t("decidim.sms.text", code:) end private diff --git a/app/views/census16_authorization/_form.html.erb b/app/views/census16_authorization/_form.html.erb index 47d975f0f1..e81b7e8c5f 100644 --- a/app/views/census16_authorization/_form.html.erb +++ b/app/views/census16_authorization/_form.html.erb @@ -1,33 +1,35 @@ -
- <%= form.select :document_type, handler.census_document_types, prompt: true %> -
+
+
+ <%= form.select :document_type, handler.census_document_types, prompt: true %> +
-
- <%= form.text_field :document_number %> -
+
+ <%= form.text_field :document_number %> +
-
- <%= form.date_select :date_of_birth, start_year: 1900, end_year: 16.years.ago.year, default: 35.years.ago, prompt: { day: t(".date_select.day"), month: t(".date_select.month"), year: t(".date_select.year") } %> -
+
+ <%= form.date_select :date_of_birth, start_year: 1900, end_year: 16.years.ago.year, default: 35.years.ago, prompt: { day: t(".date_select.day"), month: t(".date_select.month"), year: t(".date_select.year") } %> +
-
- <%= form.text_field :postal_code %> -
+
+ <%= form.text_field :postal_code %> +
-
- <% parent_scope = Decidim::Scope.where("name->>'ca' = 'Ciutat'").first %> - <%= form.collection_select :scope_id, current_organization.scopes.where(parent: parent_scope), :id, ->(scope){ translated_attribute(scope.name) }, prompt: t(".scope_prompt") %> -
+
+ <% parent_scope = Decidim::Scope.where("name->>'ca' = 'Ciutat'").first %> + <%= form.collection_select :scope_id, current_organization.scopes.where(parent: parent_scope), :id, ->(scope){ translated_attribute(scope.name) }, prompt: t(".scope_prompt") %> +
-
- <%= form.collection_select( - :gender, - Census16AuthorizationHandler::AVAILABLE_GENDERS, - :to_s, - ->(gender) { t(".genders.#{gender}") }, - prompt: t(".gender_prompt") - ) %> -

<%= t ".gender_help" %>

-
+
+ <%= form.collection_select( + :gender, + Census16AuthorizationHandler::AVAILABLE_GENDERS, + :to_s, + ->(gender) { t(".genders.#{gender}") }, + prompt: t(".gender_prompt") + ) %> +

<%= t ".gender_help" %>

+
-<%= form.hidden_field :handler_name %> + <%= form.hidden_field :handler_name %> +
diff --git a/app/views/census_authorization/_form.html.erb b/app/views/census_authorization/_form.html.erb index 66444b1c1f..a8f4bb6318 100644 --- a/app/views/census_authorization/_form.html.erb +++ b/app/views/census_authorization/_form.html.erb @@ -1,33 +1,35 @@ -
- <%= form.select :document_type, handler.census_document_types, prompt: true %> -
+
+
+ <%= form.select :document_type, handler.census_document_types, prompt: true %> +
-
- <%= form.text_field :document_number %> -
+
+ <%= form.text_field :document_number %> +
-
- <%= form.date_select :date_of_birth, start_year: 1900, end_year: 14.years.ago.year, default: 35.years.ago, prompt: { day: t(".date_select.day"), month: t(".date_select.month"), year: t(".date_select.year") } %> -
+
+ <%= form.date_select :date_of_birth, start_year: 1900, end_year: 14.years.ago.year, default: 35.years.ago, prompt: { day: t(".date_select.day"), month: t(".date_select.month"), year: t(".date_select.year") } %> +
-
- <%= form.text_field :postal_code %> -
+
+ <%= form.text_field :postal_code %> +
-
- <% parent_scope = Decidim::Scope.where("name->>'ca' = 'Ciutat'").first %> - <%= form.collection_select :scope_id, current_organization.scopes.where(parent: parent_scope), :id, ->(scope){ translated_attribute(scope.name) }, prompt: t(".scope_prompt") %> -
+
+ <% parent_scope = Decidim::Scope.where("name->>'ca' = 'Ciutat'").first %> + <%= form.collection_select :scope_id, current_organization.scopes.where(parent: parent_scope), :id, ->(scope){ translated_attribute(scope.name) }, prompt: t(".scope_prompt") %> +
-
- <%= form.collection_select( - :gender, - CensusAuthorizationHandler::AVAILABLE_GENDERS, - :to_s, - ->(gender) { t(".genders.#{gender}") }, - prompt: t(".gender_prompt") - ) %> -

<%= t ".gender_help" %>

-
+
+ <%= form.collection_select( + :gender, + CensusAuthorizationHandler::AVAILABLE_GENDERS, + :to_s, + ->(gender) { t(".genders.#{gender}") }, + prompt: t(".gender_prompt") + ) %> +

<%= t ".gender_help" %>

+
-<%= form.hidden_field :handler_name %> + <%= form.hidden_field :handler_name %> +
diff --git a/app/views/census_kids_authorization/_form.html.erb b/app/views/census_kids_authorization/_form.html.erb index 9eb84b8868..c94e9f2aa9 100644 --- a/app/views/census_kids_authorization/_form.html.erb +++ b/app/views/census_kids_authorization/_form.html.erb @@ -1,33 +1,35 @@ -
- <%= form.select :document_type, handler.census_document_types, prompt: true %> -
+
+
+ <%= form.select :document_type, handler.census_document_types, prompt: true %> +
-
- <%= form.text_field :document_number %> -
+
+ <%= form.text_field :document_number %> +
-
- <%= form.date_select :date_of_birth, start_year: 20.years.ago.year, end_year: 8.years.ago.year, default: 12.years.ago, prompt: { day: t(".date_select.day"), month: t(".date_select.month"), year: t(".date_select.year") } %> -
+
+ <%= form.date_select :date_of_birth, start_year: 20.years.ago.year, end_year: 8.years.ago.year, default: 12.years.ago, prompt: { day: t(".date_select.day"), month: t(".date_select.month"), year: t(".date_select.year") } %> +
-
- <%= form.text_field :postal_code %> -
+
+ <%= form.text_field :postal_code %> +
-
- <% parent_scope = Decidim::Scope.where("name->>'ca' = 'Ciutat'").first %> - <%= form.collection_select :scope_id, current_organization.scopes.where(parent: parent_scope), :id, ->(scope){ translated_attribute(scope.name) }, prompt: t(".scope_prompt") %> -
+
+ <% parent_scope = Decidim::Scope.where("name->>'ca' = 'Ciutat'").first %> + <%= form.collection_select :scope_id, current_organization.scopes.where(parent: parent_scope), :id, ->(scope){ translated_attribute(scope.name) }, prompt: t(".scope_prompt") %> +
-
- <%= form.collection_select( - :gender, - CensusKidsAuthorizationHandler::AVAILABLE_GENDERS, - :to_s, - ->(gender) { t(".genders.#{gender}") }, - prompt: t(".gender_prompt") - ) %> -

<%= t ".gender_help" %>

-
+
+ <%= form.collection_select( + :gender, + CensusKidsAuthorizationHandler::AVAILABLE_GENDERS, + :to_s, + ->(gender) { t(".genders.#{gender}") }, + prompt: t(".gender_prompt") + ) %> +

<%= t ".gender_help" %>

+
-<%= form.hidden_field :handler_name %> + <%= form.hidden_field :handler_name %> +
diff --git a/app/views/decidim/accountability/admin/import_results/new.html.erb b/app/views/decidim/accountability/admin/import_results/new.html.erb index 0bc9efcd21..35ece2e69c 100644 --- a/app/views/decidim/accountability/admin/import_results/new.html.erb +++ b/app/views/decidim/accountability/admin/import_results/new.html.erb @@ -1,19 +1,28 @@ -<%= form_tag(Rails.application.routes.url_helpers.import_results_path(current_participatory_space, current_component), multipart: true, class: "form new_import") do %> -
-
-

- <%= t(".title") %> -

-
+<% add_decidim_page_title(t(".title")) %> +
+

+ <%= t(".title") %> +

+
-
-
- <%= file_field_tag :csv_file %> +
+
+ <%= form_tag(Rails.application.routes.url_helpers.import_results_path(current_participatory_space, current_component), multipart: true, class: "form new_import") do %> +
+
+
+
+ <%= file_field_tag :csv_file %> +
+
+
-
-
-
- <%= submit_tag t(".import"), class: "button" %> +
+
+ <%= submit_tag t(".import"), class: "button button__sm button__secondary" %> +
+
+ <% end %>
-<% end %> +
diff --git a/app/views/decidim/accountability/admin/results/_form.html.erb b/app/views/decidim/accountability/admin/results/_form.html.erb new file mode 100644 index 0000000000..94714ec9b4 --- /dev/null +++ b/app/views/decidim/accountability/admin/results/_form.html.erb @@ -0,0 +1,79 @@ +
+
+ +
+
+ <%= form.translated :text_field, :title, autofocus: true, aria: { label: :title } %> +
+ +
+ <%= form.translated :editor, :description, aria: { label: :description } %> +
+ + <% if @form.parent_id %> + +
+ <%= form.select :parent_id, parent_results.map { |result| [translated_attribute(result.title), result.id] }, include_blank: true %> +
+ + <% else %> + + <% if current_component.has_subscopes? %> +
+ <%= scopes_select_field form, :decidim_scope_id, root: current_component.scope %> +
+ <% end %> + +
+ <%= form.categories_select :decidim_category_id, current_participatory_space.categories, include_blank: true, disable_parents: false %> +
+ + <% end %> + +
+
+ <%= form.date_field :start_date %> +
+ +
+ <%= form.date_field :end_date %> +
+
+ +
+
+ <%= form.select :decidim_accountability_status_id, statuses.map { |status| [translated_attribute(status.name), status.id, { "data-progress" => status.progress }] }, include_blank: true %> +
+ +
+ <%= form.number_field :progress %> +
+
+ + <% if Decidim::Accountability.enable_proposal_linking %> +
+ <%= render partial: "decidim/proposals/proposals/proposals_picker", locals: { form:, field: :proposals } %> +
+ <% end %> + +
+ <% if @form.projects %> + <%= form.select :project_ids, + @form.projects, + {}, + { multiple: true, class: "chosen-select" } %> + <% end %> +
+ +
+ <%= form.text_field :external_id %> +
+ +
+ <%= form.text_field :weight %> +
+ +
+
+ +
diff --git a/app/views/decidim/accountability/admin/results/index.html.erb b/app/views/decidim/accountability/admin/results/index.html.erb new file mode 100644 index 0000000000..7a3cf4a664 --- /dev/null +++ b/app/views/decidim/accountability/admin/results/index.html.erb @@ -0,0 +1,131 @@ +<% add_decidim_page_title(t(".title")) %> +
+
+

+ <% if parent_result %> + <%= "#{translated_attribute(parent_result.title)} > " %> + <% end %> + <%= t(".title") %> + + <%= export_dropdowns(query) %> + <%= import_dropdown do %> + <% if allowed_to?(:create, :result) && parent_result.nil? %> + <%= link_to new_projects_import_path do %> +
  • + <%= t("actions.import", scope: "decidim.accountability", name: t("models.result.name", scope: "decidim.accountability.admin")) %> +
  • + <% end %> + <% end %> + <% if allowed_to? :create, :result %> + <%= link_to import_results_path do %> +
  • + <%= t("actions.import_csv", scope: "decidim.accountability") %> +
  • + <% end %> + <% end %> + <% end %> + <%= link_to t("decidim.accountability.admin.shared.subnav.import_csv"), Rails.application.routes.url_helpers.import_results_path(current_participatory_space, current_component), class: "button button__sm button__secondary" %> + <%= render partial: "decidim/accountability/admin/shared/subnav" unless parent_result %> + <%= link_to t("actions.new_result", scope: "decidim.accountability"), new_result_path(parent_id: parent_result), class: "button button__sm button__secondary" if allowed_to? :create, :result %> + <%= render partial: "decidim/admin/components/resource_action" %> +

    +
    + + <%= admin_filter_selector(:results) %> +
    + + + + + + + <% if resource_with_scopes_enabled? %> + + <% end %> + + + + + + + + <% results.each do |result| %> + + + + + <%= td_resource_scope_for(result.scope) %> + + + + + + + <% end %> + +
    + <%= sort_link(query, :id, t("models.result.fields.id", scope: "decidim.accountability"), default_order: :desc ) %> + + <%= sort_link(query, :title, t("models.result.fields.title", scope: "decidim.accountability")) %> + + <%= sort_link(query, :category_name, t("models.result.fields.category", scope: "decidim.accountability") ) %> + + <%= sort_link(query, :scope_name, t("models.result.fields.scope", scope: "decidim.accountability") ) %> + + <%= sort_link(query, :status_name, t("models.result.fields.status", scope: "decidim.accountability") ) %> + + <%= sort_link(query, :progress, t("models.result.fields.progress", scope: "decidim.accountability") ) %> + + <%= sort_link(query, :created_at, t("models.result.fields.created_at", scope: "decidim.accountability") ) %> + <%= t("actions.title", scope: "decidim.accountability") %>
    + <%= result.id %>
    +
    + <% if result.parent_id.nil? %> + <%= link_to translated_attribute(result.title), results_path(parent_id: result.id) %>
    + <% else %> + <%= translated_attribute(result.title) %> + <% end %> +
    + <% if result.category %> + <%= translated_attribute result.category.name %> + <% end %> + + <% if result.status %> + <%= translated_attribute result.status.name %> + <% end %> + + <%= result.progress&.to_i %> + + <%= l result.created_at, format: :decidim_short %> + + <% if allowed_to? :update, :result, result: result %> + <%= icon_link_to "pencil-line", edit_result_path(result), t("actions.edit", scope: "decidim.accountability"), class: "action-icon--edit" %> + <% end %> + + <% if allowed_to? :create_children, :result, result: result %> + <%= icon_link_to "add-line", results_path(parent_id: result.id), t("actions.new_result", scope: "decidim.accountability"), class: "action-icon--plus" %> + <% end %> + + <% if allowed_to? :update, :result, result: result %> + <%= icon_link_to "time-line", result_timeline_entries_path(result), t("actions.timeline_entries", scope: "decidim.accountability"), class: "action-icon--clock" %> + <% end %> + + <% if allowed_to? :update, :result, result: result %> + <%= icon_link_to "folder-line", result_attachment_collections_path(result), t("actions.attachment_collections", scope: "decidim.accountability"), class: "action-icon--attachment_collections" %> + <% end %> + + <% if allowed_to? :update, :result, result: result %> + <%= icon_link_to "attachment-line", result_attachments_path(result), t("actions.attachments", scope: "decidim.accountability"), class: "action-icon--attachments" %> + <% end %> + + <%= icon_link_to "eye-line", resource_locator(result).path, t("actions.preview", scope: "decidim.accountability"), class: "action-icon--preview", target: :blank, data: { "external-link": false } %> + + <%= resource_permissions_link(result) %> + + <% if allowed_to? :destroy, :result, result: result %> + <%= icon_link_to "delete-bin-line", result_path(result), t("actions.destroy", scope: "decidim.accountability"), class: "action-icon--remove", method: :delete, data: { confirm: t("actions.confirm_destroy", scope: "decidim.accountability", name: t("models.result.name", scope: "decidim.accountability.admin")) } %> + <% end %> +
    +
    +
    +<%= decidim_paginate results %> diff --git a/app/views/decidim/accountability/import_mailer/import.html.erb b/app/views/decidim/accountability/import_mailer/import.html.erb index fa79310bb1..9a756ca139 100644 --- a/app/views/decidim/accountability/import_mailer/import.html.erb +++ b/app/views/decidim/accountability/import_mailer/import.html.erb @@ -23,5 +23,3 @@ <% end %> <% end %> - - diff --git a/app/views/decidim/accountability/results/_home_categories.html.erb b/app/views/decidim/accountability/results/_home_categories.html.erb index 10de3cfc48..7ef6946e8c 100644 --- a/app/views/decidim/accountability/results/_home_categories.html.erb +++ b/app/views/decidim/accountability/results/_home_categories.html.erb @@ -1,157 +1,46 @@ -<% - categories_with_children = first_class_categories.select { |category| category.subcategories.any? } - categories_without_children = first_class_categories.reject { |category| category.subcategories.any? } -%> -
    -
    -
    -
    - <%= icon("arrow-bottom", class: "icon", aria_label: categories_label, role: "img") %> - <%= categories_label %> -
    -
    - <% if categories_with_children.any? %> - <%= icon("arrow-bottom", class: "icon", aria_label: subcategories_label, role: "img") %> - <%= subcategories_label %> - <% end %> - -
    - <%= render partial: "search" %> -
    - -
    +<% unless children %> + + <%= categories_label %> + +<% end %> + +
    __grid"> + <% first_class_categories.each do |category| %> + <% category_results_count = count_calculator(current_scope, category) %> + <% next if category_results_count == 0 %> + + <% subelements = cell( + "decidim/accountability/status", + category, + show_category_image:, + extra_classes: "accountability__status__background", + url: results_path(filter: { with_category: category, with_scope: current_scope }), + render_blank: true + ) %> + +
    + <%= categories_label %> + <%= subelements.call %>
    -
    -
    -
    -
    - <% if categories_with_children.any? %> -
    - <% categories_without_children.each do |category| %> - <% category_results_count = count_calculator(current_scope, category) %> - <% next if category_results_count == 0 %> -
    - <% progress = progress_calculator(current_scope, category) %> - <%= link_to results_path(filter: { with_category: category, with_scope: current_scope }), class: "medium-4 columns end card__link card__link--block block--scope" do %> -
    - <% if show_category_image %> - <%= image_pack_tag("media/images/category-#{category.id}.jpg") %> - <% end %> -

    <%= translated_attribute(category.name) %>

    - -
    -
    -
    - - <% if component_settings.display_progress_enabled? && progress.present? %> -
    -
    - <%= display_percentage progress %> -
    -
    - <%= display_count category_results_count %> -
    -
    - <% end %> -
    -
    - <% end %> + <% if children %> +
    + <%= subcategories_label %> + <% if subelements.has_results? %> +
    + <% category.subcategories.each do |subcategory| %> + <%= cell( + "decidim/accountability/status", + subcategory, + extra_classes: "accountability__status__border", + url: results_path(filter: { with_category: subcategory, with_scope: current_scope }) + ) %> <% end %>
    <% else %> -
    -
    -
    - <% categories_without_children.each do |category| %> - <% category_results_count = count_calculator(current_scope, category) %> - <% next if category_results_count == 0 %> - <% progress = progress_calculator(current_scope, category) %> - <%= link_to results_path(filter: { with_category: category, with_scope: current_scope }), class: "medium-4 columns end card__link card__link--block block--scope" do %> -
    -
    - <% if show_category_image %> - <%= image_pack_tag("media/images/category-#{category.id}.jpg") %> - <% end %> - <%= translated_attribute(category.name) %> - -
    -
    -
    - - <% if component_settings.display_progress_enabled? && progress.present? %> -
    -
    - <%= display_percentage progress %> -
    -
    - <%= display_count category_results_count %> -
    -
    - <% end %> -
    -
    - <% end %> - <% end %> -
    -
    -
    - <% end %> - - <% categories_with_children.each do |category| %> - <% next if (category_results_count = count_calculator(current_scope, category.id)) == 0 %> -
    -
    -
    -

    - <%= link_to translated_attribute(category.name),results_path(filter: { with_category: category, with_scope: current_scope }) %>

    - - <% if component_settings.display_progress_enabled? && progress_calculator(current_scope, category.id).present? %> -
    -
    -
    - <% end %> - -
    - <% if component_settings.display_progress_enabled? && progress_calculator(current_scope, category.id).present? %> -
    - <%= display_percentage progress_calculator(current_scope, category.id) %> -
    - <% end %> -
    - <%= display_count(category_results_count) if category_results_count && category_results_count > 0 %> -
    -
    -
    -
    - -
    -
    - <% category.subcategories.each do |subcategory| %> - <% if (subcategory_results_count = count_calculator(current_scope, subcategory.id)) > 0 %> - <%= link_to results_path(filter: { with_category: subcategory, with_scope: current_scope }), class: "medium-4 columns end card__link card__link--block" do %> -
    - <%= translated_attribute(subcategory.name) %> - - <% if component_settings.display_progress_enabled? && progress_calculator(current_scope, subcategory.id).present? %> -
    - <%= display_percentage progress_calculator(current_scope, subcategory.id) %> -
    - <% end %> - -
    - <%= display_count subcategory_results_count %> -
    -
    - <% end %> - <% end %> - <% end %> - -
    -
    -
    + <%= cell("decidim/announcement", t("no_results", scope: "decidim.accountability.results")) %> <% end %>
    -
    -
    + <% end %> + <% end %>
    diff --git a/app/views/decidim/accountability/results/_home_scopes.html.erb b/app/views/decidim/accountability/results/_home_scopes.html.erb index e98ac53240..fcbe8f5a0e 100644 --- a/app/views/decidim/accountability/results/_home_scopes.html.erb +++ b/app/views/decidim/accountability/results/_home_scopes.html.erb @@ -1,41 +1,23 @@ -
    -
    -
    -
    -
    -
    -
    - <% current_participatory_space.subscopes.order(Arel.sql("code::INTEGER ASC")).each do |scope| %> - <% scope_results_count = count_calculator(scope.id, 'all') %> - <% progress = progress_calculator(scope.id, 'all') %> - <%= link_to results_path(filter: { with_scope: scope.id }), class: "medium-4 columns end card__link card__link--block block--scope" do %> -
    - <%= image_pack_tag("media/images/districte-#{scope.id}.jpg") %> -
    - <%= translated_attribute(scope.name) %> - -
    -
    -
    - - <% if component_settings.display_progress_enabled? && progress.present? %> -
    -
    - <%= display_percentage progress %> -
    -
    - <%= display_count scope_results_count %> -
    -
    - <% end %> -
    -
    - <% end %> - <% end %> -
    +
    +
    + <% current_participatory_space.subscopes.order(Arel.sql("code::INTEGER ASC")).each do |scope| %> + <% scope_results_count = count_calculator(scope.id, "all") %> + <% progress = progress_calculator(scope.id, "all") %> +
    + <%= link_to results_path(filter: { with_scope: scope.id }), class: "accountability__status accountability__status__background" do %> + <%= image_pack_tag("media/images/districte-#{scope.id}.jpg") %> +

    <%= translated_attribute(scope.name) %>

    +
    +
    -
    + <% if component_settings.display_progress_enabled? && progress.present? %> +
    + <%= display_percentage progress %> + <%= display_count scope_results_count %> +
    + <% end %> + <% end %>
    -
    + <% end %>
    diff --git a/app/views/decidim/accountability/results/_results_leaf.html.erb b/app/views/decidim/accountability/results/_results_leaf.html.erb deleted file mode 100644 index cc53a80dc2..0000000000 --- a/app/views/decidim/accountability/results/_results_leaf.html.erb +++ /dev/null @@ -1,47 +0,0 @@ -
    -

    - <%= heading_leaf_level_results(total_count) %> -

    -
    - -
    -
    -
    - <% results.each do |result| %> -
    - <%= icon "actions", class: "card--list__icon", role: "img", "aria-hidden": true, remove_icon_class: true %> - - <%= link_to result_path(result), class: "card--list__text card__link card__link--block" do %> -

    - <%= translated_attribute(result.title) %> -

    - -
    - <% if result.start_date %> - <%= t("models.result.fields.start_date", scope: "decidim.accountability") %> - <%= l result.start_date, format: :decidim_short %> - <% end %> - - <% if result.end_date %> - <%= t("models.result.fields.end_date", scope: "decidim.accountability") %> - <%= l result.end_date, format: :decidim_short %> - <% end %> - - <% if result.status %> - <%= t("models.result.fields.status", scope: "decidim.accountability") %> - <%= translated_attribute(result.status.name) %> - <% end %> -
    - <% end %> - - <% if component_settings.display_progress_enabled? && result.progress.present? && !Decidim::Accountability::Result.not_computable_results.include?(result.id) %> -
    - <%= display_percentage result.progress %> -
    - <% end %> -
    - <% end %> -
    - <%= decidim_paginate results, order_start_time: params[:order_start_time], with_scope: params.dig(:filter, :with_scope) %> -
    -
    diff --git a/app/views/decidim/accountability/results/_scope_filters.html.erb b/app/views/decidim/accountability/results/_scope_filters.html.erb new file mode 100644 index 0000000000..7c648c9d6f --- /dev/null +++ b/app/views/decidim/accountability/results/_scope_filters.html.erb @@ -0,0 +1,32 @@ +<% hide_subscopes ||= false %> +<% items = filter_items_for(participatory_space: current_participatory_space, category:) %> +
    + <%= render partial: "search" %> + + <% if current_component.has_subscopes? && !hide_subscopes %> +
    + + +
    + <% end %> +
    diff --git a/app/views/decidim/accountability/results/_show_leaf.html.erb b/app/views/decidim/accountability/results/_show_leaf.html.erb deleted file mode 100644 index 13e1059b01..0000000000 --- a/app/views/decidim/accountability/results/_show_leaf.html.erb +++ /dev/null @@ -1,83 +0,0 @@ -
    -
    - <%= render partial: "decidim/accountability/results/nav_breadcrumb", locals: { category: result.parent.try(:category) || result.category } %> -
    -
    -
    - <%= icon("proposals", class: "icon", aria_label: t("models.result.fields.title", scope: "decidim.accountability"), role: "img") %> -

    <%= translated_attribute result.title %>

    -
    - -
    - <% if component_settings.display_progress_enabled? && result.progress.present? %> -
    - <% unless Decidim::Accountability::Result.not_computable_results.include?(result.id) %> -
    -
    - <%= t("models.result.fields.progress", scope: "decidim.accountability") %>: - - <%= display_percentage result.progress %> - -
    - -
    -
    -
    -
    - <% end %> -
    - <% end %> - -
    "> -
    -
    - <% if result.start_date %> -
    <%= t("models.result.fields.start_date", scope: "decidim.accountability") %>
    -
    <%= l result.start_date, format: :decidim_short %>
    - <% end %> -
    - -
    - <% if result.end_date %> -
    <%= t("models.result.fields.end_date", scope: "decidim.accountability") %>
    -
    <%= l result.end_date, format: :decidim_short %>
    - <% end %> -
    - -
    - <% if result.status %> -
    <%= t("models.result.fields.status", scope: "decidim.accountability") %>
    -
    <%= translated_attribute(result.status.name) %>
    - <% end %> -
    - -
    - <% if result.status && translated_attribute(result.status.description).present? %> -
    <%= t("models.status.fields.description", scope: "decidim.accountability") %>
    -
    <%= translated_attribute(result.status.description) %>
    - <% end %> -
    -
    -
    - -
    - -
    -
    - <%== translated_attribute result.description %> - <%= cell "decidim/tags", result, context: { extra_classes: ["tags--result"] } %> -
    -
    - - <%= render partial: "stats_box" %> - - <%= render partial: "timeline", locals: { result: result } if result.timeline_entries.any? %> - - <%= attachments_for result %> -
    -
    - - <%= render partial: "stats" %> -
    - -<%= comments_for result %> diff --git a/app/views/decidim/accountability/results/_stats_box.html.erb b/app/views/decidim/accountability/results/_stats_box.html.erb new file mode 100644 index 0000000000..592c0decc8 --- /dev/null +++ b/app/views/decidim/accountability/results/_stats_box.html.erb @@ -0,0 +1,79 @@ +
    + + <% if result.children.any? && component_settings.display_progress_enabled? && result.progress.present? && !Decidim::Accountability::Result.not_computable_results.include?(result.id) %> +
    +
    + <%= t("models.result.fields.progress", scope: "decidim.accountability") %>: + + <%= display_percentage result.progress %> + +
    + +
    +
    +
    +
    + <% end %> + + <% if result.versions.any? || result.linked_resources(:proposals, "included_proposals").any? %> +
    +
    + <% if result.versions.any? %> +
    +
    + <%= resource_version_number(result.versions_count) %> + + <%= resource_version_of(result.versions_count) %> + +
    + +
    + + <%= link_to_other_resource_versions(result_versions_path(result)) %> + +
    +
    + <% if result.last_editor.present? %> +
    + <%= t("results.show.stats.last_edited_by", scope: "decidim.accountability") %> + <%= render_resource_last_editor(result) %> +
    + <% end %> +
    + <%= t("results.show.stats.last_updated_at", scope: "decidim.accountability") %> + <%= l result.versions.last.created_at, format: :decidim_short %> +
    + <% end %> + <% if result.linked_resources(:proposals, "included_proposals").any? %> +
    + <%= t("results.show.stats.proposals", scope: "decidim.accountability") %> + <%= stats_calculator.proposals_count %> +
    +
    + <%= t("results.show.stats.meetings", scope: "decidim.accountability") %> + <%= stats_calculator.meetings_count %> +
    +
    + <%= t("results.show.stats.comments", scope: "decidim.accountability") %> + <%= stats_calculator.comments_count %> +
    +
    + <%= t("results.show.stats.attendees", scope: "decidim.accountability") %> + <%= stats_calculator.attendees_count %> +
    +
    + <%= t("results.show.stats.votes", scope: "decidim.accountability") %> + <%= stats_calculator.votes_count %> +
    +
    + <%= t("results.show.stats.contributions", scope: "decidim.accountability") %> + <%= stats_calculator.contributions_count %> +
    + <% end %> +
    +
    + <% end %> + + <%= resource_reference(result) %> + <%= render partial: "decidim/shared/share_modal" %> +
    diff --git a/app/views/decidim/accountability/results/home.html.erb b/app/views/decidim/accountability/results/home.html.erb index 6cbe49e457..19b0758f6e 100644 --- a/app/views/decidim/accountability/results/home.html.erb +++ b/app/views/decidim/accountability/results/home.html.erb @@ -1,27 +1,52 @@ -
    -
    - <%= render partial: "home_header" %> +<% add_decidim_page_title component_name %> +<%= append_javascript_pack_tag "decidim_accountability" %> +<%= append_stylesheet_pack_tag "decidim_accountability" %> + +<% content_for :aside do %> +

    <%= component_name %>

    + + <% if component_settings.display_progress_enabled? %> + <%= cell( + "decidim/accountability/status", + nil, + title: t("decidim.accountability.results.home_header.global_status"), + progress: progress_calculator(current_scope, nil).presence, + extra_classes: "accountability__status__home" + ) %> + <% end %> + + <%= render partial: "scope_filters", locals: { hide_subscopes: current_participatory_space.slug.to_s == "PressupostosParticipatius" } %> + + <%= link_to t("decidim.accountability.results.home_header.csv_download"), Rails.application.routes.url_helpers.export_results_path(current_participatory_space, current_component), class: "button button__sm button__secondary" %> +<% end %> + +<%= render layout: "layouts/decidim/shared/layout_two_col" do %> + +
    +
    <%= decidim_sanitize_admin translated_attribute(component_settings.intro) %>
    +
    + +
    <% if (ENV["PARTICIPATORY_SPACES_WITH_ACCOUNTABILITY_RESULTS"] || "").split(',').include?(current_participatory_space.slug.to_s) %> -
    - <%= render partial: "search" %> -
    -
    - <%= render partial: "scope_filters", locals: { url_method: :results_path } %> -
    -
    - <% if results.any?{|r| r.children_count > 0 } %> - <%= render partial: "results_parent", locals: { results: results, total_count: results.total_count } %> - <% else %> - <%= render partial: "results_leaf", locals: { results: results, total_count: results.total_count } %> - <% end %> -
    + <%= cell "decidim/accountability/results", results %> + <%= decidim_paginate results, order_start_time: params[:order_start_time], with_scope: params.dig(:filter, :with_scope), hide_results_per_page_selector: true %> <% else %> + + <% if first_class_categories.empty? %> + <%= cell("decidim/announcement", + params[:filter].present? ? + t("empty_filters", scope: "decidim.accountability.results.home") : + t("empty", scope: "decidim.accountability.results.home")) %> + <% end %> + <% if current_participatory_space.slug.to_s == "PressupostosParticipatius" %> <%= render partial: "home_scopes" %> <% end %> - <%= render partial: "home_categories", locals: { show_category_image: (ENV["PARTICIPATORY_SPACES_WITH_CATEGORY_IMAGES"] || "").split(",").include?(current_participatory_space.slug.to_s) } %> + + <%= render partial: "home_categories", + locals: { children: first_class_categories.select { |category| category.subcategories.any? }.any?, + show_category_image: (ENV["PARTICIPATORY_SPACES_WITH_CATEGORY_IMAGES"] || "").split(",").include?(current_participatory_space.slug.to_s) } %> <% end %> -
    -
    + -<%= javascript_pack_tag "decidim_accountability" %> +<% end %> diff --git a/app/views/decidim/accountability/results/index.html.erb b/app/views/decidim/accountability/results/index.html.erb new file mode 100644 index 0000000000..dc27a5397d --- /dev/null +++ b/app/views/decidim/accountability/results/index.html.erb @@ -0,0 +1,17 @@ +<%= append_javascript_pack_tag "decidim_accountability" %> +<%= append_stylesheet_pack_tag "decidim_accountability" %> + +<% content_for :aside do %> + <%= render partial: "projects_aside", locals: { main_action: true } %> +<% end %> + +<%= render layout: "layouts/decidim/shared/layout_two_col" do %> +
    +

    <%= category.present? ? decidim_escape_translated(category.name) : t("decidim.accountability.results.home_header.global_status") %>

    +
    + +
    + <%= cell "decidim/accountability/results", results %> + <%= decidim_paginate results, order_start_time: params[:order_start_time], with_scope: params.dig(:filter, :with_scope), hide_results_per_page_selector: true %> +
    +<% end %> diff --git a/app/views/decidim/forms/admin/questionnaires/answers/show.html.erb b/app/views/decidim/forms/admin/questionnaires/answers/show.html.erb index 8b2f02a51d..78a5e2aebf 100644 --- a/app/views/decidim/forms/admin/questionnaires/answers/show.html.erb +++ b/app/views/decidim/forms/admin/questionnaires/answers/show.html.erb @@ -1,18 +1,13 @@
    -
    -

    +
    +

    <%= t ".title", number: current_idx + 1 %> -
    - <%= link_to_unless last?, t("views.pagination.next").html_safe, next_url, rel: "next", class: "button tiny button--title next" %> -
    -
    - <%= link_to_unless first?, t("views.pagination.previous").html_safe, prev_url, rel: "prev", class: "button tiny button--title prev" %> -
    -
    - <%= link_to t("actions.export", scope: "decidim.forms.admin.questionnaires.answers"), questionnaire_export_response_url(@participant.session_token), class: "button tiny button--title export" %> - <%= link_to t("actions.back", scope: "decidim.forms.admin.questionnaires.answers"), questionnaire_participants_url, class: "button tiny button--title back" %> -
    -

    + + <%= link_to t("actions.next", scope: "decidim.forms.admin.questionnaires.answers").html_safe, next_url, rel: "next", class: "button button__sm button__secondary next" unless last? %> + <%= link_to t("actions.previous", scope: "decidim.forms.admin.questionnaires.answers").html_safe, prev_url, rel: "prev", class: "button button__sm button__secondary prev" unless first? %> + <%= link_to t("actions.export", scope: "decidim.forms.admin.questionnaires.answers"), questionnaire_export_response_url(@participant.session_token), class: "button button__sm button__secondary export" %> + <%= link_to t("actions.back", scope: "decidim.forms.admin.questionnaires.answers"), questionnaire_participants_url, class: "button button__sm button__secondary back" %> +

    @@ -20,10 +15,10 @@ <%= t("session_token", scope: "decidim.forms.user_answers_serializer") %> - <%= t("user_status", scope: "decidim.forms.user_answers_serializer") %> - <%= t("ip_hash", scope: "decidim.forms.user_answers_serializer") %> - <%= t("completion", scope: "decidim.forms.user_answers_serializer") %> - <%= t("created_at", scope: "decidim.forms.user_answers_serializer") %> + <%= t("user_status", scope: "decidim.forms.user_answers_serializer") %> + <%= t("ip_hash", scope: "decidim.forms.user_answers_serializer") %> + <%= t("completion", scope: "decidim.forms.user_answers_serializer") %> + <%= t("created_at", scope: "decidim.forms.user_answers_serializer") %> @@ -38,9 +33,9 @@
    -
    +
    <% @participant.answers.each do |answer| %> -
    <%= answer.question %>
    +
    <%= answer.question %>
    <%= answer.body %>
    <% end %>
    diff --git a/app/views/decidim/initiatives/initiative_signatures/fill_personal_data.html.erb b/app/views/decidim/initiatives/initiative_signatures/fill_personal_data.html.erb index 9159bbb4aa..310d69f7f3 100644 --- a/app/views/decidim/initiatives/initiative_signatures/fill_personal_data.html.erb +++ b/app/views/decidim/initiatives/initiative_signatures/fill_personal_data.html.erb @@ -1,44 +1,33 @@ -
    -

    -<%= t ".help" %> -

    -
    -

    <%= t(step, scope: "layouts.decidim.initiative_signature_creation_header") %>

    +<%= cell("decidim/announcement", t("decidim.initiatives.initiative_signatures.fill_personal_data.help"), callout_class: "secondary") %> -<%= render partial: "wizard_steps" %> +<%= decidim_form_for(@form, url: fill_personal_data_initiative_signatures_path, method: :put) do |f| %> + <%= form_required_explanation %> +
    +
    + <%= f.text_field :name_and_surname, autofocus: true, required: true %> +
    -
    -
    - <%= decidim_form_for(@form, url: next_wizard_path, method: :put, html: { class: "form user_personal_data_signature_form" }) do |f| %> - <%= form_required_explanation %> -
    -
    - <%= f.text_field :name_and_surname, autofocus: true, required: true %> -
    +
    + <%= f.text_field :document_number, required: true %> +
    <%= t(".document_hint") %>
    +
    -
    - <%= f.text_field :document_number, required: true %> -

    <%= t('.document_hint') %>

    -
    +
    + <%= f.date_field :date_of_birth, min: 120.years.ago.to_date, max: 16.years.ago.to_date, value: 35.years.ago.to_date %> +
    -
    - <%= f.date_select :date_of_birth, start_year: 1900, end_year: 16.years.ago.year, default: 35.years.ago, prompt: { day: t(".date_select.day"), month: t(".date_select.month"), year: t(".date_select.year") } %> -
    +
    + <%= f.text_field :postal_code, required: true %> +
    -
    - <%= f.text_field :postal_code, required: true %> -
    - -
    - - <%= decidim_sanitize_editor translated_attribute(extra_data_legal_information) %> - -
    -
    +
    + + <%= decidim_sanitize_editor translated_attribute(extra_data_legal_information) %> + +
    +
    -
    - <%= f.submit t(".continue"), class: "button expanded" %> -
    - <% end %> +
    + <%= f.submit t(".continue"), class: "button button__sm md:button__lg button__secondary" %>
    -
    +<% end %> diff --git a/app/views/decidim/initiatives/initiatives/_progress_bar.html.erb b/app/views/decidim/initiatives/initiatives/_progress_bar.html.erb index de02dcf357..9d0ee1bfbc 100644 --- a/app/views/decidim/initiatives/initiatives/_progress_bar.html.erb +++ b/app/views/decidim/initiatives/initiatives/_progress_bar.html.erb @@ -2,23 +2,19 @@ <% current_initiative.votable_initiative_type_scopes.each_with_index do |type_scope, index| %> <% if index == 0 %> <%= cell( - "decidim/progress_bar", - current_initiative.supports_count_for(type_scope.scope), - total: current_initiative.supports_required_for(type_scope.scope), - units_name: "decidim.initiatives.initiatives.votes_count.count", - element_id: "initiative-#{current_initiative.id}-votes-count", - subtitle_text: current_initiative.supports_goal_reached? ? t("decidim.initiatives.initiatives.votes_count.most_popular_initiative") : t("decidim.initiatives.initiatives.votes_count.need_more_votes"), - small: false - ) %> + "decidim/progress_bar", + current_initiative.supports_count_for(type_scope.scope), + total: current_initiative.supports_required_for(type_scope.scope), + units_name: "decidim.initiatives.initiatives.votes_count.count", + element_id: "initiative-#{current_initiative.id}-votes-count" + ) %> <% else %> <%= cell( - "decidim/progress_bar", - current_initiative.supports_count_for(type_scope.scope), - total: current_initiative.supports_required_for(type_scope.scope), - subtitle_text: translated_attribute(type_scope.scope_name), - element_id: "initiative-scope-#{type_scope.id}-#{current_initiative.id}-votes-count", - horizontal: true - ) %> + "decidim/progress_bar", + current_initiative.supports_count_for(type_scope.scope), + total: current_initiative.supports_required_for(type_scope.scope), + element_id: "initiative-scope-#{type_scope.id}-#{current_initiative.id}-votes-count" + ) %> <% end %> <% end %>
    diff --git a/app/views/decidim/meetings/meetings/_meeting_agenda.html.erb b/app/views/decidim/meetings/meetings/_meeting_agenda.html.erb index ba04274198..ee7059a1eb 100644 --- a/app/views/decidim/meetings/meetings/_meeting_agenda.html.erb +++ b/app/views/decidim/meetings/meetings/_meeting_agenda.html.erb @@ -1,31 +1,34 @@ -
    -
    -

    <%= translated_attribute(meeting.agenda.title) %>

    +
    +
    + <%= icon "list-ordered" %> +

    <%= translated_attribute(meeting.agenda.title) %>

    -
    -
    - <% agenda_items_times = calculate_start_and_end_time_of_agenda_items(meeting.agenda.agenda_items.first_class, meeting) %> - <% zero_duration = any_zero_duration_event?(meeting.agenda.agenda_items.first_class, meeting) %> - <% meeting.agenda.agenda_items.first_class.each_with_index do |agenda_item, index| %> -
    - <%= translated_attribute(agenda_item.title) %>  - <%= zero_duration ? "" : display_duration_agenda_items(agenda_item.id, index, agenda_items_times) %> -
    -
    -

    <%= translated_attribute(agenda_item.description).html_safe %>

    - <% if agenda_item.agenda_item_children.presence %> - <% parent_start_time = agenda_items_times[index][:start_time] %> - <% agenda_item_children_times = calculate_start_and_end_time_of_agenda_items(agenda_item.agenda_item_children, meeting, parent_start_time) %> - <% agenda_item.agenda_item_children.each_with_index do |agenda_item_child, index_child| %> -
    - <%= translated_attribute(agenda_item_child.title) %>  - <%= zero_duration ? "" : display_duration_agenda_items(agenda_item_child.id, index_child, agenda_item_children_times) %> -
    -

    <%= translated_attribute(agenda_item_child.description).html_safe %>

    - <% end %> + <% agenda_items_times = calculate_start_and_end_time_of_agenda_items(meeting.agenda.agenda_items.first_class, meeting) %> + <% zero_duration = any_zero_duration_event?(meeting.agenda.agenda_items.first_class, meeting) %> + <% meeting.agenda.agenda_items.first_class.each_with_index do |agenda_item, index| %> +
    +

    + <%= translated_attribute(agenda_item.title) %> + <%= zero_duration ? "" : display_duration_agenda_items(agenda_item.id, index, agenda_items_times) %> +

    + +
    <%= decidim_sanitize(translated_attribute(agenda_item.description)).html_safe %>
    + + <% if agenda_item.agenda_item_children.presence %> + <% parent_start_time = agenda_items_times[index][:start_time] %> + <% agenda_item_children_times = calculate_start_and_end_time_of_agenda_items(agenda_item.agenda_item_children, meeting, parent_start_time) %> + + <% agenda_item.agenda_item_children.each_with_index do |agenda_item_child, index_child| %> +
    +

    + <%= translated_attribute(agenda_item_child.title) %> + <%= zero_duration ? "" : display_duration_agenda_items(agenda_item_child.id, index_child, agenda_item_children_times) %> +

    +
    <%= decidim_sanitize(translated_attribute(agenda_item_child.description)).html_safe %>
    +
    <% end %> <% end %>
    -
    -
    + <% end %> +
    diff --git a/app/views/decidim/participatory_spaces/_result.html.erb b/app/views/decidim/participatory_spaces/_result.html.erb new file mode 100644 index 0000000000..65cebbba46 --- /dev/null +++ b/app/views/decidim/participatory_spaces/_result.html.erb @@ -0,0 +1,32 @@ +
    + <%= icon "actions", class: "card--list__icon", role: "img", "aria-hidden": true, remove_icon_class: true %> + + <%= link_to resource_locator(result).path, class: "card--list__text card__link card__link--block" do %> +

    + <%= translated_attribute(result.title) %> +

    + +
    + <% if result.start_date %> + <%= t("models.result.fields.start_date", scope: "decidim.accountability") %> + <%= l result.start_date, format: :short %> + <% end %> + + <% if result.end_date %> + <%= t("models.result.fields.end_date", scope: "decidim.accountability") %> + <%= l result.end_date, format: :short %> + <% end %> + + <% if result.status %> + <%= t("models.result.fields.status", scope: "decidim.accountability") %> + <%= translated_attribute(result.status.name) %> + <% end %> +
    + <% end %> + + <% if result.progress.present? && !Decidim::Accountability::Result.not_computable_results.include?(result.id) %> +
    + <%= display_percentage result.progress %> +
    + <% end %> +
    diff --git a/app/views/layouts/decidim/_initiative_header_steps.html.erb b/app/views/layouts/decidim/_initiative_header_steps.html.erb deleted file mode 100644 index 42804f0e61..0000000000 --- a/app/views/layouts/decidim/_initiative_header_steps.html.erb +++ /dev/null @@ -1,14 +0,0 @@ -<% if initiative.has_signature_interval_defined? %> -
    -
    - - <%= t(".signature_collection_period") %> - - - <%= l(initiative.signature_start_date, format: :default) %> - → - <%= l(initiative.signature_end_date, format: :default) %> - -
    -
    -<% end %> diff --git a/app/views/layouts/decidim/mailer.html.erb b/app/views/layouts/decidim/mailer.html.erb index 0e4f54c93d..c3ac566262 100644 --- a/app/views/layouts/decidim/mailer.html.erb +++ b/app/views/layouts/decidim/mailer.html.erb @@ -44,17 +44,6 @@ - - - - -
    - <% if @organization.official_img_header.attached? %> - <%= link_to @organization.official_url do %> - <%= image_tag @organization.attached_uploader(:official_img_header).url(host: @organization.host), alt: "", style: "max-height: 50px", class: "float-right" %> - <% end %> - <% end %> -
    @@ -105,7 +94,6 @@ - <% if content_for?(:note) or content_for?(:unsubscribe) %> @@ -126,6 +114,22 @@ + + +
    +
    + + + + + + + +
    + <%= t("decidim.newsletter_mailer.newsletter.no_reply_notice") %> +
    +
    +
    diff --git a/app/views/layouts/decidim/widget.html.erb b/app/views/layouts/decidim/widget.html.erb deleted file mode 100644 index 6d445ae71d..0000000000 --- a/app/views/layouts/decidim/widget.html.erb +++ /dev/null @@ -1,31 +0,0 @@ - - - - <%= decidim_page_title %> - <%= csrf_meta_tags %> - <%= stylesheet_pack_tag "decidim_core" %> - - - - <% if content_for(:header) == "false" %> - <% elsif content_for?(:header) %> - <%= content_for(:header) %> - <% else %> -
    - <%= link_to translated_attribute(current_participatory_space.title), resource_locator(current_participatory_space).path, target: "_blank" %> -
    - <% end %> -
    -
    - - <%= yield %> - -
    -
    - - <%= javascript_pack_tag "decidim_core", defer: false %> - <%= render partial: "layouts/decidim/js_configuration" %> - <%= javascript_pack_tag "decidim_widget" %> - <%= render partial: "layouts/decidim/cors" if Decidim.cors_enabled %> - - diff --git a/app/views/layouts/mailer.html.erb b/app/views/layouts/mailer.html.erb index cbd34d2e9d..3aac9002ed 100644 --- a/app/views/layouts/mailer.html.erb +++ b/app/views/layouts/mailer.html.erb @@ -1,7 +1,7 @@ - + diff --git a/app/views/pages/home/_extended.html.erb b/app/views/pages/home/_extended.html.erb deleted file mode 100644 index 27b7e2598e..0000000000 --- a/app/views/pages/home/_extended.html.erb +++ /dev/null @@ -1,48 +0,0 @@ -
    -
    -
    -

    <%= t(".how_to_participate") %>

    -
    -
    -
    -
    -
    - <%= icon "meetings" %> -
    -
    -

    <%= t(".meetings") %>

    -

    <%= t(".meetings_explanation") %>

    -
    -
    -
    -
    -
    -
    - <%= icon "debates" %> -
    -
    -

    <%= t(".debates") %>

    -

    <%= t(".debates_explanation") %>

    -
    -
    -
    -
    -
    -
    - <%= icon "proposals" %> -
    -
    -

    <%= t(".proposals") %>

    -

    <%= t(".proposals_explanation") %>

    -
    -
    -
    -
    -
    -
    - <%= link_to t(".more_info"), page_path("more-information"), class: "button expanded hollow button--sc" %> -
    -
    -
    -
    diff --git a/app/views/static/_accountability_graph_ca.html.erb b/app/views/static/_accountability_graph_ca.html.erb index 79de7daf68..74d6d813b4 100644 --- a/app/views/static/_accountability_graph_ca.html.erb +++ b/app/views/static/_accountability_graph_ca.html.erb @@ -25,20 +25,20 @@ <%= t("static.accountability.flow_text_4_1") %> <%= t("static.accountability.flow_text_4_2") %> <%= t("static.accountability.flow_text_4_3") %> - - + + - - + + - - + + - - + + diff --git a/app/views/static/_accountability_graph_es.html.erb b/app/views/static/_accountability_graph_es.html.erb index ee59ab5ba4..33ef068784 100644 --- a/app/views/static/_accountability_graph_es.html.erb +++ b/app/views/static/_accountability_graph_es.html.erb @@ -25,20 +25,20 @@ <%= t("static.accountability.flow_text_4_1") %> <%= t("static.accountability.flow_text_4_2") %> <%= t("static.accountability.flow_text_4_3") %> - - + + - - + + - - + + - - + + diff --git a/app/views/static/accountability.html.erb b/app/views/static/accountability.html.erb index bf2d2daf0d..da111dbd4c 100644 --- a/app/views/static/accountability.html.erb +++ b/app/views/static/accountability.html.erb @@ -3,132 +3,118 @@ title: t(".meta_tags.title") }) %> -
    -
    -

    <%= t(".heading") %>

    -

    <%= t(".intro_text") %>

    - -
    -

    <%= t(".topics") %>

    - -
    -
    -
    - <%= link_to DecidimBarcelona::Application.routes.url_helpers.accountability_sections_path(anchor: "planificacio"), class: "card__link" do %> -

    <%= icon "book" %> <%= t(".section_1_title") %>

    - <% end %> +
    +
    +

    <%= t(".heading") %>

    +

    <%= t(".intro_text") %>

    +
    -
    -
      -
    • <%= link_to DecidimBarcelona::Application.routes.url_helpers.accountability_sections_path(anchor: "planificacio"), class: "card__link" do %><%= t(".section_1_item_1") %><% end %>
    • -
    • <%= link_to DecidimBarcelona::Application.routes.url_helpers.accountability_sections_path(anchor: "planificacio"), class: "card__link" do %><%= t(".section_1_item_2") %><% end %>
    • -
    • <%= link_to DecidimBarcelona::Application.routes.url_helpers.accountability_sections_path(anchor: "planificacio"), class: "card__link" do %><%= t(".section_1_item_3") %><% end %>
    • -
    -
    -
    +
    +

    <%= t(".topics") %>

    +
    +
    +
    + <%= link_to DecidimBarcelona::Application.routes.url_helpers.accountability_sections_path("planificacio"), class: "card__link", style: "text-decoration: none;" do %> +

    <%= icon "bookmark-line", style: "display: inline;" %> <%= t(".section_1_title") %>

    + <% end %> +
      +
    • <%= t(".section_1_item_1") %>
    • +
    • <%= t(".section_1_item_2") %>
    • +
    • <%= t(".section_1_item_3") %>
    • +
    +
    -
    -
    - <%= link_to DecidimBarcelona::Application.routes.url_helpers.accountability_sections_path(anchor: "economia"), class: "card__link" do %> -

    <%= icon "graph" %> <%= t(".section_2_title") %>

    - <% end %> - -
    -
      -
    • <%= link_to DecidimBarcelona::Application.routes.url_helpers.accountability_sections_path(anchor: "economia"), class: "card__link" do %><%= t(".section_2_item_1") %><% end %>
    • -
    • <%= link_to DecidimBarcelona::Application.routes.url_helpers.accountability_sections_path(anchor: "economia"), class: "card__link" do %><%= t(".section_2_item_2") %><% end %>
    • -
    • <%= link_to DecidimBarcelona::Application.routes.url_helpers.accountability_sections_path(anchor: "economia"), class: "card__link" do %><%= t(".section_2_item_3") %><% end %>
    • -
    -
    -
    +
    +
    + <%= link_to DecidimBarcelona::Application.routes.url_helpers.accountability_sections_path("economia"), class: "card__link", style: "text-decoration: none;" do %> +

    <%= icon "bar-chart-2-line", style: "display: inline;" %> <%= t(".section_2_title") %>

    + <% end %> +
      +
    • <%= t(".section_2_item_1") %>
    • +
    • <%= t(".section_2_item_2") %>
    • +
    • <%= t(".section_2_item_3") %>
    • +
    -
    -
    -
    - <%= link_to DecidimBarcelona::Application.routes.url_helpers.accountability_sections_path(anchor: "serveis"), class: "card__link" do %> -

    <%= icon "key" %> <%= t(".section_3_title") %>

    - <% end %> - -
    -
      -
    • <%= link_to DecidimBarcelona::Application.routes.url_helpers.accountability_sections_path(anchor: "serveis"), class: "card__link" do %><%= t(".section_3_item_1") %><% end %>
    • -
    • <%= link_to DecidimBarcelona::Application.routes.url_helpers.accountability_sections_path(anchor: "serveis"), class: "card__link" do %><%= t(".section_3_item_2") %><% end %>
    • -
    • <%= link_to DecidimBarcelona::Application.routes.url_helpers.accountability_sections_path(anchor: "serveis"), class: "card__link" do %><%= t(".section_3_item_3") %><% end %>
    • -
    -
    -
    +
    +
    + <%= link_to DecidimBarcelona::Application.routes.url_helpers.accountability_sections_path("serveis"), class: "card__link", style: "text-decoration: none;" do %> +

    <%= icon "key-2-line", style: "display: inline;" %> <%= t(".section_3_title") %>

    + <% end %> +
      +
    • <%= t(".section_3_item_1") %>
    • +
    • <%= t(".section_3_item_2") %>
    • +
    • <%= t(".section_3_item_3") %>
    • +
    +
    -
    -
    - <%= link_to DecidimBarcelona::Application.routes.url_helpers.accountability_sections_path(anchor: "etica"), class: "card__link" do %> -

    <%= icon "home" %> <%= t(".section_4_title") %>

    - <% end %> - -
    -
      -
    • <%= link_to DecidimBarcelona::Application.routes.url_helpers.accountability_sections_path(anchor: "etica"), class: "card__link" do %><%= t(".section_4_item_1") %><% end %>
    • -
    • <%= link_to DecidimBarcelona::Application.routes.url_helpers.accountability_sections_path(anchor: "etica"), class: "card__link" do %><%= t(".section_4_item_2") %><% end %>
    • -
    • <%= link_to DecidimBarcelona::Application.routes.url_helpers.accountability_sections_path(anchor: "etica"), class: "card__link" do %><%= t(".section_4_item_3") %><% end %>
    • -
    -
    -
    +
    +
    + <%= link_to DecidimBarcelona::Application.routes.url_helpers.accountability_sections_path("etica"), class: "card__link", style: "text-decoration: none;" do %> +

    <%= icon "home-2-line", style: "display: inline;" %> <%= t(".section_4_title") %>

    + <% end %> +
      +
    • <%= t(".section_4_item_1") %>
    • +
    • <%= t(".section_4_item_2") %>
    • +
    • <%= t(".section_4_item_3") %>
    • +
    -
    - -
    -

    <%= t(".flow_section_heading") %>

    -

    <%= t(".flow_intro_text") %>

    - - <%= render "accountability_graph_#{I18n.locale}" %> -
    - -
    -

    <%= t(".citizens_section_heading") %>

    -

    <%= t(".citizens_section_intro_text") %>

    - -
    - +
    +
    + +
    +

    <%= t(".flow_section_heading") %>

    +
    +

    <%= t(".flow_intro_text") %>

    +
    + <%= render "accountability_graph_#{I18n.locale}" %>
    - -
    -
    + +
    +

    <%= t(".citizens_section_heading") %>

    +
    +

    <%= t(".citizens_section_intro_text") %>

    +
    +
    +
    + <%= image_pack_tag "media/images/canals.jpg" %>
    - -
    - -
    - +
    +
    +
    + <%= image_pack_tag "media/images/logo_decidim.png" %> +
    +
    + "> +

    <%= t(".citizens_card_2_title") %>

    +
    + <%== t(".citizens_card_2_text") %> +
    +
    +
    +
    + <%= image_pack_tag "media/images/trobades.jpg" %> +
    +
    + "> +

    <%= t(".citizens_card_3_title") %>

    +
    + <%== t(".citizens_card_3_text") %> +
    +
    -
    -
    +
    +
    diff --git a/app/views/static/accountability_sections.html.erb b/app/views/static/accountability_sections.html.erb index 213b3e0388..08c9caf99a 100644 --- a/app/views/static/accountability_sections.html.erb +++ b/app/views/static/accountability_sections.html.erb @@ -2,141 +2,41 @@ description: t(".meta_tags.description"), title: t(".meta_tags.title") }) %> +
    +
    +

    <%= t(".heading") %>

    +

    <%= t(".intro_text") %>

    +
    -
    -
    -
    -

    <%= t(".heading") %>

    -

    <%= t(".intro_text") %>

    -
    - -
    -
    - -
    -
    -
    -
    -
    -

    <%= t(".tab_1_heading_1") %>

    -
    - <%== t(".tab_1_text_1") %> - - <%= icon "link-intact" %> <%= t(".go_to_link") %> -
    -
    - -
    -

    <%= t(".tab_1_heading_2") %>

    -
    - <%== t(".tab_1_text_2") %> - - <%= icon "link-intact" %> <%= t(".go_to_link") %> -
    -
    - -
    -

    <%= t(".tab_1_heading_3") %>

    -
    - <%== t(".tab_1_text_3") %> - - <%= icon "link-intact" %> <%= t(".go_to_link") %> -
    -
    -
    - -
    -
    -

    <%= t(".tab_2_heading_1") %>

    -
    - <%== t(".tab_2_text_1") %> -
    - -

    <%= t(".tab_2_heading_2") %>

    - -
    - - - -
    -

    <%= t(".tab_2_heading_4") %>

    -
    - <%== t(".tab_2_text_4") %> -
    -
    -
    - -
    -
    -

    <%= t(".tab_3_heading_1") %>

    - - <%== t(".tab_3_text_1") %> -
    - -
    - -
    -
    -

    <%= t(".tab_4_heading_1") %>

    - <%== t(".tab_4_text_1") %> -
    - -
    -

    <%= t(".tab_4_heading_2") %>

    -
    - <%== t(".tab_4_text_2") %> -
    -
    - -
    -

    <%= t(".tab_4_heading_3") %>

    -
    - <%== t(".tab_4_text_3") %> -
    -
    - -
    -

    <%= t(".tab_4_heading_4") %>

    -
    - <%== t(".tab_4_text_4") %> -
    -
    - -
    - -
    +
    + + +
    + <% sections[current_section.to_sym].times do |i| %> +
    +

    <%= t(".#{current_section}.heading_#{i}") %>

    +
    + <%== t(".#{current_section}.text_#{i}") %>
    -
    -
    -
    - + <% unless t(".#{current_section}.link_#{i}", default: "").empty? %> + + <% end %> + + <% end %> +
    diff --git a/app/views/static/api/docs/directive/deprecated/index.html b/app/views/static/api/docs/directive/deprecated/index.html index c07c3e77ad..7d9070e5a5 100644 --- a/app/views/static/api/docs/directive/deprecated/index.html +++ b/app/views/static/api/docs/directive/deprecated/index.html @@ -277,6 +277,13 @@

    +
  • + + LocalizedCustomFields + +
  • + +
  • LocalizedString @@ -431,6 +438,13 @@

  • +
  • + + ParticipatorySpaceManifest + +
  • + +
  • Post @@ -487,6 +501,13 @@

  • +
  • + + QuantifiableTranslatedField + +
  • + +
  • Question @@ -620,6 +641,13 @@

  • +
  • + + TranslatedCustomFields + +
  • + +
  • TranslatedField @@ -1054,6 +1082,13 @@

  • +
  • + + oneOf + +
  • + +
  • skip diff --git a/app/views/static/api/docs/directive/include/index.html b/app/views/static/api/docs/directive/include/index.html index 855624bf0e..ba0d8195dd 100644 --- a/app/views/static/api/docs/directive/include/index.html +++ b/app/views/static/api/docs/directive/include/index.html @@ -276,6 +276,13 @@

  • +
  • + + LocalizedCustomFields + +
  • + +
  • LocalizedString @@ -430,6 +437,13 @@

  • +
  • + + ParticipatorySpaceManifest + +
  • + +
  • Post @@ -486,6 +500,13 @@

  • +
  • + + QuantifiableTranslatedField + +
  • + +
  • Question @@ -619,6 +640,13 @@

  • +
  • + + TranslatedCustomFields + +
  • + +
  • TranslatedField @@ -1053,6 +1081,13 @@

  • +
  • + + oneOf + +
  • + +
  • skip diff --git a/app/views/static/api/docs/directive/index.html b/app/views/static/api/docs/directive/index.html index b19276d6df..db99564ed3 100644 --- a/app/views/static/api/docs/directive/index.html +++ b/app/views/static/api/docs/directive/index.html @@ -248,6 +248,13 @@
  • +
  • + + LocalizedCustomFields + +
  • + +
  • LocalizedString @@ -402,6 +409,13 @@
  • +
  • + + ParticipatorySpaceManifest + +
  • + +
  • Post @@ -458,6 +472,13 @@
  • +
  • + + QuantifiableTranslatedField + +
  • + +
  • Question @@ -591,6 +612,13 @@
  • +
  • + + TranslatedCustomFields + +
  • + +
  • TranslatedField @@ -1025,6 +1053,13 @@
  • +
  • + + oneOf + +
  • + +
  • skip diff --git a/app/views/static/api/docs/directive/oneof/index.html b/app/views/static/api/docs/directive/oneof/index.html new file mode 100644 index 0000000000..f624cd0a92 --- /dev/null +++ b/app/views/static/api/docs/directive/oneof/index.html @@ -0,0 +1,1081 @@ +

    +oneOf

    +

    Requires that exactly one field must be supplied and that field must not be null.

    +

    +Locations

    +
      +
    • INPUT_OBJECT
    • +
    + + + +
    + +
    diff --git a/app/views/static/api/docs/directive/skip/index.html b/app/views/static/api/docs/directive/skip/index.html index 1fb2552b3c..c5a4ff8ffa 100644 --- a/app/views/static/api/docs/directive/skip/index.html +++ b/app/views/static/api/docs/directive/skip/index.html @@ -276,6 +276,13 @@

  • +
  • + + LocalizedCustomFields + +
  • + +
  • LocalizedString @@ -430,6 +437,13 @@

  • +
  • + + ParticipatorySpaceManifest + +
  • + +
  • Post @@ -486,6 +500,13 @@

  • +
  • + + QuantifiableTranslatedField + +
  • + +
  • Question @@ -619,6 +640,13 @@

  • +
  • + + TranslatedCustomFields + +
  • + +
  • TranslatedField @@ -1053,6 +1081,13 @@

  • +
  • + + oneOf + +
  • + +
  • skip diff --git a/app/views/static/api/docs/enum/__directivelocation/index.html b/app/views/static/api/docs/enum/__directivelocation/index.html index b6de830ac1..b3cc651342 100644 --- a/app/views/static/api/docs/enum/__directivelocation/index.html +++ b/app/views/static/api/docs/enum/__directivelocation/index.html @@ -92,6 +92,11 @@

    INPUT_FIELD_DEFINITION

    Location adjacent to an input object field definition.

    +
    +

    +VARIABLE_DEFINITION

    +
    +

    Location adjacent to a variable definition.

  • +
    + manifest (ParticipatorySpaceManifest!) +
    +

    The manifest information for the participatory space.

    +
    +
    components ([ComponentInterface!])
    @@ -315,6 +321,13 @@

    +
  • + + LocalizedCustomFields + +
  • + +
  • LocalizedString @@ -469,6 +482,13 @@

  • +
  • + + ParticipatorySpaceManifest + +
  • + +
  • Post @@ -525,6 +545,13 @@

  • +
  • + + QuantifiableTranslatedField + +
  • + +
  • Question @@ -658,6 +685,13 @@

  • +
  • + + TranslatedCustomFields + +
  • + +
  • TranslatedField @@ -1092,6 +1126,13 @@

  • +
  • + + oneOf + +
  • + +
  • skip diff --git a/app/views/static/api/docs/interface/participatoryspaceresourceableinterface/index.html b/app/views/static/api/docs/interface/participatoryspaceresourceableinterface/index.html index 4e9780eb95..4c7cccce7d 100644 --- a/app/views/static/api/docs/interface/participatoryspaceresourceableinterface/index.html +++ b/app/views/static/api/docs/interface/participatoryspaceresourceableinterface/index.html @@ -261,6 +261,13 @@

  • +
  • + + LocalizedCustomFields + +
  • + +
  • LocalizedString @@ -415,6 +422,13 @@

  • +
  • + + ParticipatorySpaceManifest + +
  • + +
  • Post @@ -471,6 +485,13 @@

  • +
  • + + QuantifiableTranslatedField + +
  • + +
  • Question @@ -604,6 +625,13 @@

  • +
  • + + TranslatedCustomFields + +
  • + +
  • TranslatedField @@ -1038,6 +1066,13 @@

  • +
  • + + oneOf + +
  • + +
  • skip diff --git a/app/views/static/api/docs/interface/questionnaireentityinterface/index.html b/app/views/static/api/docs/interface/questionnaireentityinterface/index.html index c01d9a260c..961ea6b558 100644 --- a/app/views/static/api/docs/interface/questionnaireentityinterface/index.html +++ b/app/views/static/api/docs/interface/questionnaireentityinterface/index.html @@ -260,6 +260,13 @@

  • +
  • + + LocalizedCustomFields + +
  • + +
  • LocalizedString @@ -414,6 +421,13 @@

  • +
  • + + ParticipatorySpaceManifest + +
  • + +
  • Post @@ -470,6 +484,13 @@

  • +
  • + + QuantifiableTranslatedField + +
  • + +
  • Question @@ -603,6 +624,13 @@

  • +
  • + + TranslatedCustomFields + +
  • + +
  • TranslatedField @@ -1037,6 +1065,13 @@

  • +
  • + + oneOf + +
  • + +
  • skip diff --git a/app/views/static/api/docs/interface/scopableinterface/index.html b/app/views/static/api/docs/interface/scopableinterface/index.html index a96e506cda..291c9c00aa 100644 --- a/app/views/static/api/docs/interface/scopableinterface/index.html +++ b/app/views/static/api/docs/interface/scopableinterface/index.html @@ -267,6 +267,13 @@

  • +
  • + + LocalizedCustomFields + +
  • + +
  • LocalizedString @@ -421,6 +428,13 @@

  • +
  • + + ParticipatorySpaceManifest + +
  • + +
  • Post @@ -477,6 +491,13 @@

  • +
  • + + QuantifiableTranslatedField + +
  • + +
  • Question @@ -610,6 +631,13 @@

  • +
  • + + TranslatedCustomFields + +
  • + +
  • TranslatedField @@ -1044,6 +1072,13 @@

  • +
  • + + oneOf + +
  • + +
  • skip diff --git a/app/views/static/api/docs/interface/servicesinterface/index.html b/app/views/static/api/docs/interface/servicesinterface/index.html index 1382a1bd8b..aae0cdf187 100644 --- a/app/views/static/api/docs/interface/servicesinterface/index.html +++ b/app/views/static/api/docs/interface/servicesinterface/index.html @@ -260,6 +260,13 @@

  • +
  • + + LocalizedCustomFields + +
  • + +
  • LocalizedString @@ -414,6 +421,13 @@

  • +
  • + + ParticipatorySpaceManifest + +
  • + +
  • Post @@ -470,6 +484,13 @@

  • +
  • + + QuantifiableTranslatedField + +
  • + +
  • Question @@ -603,6 +624,13 @@

  • +
  • + + TranslatedCustomFields + +
  • + +
  • TranslatedField @@ -1037,6 +1065,13 @@

  • +
  • + + oneOf + +
  • + +
  • skip diff --git a/app/views/static/api/docs/interface/timestampsinterface/index.html b/app/views/static/api/docs/interface/timestampsinterface/index.html index 5428c2f025..ea822f1d5b 100644 --- a/app/views/static/api/docs/interface/timestampsinterface/index.html +++ b/app/views/static/api/docs/interface/timestampsinterface/index.html @@ -271,6 +271,13 @@

  • +
  • + + LocalizedCustomFields + +
  • + +
  • LocalizedString @@ -425,6 +432,13 @@

  • +
  • + + ParticipatorySpaceManifest + +
  • + +
  • Post @@ -481,6 +495,13 @@

  • +
  • + + QuantifiableTranslatedField + +
  • + +
  • Question @@ -614,6 +635,13 @@

  • +
  • + + TranslatedCustomFields + +
  • + +
  • TranslatedField @@ -1048,6 +1076,13 @@

  • +
  • + + oneOf + +
  • + +
  • skip diff --git a/app/views/static/api/docs/interface/traceableinterface/index.html b/app/views/static/api/docs/interface/traceableinterface/index.html index ce89493839..0d6954e4ff 100644 --- a/app/views/static/api/docs/interface/traceableinterface/index.html +++ b/app/views/static/api/docs/interface/traceableinterface/index.html @@ -268,6 +268,13 @@

  • +
  • + + LocalizedCustomFields + +
  • + +
  • LocalizedString @@ -422,6 +429,13 @@

  • +
  • + + ParticipatorySpaceManifest + +
  • + +
  • Post @@ -478,6 +492,13 @@

  • +
  • + + QuantifiableTranslatedField + +
  • + +
  • Question @@ -611,6 +632,13 @@

  • +
  • + + TranslatedCustomFields + +
  • + +
  • TranslatedField @@ -1045,6 +1073,13 @@

  • +
  • + + oneOf + +
  • + +
  • skip diff --git a/app/views/static/api/docs/mutation/comment/index.html b/app/views/static/api/docs/mutation/comment/index.html index a26a98f342..8afb624217 100644 --- a/app/views/static/api/docs/mutation/comment/index.html +++ b/app/views/static/api/docs/mutation/comment/index.html @@ -285,6 +285,13 @@

  • +
  • + + LocalizedCustomFields + +
  • + +
  • LocalizedString @@ -439,6 +446,13 @@

  • +
  • + + ParticipatorySpaceManifest + +
  • + +
  • Post @@ -495,6 +509,13 @@

  • +
  • + + QuantifiableTranslatedField + +
  • + +
  • Question @@ -628,6 +649,13 @@

  • +
  • + + TranslatedCustomFields + +
  • + +
  • TranslatedField @@ -1062,6 +1090,13 @@

  • +
  • + + oneOf + +
  • + +
  • skip diff --git a/app/views/static/api/docs/mutation/commentable/index.html b/app/views/static/api/docs/mutation/commentable/index.html index 90f23b38d5..7dc8000c63 100644 --- a/app/views/static/api/docs/mutation/commentable/index.html +++ b/app/views/static/api/docs/mutation/commentable/index.html @@ -326,6 +326,13 @@

  • +
  • + + LocalizedCustomFields + +
  • + +
  • LocalizedString @@ -480,6 +487,13 @@

  • +
  • + + ParticipatorySpaceManifest + +
  • + +
  • Post @@ -536,6 +550,13 @@

  • +
  • + + QuantifiableTranslatedField + +
  • + +
  • Question @@ -669,6 +690,13 @@

  • +
  • + + TranslatedCustomFields + +
  • + +
  • TranslatedField @@ -1103,6 +1131,13 @@

  • +
  • + + oneOf + +
  • + +
  • skip diff --git a/app/views/static/api/docs/object/__directive/index.html b/app/views/static/api/docs/object/__directive/index.html index 2d11b71ad4..2011650c9d 100644 --- a/app/views/static/api/docs/object/__directive/index.html +++ b/app/views/static/api/docs/object/__directive/index.html @@ -70,6 +70,11 @@

    Use locations.

  • +
    +
    + isRepeatable (Boolean) +
    +
    +
    + description (String) +
    +
    +
    + specifiedByURL (String) +
    +
    +
    +
    + isOneOf (Boolean!) +
    +

    Fields

    -
    - id (ID!) -
    -

    The Component's unique ID

    -
    -
    -
    - name (TranslatedField!) -
    -

    The name of this component.

    -
    -
    -
    - weight (Int!) -
    -

    The weight of the component

    -
    -
    -
    - participatorySpace (ParticipatorySpace!) -
    -

    The participatory space in which this component belongs to.

    -
    -
    result (Result)
    @@ -109,6 +85,30 @@

    +
    +
    + id (ID!) +
    +

    The Component's unique ID

    +
    +
    +
    + name (TranslatedField!) +
    +

    The name of this component.

    +
    +
    +
    + weight (Int!) +
    +

    The weight of the component

    +
    +
    +
    + participatorySpace (ParticipatorySpace!) +
    +

    The participatory space in which this component belongs to.

    +
    -
    - title (TranslatedField!) -
    -

    The graphql_name of this participatory space.

    -
    -
    -
    - type (String!) -
    -

    The participatory space class name. i.e. Decidim::ParticipatoryProcess

    -
    -
    -
    - components ([ComponentInterface!]) -
    -

    Lists the components this space contains.

    - - - - - - - - - - - - - - - - - - - - -
    ArgumentTypeDescription
    filter - ComponentFilter - -

    Provides several methods to filter the results

    -
    order - ComponentSort - -

    Provides several methods to order the results

    -
    -
    -
    -
    - stats ([Statistic]) -
    -
    -
    -
    - attachments ([Attachment]!) -
    -

    This object's attachments

    -
    -
    -
    - linkedParticipatorySpaces ([ParticipatorySpaceLink!]!) -
    -

    Lists all linked participatory spaces in a polymorphic way

    -
    -
    -
    - categories ([Category]!) -
    -

    Categories for this space

    - - - - - - - - - - - - - - - -
    ArgumentTypeDescription
    filter - CategoryFilter - -

    Provides several methods to filter the results

    -
    -
    -
    subtitle (TranslatedField)
    @@ -382,6 +292,102 @@

    Childrens of this assembly

    +

    +
    + categories ([Category]!) +
    +

    Categories for this space

    + + + + + + + + + + + + + + + +
    ArgumentTypeDescription
    filter + CategoryFilter + +

    Provides several methods to filter the results

    +
    +
    +
    +
    + linkedParticipatorySpaces ([ParticipatorySpaceLink!]!) +
    +

    Lists all linked participatory spaces in a polymorphic way

    +
    +
    +
    + attachments ([Attachment]!) +
    +

    This object's attachments

    +
    +
    +
    + title (TranslatedField!) +
    +

    The graphql_name of this participatory space.

    +
    +
    +
    + type (String!) +
    +

    The participatory space class name. i.e. Decidim::ParticipatoryProcess

    +
    +
    +
    + manifest (ParticipatorySpaceManifest!) +
    +

    The manifest information for the participatory space.

    +
    +
    +
    + components ([ComponentInterface!]) +
    +

    Lists the components this space contains.

    + + + + + + + + + + + + + + + + + + + + +
    ArgumentTypeDescription
    filter + ComponentFilter + +

    Provides several methods to filter the results

    +
    order + ComponentSort + +

    Provides several methods to order the results

    +
    +
    +
    +
    + stats ([Statistic]) +
    +
    - type (String!) -
    -

    The commentable's class name. i.e. Decidim::ParticipatoryProcess

    -
    -
    -
    - acceptsNewComments (Boolean!) + reference (String!)
    -

    Whether the object can have new comments or not

    +

    Reference for this meeting

    - commentsHaveAlignment (Boolean!) + title (TranslatedField!)
    -

    Whether the object comments have alignment or not

    +

    The title of this meeting.

    - commentsHaveVotes (Boolean!) + description (TranslatedField)
    -

    Whether the object comments have votes or not

    +

    The description of this meeting.

    - comments ([Comment!]!) + startTime (DateTime!)
    - - - - - - - - - - - - - - - - - - - - -
    ArgumentTypeDescription
    orderBy - String - -

    Order the comments

    -
    singleCommentId - String - -

    ID of the single comment to look at

    -
    +

    The time this meeting starts

    - totalCommentsCount (Int!) + endTime (DateTime!)
    -

    The number of comments in all levels this resource holds

    +

    The time this meeting ends

    - hasComments (Boolean!) + agenda (MeetingAgenda)
    -

    Check if the commentable has comments

    +

    Agenda for this meeting, if available

    - userAllowedToComment (Boolean!) + closed (Boolean!)
    -

    Check if the current user can comment

    +

    Whether this meeting is closed or not.

    - author (Author) + isWithdrawn (Boolean!)
    -

    The resource author

    +

    Whether this meeting is withdrawn or not.

    - category (Category) + closingReport (TranslatedField)
    -

    The object's category

    +

    The closing report of this meeting.

    - scope (Scope) + videoUrl (String)
    -

    The object's scope

    +

    URL for the video of the session, if any

    - attachments ([Attachment]!) + audioUrl (String)
    -

    This object's attachments

    +

    URL for the audio of the session, if any

    @@ -135,183 +101,217 @@

    - services ([MeetingService]!) + attendingOrganizations (String)
    -

    The object's services

    +

    list of attending organizations

    - proposalsFromMeeting ([Proposal]!) + attendeeCount (Int)
    -

    Proposals created in this meeting

    +

    Amount of attendees to this meeting

    - reference (String!) + contributionCount (Int)
    -

    Reference for this meeting

    +

    Amount of contributions to this meeting

    - title (TranslatedField!) + privateMeeting (Boolean!)
    -

    The title of this meeting.

    +

    Whether the meeting is private or not (it can only be true if transparent)

    - description (TranslatedField) + transparent (Boolean!)
    -

    The description of this meeting.

    +

    For private meetings, information is public if transparent

    - startTime (DateTime!) + registrationsEnabled (Boolean!)
    -

    The time this meeting starts

    +

    Whether the registrations are enabled or not

    - endTime (DateTime!) + registrationTerms (TranslatedField)
    -

    The time this meeting ends

    +

    The registration terms

    - agenda (MeetingAgenda) + remainingSlots (Int)
    -

    Agenda for this meeting, if available

    +

    Amount of slots available for this meeting

    - closed (Boolean!) + registrationFormEnabled (Boolean!)
    -

    Whether this meeting is closed or not.

    +

    Whether the registrations have a form or not

    - isWithdrawn (Boolean!) + registrationForm (Questionnaire)
    -

    Whether this meeting is withdrawn or not.

    +

    If registration requires to fill a form, this is the questionnaire

    - closingReport (TranslatedField) + location (TranslatedField)
    -

    The closing report of this meeting.

    +

    The location of this meeting (free format)

    - videoUrl (String) + locationHints (TranslatedField)
    -

    URL for the video of the session, if any

    +

    The location of this meeting (free format)

    - audioUrl (String) + address (String)
    -

    URL for the audio of the session, if any

    +

    The physical address of this meeting (used for geolocation)

    - attendingOrganizations (String) + coordinates (Coordinates)
    -

    list of attending organizations

    +

    Physical coordinates for this meeting

    - attendeeCount (Int) + typeOfMeeting (String!)
    -

    Amount of attendees to this meeting

    +

    The type of the meeting (online or in-person)

    - contributionCount (Int) + onlineMeetingUrl (String!)
    -

    Amount of contributions to this meeting

    +

    The URL of the meeting (when the type is online)

    - privateMeeting (Boolean!) + iframeEmbedType (String)
    -

    Whether the meeting is private or not (it can only be true if transparent)

    +

    The type of displaying of the online meeting URL

    - transparent (Boolean!) + proposalsFromMeeting ([Proposal]!)
    -

    For private meetings, information is public if transparent

    +

    Proposals created in this meeting

    - registrationsEnabled (Boolean!) + services ([MeetingService]!)
    -

    Whether the registrations are enabled or not

    +

    The object's services

    - registrationTerms (TranslatedField) + attachments ([Attachment]!)
    -

    The registration terms

    +

    This object's attachments

    - remainingSlots (Int) + scope (Scope)
    -

    Amount of slots available for this meeting

    +

    The object's scope

    - registrationFormEnabled (Boolean!) + category (Category)
    -

    Whether the registrations have a form or not

    +

    The object's category

    - registrationForm (Questionnaire) + author (Author)
    -

    If registration requires to fill a form, this is the questionnaire

    +

    The resource author

    - location (TranslatedField) + type (String!)
    -

    The location of this meeting (free format)

    +

    The commentable's class name. i.e. Decidim::ParticipatoryProcess

    - locationHints (TranslatedField) + acceptsNewComments (Boolean!)
    -

    The location of this meeting (free format)

    +

    Whether the object can have new comments or not

    - address (String) + commentsHaveAlignment (Boolean!)
    -

    The physical address of this meeting (used for geolocation)

    +

    Whether the object comments have alignment or not

    - coordinates (Coordinates) + commentsHaveVotes (Boolean!)
    -

    Physical coordinates for this meeting

    +

    Whether the object comments have votes or not

    - typeOfMeeting (String!) + comments ([Comment!]!)
    -

    The type of the meeting (online or in-person)

    + + + + + + + + + + + + + + + + + + + + +
    ArgumentTypeDescription
    orderBy + String + +

    Order the comments

    +
    singleCommentId + String + +

    ID of the single comment to look at

    +
    - onlineMeetingUrl (String!) + totalCommentsCount (Int!)
    -

    The URL of the meeting (when the type is online)

    +

    The number of comments in all levels this resource holds

    - iframeEmbedType (String) + hasComments (Boolean!)
    -

    The type of displaying of the online meeting URL

    +

    Check if the commentable has comments

    +
    +
    +
    + userAllowedToComment (Boolean!) +
    +

    Check if the current user can comment

    -
    - title (TranslatedField!) -
    -

    The graphql_name of this participatory space.

    -
    -
    -
    - type (String!) -
    -

    The participatory space class name. i.e. Decidim::ParticipatoryProcess

    -
    -
    -
    - components ([ComponentInterface!]) -
    -

    Lists the components this space contains.

    - - - - - - - - - - - - - - - - - - - - -
    ArgumentTypeDescription
    filter - ComponentFilter - -

    Provides several methods to filter the results

    -
    order - ComponentSort - -

    Provides several methods to order the results

    -
    -
    -
    -
    - stats ([Statistic]) -
    -
    -
    -
    - linkedParticipatorySpaces ([ParticipatorySpaceLink!]!) -
    -

    Lists all linked participatory spaces in a polymorphic way

    -
    -
    -
    - scope (Scope) -
    -

    The object's scope

    -
    -
    -
    - attachments ([Attachment]!) -
    -

    This object's attachments

    -
    -
    -
    - categories ([Category]!) -
    -

    Categories for this space

    - - - - - - - - - - - - - - - -
    ArgumentTypeDescription
    filter - CategoryFilter - -

    Provides several methods to filter the results

    -
    -
    -
    slug (String!)
    @@ -268,6 +172,108 @@

    The participatory process group in which this process belong to

    +

    +
    + categories ([Category]!) +
    +

    Categories for this space

    + + + + + + + + + + + + + + + +
    ArgumentTypeDescription
    filter + CategoryFilter + +

    Provides several methods to filter the results

    +
    +
    +
    +
    + attachments ([Attachment]!) +
    +

    This object's attachments

    +
    +
    +
    + scope (Scope) +
    +

    The object's scope

    +
    +
    +
    + linkedParticipatorySpaces ([ParticipatorySpaceLink!]!) +
    +

    Lists all linked participatory spaces in a polymorphic way

    +
    +
    +
    + title (TranslatedField!) +
    +

    The graphql_name of this participatory space.

    +
    +
    +
    + type (String!) +
    +

    The participatory space class name. i.e. Decidim::ParticipatoryProcess

    +
    +
    +
    + manifest (ParticipatorySpaceManifest!) +
    +

    The manifest information for the participatory space.

    +
    +
    +
    + components ([ComponentInterface!]) +
    +

    Lists the components this space contains.

    + + + + + + + + + + + + + + + + + + + + +
    ArgumentTypeDescription
    filter + ComponentFilter + +

    Provides several methods to filter the results

    +
    order + ComponentSort + +

    Provides several methods to order the results

    +
    +
    +
    +
    + stats ([Statistic]) +
    +
    - startDate (Date) + startDate (DateTime)

    This step's start date

    - endDate (Date) + endDate (DateTime)

    This step's end date

    @@ -309,6 +309,13 @@

    +
  • + + LocalizedCustomFields + +
  • + +
  • LocalizedString @@ -463,6 +470,13 @@

  • +
  • + + ParticipatorySpaceManifest + +
  • + +
  • Post @@ -519,6 +533,13 @@

  • +
  • + + QuantifiableTranslatedField + +
  • + +
  • Question @@ -652,6 +673,13 @@

  • +
  • + + TranslatedCustomFields + +
  • + +
  • TranslatedField @@ -1086,6 +1114,13 @@

  • +
  • + + oneOf + +
  • + +
  • skip diff --git a/app/views/static/api/docs/object/participatoryprocesstype/index.html b/app/views/static/api/docs/object/participatoryprocesstype/index.html index 67a2298aa3..f9c06959a4 100644 --- a/app/views/static/api/docs/object/participatoryprocesstype/index.html +++ b/app/views/static/api/docs/object/participatoryprocesstype/index.html @@ -279,6 +279,13 @@

  • +
  • + + LocalizedCustomFields + +
  • + +
  • LocalizedString @@ -433,6 +440,13 @@

  • +
  • + + ParticipatorySpaceManifest + +
  • + +
  • Post @@ -489,6 +503,13 @@

  • +
  • + + QuantifiableTranslatedField + +
  • + +
  • Question @@ -622,6 +643,13 @@

  • +
  • + + TranslatedCustomFields + +
  • + +
  • TranslatedField @@ -1056,6 +1084,13 @@

  • +
  • + + oneOf + +
  • + +
  • skip diff --git a/app/views/static/api/docs/object/participatoryspace/index.html b/app/views/static/api/docs/object/participatoryspace/index.html index f1f6bb636f..cff697c30b 100644 --- a/app/views/static/api/docs/object/participatoryspace/index.html +++ b/app/views/static/api/docs/object/participatoryspace/index.html @@ -26,6 +26,12 @@

    The participatory space class name. i.e. Decidim::ParticipatoryProcess

  • +
    + manifest (ParticipatorySpaceManifest!) +
    +

    The manifest information for the participatory space.

    +
    +
    components ([ComponentInterface!])
    @@ -312,6 +318,13 @@

    +
  • + + LocalizedCustomFields + +
  • + +
  • LocalizedString @@ -466,6 +479,13 @@

  • +
  • + + ParticipatorySpaceManifest + +
  • + +
  • Post @@ -522,6 +542,13 @@

  • +
  • + + QuantifiableTranslatedField + +
  • + +
  • Question @@ -655,6 +682,13 @@

  • +
  • + + TranslatedCustomFields + +
  • + +
  • TranslatedField @@ -1089,6 +1123,13 @@

  • +
  • + + oneOf + +
  • + +
  • skip diff --git a/app/views/static/api/docs/object/participatoryspacelink/index.html b/app/views/static/api/docs/object/participatoryspacelink/index.html index fe734f60fa..ac9cb8fdae 100644 --- a/app/views/static/api/docs/object/participatoryspacelink/index.html +++ b/app/views/static/api/docs/object/participatoryspacelink/index.html @@ -279,6 +279,13 @@

  • +
  • + + LocalizedCustomFields + +
  • + +
  • LocalizedString @@ -433,6 +440,13 @@

  • +
  • + + ParticipatorySpaceManifest + +
  • + +
  • Post @@ -489,6 +503,13 @@

  • +
  • + + QuantifiableTranslatedField + +
  • + +
  • Question @@ -622,6 +643,13 @@

  • +
  • + + TranslatedCustomFields + +
  • + +
  • TranslatedField @@ -1056,6 +1084,13 @@

  • +
  • + + oneOf + +
  • + +
  • skip diff --git a/app/views/static/api/docs/object/participatoryspacemanifest/index.html b/app/views/static/api/docs/object/participatoryspacemanifest/index.html new file mode 100644 index 0000000000..2c814fb025 --- /dev/null +++ b/app/views/static/api/docs/object/participatoryspacemanifest/index.html @@ -0,0 +1,1090 @@ +

    +ParticipatorySpaceManifest

    +

    A participatory manifest

    +

    +Fields

    +
    + name (String!) +
    +

    The name of the manifest

    +
    +
    +
    + humanName (QuantifiableTranslatedField!) +
    +

    The human readable name for the manifest

    +
    +
    + + + +
    + +
    diff --git a/app/views/static/api/docs/object/post/index.html b/app/views/static/api/docs/object/post/index.html index c8ff155ee8..92b189cb57 100644 --- a/app/views/static/api/docs/object/post/index.html +++ b/app/views/static/api/docs/object/post/index.html @@ -19,6 +19,72 @@

    The internal ID of this post

  • +
    + title (TranslatedField) +
    +

    The title for this post

    +
    +
    +
    + body (TranslatedField) +
    +

    The body of this post

    +
    +
    +
    + publishedAt (DateTime!) +
    +

    The time this page was published

    +
    +
    +
    + createdAt (DateTime) +
    +

    The date and time this object was created

    +
    +
    +
    + updatedAt (DateTime) +
    +

    The date and time this object was updated

    +
    +
    +
    + endorsements ([Author]!) +
    +

    The endorsements of this object.

    +
    +
    +
    + endorsementsCount (Int) +
    +

    The total amount of endorsements the object has received

    +
    +
    +
    + versionsCount (Int!) +
    +

    Total number of versions

    +
    +
    +
    + versions ([TraceVersion]!) +
    +

    This object's versions

    +
    +
    +
    + author (Author) +
    +

    The resource author

    +
    +
    +
    + attachments ([Attachment]!) +
    +

    This object's attachments

    +
    +
    type (String!)
    @@ -94,66 +160,6 @@

    Check if the current user can comment

    -

    -
    - attachments ([Attachment]!) -
    -

    This object's attachments

    -
    -
    -
    - author (Author) -
    -

    The resource author

    -
    -
    -
    - versionsCount (Int!) -
    -

    Total number of versions

    -
    -
    -
    - versions ([TraceVersion]!) -
    -

    This object's versions

    -
    -
    -
    - endorsements ([Author]!) -
    -

    The endorsements of this object.

    -
    -
    -
    - endorsementsCount (Int) -
    -

    The total amount of endorsements the object has received

    -
    -
    -
    - createdAt (DateTime) -
    -

    The date and time this object was created

    -
    -
    -
    - updatedAt (DateTime) -
    -

    The date and time this object was updated

    -
    -
    -
    - title (TranslatedField) -
    -

    The title for this post

    -
    -
    -
    - body (TranslatedField) -
    -

    The body of this post

    -
    - type (String!) + title (TranslatedField)
    -

    The commentable's class name. i.e. Decidim::ParticipatoryProcess

    +

    The title for this title

    - acceptsNewComments (Boolean!) + body (TranslatedField)
    -

    Whether the object can have new comments or not

    +

    The description for this body

    - commentsHaveAlignment (Boolean!) + address (String)
    -

    Whether the object comments have alignment or not

    +

    The physical address (location) of this proposal

    - commentsHaveVotes (Boolean!) + coordinates (Coordinates)
    -

    Whether the object comments have votes or not

    +

    Physical coordinates for this proposal

    - comments ([Comment!]!) + reference (String)
    - - - - - - - - - - - - - - - - - - - - -
    ArgumentTypeDescription
    orderBy - String - -

    Order the comments

    -
    singleCommentId - String - -

    ID of the single comment to look at

    -
    +

    This proposal's unique reference

    - totalCommentsCount (Int!) + state (String)
    -

    The number of comments in all levels this resource holds

    +

    The answer status in which proposal is in

    - hasComments (Boolean!) + answer (TranslatedField)
    -

    Check if the commentable has comments

    +

    The answer feedback for the status for this proposal

    - userAllowedToComment (Boolean!) + answeredAt (DateTime)
    -

    Check if the current user can comment

    +

    The date and time this proposal was answered

    - authorsCount (Int) + publishedAt (DateTime)
    -

    The total amount of co-authors that contributed to the entity. Note that this field may include also non-user authors like meetings or the organization

    +

    The date and time this proposal was published

    - author (Author) + participatoryTextLevel (String)
    -

    The resource author. Note that this can be null on official proposals or meeting-proposals

    +

    If it is a participatory text, the level indicates the type of paragraph

    - authors ([Author]!) + position (Int)
    -

    The resource co-authors. Include only users or groups of users

    +

    Position of this proposal in the participatory text

    - category (Category) + official (Boolean)
    -

    The object's category

    +

    Whether this proposal is official or not

    - scope (Scope) + createdInMeeting (Boolean)
    -

    The object's scope

    +

    Whether this proposal comes from a meeting or not

    - attachments ([Attachment]!) + meeting (Meeting)
    -

    This object's attachments

    +

    If the proposal comes from a meeting, the related meeting

    - fingerprint (Fingerprint!) + voteCount (Int)
    -

    This object's fingerprint

    +

    The total amount of votes the proposal has received

    - amendments ([Amendment]!) + bodyFields (TranslatedCustomFields)
    -

    This object's amendments

    +

    Custom fields for this proposal

    - versionsCount (Int!) + voteWeights (JSON)
    -

    Total number of versions

    +

    The corresponding weights count to the proposal votes

    - versions ([TraceVersion]!) + createdAt (DateTime)
    -

    This object's versions

    +

    The date and time this object was created

    +
    +
    +
    + updatedAt (DateTime) +
    +

    The date and time this object was updated

    @@ -172,105 +150,139 @@

    - createdAt (DateTime) + versionsCount (Int!)
    -

    The date and time this object was created

    +

    Total number of versions

    - updatedAt (DateTime) + versions ([TraceVersion]!)
    -

    The date and time this object was updated

    +

    This object's versions

    - title (TranslatedField) + amendments ([Amendment]!)
    -

    The title for this title

    +

    This object's amendments

    - body (TranslatedField) + fingerprint (Fingerprint!)
    -

    The description for this body

    +

    This object's fingerprint

    - address (String) + attachments ([Attachment]!)
    -

    The physical address (location) of this proposal

    +

    This object's attachments

    - coordinates (Coordinates) + scope (Scope)
    -

    Physical coordinates for this proposal

    +

    The object's scope

    - reference (String) + category (Category)
    -

    This proposal's unique reference

    +

    The object's category

    - state (String) + authorsCount (Int)
    -

    The answer status in which proposal is in

    +

    The total amount of co-authors that contributed to the entity. Note that this field may include also non-user authors like meetings or the organization

    - answer (TranslatedField) + author (Author)
    -

    The answer feedback for the status for this proposal

    +

    The resource author. Note that this can be null on official proposals or meeting-proposals

    - answeredAt (DateTime) + authors ([Author]!)
    -

    The date and time this proposal was answered

    +

    The resource co-authors. Include only users or groups of users

    - publishedAt (DateTime) + type (String!)
    -

    The date and time this proposal was published

    +

    The commentable's class name. i.e. Decidim::ParticipatoryProcess

    - participatoryTextLevel (String) + acceptsNewComments (Boolean!)
    -

    If it is a participatory text, the level indicates the type of paragraph

    +

    Whether the object can have new comments or not

    - position (Int) + commentsHaveAlignment (Boolean!)
    -

    Position of this proposal in the participatory text

    +

    Whether the object comments have alignment or not

    - official (Boolean) + commentsHaveVotes (Boolean!)
    -

    Whether this proposal is official or not

    +

    Whether the object comments have votes or not

    - createdInMeeting (Boolean) + comments ([Comment!]!)
    -

    Whether this proposal comes from a meeting or not

    + + + + + + + + + + + + + + + + + + + + +
    ArgumentTypeDescription
    orderBy + String + +

    Order the comments

    +
    singleCommentId + String + +

    ID of the single comment to look at

    +
    - meeting (Meeting) + totalCommentsCount (Int!)
    -

    If the proposal comes from a meeting, the related meeting

    +

    The number of comments in all levels this resource holds

    - voteCount (Int) + hasComments (Boolean!)
    -

    The total amount of votes the proposal has received

    +

    Check if the commentable has comments

    +
    +
    +
    + userAllowedToComment (Boolean!) +
    +

    Check if the current user can comment

    - badge (String!) + directMessagesEnabled (String!)
    -

    A badge for the user group

    +

    If the user making the request is logged in, it will return whether this recipient accepts a conversation or not. It will return false for non-logged requests.

    @@ -57,9 +57,9 @@

    - directMessagesEnabled (String!) + badge (String!)
    -

    If the user making the request is logged in, it will return whether this recipient accepts a conversation or not. It will return false for non-logged requests.

    +

    A badge for the user group

    @@ -314,6 +314,13 @@

    +
  • + + LocalizedCustomFields + +
  • + +
  • LocalizedString @@ -468,6 +475,13 @@

  • +
  • + + ParticipatorySpaceManifest + +
  • + +
  • Post @@ -524,6 +538,13 @@

  • +
  • + + QuantifiableTranslatedField + +
  • + +
  • Question @@ -657,6 +678,13 @@

  • +
  • + + TranslatedCustomFields + +
  • + +
  • TranslatedField @@ -1091,6 +1119,13 @@

  • +
  • + + oneOf + +
  • + +
  • skip diff --git a/app/views/static/api/docs/object/usergroup/index.html b/app/views/static/api/docs/object/usergroup/index.html index 4864b8a0c3..4278127437 100644 --- a/app/views/static/api/docs/object/usergroup/index.html +++ b/app/views/static/api/docs/object/usergroup/index.html @@ -38,12 +38,6 @@

    The user group's profile url

  • -
    - badge (String!) -
    -

    A badge for the user group

    -
    -
    organizationName (String!)
    @@ -56,6 +50,12 @@

    Whether the user group's has been deleted or not

    +
    + badge (String!) +
    +

    A badge for the user group

    +
    +
    members ([User]!)
    @@ -314,6 +314,13 @@

    +
  • + + LocalizedCustomFields + +
  • + +
  • LocalizedString @@ -468,6 +475,13 @@

  • +
  • + + ParticipatorySpaceManifest + +
  • + +
  • Post @@ -524,6 +538,13 @@

  • +
  • + + QuantifiableTranslatedField + +
  • + +
  • Question @@ -657,6 +678,13 @@

  • +
  • + + TranslatedCustomFields + +
  • + +
  • TranslatedField @@ -1091,6 +1119,13 @@

  • +
  • + + oneOf + +
  • + +
  • skip diff --git a/app/views/static/api/docs/operation/mutation/index.html b/app/views/static/api/docs/operation/mutation/index.html index 61bdd18899..135a9715a2 100644 --- a/app/views/static/api/docs/operation/mutation/index.html +++ b/app/views/static/api/docs/operation/mutation/index.html @@ -249,6 +249,13 @@
  • +
  • + + LocalizedCustomFields + +
  • + +
  • LocalizedString @@ -403,6 +410,13 @@
  • +
  • + + ParticipatorySpaceManifest + +
  • + +
  • Post @@ -459,6 +473,13 @@
  • +
  • + + QuantifiableTranslatedField + +
  • + +
  • Question @@ -592,6 +613,13 @@
  • +
  • + + TranslatedCustomFields + +
  • + +
  • TranslatedField @@ -1026,6 +1054,13 @@
  • +
  • + + oneOf + +
  • + +
  • skip diff --git a/app/views/static/api/docs/operation/query/index.html b/app/views/static/api/docs/operation/query/index.html index a4ba6c68af..83818d6c07 100644 --- a/app/views/static/api/docs/operation/query/index.html +++ b/app/views/static/api/docs/operation/query/index.html @@ -3,58 +3,6 @@

    Every GraphQL schema has a root type for both queries and mutations. The query type defines GraphQL operations that retrieve data from the server.

    Fields

    -
    - commentable (Commentable!) -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    ArgumentTypeDescription
    id - String! - -

    The commentable's ID

    -
    type - String! - -

    The commentable's class name. i.e. Decidim::ParticipatoryProcess

    -
    locale - String! - -

    The locale for which to get the comments text

    -
    toggleTranslations - Boolean! - -

    Whether the user asked to toggle the machine translations or not.

    -
    -
    -
    participatoryProcesses ([ParticipatoryProcess!])
    @@ -74,7 +22,7 @@

    ParticipatoryProcessFilter -

    This argument let's you filter the results

    +

    This argument lets you filter the results

    @@ -83,7 +31,7 @@

    ParticipatoryProcessSort -

    This argument let's you order the results

    +

    This argument lets you order the results

    @@ -423,7 +371,7 @@

    ParticipatoryProcessFilter -

    This argument let's you filter the results

    +

    This argument lets you filter the results

    @@ -432,7 +380,7 @@

    ParticipatoryProcessSort -

    This argument let's you order the results

    +

    This argument lets you order the results

    @@ -442,7 +390,7 @@

    assembly (Assembly)
    -

    Finds a assembly

    +

    Finds an assembly

    @@ -465,6 +413,58 @@

    +
    + commentable (Commentable!) +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ArgumentTypeDescription
    id + String! + +

    The commentable's ID

    +
    type + String! + +

    The commentable's class name. i.e. Decidim::ParticipatoryProcess

    +
    locale + String! + +

    The locale for which to get the comments text

    +
    toggleTranslations + Boolean! + +

    Whether the user asked to toggle the machine translations or not.

    +
    +
    +
    initiativesTypes ([InitiativeType!]!)
    @@ -474,7 +474,7 @@

    initiativesType (InitiativeType)
    -

    Finds a initiative type

    +

    Finds an initiative type

    @@ -535,7 +535,7 @@

    initiative (Initiative)
    -

    Finds a initiative

    +

    Finds an initiative

    @@ -804,6 +804,13 @@

    +
  • + + LocalizedCustomFields + +
  • + +
  • LocalizedString @@ -958,6 +965,13 @@

  • +
  • + + ParticipatorySpaceManifest + +
  • + +
  • Post @@ -1014,6 +1028,13 @@

  • +
  • + + QuantifiableTranslatedField + +
  • + +
  • Question @@ -1147,6 +1168,13 @@

  • +
  • + + TranslatedCustomFields + +
  • + +
  • TranslatedField @@ -1581,6 +1609,13 @@

  • +
  • + + oneOf + +
  • + +
  • skip diff --git a/app/views/static/api/docs/scalar/boolean/index.html b/app/views/static/api/docs/scalar/boolean/index.html index 209c37860a..4022ab7c69 100644 --- a/app/views/static/api/docs/scalar/boolean/index.html +++ b/app/views/static/api/docs/scalar/boolean/index.html @@ -247,6 +247,13 @@
  • +
  • + + LocalizedCustomFields + +
  • + +
  • LocalizedString @@ -401,6 +408,13 @@
  • +
  • + + ParticipatorySpaceManifest + +
  • + +
  • Post @@ -457,6 +471,13 @@
  • +
  • + + QuantifiableTranslatedField + +
  • + +
  • Question @@ -590,6 +611,13 @@
  • +
  • + + TranslatedCustomFields + +
  • + +
  • TranslatedField @@ -1024,6 +1052,13 @@
  • +
  • + + oneOf + +
  • + +
  • skip diff --git a/app/views/static/api/docs/scalar/date/index.html b/app/views/static/api/docs/scalar/date/index.html index 98917988db..3e42e3f1cc 100644 --- a/app/views/static/api/docs/scalar/date/index.html +++ b/app/views/static/api/docs/scalar/date/index.html @@ -247,6 +247,13 @@
  • +
  • + + LocalizedCustomFields + +
  • + +
  • LocalizedString @@ -401,6 +408,13 @@
  • +
  • + + ParticipatorySpaceManifest + +
  • + +
  • Post @@ -457,6 +471,13 @@
  • +
  • + + QuantifiableTranslatedField + +
  • + +
  • Question @@ -590,6 +611,13 @@
  • +
  • + + TranslatedCustomFields + +
  • + +
  • TranslatedField @@ -1024,6 +1052,13 @@
  • +
  • + + oneOf + +
  • + +
  • skip diff --git a/app/views/static/api/docs/scalar/datetime/index.html b/app/views/static/api/docs/scalar/datetime/index.html index 5d7eaa539e..02a4c915f7 100644 --- a/app/views/static/api/docs/scalar/datetime/index.html +++ b/app/views/static/api/docs/scalar/datetime/index.html @@ -247,6 +247,13 @@
  • +
  • + + LocalizedCustomFields + +
  • + +
  • LocalizedString @@ -401,6 +408,13 @@
  • +
  • + + ParticipatorySpaceManifest + +
  • + +
  • Post @@ -457,6 +471,13 @@
  • +
  • + + QuantifiableTranslatedField + +
  • + +
  • Question @@ -590,6 +611,13 @@
  • +
  • + + TranslatedCustomFields + +
  • + +
  • TranslatedField @@ -1024,6 +1052,13 @@
  • +
  • + + oneOf + +
  • + +
  • skip diff --git a/app/views/static/api/docs/scalar/float/index.html b/app/views/static/api/docs/scalar/float/index.html index 7beb6e4e6b..7b17c6164f 100644 --- a/app/views/static/api/docs/scalar/float/index.html +++ b/app/views/static/api/docs/scalar/float/index.html @@ -247,6 +247,13 @@
  • +
  • + + LocalizedCustomFields + +
  • + +
  • LocalizedString @@ -401,6 +408,13 @@
  • +
  • + + ParticipatorySpaceManifest + +
  • + +
  • Post @@ -457,6 +471,13 @@
  • +
  • + + QuantifiableTranslatedField + +
  • + +
  • Question @@ -590,6 +611,13 @@
  • +
  • + + TranslatedCustomFields + +
  • + +
  • TranslatedField @@ -1024,6 +1052,13 @@
  • +
  • + + oneOf + +
  • + +
  • skip diff --git a/app/views/static/api/docs/scalar/id/index.html b/app/views/static/api/docs/scalar/id/index.html index cb86d196b4..8b1120a0f4 100644 --- a/app/views/static/api/docs/scalar/id/index.html +++ b/app/views/static/api/docs/scalar/id/index.html @@ -247,6 +247,13 @@
  • +
  • + + LocalizedCustomFields + +
  • + +
  • LocalizedString @@ -401,6 +408,13 @@
  • +
  • + + ParticipatorySpaceManifest + +
  • + +
  • Post @@ -457,6 +471,13 @@
  • +
  • + + QuantifiableTranslatedField + +
  • + +
  • Question @@ -590,6 +611,13 @@
  • +
  • + + TranslatedCustomFields + +
  • + +
  • TranslatedField @@ -1024,6 +1052,13 @@
  • +
  • + + oneOf + +
  • + +
  • skip diff --git a/app/views/static/api/docs/scalar/index.html b/app/views/static/api/docs/scalar/index.html index 8031a53936..c6f969c9cb 100644 --- a/app/views/static/api/docs/scalar/index.html +++ b/app/views/static/api/docs/scalar/index.html @@ -248,6 +248,13 @@
  • +
  • + + LocalizedCustomFields + +
  • + +
  • LocalizedString @@ -402,6 +409,13 @@
  • +
  • + + ParticipatorySpaceManifest + +
  • + +
  • Post @@ -458,6 +472,13 @@
  • +
  • + + QuantifiableTranslatedField + +
  • + +
  • Question @@ -591,6 +612,13 @@
  • +
  • + + TranslatedCustomFields + +
  • + +
  • TranslatedField @@ -1025,6 +1053,13 @@
  • +
  • + + oneOf + +
  • + +
  • skip diff --git a/app/views/static/api/docs/scalar/int/index.html b/app/views/static/api/docs/scalar/int/index.html index 82b038e76f..3e0ce8ae92 100644 --- a/app/views/static/api/docs/scalar/int/index.html +++ b/app/views/static/api/docs/scalar/int/index.html @@ -247,6 +247,13 @@
  • +
  • + + LocalizedCustomFields + +
  • + +
  • LocalizedString @@ -401,6 +408,13 @@
  • +
  • + + ParticipatorySpaceManifest + +
  • + +
  • Post @@ -457,6 +471,13 @@
  • +
  • + + QuantifiableTranslatedField + +
  • + +
  • Question @@ -590,6 +611,13 @@
  • +
  • + + TranslatedCustomFields + +
  • + +
  • TranslatedField @@ -1024,6 +1052,13 @@
  • +
  • + + oneOf + +
  • + +
  • skip diff --git a/app/views/static/api/docs/scalar/json/index.html b/app/views/static/api/docs/scalar/json/index.html index 3aa6607824..0ec570f9d3 100644 --- a/app/views/static/api/docs/scalar/json/index.html +++ b/app/views/static/api/docs/scalar/json/index.html @@ -247,6 +247,13 @@
  • +
  • + + LocalizedCustomFields + +
  • + +
  • LocalizedString @@ -401,6 +408,13 @@
  • +
  • + + ParticipatorySpaceManifest + +
  • + +
  • Post @@ -457,6 +471,13 @@
  • +
  • + + QuantifiableTranslatedField + +
  • + +
  • Question @@ -590,6 +611,13 @@
  • +
  • + + TranslatedCustomFields + +
  • + +
  • TranslatedField @@ -1024,6 +1052,13 @@
  • +
  • + + oneOf + +
  • + +
  • skip diff --git a/app/views/static/api/docs/scalar/string/index.html b/app/views/static/api/docs/scalar/string/index.html index df11596e64..99fee64776 100644 --- a/app/views/static/api/docs/scalar/string/index.html +++ b/app/views/static/api/docs/scalar/string/index.html @@ -247,6 +247,13 @@
  • +
  • + + LocalizedCustomFields + +
  • + +
  • LocalizedString @@ -401,6 +408,13 @@
  • +
  • + + ParticipatorySpaceManifest + +
  • + +
  • Post @@ -457,6 +471,13 @@
  • +
  • + + QuantifiableTranslatedField + +
  • + +
  • Question @@ -590,6 +611,13 @@
  • +
  • + + TranslatedCustomFields + +
  • + +
  • TranslatedField @@ -1024,6 +1052,13 @@
  • +
  • + + oneOf + +
  • + +
  • skip diff --git a/app/views/static/api/docs/union/index.html b/app/views/static/api/docs/union/index.html index 38fc6f184d..c754b32213 100644 --- a/app/views/static/api/docs/union/index.html +++ b/app/views/static/api/docs/union/index.html @@ -248,6 +248,13 @@
  • +
  • + + LocalizedCustomFields + +
  • + +
  • LocalizedString @@ -402,6 +409,13 @@
  • +
  • + + ParticipatorySpaceManifest + +
  • + +
  • Post @@ -458,6 +472,13 @@
  • +
  • + + QuantifiableTranslatedField + +
  • + +
  • Question @@ -591,6 +612,13 @@
  • +
  • + + TranslatedCustomFields + +
  • + +
  • TranslatedField @@ -1025,6 +1053,13 @@
  • +
  • + + oneOf + +
  • + +
  • skip diff --git a/bin/decidim_update b/bin/decidim_update deleted file mode 100755 index a976176a7d..0000000000 --- a/bin/decidim_update +++ /dev/null @@ -1 +0,0 @@ -bundle update --source decidim decidim-initiatives decidim-sortitions decidim-dev decidim-term_customizer && bundle exec rake decidim:upgrade && bundle exec rake db:migrate diff --git a/bin/dev b/bin/dev new file mode 100755 index 0000000000..74ade16641 --- /dev/null +++ b/bin/dev @@ -0,0 +1,8 @@ +#!/usr/bin/env sh + +if ! gem list foreman -i --silent; then + echo "Installing foreman..." + gem install foreman +fi + +exec foreman start -f Procfile.dev "$@" diff --git a/bin/shakapacker b/bin/shakapacker new file mode 100755 index 0000000000..0513f209fa --- /dev/null +++ b/bin/shakapacker @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +ENV["RAILS_ENV"] ||= "development" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) + +require "bundler/setup" + +# Add the Decidim override load path to override webpacker functionality +$LOAD_PATH.unshift "#{Gem.loaded_specs["decidim-core"].full_gem_path}/lib/gem_overrides" +require "shakapacker" +require "shakapacker/webpack_runner" + +APP_ROOT = File.expand_path("..", __dir__) +Dir.chdir(APP_ROOT) do + Shakapacker::WebpackRunner.run(ARGV) +end diff --git a/bin/shakapacker-dev-server b/bin/shakapacker-dev-server new file mode 100755 index 0000000000..1416541af7 --- /dev/null +++ b/bin/shakapacker-dev-server @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +ENV["RAILS_ENV"] ||= "development" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) + +require "bundler/setup" + +# Add the Decidim override load path to override webpacker functionality +$LOAD_PATH.unshift "#{Gem.loaded_specs["decidim-core"].full_gem_path}/lib/gem_overrides" +require "shakapacker" +require "shakapacker/dev_server_runner" + +APP_ROOT = File.expand_path("..", __dir__) +Dir.chdir(APP_ROOT) do + Shakapacker::DevServerRunner.run(ARGV) +end diff --git a/bin/webpack b/bin/webpack deleted file mode 100755 index b271fe76bd..0000000000 --- a/bin/webpack +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: true - -ENV["RAILS_ENV"] ||= ENV.fetch("RACK_ENV", nil) || "development" -ENV["NODE_ENV"] ||= "development" - -require "pathname" -ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require "bundler/setup" - -# Add the Decidim override load path to override webpacker functionality -$LOAD_PATH.unshift "#{Gem.loaded_specs["decidim-core"].full_gem_path}/lib/gem_overrides" - -require "webpacker" -require "webpacker/webpack_runner" - -APP_ROOT = File.expand_path("..", __dir__) -Dir.chdir(APP_ROOT) do - Webpacker::WebpackRunner.run(ARGV) -end diff --git a/bin/webpack-dev-server b/bin/webpack-dev-server deleted file mode 100755 index 1bcc73d70c..0000000000 --- a/bin/webpack-dev-server +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: true - -ENV["RAILS_ENV"] ||= ENV.fetch("RACK_ENV", nil) || "development" -ENV["NODE_ENV"] ||= "development" - -require "pathname" -ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require "bundler/setup" - -# Add the Decidim override load path to override webpacker functionality -$LOAD_PATH.unshift "#{Gem.loaded_specs["decidim-core"].full_gem_path}/lib/gem_overrides" - -require "webpacker" -require "webpacker/dev_server_runner" - -APP_ROOT = File.expand_path("..", __dir__) -Dir.chdir(APP_ROOT) do - Webpacker::DevServerRunner.run(ARGV) -end diff --git a/config/application.rb b/config/application.rb index d0d72118ed..3e26f82881 100644 --- a/config/application.rb +++ b/config/application.rb @@ -17,6 +17,7 @@ class Application < Rails::Application # Settings in config/environments/* take precedence over those specified here. # Application configuration should go into files in config/initializers # -- all .rb files in that directory are automatically loaded. + config.autoloader = :zeitwerk # Locales config.i18n.available_locales = [:ca, :es] diff --git a/config/database.yml b/config/database.yml index 1070086fba..0241b38962 100644 --- a/config/database.yml +++ b/config/database.yml @@ -28,6 +28,7 @@ development: <<: *default database: <%= ENV.fetch("DATABASE_NAME") { "decidim-barcelona_development" } %> statement_limit: <%= ENV['PREPARED_STATEMENTS_LIMIT'] ? ENV['PREPARED_STATEMENTS_LIMIT'].to_i : 200 %> + gssencmode: disable # The specified database role being used to connect to postgres. # To create additional roles in postgres see `$ createuser --help`. @@ -62,6 +63,7 @@ development: test: <<: *default database: <%= ENV.fetch("DATABASE_NAME") { "decidim-barcelona_test" } %> + gssencmode: disable # As with config/secrets.yml, you never want to store sensitive information, # like your database password, in your source code. If your source code is diff --git a/config/environments/development.rb b/config/environments/development.rb index cb7bc58c80..893609d87d 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -38,7 +38,7 @@ # Don't care if the mailer can't send. config.action_mailer.raise_delivery_errors = false config.action_mailer.delivery_method = :letter_opener_web - config.action_mailer.default_url_options = { host: "localhost:3000" } + config.action_mailer.default_url_options = { host: "localhost", port: 3000 } config.action_mailer.asset_host = "http://localhost:3000" config.action_mailer.perform_deliveries = true diff --git a/config/environments/production.rb b/config/environments/production.rb index 81b620fc56..e05b237e01 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -56,7 +56,7 @@ # Include generic and useful information about system operation, but avoid logging too much # information to avoid inadvertent exposure of personally identifiable information (PII). - config.log_level = %w(debug info warn error fatal).include?(ENV.fetch("RAILS_LOG_LEVEL", nil)) ? ENV["RAILS_LOG_LEVEL"] : :info + config.log_level = %w(debug info warn error fatal).include?(ENV.fetch("RAILS_LOG_LEVEL", nil)) ? ENV.fetch("RAILS_LOG_LEVEL", nil) : :info # Prepend all log lines with the following tags. config.log_tags = [:request_id] @@ -88,7 +88,7 @@ config.active_support.disallowed_deprecation_warnings = [] # Use default logging formatter so that PID and timestamp are not suppressed. - config.log_formatter = ::Logger::Formatter.new + config.log_formatter = Logger::Formatter.new config.action_mailer.smtp_settings = { address: Rails.application.secrets.smtp_address, port: Rails.application.secrets.smtp_port, diff --git a/config/initializers/carrierwave.rb b/config/initializers/carrierwave.rb deleted file mode 100644 index 81c0da61a8..0000000000 --- a/config/initializers/carrierwave.rb +++ /dev/null @@ -1,29 +0,0 @@ -# frozen_string_literal: true - -# Default CarrierWave setup. -# -CarrierWave.configure do |config| - config.permissions = 0o666 - config.directory_permissions = 0o777 - config.storage = :file - config.enable_processing = !Rails.env.test? -end - -if Rails.application.secrets.dig(:storage, :s3, :access_key_id).present? - require "carrierwave/storage/fog" - - region = "eu-west-1" - CarrierWave.configure do |config| - config.storage = :fog - config.fog_provider = "fog/aws" # required - config.fog_credentials = { - provider: "AWS", # required - aws_access_key_id: Rails.application.secrets.dig(:storage, :s3, :access_key_id), # required - aws_secret_access_key: Rails.application.secrets.dig(:storage, :s3, :secret_access_key), # required - region: region, # optional, defaults to 'us-east-1' - host: "s3.#{region}.amazonaws.com" # optional, defaults to nil - } - config.fog_directory = Rails.application.secrets.dig(:storage, :s3, :bucket) # required - config.fog_attributes = { "Cache-Control" => "max-age=#{365.days.to_i}" } # optional, defaults to {} - end -end diff --git a/config/initializers/decidim.rb b/config/initializers/decidim.rb index e13659893d..38d39eae73 100644 --- a/config/initializers/decidim.rb +++ b/config/initializers/decidim.rb @@ -489,6 +489,12 @@ end end +if Decidim.module_installed? :verifications + Decidim::Verifications.configure do |config| + config.document_types = Rails.application.secrets.dig(:verifications, :document_types).presence || %w(identification_number passport) + end +end + # Inform Decidim about the assets folder Decidim.register_assets_path File.expand_path("app/packs", Rails.application.root) @@ -532,3 +538,9 @@ auth.metadata_cell = "census_sarria_sant_gervasi_authorization_metadata" auth.ephemerable = true end + +Decidim.icons.register(name: "arrow-bottom", icon: "arrow-bottom", category: "system", description: "", engine: :core) +Decidim.icons.register(name: "audio", icon: "audio", category: "system", description: "", engine: :core) +Decidim.icons.register(name: "fingerprint-2-line", icon: "fingerprint-2-line", category: "system", description: "", engine: :core) +Decidim.icons.register(name: "link-intact", icon: "link-intact", category: "system", description: "", engine: :core) +Decidim.icons.register(name: "route-line", icon: "route-line", category: "system", description: "", engine: :core) diff --git a/config/initializers/decidim_overrides.rb b/config/initializers/decidim_overrides.rb index cd716aef80..2e9fe94632 100644 --- a/config/initializers/decidim_overrides.rb +++ b/config/initializers/decidim_overrides.rb @@ -1,13 +1,15 @@ # frozen_string_literal: true Rails.application.config.to_prepare do + Decidim::PaginateHelper.include(Decidim::PaginateHelperOverride) Decidim::Initiatives::Admin::Permissions.prepend(Decidim::Initiatives::Admin::PermissionsOverride) - Decidim::Initiatives::InitiativeMCell.prepend Decidim::Overrides::Initiatives::InitiativeMCell - Decidim::SearchResourceFieldsMapper.prepend Decidim::Overrides::SearchResourceFieldsMapper - Decidim::Forms::UserAnswersSerializer.prepend Decidim::Overrides::Forms::UserAnswersSerializer + Decidim::SearchResourceFieldsMapper.prepend(Decidim::Overrides::SearchResourceFieldsMapper) + Decidim::Initiatives::InitiativeMetadataGCell.include(Decidim::Initiatives::InitiativeMetadataGCellOverride) + Decidim::Forms::UserAnswersSerializer.prepend(Decidim::Overrides::Forms::UserAnswersSerializer) Decidim::Initiative.include(Decidim::InitiativeOverride) Decidim::Accountability::Result.include(Decidim::Accountability::ResultOverride) Decidim::Accountability::ResultsCalculator.include(Decidim::Accountability::ResultsCalculatorOverride) + Decidim::Accountability::StatusCell.include(Decidim::Accountability::StatusCellOverride) Decidim::Meetings::Meeting.include(Decidim::Meetings::MeetingOverride) Decidim::Meetings::MeetingsController.include(Decidim::Meetings::MeetingsControllerOverride) Decidim::Meetings::OnlineMeetingCell.include(Decidim::Meetings::OnlineMeetingCellOverride) @@ -19,5 +21,11 @@ Decidim::Proposals::ProposalPresenter.include(Decidim::Proposals::ProposalPresenterOverride) Decidim::Forms::QuestionnaireUserAnswers.include(Decidim::Forms::QuestionnaireUserAnswersOverride) Decidim::Proposals::ApplicationHelper.include(Decidim::Proposals::ApplicationHelperOverride) - Decidim::Admin::ConflictsController.include(Decidim::Admin::ConflictsControllerOverride) + Decidim::Assemblies::AssembliesController.include(Decidim::Assemblies::AssembliesControllerOverride) + # This last one will be removed once https://github.com/decidim/decidim/pull/13402 is used + Decidim::ViewModel.class_eval do + def cache_expiry_time + 5.minutes + end + end end diff --git a/config/initializers/social_share_button.rb b/config/initializers/social_share_button.rb deleted file mode 100644 index 592835b1c5..0000000000 --- a/config/initializers/social_share_button.rb +++ /dev/null @@ -1,8 +0,0 @@ -# frozen_string_literal: true - -# Further information on how to configure the SocialShareButton gem can be -# found here: https://github.com/huacnlee/social-share-button#configure -# -SocialShareButton.configure do |config| - config.allow_sites = %w(twitter facebook whatsapp_app whatsapp_web telegram) -end diff --git a/config/locales/accountability.ca.yml b/config/locales/accountability.ca.yml index 95a2adf710..c86c37c494 100644 --- a/config/locales/accountability.ca.yml +++ b/config/locales/accountability.ca.yml @@ -59,80 +59,87 @@ ca: heading: L’Ajuntament ret comptes intro_text: Estrenem la Rendició de Comptes al Decidim Barcelona. Un espai en què l'Ajuntament de Barcelona ret comptes a la ciutadania sobre els seus objectius i resultats. go_to_link: Anar a la pàgina - tab_1: Planificació i estratègia municipal - tab_2: Recursos econòmics i pressupostos - tab_3: Prestació de serveis i gestió pública - tab_4: Gestió ètica y bon govern - tab_1_heading_1: PAM 2016-2019 - tab_1_text_1: | -

    El Programa d’Actuació Municipal (PAM) és el document i eina de gestió que defineix l'estratègia municipal per a un mandat. En aquest apartat podràs accedir als diferents documents i informació relativa al PAM.

    -
    - tab_1_heading_2: Plans estratègics municipals - tab_1_text_2: | -

    Els plans estratègics són conjunts de mesures polítiques i econòmiques dirigides a resoldre problemes o situacions determinades, que inclouen els mitjans per aconseguir-ho, les responsabilitats i les dates de compliment.

    - tab_1_heading_3: Processos de participació al Decidim - tab_1_text_3: | -

    En aquest apartat podràs accedir als diferents documents i informació relativa a l'execució dels processos acordats al Decidim.

    - tab_2_heading_1: Econòmica i pressupostària - tab_2_text_1: | -

    Informació sobre com s'assignen, gasten i gestionen els recursos econòmics en relació a l'estratègia i prioritats municipals.

    - tab_2_heading_2: Pressupost - tab_2_link_2: http://ajuntament.barcelona.cat/estrategiaifinances/ca/i-pressupost - tab_2_text_2: | -

    El pressupost és el reflex financer de l'estratègia i prioritats municipals, on els recursos s'assignen a aquells programes i actuacions que permeten avançar cap als objectius definits. En aquesta secció podràs consultar l'estat d'execució dels pressupostos així com accedir a documentació relacionada, per exemple:

    -
      -
    • Pressupost obert: Accedeix a la nova web per saber d’on venen els ingressos (impostos i transferències d’altres administracions) i a quines polítiques i projectes es destinen.
    • -
    • Execució pressupostos 2017: En aquesta secció podràs consultar l'estat d'execució dels pressupostos segons diferents visions o classificacions, així com accedir a la documentació més rellevant relacionada amb els pressupostos de l'Ajuntament.
    • -
    • Execució pressupostos anys anteriors 2001-2016: Aquí podràs accedir als diferents documents relatius als pressupostos liquidats d'anys anteriors a l'exercici actual.
    • -
    • Pressupostos per política de despesa: Informació de recursos pressupostaris (despeses corrents) i indicadors de resultats dels programes de les diferents polítiques de despesa.
    • -
    • Costos basats en activitats (ABC): Indicadors de costos unitaris dels diferents equipaments i serveis municipals.
    • -
    - tab_2_heading_3: Resultats i informes financers - tab_2_link_3: http://ajuntament.barcelona.cat/estrategiaifinances/ca/i-compte-de-resultats - tab_2_text_3: | -

    L'Ajuntament s'orienta a l'obtenció de resultats en termes del Sistema Europeu de Comptes, per tal de garantir la solvència, estabilitat i sostenibilitat de les finances municipals. En aquest apartat podràs consultar la previsió del resultat de l'exercici corrent, així com els principals informes financers de l'Ajuntament i la Informació sobre el pagament a empreses proveïdores.

    - tab_2_heading_4: Contratació pública - tab_2_text_4: | -

    Informació sobre els contractes que signa l'Ajuntament, tant concursos i licitacions públiques com contractes menors, entre d'altres:

    - - tab_3_heading_1: Prestació de serveis i gestió pública - tab_3_text_1: | -

    Estem treballant per proporcionar informació sobre l'acompliment de l'Ajuntament respecte als serveis que presta per garantir els drets de la ciutadania. De moment pots accedir a:

    - - tab_4_heading_1: Gestió ètica i bon govern - tab_4_text_1: | -

    Informació sobre les actuacions realitzades i les mesures adoptades per garantir la integritat i la correcta prevenció i gestió de conflictes d'interessos i de males pràctiques.

    - tab_4_heading_2: Informació sobre alts càrrecs - tab_4_text_2: | - - tab_4_heading_3: Transparència - tab_4_text_3: | - - tab_4_heading_4: Prevenció de la corrupció - tab_4_text_4: | -
      -
    • Codi de conducta: El codi recull els principis ètics i els valors de bona governança que han d'informar tota actuació municipal. També regula les normes de conducta i de conflictes d'interessos. El codi determina els mecanismes i procediments per garantir la seva efectivitat, avaluació i impuls.
    • -
    • Bústia Ètica i de Bon Govern: és un canal segur de participació electrònica que neix de la conveniència d'oferir un espai que permeti tenir coneixement de qualsevol acció o omissió contrària als principis de bon govern, com una manera de reforçar la gestió pública.
    • -
    + planificacio: + heading_0: PAM 2016-2019 + heading_1: Plans estratègics municipals + heading_2: Processos de participació al Decidim + link_0: https://www.decidim.barcelona/processes/1 + link_1: https://bcnroc.ajuntament.barcelona.cat/jspui/handle/11703/83559 + link_2: https://www.decidim.barcelona/ + text_0: | +

    El Programa d’Actuació Municipal (PAM) és el document i eina de gestió que defineix l'estratègia municipal per a un mandat. En aquest apartat podràs accedir als diferents documents i informació relativa al PAM.

    +
      +
    • Dades quantitatives agregades per eixos, línies, actuacions i projectes
    • +
    • Informació en cada una de las actuacions, propostes i aportacions d’entitats i de la ciutadania, desglossades en projectes, amb l’estat d'execució detallat
    • +
    + text_1: | +

    Els plans estratègics són conjunts de mesures polítiques i econòmiques dirigides a resoldre problemes o situacions determinades, que inclouen els mitjans per aconseguir-ho, les responsabilitats i les dates de compliment.

    + text_2: | +

    En aquest apartat podràs accedir als diferents documents i informació relativa a l'execució dels processos acordats al Decidim.

    + title: Planificació i estratègia municipal + economia: + heading_0: Econòmica i pressupostària + heading_1: Pressupost + heading_2: Resultats i informes financers + heading_3: Contratació pública + link_1: http://ajuntament.barcelona.cat/estrategiaifinances/ca/i-pressupost + link_2: http://ajuntament.barcelona.cat/estrategiaifinances/ca/i-compte-de-resultats + text_0: | +

    Informació sobre com s'assignen, gasten i gestionen els recursos econòmics en relació a l'estratègia i prioritats municipals.

    + text_1: | +

    El pressupost és el reflex financer de l'estratègia i prioritats municipals, on els recursos s'assignen a aquells programes i actuacions que permeten avançar cap als objectius definits. En aquesta secció podràs consultar l'estat d'execució dels pressupostos així com accedir a documentació relacionada, per exemple:

    +
      +
    • Pressupost obert: Accedeix a la nova web per saber d’on venen els ingressos (impostos i transferències d’altres administracions) i a quines polítiques i projectes es destinen.
    • +
    • Execució pressupostos 2017: En aquesta secció podràs consultar l'estat d'execució dels pressupostos segons diferents visions o classificacions, així com accedir a la documentació més rellevant relacionada amb els pressupostos de l'Ajuntament.
    • +
    • Execució pressupostos anys anteriors 2001-2016: Aquí podràs accedir als diferents documents relatius als pressupostos liquidats d'anys anteriors a l'exercici actual.
    • +
    • Pressupostos per política de despesa: Informació de recursos pressupostaris (despeses corrents) i indicadors de resultats dels programes de les diferents polítiques de despesa.
    • +
    • Costos basats en activitats (ABC): Indicadors de costos unitaris dels diferents equipaments i serveis municipals.
    • +
    + text_2: | +

    L'Ajuntament s'orienta a l'obtenció de resultats en termes del Sistema Europeu de Comptes, per tal de garantir la solvència, estabilitat i sostenibilitat de les finances municipals. En aquest apartat podràs consultar la previsió del resultat de l'exercici corrent, així com els principals informes financers de l'Ajuntament i la Informació sobre el pagament a empreses proveïdores.

    + text_3: | +

    Informació sobre els contractes que signa l'Ajuntament, tant concursos i licitacions públiques com contractes menors, entre d'altres:

    + + title: Recursos econòmics i pressupostos + serveis: + heading_0: Prestació de serveis i gestió pública + text_0: | +

    Estem treballant per proporcionar informació sobre l'acompliment de l'Ajuntament respecte als serveis que presta per garantir els drets de la ciutadania. De moment pots accedir a:

    + + title: Prestació de serveis i gestió pública + etica: + heading_0: Gestió ètica i bon govern + heading_1: Informació sobre alts càrrecs + heading_2: Transparència + heading_3: Prevenció de la corrupció + text_0: | +

    Informació sobre les actuacions realitzades i les mesures adoptades per garantir la integritat i la correcta prevenció i gestió de conflictes d'interessos i de males pràctiques.

    + text_1: | + + text_2: | + + text_3: | +
      +
    • Codi de conducta: El codi recull els principis ètics i els valors de bona governança que han d'informar tota actuació municipal. També regula les normes de conducta i de conflictes d'interessos. El codi determina els mecanismes i procediments per garantir la seva efectivitat, avaluació i impuls.
    • +
    • Bústia Ètica i de Bon Govern: és un canal segur de participació electrònica que neix de la conveniència d'oferir un espai que permeti tenir coneixement de qualsevol acció o omissió contrària als principis de bon govern, com una manera de reforçar la gestió pública.
    • +
    + title: Gestió ètica y bon govern diff --git a/config/locales/accountability.es.yml b/config/locales/accountability.es.yml index 1ca1f64e1f..3af72b3a69 100644 --- a/config/locales/accountability.es.yml +++ b/config/locales/accountability.es.yml @@ -58,82 +58,88 @@ es: heading: El Ajuntament rinde cuentas intro_text: Estrenamos la Rendición de Cuentas al Decidim Barcelona. Un espacio en que el Ajuntament de Barcelona rinde cuentas, sobre sus objetivos y resultados, a la ciudadanía. go_to_link: Ir al sitio - tab_1: Planificación y estrategia municipal - tab_2: Recursos económicos y presupuestos - tab_3: Prestación de servicios y gestión pública - tab_4: Gestión ética y buen gobierno - tab_1_heading_1: PAM 2016-2019 - tab_1_text_1: | -

    El Programa de Actuación Municipal (PAM) es el documento y herramienta de gestión que define la estrategia municipal para un mandato. En este apartado (en breve) podrás acceder a los diferentes documentos e información relativa al PAM.

    -
      -
    • Datos cuantitativos agregados por ejes, líneas, actuaciones, proyectos
    • -
    • Información de cada una de las actuaciones: Propuestas y las aportaciones de entidades y ciudadanía desglosadas en proyectos, con su estado de ejecución detallado.
    • -
    - tab_1_heading_2: Planes estratégicos municipales - tab_1_text_2: | -

    Los planes estratégicos son conjuntos de medidas políticas y económicas dirigidas a resolver problemas o situaciones determinadas, que incluyen los medios para conseguirlo, las responsabilidades y las fechas de cumplimiento.

    - tab_1_heading_3: Procesos de participación en Decidim - tab_1_text_3: | -

    En este apartado podrás acceder a los diferentes documentos e información relativa a la ejecución de los procesos acordados en Decidim.

    - tab_2_heading_1: Económica y presupuestaria - tab_2_link_1: Económica y presupuestaria - tab_2_text_1: | -

    Información sobre cómo se asignan, gastan y gestionan los recursos económicos en relación a la estrategia y prioridades municipales.

    - tab_2_heading_2: Presupuesto - tab_2_link_2: http://ajuntament.barcelona.cat/estrategiaifinances/es/i-pressupost - tab_2_text_2: | -

    El presupuesto es el reflejo financiero de la estrategia y prioridades municipales, donde los recursos se asignan a aquellos programas y actuaciones que permiten avanzar hacia los objetivos definidos. En esta sección podrás consultar el estado de ejecución de los presupuestos del Ajuntament de Barcelona y acceder a documentación relacionada, por ejemplo:

    -
      -
    • Presupuestos abiertos: Accede a la nueva web para saber de dónde vienen los ingresos (impuestos y transferencias de otras administraciones) y a qué políticas y proyectos se destinan los mismos.
    • -
    • Ejecución presupuesto 2017: En esta sección podrás consultar el estado de ejecución del presupuesto según diferentes visiones o clasificaciones, así como acceder a la documentación más relevante relacionada con los presupuestos del Ajuntament
    • -
    • Ejecución presupuesto años anteriores 2001-2016: Aquí podrás acceder a los diferentes documentos relativos a los presupuestos liquidados de años anteriores al ejercicio actual.
    • -
    • Presupuesto por política de gasto: Información de recursos presupuestarios (gastos corrientes) e indicadores de resultados de los programas de las diferentes políticas de gasto.
    • -
    • Costes basados en actividades (ABC): Indicadores de costes unitarios de los diferentes equipamientos y servicios municipales.
    • -
    - tab_2_heading_3: Resultados e informes financieros - tab_2_link_3: http://ajuntament.barcelona.cat/estrategiaifinances/es/i-compte-de-resultats - tab_2_text_3: | -

    El Ajuntament se orienta a la obtención de resultados en términos del Sistema Europeo de Cuentas, con el fin de garantizar la solvencia, estabilidad y sostenibilidad de las finanzas municipales. En este apartado podrás consultar la previsión del resultado del ejercicio corriente, así como los principales informes financieros del Ajuntament y la Información sobre el pago a empresas proveedoras.

    - tab_2_heading_4: Contratación pública - tab_2_text_4: | -

    Información sobre los contratos que firma el Ajuntament, tanto concursos y licitaciones públicas como contratos menores, entre otros:

    - - tab_3_heading_1: Prestación de servicios y gestión pública - tab_3_text_1: | -

    El Ajuntament sigue trabajando para proporcionar información sobre su desempeño respecto a los servicios que presta para garantizar los derechos de la ciudadanía. De momento puedes acceder a:

    - - tab_4_heading_1: Gestión ética y buen gobierno - tab_4_text_1: | -

    Información sobre las actuaciones realizadas y las medidas adoptadas para garantizar la integridad y la correcta prevención y gestión de conflictos de intereses y de malas prácticas.

    - tab_4_heading_2: Información sobre altos cargos - tab_4_text_2: | - - tab_4_heading_3: Transparencia - tab_4_text_3: | - - tab_4_heading_4: Prevención de la corrupción - tab_4_text_4: | -
      -
    • Código de conducta: El código recoge los principios éticos y los valores de buena gobernanza que deben informar toda actuación municipal. Regula las normas de conducta y de conflictos de intereses y determina los mecanismos y procedimientos para garantizar su efectividad, evaluación e impulso.
    • -
    • Buzón Ético y de Buen Gobierno: Es un canal seguro de participación electrónica que nace de la conveniencia de ofrecer un espacio que permita tener conocimiento de cualquier acción u omisión contraria a los principios de buen gobierno, como una manera de reforzar la gestión pública.
    • -
    + planificacio: + heading_0: PAM 2016-2019 + heading_1: Planes estratégicos municipales + heading_2: Procesos de participación en Decidim + link_0: https://www.decidim.barcelona/processes/1 + link_1: https://bcnroc.ajuntament.barcelona.cat/jspui/handle/11703/83559 + link_2: https://www.decidim.barcelona/ + text_0: | +

    El Programa de Actuación Municipal (PAM) es el documento y herramienta de gestión que define la estrategia municipal para un mandato. En este apartado (en breve) podrás acceder a los diferentes documentos e información relativa al PAM.

    +
      +
    • Datos cuantitativos agregados por ejes, líneas, actuaciones, proyectos
    • +
    • Información de cada una de las actuaciones: Propuestas y las aportaciones de entidades y ciudadanía desglosadas en proyectos, con su estado de ejecución detallado.
    • +
    + text_1: | +

    Los planes estratégicos son conjuntos de medidas políticas y económicas dirigidas a resolver problemas o situaciones determinadas, que incluyen los medios para conseguirlo, las responsabilidades y las fechas de cumplimiento.

    + text_2: | +

    En este apartado podrás acceder a los diferentes documentos e información relativa a la ejecución de los procesos acordados en Decidim.

    + title: Planificación y estrategia municipal + economia: + heading_0: Económica y presupuestaria + heading_1: Presupuesto + heading_2: Resultados e informes financieros + heading_3: Contratación pública + link_1: http://ajuntament.barcelona.cat/estrategiaifinances/es/i-pressupost + link_2: http://ajuntament.barcelona.cat/estrategiaifinances/es/i-compte-de-resultats + text_0: | +

    Información sobre cómo se asignan, gastan y gestionan los recursos económicos en relación a la estrategia y prioridades municipales.

    + text_1: | +

    El presupuesto es el reflejo financiero de la estrategia y prioridades municipales, donde los recursos se asignan a aquellos programas y actuaciones que permiten avanzar hacia los objetivos definidos. En esta sección podrás consultar el estado de ejecución de los presupuestos del Ajuntament de Barcelona y acceder a documentación relacionada, por ejemplo:

    +
      +
    • Presupuestos abiertos: Accede a la nueva web para saber de dónde vienen los ingresos (impuestos y transferencias de otras administraciones) y a qué políticas y proyectos se destinan los mismos.
    • +
    • Ejecución presupuesto 2017: En esta sección podrás consultar el estado de ejecución del presupuesto según diferentes visiones o clasificaciones, así como acceder a la documentación más relevante relacionada con los presupuestos del Ajuntament
    • +
    • Ejecución presupuesto años anteriores 2001-2016: Aquí podrás acceder a los diferentes documentos relativos a los presupuestos liquidados de años anteriores al ejercicio actual.
    • +
    • Presupuesto por política de gasto: Información de recursos presupuestarios (gastos corrientes) e indicadores de resultados de los programas de las diferentes políticas de gasto.
    • +
    • Costes basados en actividades (ABC): Indicadores de costes unitarios de los diferentes equipamientos y servicios municipales.
    • +
    + text_2: | +

    El Ajuntament se orienta a la obtención de resultados en términos del Sistema Europeo de Cuentas, con el fin de garantizar la solvencia, estabilidad y sostenibilidad de las finanzas municipales. En este apartado podrás consultar la previsión del resultado del ejercicio corriente, así como los principales informes financieros del Ajuntament y la Información sobre el pago a empresas proveedoras.

    + text_3: | +

    Información sobre los contratos que firma el Ajuntament, tanto concursos y licitaciones públicas como contratos menores, entre otros:

    + + title: Recursos económicos y presupuestos + serveis: + heading_0: Prestación de servicios y gestión pública + text_0: | +

    El Ajuntament sigue trabajando para proporcionar información sobre su desempeño respecto a los servicios que presta para garantizar los derechos de la ciudadanía. De momento puedes acceder a:

    + + title: Prestación de servicios y gestión pública + etica: + heading_0: Gestión ética y buen gobierno + heading_1: Información sobre altos cargos + heading_2: Transparencia + heading_3: Prevención de la corrupción + text_0: | +

    Información sobre las actuaciones realizadas y las medidas adoptadas para garantizar la integridad y la correcta prevención y gestión de conflictos de intereses y de malas prácticas.

    + text_1: | + + text_2: | + + text_3: | +
      +
    • Código de conducta: El código recoge los principios éticos y los valores de buena gobernanza que deben informar toda actuación municipal. Regula las normas de conducta y de conflictos de intereses y determina los mecanismos y procedimientos para garantizar su efectividad, evaluación e impulso.
    • +
    • Buzón Ético y de Buen Gobierno: Es un canal seguro de participación electrónica que nace de la conveniencia de ofrecer un espacio que permita tener conocimiento de cualquier acción u omisión contraria a los principios de buen gobierno, como una manera de reforzar la gestión pública.
    • +
    + title: Gestión ética y buen gobierno diff --git a/config/puma.rb b/config/puma.rb index f197c4632d..6ce5169b9d 100644 --- a/config/puma.rb +++ b/config/puma.rb @@ -7,7 +7,6 @@ preload_app! -rackup DefaultRackup port ENV.fetch("PORT", nil) || 3000 environment ENV.fetch("RACK_ENV", nil) || "development" diff --git a/config/routes.rb b/config/routes.rb index ba389a0fe9..7427c3e8c1 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -38,12 +38,10 @@ end # rubocop:enable Layout/LineLength - authenticate :user, ->(u) { u.admin? } do - mount Sidekiq::Web => "/sidekiq" - end - get "/accountability", to: "static#accountability", as: :accountability_static - get "/accountability/sections", to: "static#accountability_sections", as: :accountability_sections + get "/accountability/sections/:section", to: "static#accountability_sections", as: :accountability_sections + + get "/pages/faq", to: redirect("/pages/decidim") scope "/processes/:participatory_process_slug/f/:component_id" do get :export_results, to: "export_results#csv" @@ -52,11 +50,12 @@ post :import_results, to: "decidim/accountability/admin/import_results#create" end - get "/pages/faq", to: redirect("/pages/more-information") - mount Decidim::Core::Engine => "/" - # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html + mount Decidim::EphemeralParticipation::Engine, at: "/", as: "decidim_ephemeral_participation" mount LetterOpenerWeb::Engine, at: "/letter_opener" if Rails.env.development? + authenticate :user, ->(u) { u.admin? } do + mount Sidekiq::Web => "/sidekiq" + end - mount Decidim::EphemeralParticipation::Engine, at: "/", as: "decidim_ephemeral_participation" + # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html end diff --git a/config/secrets.yml b/config/secrets.yml index c456940f4b..d7136965c0 100644 --- a/config/secrets.yml +++ b/config/secrets.yml @@ -78,6 +78,8 @@ decidim_default: &decidim_default max_time_in_validating_state: <%= Decidim::Env.new("INITIATIVES_MAX_TIME_IN_VALIDATING_STATE", 60).to_i %> print_enabled: <%= Decidim::Env.new("INITIATIVES_PRINT_ENABLED", "auto").default_or_present_if_exists.to_s %> do_not_require_authorization: <%= Decidim::Env.new("INITIATIVES_DO_NOT_REQUIRE_AUTHORIZATION").to_boolean_string %> + verifications: + document_types: <%%= Decidim::Env.new("VERIFICATIONS_DOCUMENT_TYPES", %w(identification_number passport)).to_array %> elections_default: &elections_default bulletin_board_server: <%= Decidim::Env.new("ELECTIONS_BULLETIN_BOARD_SERVER", 'http://bulletin-board.lvh.me:8000/api').to_s %> diff --git a/config/webpacker.yml b/config/shakapacker.yml similarity index 61% rename from config/webpacker.yml rename to config/shakapacker.yml index 34b1e9121e..25fe7e437a 100644 --- a/config/webpacker.yml +++ b/config/shakapacker.yml @@ -4,11 +4,15 @@ default: &default source_path: app/packs source_entry_path: entrypoints - public_output_path: decidim-packs + nested_entries: true + css_extract_ignore_order_warnings: false + public_root_path: public + public_output_path: decidim-packs + cache_path: tmp/shakapacker webpack_compile_output: true - cache_path: tmp/webpacker-cache extract_css: true + shakapacker_precompile: true additional_paths: - node_modules @@ -17,9 +21,24 @@ default: &default # Reload manifest.json on all requests so we reload latest compiled packs cache_manifest: false + # Select loader to use, available options are 'babel' (default), 'swc' or 'esbuild' + webpack_loader: 'babel' + + # Set to true to enable check for matching versions of shakapacker gem and NPM package - will raise an error if there is a mismatch or wildcard versioning is used + ensure_consistent_versioning: true + + # Select whether the compiler will use SHA digest ('digest' option) or most most recent modified timestamp ('mtime') to determine freshness + compiler_strategy: digest + + # Select whether the compiler will always use a content hash and not just in production + # Do not use contentHash except for production for performance + # https://webpack.js.org/guides/build-performance/#avoid-production-specific-tooling + useContentHash: false + development: <<: *default compile: true + compiler_strategy: mtime # Compile test packs to decidim decidim-packs folder # Reference: https://webpack.js.org/configuration/dev-server/ @@ -31,6 +50,8 @@ development: port: 3035 # Hot Module Replacement updates modules while the application is running without a full reload hmr: false + # mini-css-extract-plugin is a required dependency in both cases. + inline_css: true client: # Should we show a full-screen overlay in the browser when there are compiler errors or warnings? overlay: false @@ -61,5 +82,8 @@ production: # Production depends on precompilation of packs prior to booting for performance. compile: false + # Use content hash for naming assets. Cannot be overridden by for production. + useContentHash: true + # Cache manifest.json for performance cache_manifest: true diff --git a/config/webpack/base.js b/config/webpack/base.js deleted file mode 100644 index 13a710c687..0000000000 --- a/config/webpack/base.js +++ /dev/null @@ -1,6 +0,0 @@ -/* eslint-disable */ - -const { webpackConfig, merge } = require("@decidim/webpacker") -const customConfig = require("./custom") - -module.exports = merge(webpackConfig, customConfig) diff --git a/config/webpack/custom.js b/config/webpack/custom.js index cac081d39e..a96bb6a8ee 100644 --- a/config/webpack/custom.js +++ b/config/webpack/custom.js @@ -1,17 +1,11 @@ /* eslint-disable */ -const { config } = require("@rails/webpacker"); +const { config } = require("shakapacker"); const { InjectManifest } = require("workbox-webpack-plugin"); +const TerserPlugin = require('terser-webpack-plugin') module.exports = { module: { rules: [ - { - test: require.resolve("quill"), - loader: "expose-loader", - options: { - exposes: ["Quill"] - } - }, { test: require.resolve("jquery"), loader: "expose-loader", @@ -84,13 +78,36 @@ module.exports = { resolve: { extensions: [".js", ".jsx", ".gql", ".graphql"], fallback: { + punycode: false, crypto: false } }, // https://github.com/rails/webpacker/issues/2932 // As Decidim uses multiple packs, we need to enforce a single runtime, to prevent duplication optimization: { - runtimeChunk: false + minimizer: [ + new TerserPlugin({ + parallel: Number.parseInt(process.env.SHAKAPACKER_PARALLEL, 10) || true, + terserOptions: { + parse: { + // Let terser parse ecma 8 code but always output + // ES5 compliant code for older browsers + ecma: 8 + }, + compress: { + ecma: 5, + warnings: false, + comparisons: false + }, + mangle: { safari10: true }, + output: { + ecma: 5, + comments: false, + ascii_only: true + } + } + }) + ].filter(Boolean) }, entry: config.entrypoints, plugins: [ diff --git a/config/webpack/development.js b/config/webpack/development.js deleted file mode 100644 index 9f67055049..0000000000 --- a/config/webpack/development.js +++ /dev/null @@ -1,7 +0,0 @@ -/* eslint-disable */ - -process.env.NODE_ENV = process.env.NODE_ENV || "development" - -const webpackConfig = require("./base") - -module.exports = webpackConfig diff --git a/config/webpack/production.js b/config/webpack/production.js deleted file mode 100644 index 4c1e712a74..0000000000 --- a/config/webpack/production.js +++ /dev/null @@ -1,7 +0,0 @@ -/* eslint-disable */ - -process.env.NODE_ENV = process.env.NODE_ENV || "production" - -const webpackConfig = require("./base") - -module.exports = webpackConfig diff --git a/config/webpack/test.js b/config/webpack/test.js deleted file mode 100644 index 9f67055049..0000000000 --- a/config/webpack/test.js +++ /dev/null @@ -1,7 +0,0 @@ -/* eslint-disable */ - -process.env.NODE_ENV = process.env.NODE_ENV || "development" - -const webpackConfig = require("./base") - -module.exports = webpackConfig diff --git a/config/webpack/webpack.config.js b/config/webpack/webpack.config.js new file mode 100644 index 0000000000..0b11fe3a5e --- /dev/null +++ b/config/webpack/webpack.config.js @@ -0,0 +1,10 @@ +/* eslint-disable */ +process.env.NODE_ENV ??= "development" + +const { webpackConfig, merge } = require("@decidim/webpacker") +const customConfig = require("./custom") + +webpackConfig.optimization = {} +const combinedConfig = merge(webpackConfig, customConfig) + +module.exports = combinedConfig diff --git a/db/migrate/20240311160646_create_decidim_authorization_transfers.decidim.rb b/db/migrate/20240311160646_create_decidim_authorization_transfers.decidim.rb new file mode 100644 index 0000000000..49f21cfeaa --- /dev/null +++ b/db/migrate/20240311160646_create_decidim_authorization_transfers.decidim.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true +# This migration comes from decidim (originally 20220629194812) + +class CreateDecidimAuthorizationTransfers < ActiveRecord::Migration[6.1] + def change + create_table :decidim_authorization_transfers do |t| + t.references :user, null: false, foreign_key: { to_table: :decidim_users }, index: true + t.references :source_user, null: false, foreign_key: { to_table: :decidim_users }, index: true + t.references :authorization, null: false, foreign_key: { to_table: :decidim_authorizations }, index: true + + t.datetime :created_at, null: false + end + + create_table :decidim_authorization_transfer_records do |t| + t.references :transfer, null: false, foreign_key: { to_table: :decidim_authorization_transfers }, index: true + t.references :resource, polymorphic: true, null: false + + t.datetime :created_at, null: false + end + end +end diff --git a/db/migrate/20240311160647_rename_terms_of_use.decidim.rb b/db/migrate/20240311160647_rename_terms_of_use.decidim.rb new file mode 100644 index 0000000000..5c74f08ef7 --- /dev/null +++ b/db/migrate/20240311160647_rename_terms_of_use.decidim.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true +# This migration comes from decidim (originally 20230322101707) + +class RenameTermsOfUse < ActiveRecord::Migration[6.1] + def change + rename_column :decidim_organizations, :admin_terms_of_use_body, :admin_terms_of_service_body + + # rubocop:disable Rails/SkipsModelValidations + reversible do |dir| + dir.up do + Decidim::StaticPage.where(slug: "terms-and-conditions").update_all( + slug: "terms-of-service" + ) + end + + dir.down do + Decidim::StaticPage.where(slug: "terms-of-service").update_all( + slug: "terms-and-conditions" + ) + end + end + # rubocop:enable Rails/SkipsModelValidations + end +end diff --git a/db/migrate/20240311160648_add_content_policy_to_decidim_organizations.decidim.rb b/db/migrate/20240311160648_add_content_policy_to_decidim_organizations.decidim.rb new file mode 100644 index 0000000000..19c1260279 --- /dev/null +++ b/db/migrate/20240311160648_add_content_policy_to_decidim_organizations.decidim.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true +# This migration comes from decidim (originally 20230409123300) + +class AddContentPolicyToDecidimOrganizations < ActiveRecord::Migration[6.1] + def change + add_column :decidim_organizations, :content_security_policy, :jsonb, default: {} + end +end diff --git a/db/migrate/20240311160649_change_states_on_amendments.decidim.rb b/db/migrate/20240311160649_change_states_on_amendments.decidim.rb new file mode 100644 index 0000000000..1f0af8c7e2 --- /dev/null +++ b/db/migrate/20240311160649_change_states_on_amendments.decidim.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true +# This migration comes from decidim (originally 20230427105700) + +class ChangeStatesOnAmendments < ActiveRecord::Migration[6.1] + class Amendment < ApplicationRecord + self.table_name = :decidim_amendments + STATES = { draft: 0, evaluating: 10, accepted: 20, rejected: 30, withdrawn: -1 }.freeze + end + + def up + rename_column :decidim_amendments, :state, :old_state + add_column :decidim_amendments, :state, :integer, default: 0, null: false + + Amendment.reset_column_information + + Amendment::STATES.each_pair do |status, index| + Amendment.where(old_state: status).update_all(state: index) # rubocop:disable Rails/SkipsModelValidations + end + + remove_column :decidim_amendments, :old_state + end + + def down + rename_column :decidim_amendments, :state, :old_state + add_column :decidim_amendments, :state, :string, default: "draft", null: false + + Amendment.reset_column_information + + Amendment::STATES.each_pair do |status, index| + Amendment.where(old_state: index).update_all(state: status) # rubocop:disable Rails/SkipsModelValidations + end + + remove_column :decidim_amendments, :old_state + end +end diff --git a/db/migrate/20240311160650_change_states_on_reminder_records.decidim.rb b/db/migrate/20240311160650_change_states_on_reminder_records.decidim.rb new file mode 100644 index 0000000000..68d84843a5 --- /dev/null +++ b/db/migrate/20240311160650_change_states_on_reminder_records.decidim.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true +# This migration comes from decidim (originally 20230427105701) + +class ChangeStatesOnReminderRecords < ActiveRecord::Migration[6.1] + class ReminderRecord < ApplicationRecord + self.table_name = :decidim_reminder_records + STATES = { active: 0, pending: 10, completed: 20, deleted: -1 }.freeze + end + + def up + rename_column :decidim_reminder_records, :state, :old_state + add_column :decidim_reminder_records, :state, :integer, default: 0, null: false + + ReminderRecord.reset_column_information + + ReminderRecord::STATES.each_pair do |status, index| + ReminderRecord.where(old_state: status).update_all(state: index) # rubocop:disable Rails/SkipsModelValidations + end + + remove_column :decidim_reminder_records, :old_state + end + + def down + rename_column :decidim_reminder_records, :state, :old_state + add_column :decidim_reminder_records, :state, :string, default: "draft", null: false + ReminderRecord.reset_column_information + + ReminderRecord::STATES.each_pair do |status, index| + ReminderRecord.where(old_state: index).update_all(state: status) # rubocop:disable Rails/SkipsModelValidations + end + + remove_column :decidim_reminder_records, :old_state + end +end diff --git a/db/migrate/20240311160651_change_default_value_for_decidim_endorsements.decidim.rb b/db/migrate/20240311160651_change_default_value_for_decidim_endorsements.decidim.rb new file mode 100644 index 0000000000..8c079d4b2f --- /dev/null +++ b/db/migrate/20240311160651_change_default_value_for_decidim_endorsements.decidim.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true +# This migration comes from decidim (originally 20231027142329) + +class ChangeDefaultValueForDecidimEndorsements < ActiveRecord::Migration[6.1] + def up + change_column_default :decidim_endorsements, :decidim_user_group_id, 0 + end + + def down + change_column_default :decidim_endorsements, :decidim_user_group_id, nil + end +end diff --git a/db/migrate/20240311160652_remove_official_img_header.decidim.rb b/db/migrate/20240311160652_remove_official_img_header.decidim.rb new file mode 100644 index 0000000000..5e418ee5f3 --- /dev/null +++ b/db/migrate/20240311160652_remove_official_img_header.decidim.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true +# This migration comes from decidim (originally 20231123111229) + +class RemoveOfficialImgHeader < ActiveRecord::Migration[6.1] + def up + remove_column :decidim_organizations, :official_img_header + end + + def down + add_column :decidim_organizations, :official_img_header, :string + end +end diff --git a/db/migrate/20240311160653_change_steps_dates_to_datetime.decidim_participatory_processes.rb b/db/migrate/20240311160653_change_steps_dates_to_datetime.decidim_participatory_processes.rb new file mode 100644 index 0000000000..92e4fb79e9 --- /dev/null +++ b/db/migrate/20240311160653_change_steps_dates_to_datetime.decidim_participatory_processes.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true +# This migration comes from decidim_participatory_processes (originally 20220315100140) + +class ChangeStepsDatesToDatetime < ActiveRecord::Migration[6.0] + def change + change_column :decidim_participatory_process_steps, :start_date, :datetime + change_column :decidim_participatory_process_steps, :end_date, :datetime + end +end diff --git a/db/migrate/20240311160654_change_states_on_collaborative_drafts.decidim_proposals.rb b/db/migrate/20240311160654_change_states_on_collaborative_drafts.decidim_proposals.rb new file mode 100644 index 0000000000..225158e378 --- /dev/null +++ b/db/migrate/20240311160654_change_states_on_collaborative_drafts.decidim_proposals.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true +# This migration comes from decidim_proposals (originally 20230427105700) + +class ChangeStatesOnCollaborativeDrafts < ActiveRecord::Migration[6.1] + class CollaborativeDraft < ApplicationRecord + self.table_name = :decidim_proposals_collaborative_drafts + STATES = { open: 0, published: 10, withdrawn: -1 }.freeze + end + + def up + rename_column :decidim_proposals_collaborative_drafts, :state, :old_state + add_column :decidim_proposals_collaborative_drafts, :state, :integer, default: 0, null: false + + CollaborativeDraft.reset_column_information + + CollaborativeDraft::STATES.each_pair do |status, index| + CollaborativeDraft.where(old_state: status).update_all(state: index) # rubocop:disable Rails/SkipsModelValidations + end + + remove_column :decidim_proposals_collaborative_drafts, :old_state + end + + def down + rename_column :decidim_proposals_collaborative_drafts, :state, :old_state + add_column :decidim_proposals_collaborative_drafts, :state, :string + + CollaborativeDraft.reset_column_information + + CollaborativeDraft::STATES.each_pair do |status, index| + CollaborativeDraft.where(old_state: index).update_all(state: status) # rubocop:disable Rails/SkipsModelValidations + end + + remove_column :decidim_proposals_collaborative_drafts, :old_state + end +end diff --git a/db/migrate/20240311160655_change_states_on_proposals.decidim_proposals.rb b/db/migrate/20240311160655_change_states_on_proposals.decidim_proposals.rb new file mode 100644 index 0000000000..7ea1fed870 --- /dev/null +++ b/db/migrate/20240311160655_change_states_on_proposals.decidim_proposals.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true +# This migration comes from decidim_proposals (originally 20230427105700) + +class ChangeStatesOnProposals < ActiveRecord::Migration[6.1] + class Proposal < ApplicationRecord + self.table_name = :decidim_proposals_proposals + STATES = { not_answered: 0, evaluating: 10, accepted: 20, rejected: -10, withdrawn: -20 }.freeze + end + + def up + rename_column :decidim_proposals_proposals, :state, :old_state + add_column :decidim_proposals_proposals, :state, :integer, default: 0, null: false + + Proposal.reset_column_information + + Proposal::STATES.each_pair do |status, index| + Proposal.where(old_state: status).update_all(state: index) # rubocop:disable Rails/SkipsModelValidations + end + + remove_column :decidim_proposals_proposals, :old_state + end + + def down + rename_column :decidim_proposals_proposals, :state, :old_state + add_column :decidim_proposals_proposals, :state, :string + + Proposal.reset_column_information + + Proposal::STATES.each_pair do |status, index| + Proposal.where(old_state: index).update_all(state: status) # rubocop:disable Rails/SkipsModelValidations + end + + remove_column :decidim_proposals_proposals, :old_state + end +end diff --git a/db/migrate/20240311160656_change_types_and_registration_types_on_meetings.decidim_meetings.rb b/db/migrate/20240311160656_change_types_and_registration_types_on_meetings.decidim_meetings.rb new file mode 100644 index 0000000000..5c57e6d61d --- /dev/null +++ b/db/migrate/20240311160656_change_types_and_registration_types_on_meetings.decidim_meetings.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true +# This migration comes from decidim_meetings (originally 20230427105701) + +class ChangeTypesAndRegistrationTypesOnMeetings < ActiveRecord::Migration[6.1] + class Meeting < ApplicationRecord + self.table_name = :decidim_meetings_meetings + + TYPE_OF_MEETING = { in_person: 0, online: 10, hybrid: 20 }.freeze + REGISTRATION_TYPES = { registration_disabled: 0, on_this_platform: 10, on_different_platform: 20 }.freeze + end + + def up + rename_column :decidim_meetings_meetings, :type_of_meeting, :old_type_of_meeting + rename_column :decidim_meetings_meetings, :registration_type, :old_registration_type + add_column :decidim_meetings_meetings, :type_of_meeting, :integer, default: 0, null: false + add_column :decidim_meetings_meetings, :registration_type, :integer, default: 0, null: false + + Meeting.reset_column_information + + Meeting::TYPE_OF_MEETING.each_pair do |status, index| + Meeting.where(old_type_of_meeting: status).update_all(type_of_meeting: index) # rubocop:disable Rails/SkipsModelValidations + end + Meeting::REGISTRATION_TYPES.each_pair do |status, index| + Meeting.where(old_registration_type: status).update_all(registration_type: index) # rubocop:disable Rails/SkipsModelValidations + end + + remove_column :decidim_meetings_meetings, :old_type_of_meeting + remove_column :decidim_meetings_meetings, :old_registration_type + end + + def down + rename_column :decidim_meetings_meetings, :type_of_meeting, :old_type_of_meeting + rename_column :decidim_meetings_meetings, :registration_type, :old_registration_type + + add_column :decidim_meetings_meetings, :type_of_meeting, :string, default: null + add_column :decidim_meetings_meetings, :registration_type, :string, default: null + + Meeting.reset_column_information + + Meeting::TYPE_OF_MEETING.each_pair do |status, index| + Meeting.where(old_type_of_meeting: index).update_all(type_of_meeting: status) # rubocop:disable Rails/SkipsModelValidations + end + Meeting::REGISTRATION_TYPES.each_pair do |status, index| + Meeting.where(old_registration_type: index).update_all(registration_type: status) # rubocop:disable Rails/SkipsModelValidations + end + + remove_column :decidim_meetings_meetings, :old_type_of_meeting + remove_column :decidim_meetings_meetings, :old_registration_type + end +end diff --git a/db/migrate/20240311160657_add_field_values_and_target_to_decidim_templates.decidim_templates.rb b/db/migrate/20240311160657_add_field_values_and_target_to_decidim_templates.decidim_templates.rb new file mode 100644 index 0000000000..fd1afdb631 --- /dev/null +++ b/db/migrate/20240311160657_add_field_values_and_target_to_decidim_templates.decidim_templates.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true +# This migration comes from decidim_templates (originally 20221006055954) + +class AddFieldValuesAndTargetToDecidimTemplates < ActiveRecord::Migration[6.0] + class Template < ApplicationRecord + self.table_name = :decidim_templates_templates + end + + def change + add_column :decidim_templates_templates, :field_values, :json, default: {} + add_column :decidim_templates_templates, :target, :string + + reversible do |direction| + direction.up do + # rubocop:disable Rails/SkipsModelValidations + Template.where(templatable_type: "Decidim::Forms::Questionnaire").update_all(target: "questionnaire") + Template.where(templatable_type: "Decidim::Organization").update_all(target: "user_block") + # rubocop:enable Rails/SkipsModelValidations + end + end + end +end diff --git a/db/migrate/20240311160658_add_published_at_to_decidim_blogs_posts.decidim_blogs.rb b/db/migrate/20240311160658_add_published_at_to_decidim_blogs_posts.decidim_blogs.rb new file mode 100644 index 0000000000..09d06f1b82 --- /dev/null +++ b/db/migrate/20240311160658_add_published_at_to_decidim_blogs_posts.decidim_blogs.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true +# This migration comes from decidim_blogs (originally 20220812122940) + +class AddPublishedAtToDecidimBlogsPosts < ActiveRecord::Migration[6.1] + class Post < ApplicationRecord + self.table_name = :decidim_blogs_posts + end + + def change + add_column :decidim_blogs_posts, :published_at, :datetime + + reversible do |direction| + direction.up do + Post.update_all("published_at = created_at") # rubocop:disable Rails/SkipsModelValidations + end + end + end +end diff --git a/db/migrate/20240327123826_rename_editor_images_awesome_config.decidim_decidim_awesome.rb b/db/migrate/20240327123826_rename_editor_images_awesome_config.decidim_decidim_awesome.rb new file mode 100644 index 0000000000..a556be33f3 --- /dev/null +++ b/db/migrate/20240327123826_rename_editor_images_awesome_config.decidim_decidim_awesome.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true +# This migration comes from decidim_decidim_awesome (originally 20240306175331) + +class RenameEditorImagesAwesomeConfig < ActiveRecord::Migration[6.1] + class AwesomeConfig < ApplicationRecord + self.table_name = :decidim_awesome_config + end + + # rubocop:disable Rails/SkipsModelValidations + def up + AwesomeConfig.where(var: :allow_images_in_full_editor).update_all(var: :allow_images_in_editors) + AwesomeConfig.where(var: :allow_images_in_small_editor).destroy_all + end + + def down + AwesomeConfig.where(var: :allow_images_in_editors).update_all(var: :allow_images_in_full_editor) + end + # rubocop:enable Rails/SkipsModelValidations +end diff --git a/db/migrate/20240611125821_add_comment_vote_counter_cache_to_comments.decidim_comments.rb b/db/migrate/20240611125821_add_comment_vote_counter_cache_to_comments.decidim_comments.rb new file mode 100644 index 0000000000..e4c0f57627 --- /dev/null +++ b/db/migrate/20240611125821_add_comment_vote_counter_cache_to_comments.decidim_comments.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true +# This migration comes from decidim_comments (originally 20240304092558) + +class AddCommentVoteCounterCacheToComments < ActiveRecord::Migration[6.1] + def change + add_column :decidim_comments_comments, :up_votes_count, :integer, null: false, default: 0, index: true + add_column :decidim_comments_comments, :down_votes_count, :integer, null: false, default: 0, index: true + + # We cannot use the reset_counters as up_votes and down_votes are scoped associationws + reversible do |dir| + dir.up do + Decidim::Comments::Comment.reset_column_information + Decidim::Comments::Comment.find_each do |record| + # rubocop:disable Rails/SkipsModelValidations + record.class.update_counters(record.id, up_votes_count: record.up_votes.length) + record.class.update_counters(record.id, down_votes_count: record.down_votes.length) + # rubocop:enable Rails/SkipsModelValidations + end + end + end + end +end diff --git a/db/migrate/20240611125822_add_valuation_assignments_count_to_decidim_proposals_proposals.decidim_proposals.rb b/db/migrate/20240611125822_add_valuation_assignments_count_to_decidim_proposals_proposals.decidim_proposals.rb new file mode 100644 index 0000000000..97a1674473 --- /dev/null +++ b/db/migrate/20240611125822_add_valuation_assignments_count_to_decidim_proposals_proposals.decidim_proposals.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true +# This migration comes from decidim_proposals (originally 20240404202756) + +class AddValuationAssignmentsCountToDecidimProposalsProposals < ActiveRecord::Migration[6.1] + def change + add_column :decidim_proposals_proposals, :valuation_assignments_count, :integer, default: 0 + + reversible do |dir| + dir.up do + Decidim::Proposals::Proposal.reset_column_information + Decidim::Proposals::Proposal.find_each do |record| + Decidim::Proposals::Proposal.reset_counters(record.id, :valuation_assignments) + end + end + end + end +end diff --git a/db/migrate/20240813060358_add_decidim_awesome_proposal_private_fields.decidim_decidim_awesome.rb b/db/migrate/20240813060358_add_decidim_awesome_proposal_private_fields.decidim_decidim_awesome.rb new file mode 100644 index 0000000000..8ebac8029f --- /dev/null +++ b/db/migrate/20240813060358_add_decidim_awesome_proposal_private_fields.decidim_decidim_awesome.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true +# This migration comes from decidim_decidim_awesome (originally 20240531224204) + +class AddDecidimAwesomeProposalPrivateFields < ActiveRecord::Migration[6.0] + class ProposalExtraField < ApplicationRecord + self.table_name = :decidim_awesome_proposal_extra_fields + end + + def change + add_column :decidim_awesome_proposal_extra_fields, :private_body, :string + add_column :decidim_awesome_proposal_extra_fields, :decidim_proposal_type, :string + reversible do |direction| + direction.up do + execute <<~SQL.squish + UPDATE decidim_awesome_proposal_extra_fields + SET decidim_proposal_type = 'Decidim::Proposals::Proposal' + SQL + end + end + + remove_index :decidim_awesome_proposal_extra_fields, name: "decidim_awesome_extra_fields_on_proposal" + add_index :decidim_awesome_proposal_extra_fields, + [:decidim_proposal_id, :decidim_proposal_type], + name: "index_decidim_awesome_proposal_extra_fields_on_decidim_proposal" + + change_column_null :decidim_awesome_proposal_extra_fields, :decidim_proposal_id, false + change_column_null :decidim_awesome_proposal_extra_fields, :decidim_proposal_type, false + ProposalExtraField.reset_column_information + end +end diff --git a/db/migrate/20240813060359_add_decidim_awesome_proposal_private_fields_date.decidim_decidim_awesome.rb b/db/migrate/20240813060359_add_decidim_awesome_proposal_private_fields_date.decidim_decidim_awesome.rb new file mode 100644 index 0000000000..7d6b053c8c --- /dev/null +++ b/db/migrate/20240813060359_add_decidim_awesome_proposal_private_fields_date.decidim_decidim_awesome.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true +# This migration comes from decidim_decidim_awesome (originally 20240729164227) + +class AddDecidimAwesomeProposalPrivateFieldsDate < ActiveRecord::Migration[6.1] + class ProposalExtraField < ApplicationRecord + self.table_name = :decidim_awesome_proposal_extra_fields + end + + def change + add_column :decidim_awesome_proposal_extra_fields, :private_body_updated_at, :datetime + + reversible do |direction| + direction.up do + execute <<~SQL.squish + UPDATE decidim_awesome_proposal_extra_fields + SET private_body_updated_at = updated_at + SQL + end + end + end +end diff --git a/db/schema.rb b/db/schema.rb index 7698d7fc81..463b5dce86 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2024_01_23_140328) do +ActiveRecord::Schema.define(version: 2024_08_13_060359) do # These are extensions that must be enabled in order to support this database enable_extension "ltree" @@ -127,14 +127,13 @@ t.bigint "decidim_amendable_id" t.string "decidim_emendation_type" t.bigint "decidim_emendation_id" - t.string "state" t.datetime "created_at", null: false t.datetime "updated_at", null: false + t.integer "state", default: 0, null: false t.index ["decidim_amendable_id", "decidim_amendable_type"], name: "index_on_amendable" t.index ["decidim_emendation_id"], name: "index_decidim_amendments_on_decidim_emendation_id" t.index ["decidim_user_id", "decidim_amendable_id", "decidim_amendable_type"], name: "index_on_amender_and_amendable" t.index ["decidim_user_id"], name: "index_decidim_amendments_on_decidim_user_id" - t.index ["state"], name: "index_decidim_amendments_on_state" end create_table "decidim_area_types", force: :cascade do |t| @@ -280,6 +279,25 @@ t.index ["attachment_collection_id"], name: "index_decidim_attachments_on_attachment_collection_id" end + create_table "decidim_authorization_transfer_records", force: :cascade do |t| + t.bigint "transfer_id", null: false + t.string "resource_type", null: false + t.bigint "resource_id", null: false + t.datetime "created_at", null: false + t.index ["resource_type", "resource_id"], name: "index_decidim_authorization_transfer_records_on_resource" + t.index ["transfer_id"], name: "index_decidim_authorization_transfer_records_on_transfer_id" + end + + create_table "decidim_authorization_transfers", force: :cascade do |t| + t.bigint "user_id", null: false + t.bigint "source_user_id", null: false + t.bigint "authorization_id", null: false + t.datetime "created_at", null: false + t.index ["authorization_id"], name: "index_decidim_authorization_transfers_on_authorization_id" + t.index ["source_user_id"], name: "index_decidim_authorization_transfers_on_source_user_id" + t.index ["user_id"], name: "index_decidim_authorization_transfers_on_user_id" + end + create_table "decidim_authorizations", id: :serial, force: :cascade do |t| t.string "name", null: false t.jsonb "metadata" @@ -331,7 +349,10 @@ t.integer "weight_total", default: 0 t.datetime "created_at", precision: 6, null: false t.datetime "updated_at", precision: 6, null: false - t.index ["decidim_proposal_id"], name: "decidim_awesome_extra_fields_on_proposal" + t.string "private_body" + t.string "decidim_proposal_type", null: false + t.datetime "private_body_updated_at" + t.index ["decidim_proposal_id", "decidim_proposal_type"], name: "index_decidim_awesome_proposal_extra_fields_on_decidim_proposal" end create_table "decidim_awesome_vote_weights", force: :cascade do |t| @@ -354,6 +375,7 @@ t.integer "endorsements_count", default: 0, null: false t.integer "comments_count", default: 0, null: false t.integer "follows_count", default: 0, null: false + t.datetime "published_at" t.index ["decidim_author_id", "decidim_author_type"], name: "index_decidim_blogs_posts_on_decidim_author" t.index ["decidim_component_id"], name: "index_decidim_blogs_posts_on_decidim_component_id" t.index ["decidim_user_group_id"], name: "index_decidim_blogs_posts_on_decidim_user_group_id" @@ -473,6 +495,8 @@ t.string "decidim_participatory_space_type" t.integer "decidim_participatory_space_id" t.datetime "deleted_at" + t.integer "up_votes_count", default: 0, null: false + t.integer "down_votes_count", default: 0, null: false t.index ["created_at"], name: "index_decidim_comments_comments_on_created_at" t.index ["decidim_author_id", "decidim_author_type"], name: "index_decidim_comments_comments_on_decidim_author" t.index ["decidim_author_id"], name: "decidim_comments_comment_author" @@ -562,56 +586,6 @@ t.index ["endorsements_count"], name: "idx_decidim_debates_debates_on_endorsemnts_count" end - create_table "decidim_dummy_resources_coauthorable_dummy_resources", force: :cascade do |t| - t.jsonb "translatable_text" - t.string "title" - t.string "body" - t.text "address" - t.float "latitude" - t.float "longitude" - t.datetime "published_at" - t.integer "coauthorships_count", default: 0, null: false - t.integer "endorsements_count", default: 0, null: false - t.integer "comments_count", default: 0, null: false - t.bigint "decidim_component_id" - t.bigint "decidim_category_id" - t.bigint "decidim_scope_id" - t.string "reference" - t.datetime "created_at", precision: 6, null: false - t.datetime "updated_at", precision: 6, null: false - end - - create_table "decidim_dummy_resources_dummy_resources", force: :cascade do |t| - t.jsonb "translatable_text" - t.jsonb "title" - t.string "body" - t.text "address" - t.float "latitude" - t.float "longitude" - t.datetime "published_at" - t.integer "coauthorships_count", default: 0, null: false - t.integer "endorsements_count", default: 0, null: false - t.integer "comments_count", default: 0, null: false - t.integer "follows_count", default: 0, null: false - t.bigint "decidim_component_id" - t.integer "decidim_author_id" - t.string "decidim_author_type" - t.integer "decidim_user_group_id" - t.bigint "decidim_category_id" - t.bigint "decidim_scope_id" - t.string "reference" - t.datetime "created_at", precision: 6, null: false - t.datetime "updated_at", precision: 6, null: false - end - - create_table "decidim_dummy_resources_nested_dummy_resources", force: :cascade do |t| - t.jsonb "translatable_text" - t.string "title" - t.bigint "dummy_resource_id" - t.datetime "created_at", precision: 6, null: false - t.datetime "updated_at", precision: 6, null: false - end - create_table "decidim_editor_images", force: :cascade do |t| t.bigint "decidim_author_id", null: false t.bigint "decidim_organization_id", null: false @@ -626,7 +600,7 @@ t.bigint "resource_id" t.string "decidim_author_type" t.bigint "decidim_author_id" - t.integer "decidim_user_group_id" + t.integer "decidim_user_group_id", default: 0 t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["decidim_author_type", "decidim_author_id"], name: "idx_endorsements_authors" @@ -1026,8 +1000,6 @@ t.integer "comments_count", default: 0, null: false t.string "salt" t.string "online_meeting_url" - t.string "type_of_meeting", default: "in_person" - t.string "registration_type", default: "registration_disabled", null: false t.string "registration_url" t.integer "follows_count", default: 0, null: false t.boolean "customize_registration_email", default: false @@ -1042,6 +1014,8 @@ t.string "state" t.integer "iframe_access_level", default: 0 t.integer "iframe_embed_type", default: 0 + t.integer "type_of_meeting", default: 0, null: false + t.integer "registration_type", default: 0, null: false t.index ["decidim_author_id", "decidim_author_type"], name: "index_decidim_meetings_meetings_on_author" t.index ["decidim_author_id"], name: "index_decidim_meetings_meetings_on_decidim_author_id" t.index ["decidim_component_id"], name: "index_decidim_meetings_meetings_on_decidim_component_id" @@ -1236,7 +1210,6 @@ t.string "logo" t.string "twitter_handler" t.string "favicon" - t.string "official_img_header" t.string "official_img_footer" t.string "official_url" t.string "instagram_handler" @@ -1273,7 +1246,7 @@ t.boolean "force_users_to_authenticate_before_access_organization", default: false t.jsonb "omniauth_settings" t.boolean "rich_text_editor_in_public_views", default: false - t.jsonb "admin_terms_of_use_body" + t.jsonb "admin_terms_of_service_body" t.string "time_zone", limit: 255, default: "UTC" t.boolean "enable_machine_translations", default: false t.integer "comments_max_length", default: 1000 @@ -1282,6 +1255,7 @@ t.jsonb "available_authorizations", default: {} t.string "external_domain_whitelist", default: [], array: true t.boolean "enable_participatory_space_filters", default: true + t.jsonb "content_security_policy", default: {} t.index ["host"], name: "index_decidim_organizations_on_host", unique: true t.index ["name"], name: "index_decidim_organizations_on_name", unique: true end @@ -1316,8 +1290,8 @@ create_table "decidim_participatory_process_steps", id: :serial, force: :cascade do |t| t.jsonb "title", null: false t.jsonb "description" - t.date "start_date" - t.date "end_date" + t.datetime "start_date" + t.datetime "end_date" t.integer "decidim_participatory_process_id" t.datetime "created_at", null: false t.datetime "updated_at", null: false @@ -1431,7 +1405,6 @@ t.text "body", null: false t.integer "decidim_component_id", null: false t.integer "decidim_scope_id" - t.string "state" t.string "reference" t.text "address" t.float "latitude" @@ -1445,10 +1418,10 @@ t.integer "coauthorships_count", default: 0, null: false t.integer "comments_count", default: 0, null: false t.integer "follows_count", default: 0, null: false + t.integer "state", default: 0, null: false t.index ["body"], name: "decidim_proposals_collaborative_draft_body_search" t.index ["decidim_component_id"], name: "decidim_proposals_collaborative_drafts_on_decidim_component_id" t.index ["decidim_scope_id"], name: "decidim_proposals_collaborative_drafts_on_decidim_scope_id" - t.index ["state"], name: "decidim_proposals_collaborative_drafts_on_state" t.index ["title"], name: "decidim_proposals_collaborative_drafts_title_search" t.index ["updated_at"], name: "decidim_proposals_collaborative_drafts_on_updated_at" end @@ -1491,7 +1464,6 @@ t.datetime "updated_at", null: false t.integer "proposal_votes_count", default: 0, null: false t.jsonb "extra" - t.string "state" t.datetime "answered_at" t.jsonb "answer" t.string "reference" @@ -1513,13 +1485,14 @@ t.jsonb "title" t.jsonb "body" t.integer "follows_count", default: 0, null: false + t.integer "state", default: 0, null: false + t.integer "valuation_assignments_count", default: 0 t.index "md5((body)::text)", name: "decidim_proposals_proposal_body_search" t.index "md5((title)::text)", name: "decidim_proposals_proposal_title_search" t.index ["created_at"], name: "index_decidim_proposals_proposals_on_created_at" t.index ["decidim_component_id"], name: "index_decidim_proposals_proposals_on_decidim_component_id" t.index ["decidim_scope_id"], name: "index_decidim_proposals_proposals_on_decidim_scope_id" t.index ["proposal_votes_count"], name: "index_decidim_proposals_proposals_on_proposal_votes_count" - t.index ["state"], name: "index_decidim_proposals_proposals_on_state" end create_table "decidim_proposals_valuation_assignments", force: :cascade do |t| @@ -1540,14 +1513,13 @@ end create_table "decidim_reminder_records", force: :cascade do |t| - t.string "state", default: "active" t.string "string", default: "active" t.bigint "decidim_reminder_id" t.string "remindable_type", null: false t.bigint "remindable_id", null: false + t.integer "state", default: 0, null: false t.index ["decidim_reminder_id"], name: "index_decidim_reminder_records_on_decidim_reminder_id" t.index ["remindable_type", "remindable_id"], name: "index_decidim_reminder_records_remindable" - t.index ["state"], name: "index_decidim_reminder_records_on_state" t.index ["string"], name: "index_decidim_reminder_records_on_string" end @@ -1751,6 +1723,8 @@ t.jsonb "description" t.datetime "created_at", null: false t.datetime "updated_at", null: false + t.json "field_values", default: {} + t.string "target" t.index ["decidim_organization_id"], name: "index_decidim_templates_organization" t.index ["templatable_type", "templatable_id"], name: "index_decidim_templates_templatable" end @@ -1984,6 +1958,10 @@ add_foreign_key "decidim_assemblies", "decidim_assemblies_types" add_foreign_key "decidim_assemblies_settings", "decidim_organizations" add_foreign_key "decidim_attachments", "decidim_attachment_collections", column: "attachment_collection_id", name: "fk_decidim_attachments_attachment_collection_id", on_delete: :nullify + add_foreign_key "decidim_authorization_transfer_records", "decidim_authorization_transfers", column: "transfer_id" + add_foreign_key "decidim_authorization_transfers", "decidim_authorizations", column: "authorization_id" + add_foreign_key "decidim_authorization_transfers", "decidim_users", column: "source_user_id" + add_foreign_key "decidim_authorization_transfers", "decidim_users", column: "user_id" add_foreign_key "decidim_authorizations", "decidim_users" add_foreign_key "decidim_awesome_config_constraints", "decidim_awesome_config" add_foreign_key "decidim_awesome_editor_images", "decidim_organizations" diff --git a/decidim-census_sms/app/commands/decidim/census_sms/verification/send_code.rb b/decidim-census_sms/app/commands/decidim/census_sms/verification/send_code.rb index bc0792f9da..c83e52e689 100644 --- a/decidim-census_sms/app/commands/decidim/census_sms/verification/send_code.rb +++ b/decidim-census_sms/app/commands/decidim/census_sms/verification/send_code.rb @@ -32,7 +32,7 @@ def update_authorization metadata = @authorization.metadata metadata[:mobile_phone_number] = @form.mobile_phone_number_hash - @authorization.update(metadata: metadata, verification_metadata: verification_metadata) + @authorization.update(metadata:, verification_metadata:) end def verification_metadata diff --git a/decidim-census_sms/app/controllers/decidim/census_sms/verification/authorizations_controller.rb b/decidim-census_sms/app/controllers/decidim/census_sms/verification/authorizations_controller.rb index 184bf70df4..f13937862d 100644 --- a/decidim-census_sms/app/controllers/decidim/census_sms/verification/authorizations_controller.rb +++ b/decidim-census_sms/app/controllers/decidim/census_sms/verification/authorizations_controller.rb @@ -9,13 +9,13 @@ class AuthorizationsController < Decidim::ApplicationController helper_method :authorization, :tos_path def new - enforce_permission_to :create, :authorization, authorization: authorization + enforce_permission_to(:create, :authorization, authorization:) @form = AuthorizationForm.new end def create - enforce_permission_to :create, :authorization, authorization: authorization + enforce_permission_to(:create, :authorization, authorization:) @form = AuthorizationForm.from_params(create_params) @@ -27,7 +27,7 @@ def create on(:ok) do flash[:notice] = t("authorizations.create.success", scope: "decidim.census_sms.verification") authorization_method = Decidim::Verifications::Adapter.from_element(authorization.name) - redirect_to authorization_method.resume_authorization_path(redirect_url: redirect_url) + redirect_to authorization_method.resume_authorization_path(redirect_url:) end on(:invalid) do @@ -45,13 +45,13 @@ def create end def edit - enforce_permission_to :update, :authorization, authorization: authorization + enforce_permission_to(:update, :authorization, authorization:) @form = Decidim::Verifications::Sms::ConfirmationForm.from_params(params) end def update - enforce_permission_to :update, :authorization, authorization: authorization + enforce_permission_to(:update, :authorization, authorization:) @form = Decidim::Verifications::Sms::ConfirmationForm.from_params(params) @@ -69,7 +69,7 @@ def update end def reset - enforce_permission_to :update, :authorization, authorization: authorization + enforce_permission_to(:update, :authorization, authorization:) @form = CodeForm.from_params(params) @@ -79,7 +79,7 @@ def reset on(:ok) do flash[:notice] = t("authorizations.reset.success", scope: "decidim.census_sms.verification") authorization_method = Decidim::Verifications::Adapter.from_element(authorization.name) - redirect_to authorization_method.resume_authorization_path(redirect_url: redirect_url) + redirect_to authorization_method.resume_authorization_path(redirect_url:) end on(:invalid) do @@ -90,7 +90,7 @@ def reset end def destroy - enforce_permission_to :destroy, :authorization, authorization: authorization + enforce_permission_to(:destroy, :authorization, authorization:) authorization.destroy! flash[:notice] = t("authorizations.destroy.success", scope: "decidim.census_sms.verification") @@ -101,7 +101,7 @@ def destroy private def create_params - params[:authorization].merge(user: current_user, date_of_birth: date_of_birth) + params[:authorization].merge(user: current_user, date_of_birth:) end def date_of_birth @@ -120,7 +120,7 @@ def authorization end def tos_path - @tos_path ||= decidim.page_path(Decidim::StaticPage.find_by(slug: "terms-and-conditions", organization: current_organization)) + @tos_path ||= decidim.page_path("terms-and-conditions") end end end diff --git a/decidim-census_sms/app/packs/stylesheets/decidim/census_sms/verification.scss b/decidim-census_sms/app/packs/stylesheets/decidim/census_sms/verification.scss index 6b558830f5..4463b25a22 100644 --- a/decidim-census_sms/app/packs/stylesheets/decidim/census_sms/verification.scss +++ b/decidim-census_sms/app/packs/stylesheets/decidim/census_sms/verification.scss @@ -11,7 +11,7 @@ } .label-required { - width: .5rem; + width: 0.5rem; grid-column: 3; justify-self: flex-end; } diff --git a/decidim-census_sms/app/views/decidim/census_sms/verification/authorizations/edit.html.erb b/decidim-census_sms/app/views/decidim/census_sms/verification/authorizations/edit.html.erb index 53f44cd0c3..6858db3d04 100644 --- a/decidim-census_sms/app/views/decidim/census_sms/verification/authorizations/edit.html.erb +++ b/decidim-census_sms/app/views/decidim/census_sms/verification/authorizations/edit.html.erb @@ -1,29 +1,24 @@ -
    -
    -
    -

    <%= t(".title") %>

    -
    - -
    -
    - <%= decidim_form_for(@form, url: authorization_path(redirect_url: redirect_url), method: :put) do |form| %> - <%= form_required_explanation %> +
    +
    +

    <%= t(".title") %>

    +
    -
    - <%= form.text_field :verification_code %> -
    + <%= decidim_form_for(@form, url: authorization_path(redirect_url: redirect_url), method: :put) do |form| %> + <%= form_required_explanation %> -
    - <%= form.submit t(".send"), class: "button expanded", "data-disable-with" => "#{t('.send')}..." %> -
    - <% end %> +
    +
    + <%= form.text_field :verification_code %>
    -
    -
    - <%= t(".instructions") %> - <%= link_to t(".reset"), reset_authorization_path(id: authorization.id) %> -
    + +
    + <%= form.submit t(".send"), class: "button button__lg button__secondary", "data-disable-with" => "#{t('.send')}..." %>
    -
    -
    + <% end %> + +

    + <%= t(".instructions") %> + <%= link_to t(".reset"), reset_authorization_path(id: authorization.id) %> +

    + diff --git a/decidim-census_sms/app/views/decidim/census_sms/verification/authorizations/new.html.erb b/decidim-census_sms/app/views/decidim/census_sms/verification/authorizations/new.html.erb index 7969cf2a1e..46f00c3525 100644 --- a/decidim-census_sms/app/views/decidim/census_sms/verification/authorizations/new.html.erb +++ b/decidim-census_sms/app/views/decidim/census_sms/verification/authorizations/new.html.erb @@ -1,58 +1,54 @@ -
    -
    -
    -

    <%= t(".title") %>

    -
    +
    +
    +

    <%= t(".title") %>

    +
    + + <%= decidim_form_for(@form, url: authorization_path(redirect_url: redirect_url)) do |form| %> + <%= form_required_explanation %> + +
    +
    + <%= form.select :document_type, form.object.census_document_types, prompt: true %> +
    -
    -
    - <%= decidim_form_for(@form, url: authorization_path(redirect_url: redirect_url)) do |form| %> - <%= form_required_explanation %> - -
    - <%= form.select :document_type, form.object.census_document_types, prompt: true %> -
    - -
    - <%= form.text_field :document_number %> -
    - -
    - <%= form.date_select :date_of_birth, start_year: 1900, end_year: 14.years.ago.year, default: 35.years.ago, prompt: { day: t(".date_select.day"), month: t(".date_select.month"), year: t(".date_select.year") } %> -
    - -
    - <%= form.text_field :postal_code %> -

    - <%== t(".postal_code_help") %> -

    -
    - -
    - <% parent_scope = Decidim::Scope.where("name->>'ca' = 'Ciutat'").first %> - <%= form.collection_select :scope_id, current_organization.scopes.where(parent: parent_scope), :id, ->(scope){ translated_attribute(scope.name) }, prompt: t(".scope_prompt") %> -
    - -
    - <%= form.phone_field :mobile_phone_number %> -
    - -
    - <%= form.label :tos_acceptance do %> - <%= form.check_box :tos_acceptance, label: false %> - <%== t("activemodel.attributes.authorization.tos_acceptance_label", tos_path: tos_path) %> - <% end %> -
    - - <%= form.hidden_field :handler_name %> - -
    - <%= form.submit t(".send"), class: "button expanded", "data-disable-with" => "#{t('.send')}..." %> -
    +
    + <%= form.text_field :document_number %> +
    + +
    + <%= form.date_select :date_of_birth, start_year: 1900, end_year: 14.years.ago.year, default: 35.years.ago, prompt: { day: t(".date_select.day"), month: t(".date_select.month"), year: t(".date_select.year") } %> +
    + +
    + <%= form.text_field :postal_code %> +

    + <%== t(".postal_code_help") %> +

    +
    + +
    + <% parent_scope = Decidim::Scope.where("name->>'ca' = 'Ciutat'").first %> + <%= form.collection_select :scope_id, current_organization.scopes.where(parent: parent_scope), :id, ->(scope){ translated_attribute(scope.name) }, prompt: t(".scope_prompt") %> +
    + +
    + <%= form.phone_field :mobile_phone_number %> +
    + +
    + <%= form.label :tos_acceptance do %> + <%= form.check_box :tos_acceptance, label: false %> + <%== t("activemodel.attributes.authorization.tos_acceptance_label", tos_path: tos_path) %> <% end %>
    + + <%= form.hidden_field :handler_name %>
    -
    -
    -<%= stylesheet_pack_tag "decidim_census_sms" %> +
    + <%= form.submit t(".send"), class: "button button__lg button__secondary", "data-disable-with" => "#{t('.send')}..." %> +
    + <% end %> +
    + +<%= append_stylesheet_pack_tag "decidim_census_sms" %> diff --git a/decidim-census_sms/app/views/decidim/census_sms/verification/authorizations/reset.html.erb b/decidim-census_sms/app/views/decidim/census_sms/verification/authorizations/reset.html.erb index 9e0b54ae6d..65cc7292fa 100644 --- a/decidim-census_sms/app/views/decidim/census_sms/verification/authorizations/reset.html.erb +++ b/decidim-census_sms/app/views/decidim/census_sms/verification/authorizations/reset.html.erb @@ -1,23 +1,18 @@ -
    -
    -
    -

    <%= t(".title") %>

    -
    - -
    -
    - <%= decidim_form_for(@form, url: reset_authorization_path(id: authorization.id, redirect_url: redirect_url), method: :post) do |form| %> - <%= form_required_explanation %> - -
    - <%= form.text_field :mobile_phone_number, label: t("mobile_phone_number", scope: "activemodel.attributes.authorization") %> -
    +
    +
    +

    <%= t(".title") %>

    +
    + <%= decidim_form_for(@form, url: reset_authorization_path(id: authorization.id, redirect_url: redirect_url), method: :post) do |form| %> + <%= form_required_explanation %> -
    - <%= form.submit t(".send"), class: "button expanded", "data-disable-with" => "#{t('.send')}..." %> -
    - <% end %> +
    +
    + <%= form.text_field :mobile_phone_number, label: t("mobile_phone_number", scope: "activemodel.attributes.authorization") %>
    -
    -
    + +
    + <%= form.submit t(".send"), class: "button button__lg button__secondary", "data-disable-with" => "#{t('.send')}..." %> +
    + <% end %> + diff --git a/decidim-census_sms/decidim-census_sms.gemspec b/decidim-census_sms/decidim-census_sms.gemspec index 21918c4910..384515c4a0 100644 --- a/decidim-census_sms/decidim-census_sms.gemspec +++ b/decidim-census_sms/decidim-census_sms.gemspec @@ -6,15 +6,15 @@ Gem::Specification.new do |s| s.name = "decidim-census_sms" s.summary = "A verification workflow for Decidim Barcelona." s.description = s.summary - s.required_ruby_version = ">= 3.0" - s.version = "0.0.2" + s.required_ruby_version = ">= 3.1" + s.version = "0.0.3" s.authors = ["Vera Rojman"] s.email = ["vera@platoniq.net"] s.files = Dir["{app,config,lib}/**/*", "Rakefile", "README.md"] - s.add_dependency "decidim-core" + s.add_dependency "decidim-core", "~> 0.28.0" - s.add_development_dependency "decidim-dev" + s.add_development_dependency "decidim-dev", "~> 0.28.0" s.metadata["rubygems_mfa_required"] = "true" end diff --git a/decidim-census_sms/lib/decidim/census_sms/verification/test/shared_examples/with_census_sms_handler.rb b/decidim-census_sms/lib/decidim/census_sms/verification/test/shared_examples/with_census_sms_handler.rb index 99e7a4eb0e..340686f52a 100644 --- a/decidim-census_sms/lib/decidim/census_sms/verification/test/shared_examples/with_census_sms_handler.rb +++ b/decidim-census_sms/lib/decidim/census_sms/verification/test/shared_examples/with_census_sms_handler.rb @@ -33,10 +33,10 @@ def fill_in_authorization_form # rubocop:disable Naming/AccessorMethodName: def get_verified fill_in_authorization_form - click_button "Verifica't" + click_on "Verifica't" fill_in "confirmation_verification_code", with: code - click_button "Verifica't" + click_on "Verifica't" end # rubocop:enable Naming/AccessorMethodName: diff --git a/decidim-census_sms/spec/rails_helper.rb b/decidim-census_sms/spec/rails_helper.rb index ee8491ac8b..3bbda0e5ba 100644 --- a/decidim-census_sms/spec/rails_helper.rb +++ b/decidim-census_sms/spec/rails_helper.rb @@ -1,3 +1,3 @@ # frozen_string_literal: true -require "../../spec/rails_helper" +require_relative "../../spec/rails_helper" diff --git a/decidim-census_sms/spec/system/census_sms_authorization_spec.rb b/decidim-census_sms/spec/system/census_sms_authorization_spec.rb index 534fc76ae1..4da16a8622 100644 --- a/decidim-census_sms/spec/system/census_sms_authorization_spec.rb +++ b/decidim-census_sms/spec/system/census_sms_authorization_spec.rb @@ -2,7 +2,7 @@ require "rails_helper" -describe "Census + SMS authorization", type: :system, perform_enqueued: true, with_authorization_workflows: ["census_sms_authorization_handler"] do +describe "Census + SMS authorization", :perform_enqueued, with_authorization_workflows: ["census_sms_authorization_handler"] do let(:organization) do create( :organization, @@ -17,9 +17,9 @@ let(:authorization_name) { "Verificació Pressupostos Participatius" } let(:authorizations) { { "census_sms_authorization_handler" => { "allow_ephemeral_participation" => true } } } let(:code) { user_authorization.verification_metadata["verification_code"] } - let(:user_authorization) { Decidim::Authorization.find_by(user: user, name: "census_sms_authorization_handler") } + let(:user_authorization) { Decidim::Authorization.find_by(user:, name: "census_sms_authorization_handler") } - let!(:scope) { create :scope, organization: organization, code: "1" } + let!(:scope) { create(:scope, organization:, code: "1") } let(:response) do Nokogiri::XML("01").remove_namespaces! @@ -43,10 +43,11 @@ def fill_in_authorization_form allow_any_instance_of(Decidim::CensusSms::Verification::AuthorizationForm).to receive(:response).and_return(response) # rubocop:enable RSpec/AnyInstance: switch_to_host(organization.host) + stub_request(:post, "http://example.org/sms").to_return(status: 200, body: "OK") end context "when visiting authorizations" do - let(:user) { create(:user, :confirmed, organization: organization) } + let(:user) { create(:user, :confirmed, organization:) } before do login_as user, scope: :user @@ -54,20 +55,22 @@ def fill_in_authorization_form end it "allows the user to authorize against available authorizations" do + skip "Capybara driver is not able to handle the form submission in this case" + within_user_menu do - click_link "El meu compte" + click_on "El meu compte" end - click_link "Autoritzacions" - click_link authorization_name + click_on "Autoritzacions" + click_on authorization_name fill_in_authorization_form - click_button "Verifica't" + click_on "Verifica't" expect(page).to have_content("Has completat el primer pas") fill_in "confirmation_verification_code", with: code - click_button "Verifica't" + click_on "Verifica't" expect(page).to have_content("T'has verificat correctament") @@ -75,30 +78,32 @@ def fill_in_authorization_form within ".authorizations-list" do expect(page).to have_content(authorization_name) - expect(page).not_to have_link(authorization_name) + expect(page).to have_no_link(authorization_name) end end it "allows the user to reset the verification code" do + skip "Capybara driver is not able to handle the form submission in this case" + within_user_menu do - click_link "El meu compte" + click_on "El meu compte" end - click_link "Autoritzacions" - click_link authorization_name + click_on "Autoritzacions" + click_on authorization_name fill_in_authorization_form - click_button "Verifica't" + click_on "Verifica't" - click_link "Restableix el codi de verificació" + click_on "Restableix el codi de verificació" fill_in "code[mobile_phone_number]", with: "(+34) 654 321 987" - click_button "Envia'm un nou codi" + click_on "Envia'm un nou codi" expect(page).to have_content("T'hem enviat un nou codi de verificació") fill_in "confirmation_verification_code", with: code - click_button "Verifica't" + click_on "Verifica't" expect(page).to have_content("T'has verificat correctament") @@ -106,45 +111,45 @@ def fill_in_authorization_form within ".authorizations-list" do expect(page).to have_content(authorization_name) - expect(page).not_to have_link(authorization_name) + expect(page).to have_no_link(authorization_name) end end context "when the user has completed the first authorization step" do let!(:code) { "012345" } - let!(:authorization) { create(:authorization, :pending, name: "census_sms_authorization_handler", user: user, verification_metadata: { verification_code: code, code_sent_at: Time.current }) } + let!(:authorization) { create(:authorization, :pending, name: "census_sms_authorization_handler", user:, verification_metadata: { verification_code: code, code_sent_at: Time.current }) } it "can resume the authorization" do visit decidim_verifications.authorizations_path - click_link authorization_name + click_on authorization_name expect(page).to have_content("Introdueix el codi") fill_in "confirmation_verification_code", with: code - click_button "Verifica't" + click_on "Verifica't" expect(page).to have_content("T'has verificat correctament") end end context "when the user has already been authorised" do - let!(:authorization) { create(:authorization, name: "census_sms_authorization_handler", user: user) } + let!(:authorization) { create(:authorization, name: "census_sms_authorization_handler", user:) } it "shows the authorization at their account" do visit decidim_verifications.authorizations_path within ".authorizations-list" do expect(page).to have_content(authorization_name) - expect(page).to have_content(I18n.l(authorization.granted_at, format: :long, locale: :ca)) + expect(page).to have_content(I18n.l(authorization.granted_at, format: :long_with_particles, locale: :ca)) end end end end context "when trying to authorize another user with previously used information" do - let!(:authorization) { create(:authorization, name: "census_sms_authorization_handler", unique_id: unique_id, organization: organization) } - let!(:user) { create(:user, :confirmed, organization: organization) } + let!(:authorization) { create(:authorization, name: "census_sms_authorization_handler", unique_id:, organization:) } + let!(:user) { create(:user, :confirmed, organization:) } let(:unique_id) do Digest::MD5.hexdigest( "#{document_number}-#{Rails.application.secrets.secret_key_base}" @@ -157,12 +162,12 @@ def fill_in_authorization_form end it "throws an error" do - click_link authorization_name + click_on authorization_name fill_in_authorization_form - click_button "Verifica't" + click_on "Verifica't" expect(page).to have_content("Ja hi ha una participant autoritzada amb les mateixes dades") - expect(page).not_to have_content("Restableix el codi de verificació") + expect(page).to have_no_content("Restableix el codi de verificació") end end end diff --git a/decidim-dataviz/app/packs/entrypoints/decidim_dataviz.js b/decidim-dataviz/app/packs/entrypoints/decidim_dataviz.js index a401a40fec..cb60f7634a 100644 --- a/decidim-dataviz/app/packs/entrypoints/decidim_dataviz.js +++ b/decidim-dataviz/app/packs/entrypoints/decidim_dataviz.js @@ -1,3 +1 @@ -import "src/decidim/dataviz/dataviz.js"; -// CSS for compiling import "stylesheets/decidim/dataviz/dataviz.scss"; diff --git a/app/packs/images/.keep b/decidim-dataviz/app/packs/src/.keep similarity index 100% rename from app/packs/images/.keep rename to decidim-dataviz/app/packs/src/.keep diff --git a/decidim-dataviz/app/packs/src/decidim/dataviz/dataviz.js b/decidim-dataviz/app/packs/src/decidim/dataviz/dataviz.js deleted file mode 100644 index 7b07c6d9d6..0000000000 --- a/decidim-dataviz/app/packs/src/decidim/dataviz/dataviz.js +++ /dev/null @@ -1,8 +0,0 @@ -import "src/vendor/jquery.browser"; -import "src/vendor/jquery-iframe-auto-height"; - -$(() => { - $("iframe.autoheight").iframeAutoHeight({ - heightOffset: 150 - }); -}) diff --git a/decidim-dataviz/app/packs/src/vendor/jquery-iframe-auto-height.js b/decidim-dataviz/app/packs/src/vendor/jquery-iframe-auto-height.js deleted file mode 100644 index 15ce50b372..0000000000 --- a/decidim-dataviz/app/packs/src/vendor/jquery-iframe-auto-height.js +++ /dev/null @@ -1,219 +0,0 @@ -/*! jquery-iframe-auto-height - v2.0.0 - * Release on: 2015-06-28 - * Copyright (c) 2015 Jesse House - * Licensed The Unlicense */ -(function (root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module unless amdModuleId is set - define([], function () { - return (factory()); - }); - } else if (typeof exports === 'object') { - // Node. Does not work with strict CommonJS, but - // only CommonJS-like environments that support module.exports, - // like Node. - module.exports = factory(); - } else { - factory(); - } -}(this, function () { - -(function ($) { - $.fn.iframeAutoHeight = function (spec) { - - var undef; - if ($.browser === undef) { - var message = []; - message.push("WARNING: you appear to be using a newer version of jquery which does not support the $.browser variable."); - message.push("The jQuery iframe auto height plugin relies heavly on the $.browser features."); - message.push("Install jquery-browser: https://raw.github.com/house9/jquery-iframe-auto-height/master/release/jquery.browser.js"); - alert(message.join("\n")); - return $; - } - - // set default option values - var options = $.extend({ - heightOffset: 0, - minHeight: 0, - maxHeight: 0, - callback: function () {}, - animate: false, - debug: false, - diagnostics: false, // used for development only - resetToMinHeight: false, - triggerFunctions: [], - heightCalculationOverrides: [] - }, spec); - - // logging - function debug(message) { - if (options.debug && options.debug === true && window.console) { - console.log(message); - } - } - - // not used by production code - function showDiagnostics(iframe, calledFrom) { - debug("Diagnostics from '" + calledFrom + "'"); - try { - debug(" " + $(iframe, window.parent).contents().find('body')[0].scrollHeight + " for ...find('body')[0].scrollHeight"); - debug(" " + $(iframe.contentWindow.document).height() + " for ...contentWindow.document).height()"); - debug(" " + $(iframe.contentWindow.document.body).height() + " for ...contentWindow.document.body).height()"); - } catch (ex) { - // ie fails when called during for each, ok later on - // probably not an issue if called in a document ready block - debug(" unable to check in this state"); - } - debug("End diagnostics -> results vary by browser and when diagnostics are requested"); - } - - // show all option values - debug(options); - - // ****************************************************** - // iterate over the matched elements passed to the plugin ; return will make it chainable - return this.each(function () { - - // ****************************************************** - // http://api.jquery.com/jQuery.browser/ - var strategyKeys = ['webkit', 'mozilla', 'msie', 'opera', 'chrome']; - var strategies = {}; - strategies['default'] = function (iframe, $iframeBody, options) { - // NOTE: this is how the plugin determines the iframe height, override if you need custom - return $iframeBody[0].scrollHeight + options.heightOffset; - }; - - jQuery.each(strategyKeys, function (index, value) { - // use the default strategy for all browsers, can be overridden if desired - strategies[value] = strategies['default']; - }); - - // override strategies if registered in options - jQuery.each(options.heightCalculationOverrides, function (index, value) { - strategies[value.browser] = value.calculation; - }); - - function findStrategy(browser) { - var strategy = null; - - jQuery.each(strategyKeys, function (index, value) { - if (browser[value]) { - strategy = strategies[value]; - return false; - } - }); - - if (strategy === null) { - strategy = strategies['default']; - } - - return strategy; - } - // ****************************************************** - - // for use by webkit only - var loadCounter = 0; - - var iframeDoc = this.contentDocument || this.contentWindow.document; - - // resizeHeight - function resizeHeight(iframe) { - if (options.diagnostics) { - showDiagnostics(iframe, "resizeHeight"); - } - - // set the iframe size to minHeight so it'll get smaller on resizes in FF and IE - if (options.resetToMinHeight && options.resetToMinHeight === true) { - iframe.style.height = options.minHeight + 'px'; - } - - // get the iframe body height and set inline style to that plus a little - var $body = $(iframe, window.parent).contents().find('body'); - var strategy = findStrategy($.browser); - var newHeight = strategy(iframe, $body, options, $.browser); - debug(newHeight); - - if (newHeight < options.minHeight) { - debug("new height is less than minHeight"); - newHeight = options.minHeight; - } - - if (options.maxHeight > 0 && newHeight > options.maxHeight) { - debug("new height is greater than maxHeight"); - newHeight = options.maxHeight; - } - - newHeight += options.heightOffset; - - debug("New Height: " + newHeight); - if (options.animate) { - $(iframe).animate({height: newHeight + 'px'}, {duration: 500}); - } else { - iframe.style.height = newHeight + 'px'; - } - - options.callback.apply($(iframe), [{newFrameHeight: newHeight}]); - } // END resizeHeight - - // debug me - debug(this); - if (options.diagnostics) { - showDiagnostics(this, "each iframe"); - } - - // if trigger functions are registered, invoke them - if (options.triggerFunctions.length > 0) { - debug(options.triggerFunctions.length + " trigger Functions"); - for (var i = 0; i < options.triggerFunctions.length; i++) { - options.triggerFunctions[i](resizeHeight, this); - } - } - - // Check if browser is Webkit (Safari/Chrome) or Opera - if ($.browser.webkit || $.browser.opera || $.browser.chrome) { - debug("browser is webkit (Safari/Chrome) or opera"); - - // Start timer when loaded. - $(this).load(function () { - var delay = 0; - var iframe = this; - - var delayedResize = function () { - resizeHeight(iframe); - }; - - if (loadCounter === 0) { - // delay the first one - delay = 500; - } else { - // Reset iframe height to 0 to force new frame size to fit window properly - // this is only an issue when going from large to small iframe, not executed on page load - iframe.style.height = options.minHeight + 'px'; - } - - debug("load delay: " + delay); - setTimeout(delayedResize, delay); - loadCounter++; - }); - - // Safari and Opera need a kick-start. - var source = $(this).attr('src'); - $(this).attr('src', ''); - $(this).attr('src', source); - } else { - // For other browsers. - if(iframeDoc.readyState === 'complete') { - resizeHeight(this); - } else { - $(this).load(function () { - resizeHeight(this); - }); - } - } // if browser - - }); // $(this).each(function () { - }; // $.fn.iframeAutoHeight = function (options) { -}(jQuery)); // (function ($) { - - -})); diff --git a/decidim-dataviz/app/packs/src/vendor/jquery.browser.js b/decidim-dataviz/app/packs/src/vendor/jquery.browser.js deleted file mode 100644 index c1acb863a0..0000000000 --- a/decidim-dataviz/app/packs/src/vendor/jquery.browser.js +++ /dev/null @@ -1,39 +0,0 @@ -(function( jQuery ) { - var matched, - userAgent = navigator.userAgent || ""; - - // Use of jQuery.browser is frowned upon. - // More details: http://api.jquery.com/jQuery.browser - // jQuery.uaMatch maintained for back-compat - jQuery.uaMatch = function( ua ) { - ua = ua.toLowerCase(); - - var match = /(chrome)[ \/]([\w.]+)/.exec( ua ) || - /(webkit)[ \/]([\w.]+)/.exec( ua ) || - /(opera)(?:.*version)?[ \/]([\w.]+)/.exec( ua ) || - /(msie) ([\w.]+)/.exec( ua ) || - ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+))?/.exec( ua ) || - []; - - return { - browser: match[ 1 ] || "", - version: match[ 2 ] || "0" - }; - }; - - matched = jQuery.uaMatch( userAgent ); - - jQuery.browser = {}; - - if ( matched.browser ) { - jQuery.browser[ matched.browser ] = true; - jQuery.browser.version = matched.version; - } - - // Deprecated, use jQuery.browser.webkit instead - // Maintained for back-compat only - if ( jQuery.browser.webkit ) { - jQuery.browser.safari = true; - } - -}( jQuery )); \ No newline at end of file diff --git a/decidim-dataviz/app/packs/stylesheets/decidim/dataviz/dataviz.scss b/decidim-dataviz/app/packs/stylesheets/decidim/dataviz/dataviz.scss index b9448afee2..5f1adc711e 100644 --- a/decidim-dataviz/app/packs/stylesheets/decidim/dataviz/dataviz.scss +++ b/decidim-dataviz/app/packs/stylesheets/decidim/dataviz/dataviz.scss @@ -1,50 +1,6 @@ -@import "stylesheets/decidim/variables"; -@import "stylesheets/decidim/utils/settings"; - .dataviz { - margin-top: -2rem; - - .menu { - margin-bottom: 2rem; - } - iframe { - overflow-x: hidden; - overflow-y: hidden; - } - - .dataviz-embedded { - &:not(.autoheight) { - height: rem-calc(250px); - - @include breakpoint(medium) { - height: rem-calc(450px); - } - - @include breakpoint(large) { - height: rem-calc(800px); - } - } - - &.total_interactions { - height: rem-calc(600px); - - @include breakpoint(medium) { - height: rem-calc(800px); - } - - @include breakpoint(large) { - height: rem-calc(800px); - } - } - + overflow: hidden hidden; width: 100%; - border: 0; - } - - @include breakpoint(large) { - .mobile-devices-alert { - display: none; - } } } diff --git a/decidim-dataviz/app/views/decidim/dataviz/dataviz/_action_plans.html.erb b/decidim-dataviz/app/views/decidim/dataviz/dataviz/_action_plans.html.erb index 308a43ba9b..eab03e8cfe 100644 --- a/decidim-dataviz/app/views/decidim/dataviz/dataviz/_action_plans.html.erb +++ b/decidim-dataviz/app/views/decidim/dataviz/dataviz/_action_plans.html.erb @@ -1 +1 @@ - + diff --git a/decidim-dataviz/app/views/decidim/dataviz/dataviz/_map.html.erb b/decidim-dataviz/app/views/decidim/dataviz/dataviz/_map.html.erb index 0b32d973fc..2ffdcad043 100644 --- a/decidim-dataviz/app/views/decidim/dataviz/dataviz/_map.html.erb +++ b/decidim-dataviz/app/views/decidim/dataviz/dataviz/_map.html.erb @@ -1 +1 @@ - + diff --git a/decidim-dataviz/app/views/decidim/dataviz/dataviz/_meetings.html.erb b/decidim-dataviz/app/views/decidim/dataviz/dataviz/_meetings.html.erb index a22e084052..73ff433518 100644 --- a/decidim-dataviz/app/views/decidim/dataviz/dataviz/_meetings.html.erb +++ b/decidim-dataviz/app/views/decidim/dataviz/dataviz/_meetings.html.erb @@ -1 +1 @@ - + diff --git a/decidim-dataviz/app/views/decidim/dataviz/dataviz/_open_data.html.erb b/decidim-dataviz/app/views/decidim/dataviz/dataviz/_open_data.html.erb index eacfca4782..1290764341 100644 --- a/decidim-dataviz/app/views/decidim/dataviz/dataviz/_open_data.html.erb +++ b/decidim-dataviz/app/views/decidim/dataviz/dataviz/_open_data.html.erb @@ -3,9 +3,9 @@
      <% %w{proposals meetings action_plans}.each do |item| %> -
    • +
    • - <%= link_to asset_url("/dataviz/documents/#{item}.csv"), download: "#{item}.csv" do %> + <%= link_to asset_url("/dataviz/documents/#{item}.csv"), download: "#{item}.csv", class: "button button__lg button__primary" do %> <%= t ".download-#{item}" %> <% end %> diff --git a/decidim-dataviz/app/views/decidim/dataviz/dataviz/_proposals.html.erb b/decidim-dataviz/app/views/decidim/dataviz/dataviz/_proposals.html.erb index 0623bbfca7..42fba100c1 100644 --- a/decidim-dataviz/app/views/decidim/dataviz/dataviz/_proposals.html.erb +++ b/decidim-dataviz/app/views/decidim/dataviz/dataviz/_proposals.html.erb @@ -1 +1 @@ - + diff --git a/decidim-dataviz/app/views/decidim/dataviz/dataviz/_summary.html.erb b/decidim-dataviz/app/views/decidim/dataviz/dataviz/_summary.html.erb index eb1cc78341..31dcb545ec 100644 --- a/decidim-dataviz/app/views/decidim/dataviz/dataviz/_summary.html.erb +++ b/decidim-dataviz/app/views/decidim/dataviz/dataviz/_summary.html.erb @@ -1 +1 @@ - + diff --git a/decidim-dataviz/app/views/decidim/dataviz/dataviz/_total_interactions.html.erb b/decidim-dataviz/app/views/decidim/dataviz/dataviz/_total_interactions.html.erb index 746263be08..7a3f401292 100644 --- a/decidim-dataviz/app/views/decidim/dataviz/dataviz/_total_interactions.html.erb +++ b/decidim-dataviz/app/views/decidim/dataviz/dataviz/_total_interactions.html.erb @@ -1 +1 @@ - + diff --git a/decidim-dataviz/app/views/decidim/dataviz/dataviz/show.html.erb b/decidim-dataviz/app/views/decidim/dataviz/dataviz/show.html.erb index 8094b2f3bf..5acbd2a4e3 100644 --- a/decidim-dataviz/app/views/decidim/dataviz/dataviz/show.html.erb +++ b/decidim-dataviz/app/views/decidim/dataviz/dataviz/show.html.erb @@ -1,28 +1,48 @@ -
      -
      -
      -
  • +<%= f.fields_for :available_authorizations do %> + <%= f.label :available_authorizations, "", class: @form.respond_to?(:errors) && @form.errors[:default_locale].present? ? "is-invalid-label" : "" %> +
    - - - + + + @@ -13,7 +14,7 @@ <% Decidim.authorization_workflows.each do |authorization_workflow| %> @@ -45,14 +46,14 @@ <% end %>
    <%= f.label :available_authorizations %><%= f.label :enabled %><%= f.label :allows_ephemeral_participation %><%= f.label :enabled, t("activemodel.attributes.organization.enabled"), style: "font-size: 16px;" %><%= f.label :allows_ephemeral_participation, t("activemodel.attributes.organization.allows_ephemeral_participation"), style: "font-size: 16px;" %>
    - <%= ff.label authorization_workflow.description %> + <%= ff.label authorization_workflow.description, authorization_workflow.description, style: "font-size: 16px; font-weight: 400;" %> <%= ff.check_box( @@ -36,7 +37,7 @@ id: "organization_available_authorizations_#{authorization_workflow.name}_allow_ephemeral_participation", checked: (f.object.available_authorizations.presence || {}).dig(authorization_workflow.name, "allow_ephemeral_participation") == true, disabled: !authorization_workflow.ephemerable, - class: ("hide" if !authorization_workflow.ephemerable) + class: ("hide" unless authorization_workflow.ephemerable) } # options ) %>
    -
    +<% end %>