decidim 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of decidim might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/.circleci/config.yml +3 -1
- data/.codeclimate.yml +2 -3
- data/.rubocop.yml +1 -48
- data/.travis.yml +1 -0
- data/Dockerfile +1 -0
- data/Gemfile +1 -0
- data/Gemfile.lock +119 -115
- data/README.md +24 -9
- data/Rakefile +14 -10
- data/decidim-admin/app/assets/javascripts/decidim/admin/application.js.es6 +21 -9
- data/decidim-admin/app/assets/javascripts/decidim/admin/sort_list.component.js.es6 +35 -0
- data/decidim-admin/app/assets/stylesheets/decidim/admin/extra/_language-chooser.scss +4 -0
- data/decidim-admin/app/assets/stylesheets/decidim/admin/extra/_sort.scss +12 -0
- data/decidim-admin/app/controllers/decidim/admin/application_controller.rb +1 -0
- data/decidim-admin/app/controllers/decidim/admin/participatory_process_attachments_controller.rb +4 -0
- data/decidim-admin/app/helpers/decidim/admin/menu_helper.rb +0 -1
- data/decidim-admin/app/models/decidim/admin/participatory_process_user_role.rb +2 -2
- data/decidim-admin/app/views/decidim/admin/categories/index.html.erb +7 -1
- data/decidim-admin/app/views/decidim/admin/exports/_dropdown.html.erb +1 -1
- data/decidim-admin/app/views/decidim/admin/moderations/index.html.erb +6 -2
- data/decidim-admin/app/views/decidim/admin/participatory_process_steps/index.html.erb +1 -0
- data/decidim-admin/app/views/layouts/decidim/admin/_title_bar.html.erb +10 -0
- data/decidim-admin/bin/rails +3 -3
- data/decidim-admin/config/locales/ca.yml +3 -1
- data/decidim-admin/config/locales/en.yml +3 -1
- data/decidim-admin/config/locales/es.yml +3 -1
- data/decidim-admin/config/locales/eu.yml +0 -1
- data/decidim-admin/config/locales/fi.yml +0 -1
- data/decidim-admin/config/locales/fr.yml +0 -1
- data/decidim-admin/config/locales/it.yml +490 -0
- data/decidim-admin/db/migrate/20161102144648_add_admin_participatory_process_user_roles.rb +5 -3
- data/decidim-admin/db/migrate/20170128112958_change_user_groups_verified_to_timestamp.rb +2 -0
- data/decidim-admin/decidim-admin.gemspec +2 -1
- data/decidim-admin/lib/decidim/admin/engine.rb +1 -1
- data/decidim-admin/lib/decidim/admin/test/manage_attachments_examples.rb +3 -3
- data/decidim-admin/spec/commands/reject_user_group_spec.rb +2 -2
- data/decidim-admin/spec/features/admin_copy_participatory_process_spec.rb +2 -2
- data/decidim-admin/spec/features/admin_invite_spec.rb +1 -1
- data/decidim-admin/spec/features/admin_manages_features_spec.rb +2 -2
- data/decidim-admin/spec/features/admin_manages_newsletters_spec.rb +4 -4
- data/decidim-admin/spec/features/admin_manages_organization_spec.rb +6 -6
- data/decidim-admin/spec/features/admin_manages_participatory_process_groups_spec.rb +4 -4
- data/decidim-admin/spec/features/admin_manages_participatory_processes_spec.rb +4 -4
- data/decidim-admin/spec/features/static_pages_spec.rb +4 -4
- data/decidim-admin/spec/forms/organization_form_spec.rb +1 -1
- data/decidim-admin/spec/shared/manage_process_categories_examples.rb +44 -29
- data/decidim-admin/spec/shared/manage_process_steps_examples.rb +3 -3
- data/decidim-admin/spec/shared/manage_processes_examples.rb +1 -1
- data/decidim-admin/spec/shared/participatory_admin_shared_context.rb +3 -3
- data/decidim-admin/spec/spec_helper.rb +3 -2
- data/decidim-api/bin/rails +3 -3
- data/decidim-api/decidim-api.gemspec +2 -1
- data/decidim-api/lib/decidim/api/engine.rb +1 -1
- data/decidim-api/spec/spec_helper.rb +3 -2
- data/decidim-budgets/app/controllers/decidim/budgets/application_controller.rb +1 -1
- data/decidim-budgets/app/models/decidim/budgets/line_item.rb +1 -2
- data/decidim-budgets/app/models/decidim/budgets/order.rb +2 -2
- data/decidim-budgets/app/views/decidim/budgets/projects/_linked_projects.html.erb +1 -1
- data/decidim-budgets/bin/rails +3 -3
- data/decidim-budgets/config/locales/it.yml +126 -0
- data/decidim-budgets/db/migrate/20170127114122_create_projects.rb +2 -0
- data/decidim-budgets/db/migrate/20170130095615_create_orders.rb +2 -0
- data/decidim-budgets/db/migrate/20170130101825_create_line_items.rb +2 -0
- data/decidim-budgets/db/migrate/20170207101750_remove_short_description_from_decidim_projects.rb +2 -0
- data/decidim-budgets/db/migrate/20170215132708_add_reference_to_projects.rb +2 -0
- data/decidim-budgets/db/migrate/20170410074214_remove_not_null_reference_budgets.rb +2 -0
- data/decidim-budgets/db/migrate/20170612101846_migrate_projects_category.rb +15 -0
- data/decidim-budgets/decidim-budgets.gemspec +3 -1
- data/decidim-budgets/lib/decidim/budgets/feature.rb +2 -2
- data/decidim-budgets/spec/features/admin_manages_project_attachments_spec.rb +5 -3
- data/decidim-budgets/spec/features/admin_manages_projects_spec.rb +5 -7
- data/decidim-budgets/spec/features/process_admin_manages_project_attachments_spec.rb +4 -4
- data/decidim-budgets/spec/features/process_admin_manages_projects_spec.rb +5 -8
- data/decidim-budgets/spec/shared/manage_attachments_examples.rb +0 -4
- data/decidim-budgets/spec/shared/manage_projects_examples.rb +3 -3
- data/decidim-budgets/spec/spec_helper.rb +2 -1
- data/decidim-comments/app/assets/javascripts/decidim/comments/bundle.js +0 -0
- data/decidim-comments/app/commands/decidim/comments/create_comment.rb +2 -2
- data/decidim-comments/app/frontend/comments/add_comment_form.component.tsx +1 -0
- data/decidim-comments/app/frontend/comments/comment.component.test.tsx +12 -1
- data/decidim-comments/app/frontend/comments/comment.component.tsx +42 -4
- data/decidim-comments/app/frontend/comments/comment_thread.component.test.tsx +11 -0
- data/decidim-comments/app/frontend/comments/comment_thread.component.tsx +5 -1
- data/decidim-comments/app/frontend/fragments/comment_data.fragment.graphql +3 -0
- data/decidim-comments/app/frontend/support/generate_comments_data.ts +3 -0
- data/decidim-comments/app/frontend/support/schema.ts +18 -12
- data/decidim-comments/app/mailers/decidim/comments/comment_notification_mailer.rb +6 -4
- data/decidim-comments/app/models/decidim/comments/comment.rb +6 -4
- data/decidim-comments/app/models/decidim/comments/comment_vote.rb +1 -2
- data/decidim-comments/app/models/decidim/comments/seed.rb +5 -2
- data/decidim-comments/app/resolvers/decidim/comments/vote_comment_resolver.rb +3 -0
- data/decidim-comments/app/types/decidim/comments/commentable_interface.rb +3 -3
- data/decidim-comments/app/views/decidim/comments/comment_notification_mailer/comment_created.html.erb +1 -1
- data/decidim-comments/app/views/decidim/comments/comment_notification_mailer/reply_created.html.erb +1 -1
- data/decidim-comments/bin/rails +3 -3
- data/decidim-comments/config/locales/ca.yml +5 -0
- data/decidim-comments/config/locales/en.yml +5 -0
- data/decidim-comments/config/locales/es.yml +5 -0
- data/decidim-comments/config/locales/it.yml +65 -0
- data/decidim-comments/db/migrate/20161130143508_create_comments.rb +2 -0
- data/decidim-comments/db/migrate/20161214082645_add_depth_to_comments.rb +2 -0
- data/decidim-comments/db/migrate/20161216102820_add_alignment_to_comments.rb +2 -0
- data/decidim-comments/db/migrate/20161219150806_create_comment_votes.rb +3 -1
- data/decidim-comments/db/migrate/20170123102043_add_user_group_id_to_comments.rb +2 -0
- data/decidim-comments/db/migrate/20170504085413_add_root_commentable_to_comments.rb +2 -0
- data/decidim-comments/db/migrate/20170510091348_update_root_commentable_for_comments.rb +3 -2
- data/decidim-comments/db/migrate/20170510091409_set_root_commentable_null_constraints.rb +2 -0
- data/decidim-comments/decidim-comments.gemspec +2 -1
- data/decidim-comments/lib/decidim/comments/comment_serializer.rb +1 -1
- data/decidim-comments/lib/decidim/comments/commentable.rb +4 -4
- data/decidim-comments/spec/commands/create_comment_spec.rb +2 -2
- data/decidim-comments/spec/features/admin_manages_comments_spec.rb +4 -9
- data/decidim-comments/spec/features/process_admin_manages_comments_spec.rb +5 -11
- data/decidim-comments/spec/mailers/comment_notification_mailer_spec.rb +12 -7
- data/decidim-comments/spec/shared/author_localised_email.rb +26 -0
- data/decidim-comments/spec/spec_helper.rb +1 -1
- data/decidim-dev/config/locales/it.yml +9 -0
- data/decidim-dev/decidim-dev.gemspec +8 -3
- data/decidim-dev/lib/decidim/dev.rb +1 -8
- data/decidim-dev/lib/decidim/dev/railtie.rb +1 -1
- data/decidim-dev/lib/decidim/dev/test/base_spec_helper.rb +6 -4
- data/decidim-dev/lib/decidim/dev/test/rspec_support/capybara.rb +2 -2
- data/decidim-dev/lib/decidim/dev/test/rspec_support/feature.rb +4 -2
- data/decidim-dev/lib/decidim/dev/test/rspec_support/feature_context.rb +28 -8
- data/decidim-dev/lib/decidim/dev/test/rspec_support/translation_helpers.rb +7 -2
- data/decidim-dev/lib/decidim/dev/test/spec_helper.rb +2 -2
- data/decidim-dev/lib/generators/decidim/dummy_generator.rb +1 -1
- data/decidim-meetings/README.md +1 -1
- data/decidim-meetings/app/controllers/decidim/meetings/application_controller.rb +1 -1
- data/decidim-meetings/app/views/decidim/meetings/meetings/_linked_meetings.html.erb +1 -1
- data/decidim-meetings/bin/rails +3 -3
- data/decidim-meetings/config/locales/it.yml +87 -0
- data/decidim-meetings/db/migrate/20161130121354_create_meetings.rb +2 -0
- data/decidim-meetings/db/migrate/20170110142105_close_a_meeting.rb +2 -0
- data/decidim-meetings/db/migrate/20170123151650_add_latitude_and_longitude_to_meetings.rb +2 -0
- data/decidim-meetings/db/migrate/20170129153716_remove_short_description_from_meetings.rb +2 -0
- data/decidim-meetings/db/migrate/20170215132546_add_reference_to_meetings.rb +2 -0
- data/decidim-meetings/db/migrate/20170410074252_remove_not_null_reference_meetings.rb +2 -0
- data/decidim-meetings/db/migrate/20170612101925_migrate_meetings_category.rb +15 -0
- data/decidim-meetings/decidim-meetings.gemspec +3 -1
- data/decidim-meetings/lib/decidim/meetings/feature.rb +2 -2
- data/decidim-meetings/spec/features/admin_manages_meetings_attachments_spec.rb +5 -1
- data/decidim-meetings/spec/features/admin_manages_meetings_spec.rb +5 -7
- data/decidim-meetings/spec/features/explore_meetings_spec.rb +32 -6
- data/decidim-meetings/spec/features/process_admin_manages_meetings_attachments_spec.rb +4 -2
- data/decidim-meetings/spec/features/process_admin_manages_meetings_spec.rb +5 -8
- data/decidim-meetings/spec/shared/manage_attachments_examples.rb +0 -3
- data/decidim-meetings/spec/shared/manage_meetings_examples.rb +11 -11
- data/decidim-meetings/spec/spec_helper.rb +2 -1
- data/decidim-pages/bin/rails +3 -3
- data/decidim-pages/config/locales/it.yml +22 -0
- data/decidim-pages/db/migrate/20161116121353_create_decidim_pages.rb +2 -0
- data/decidim-pages/db/migrate/20161214150429_add_commentable_to_pages.rb +2 -0
- data/decidim-pages/db/migrate/20170110145040_remove_commentable_flag_from_pages.rb +2 -0
- data/decidim-pages/db/migrate/20170220091402_remove_page_feature_titles.rb +2 -0
- data/decidim-pages/decidim-pages.gemspec +3 -1
- data/decidim-pages/spec/features/admin_spec.rb +1 -1
- data/decidim-pages/spec/spec_helper.rb +2 -3
- data/decidim-proposals/app/commands/decidim/proposals/unvote_proposal.rb +34 -0
- data/decidim-proposals/app/commands/decidim/proposals/vote_proposal.rb +39 -0
- data/decidim-proposals/app/controllers/concerns/decidim/proposals/orderable.rb +7 -3
- data/decidim-proposals/app/controllers/decidim/proposals/proposal_votes_controller.rb +18 -8
- data/decidim-proposals/app/models/decidim/proposals/proposal.rb +3 -3
- data/decidim-proposals/app/models/decidim/proposals/proposal_vote.rb +0 -1
- data/decidim-proposals/app/views/decidim/proposals/proposals/_author.html.erb +23 -0
- data/decidim-proposals/app/views/decidim/proposals/proposals/_linked_proposals.html.erb +2 -2
- data/decidim-proposals/app/views/decidim/proposals/proposals/_proposal.html.erb +1 -9
- data/decidim-proposals/app/views/decidim/proposals/proposals/_vote_button.html.erb +2 -6
- data/decidim-proposals/app/views/decidim/proposals/proposals/new.html.erb +1 -1
- data/decidim-proposals/app/views/decidim/proposals/proposals/show.html.erb +1 -11
- data/decidim-proposals/bin/rails +3 -3
- data/decidim-proposals/config/locales/ca.yml +6 -0
- data/decidim-proposals/config/locales/en.yml +6 -0
- data/decidim-proposals/config/locales/es.yml +6 -0
- data/decidim-proposals/config/locales/eu.yml +0 -2
- data/decidim-proposals/config/locales/fi.yml +0 -2
- data/decidim-proposals/config/locales/fr.yml +0 -2
- data/decidim-proposals/config/locales/it.yml +147 -0
- data/decidim-proposals/db/migrate/20161212110850_create_decidim_proposals.rb +2 -0
- data/decidim-proposals/db/migrate/20170112115253_create_proposal_votes.rb +3 -1
- data/decidim-proposals/db/migrate/20170113114245_add_text_search_indexes.rb +2 -0
- data/decidim-proposals/db/migrate/20170118120151_add_counter_cache_votes_to_proposals.rb +2 -0
- data/decidim-proposals/db/migrate/20170120151202_add_user_group_id_to_proposals.rb +2 -0
- data/decidim-proposals/db/migrate/20170131092413_add_answers_to_proposals.rb +2 -0
- data/decidim-proposals/db/migrate/20170205082832_add_index_to_decidim_proposals_proposals_proposal_votes_count.rb +2 -0
- data/decidim-proposals/db/migrate/20170215113152_create_proposal_reports.rb +2 -0
- data/decidim-proposals/db/migrate/20170215131720_add_report_count_to_proposals.rb +2 -0
- data/decidim-proposals/db/migrate/20170215132030_add_reference_to_proposals.rb +2 -0
- data/decidim-proposals/db/migrate/20170220152416_add_hidden_at_to_proposals.rb +2 -0
- data/decidim-proposals/db/migrate/20170228105156_add_geolocalization_fields_to_proposals.rb +2 -0
- data/decidim-proposals/db/migrate/20170307085300_migrate_proposal_reports_data_to_reports.rb +8 -10
- data/decidim-proposals/db/migrate/20170410073742_remove_not_null_reference_proposals.rb +2 -0
- data/decidim-proposals/db/migrate/20170612101809_migrate_proposals_category.rb +15 -0
- data/decidim-proposals/decidim-proposals.gemspec +4 -2
- data/decidim-proposals/lib/decidim/proposals/feature.rb +5 -1
- data/decidim-proposals/lib/decidim/proposals/proposal_serializer.rb +1 -6
- data/decidim-proposals/spec/commands/decidim/proposals/unvote_proposal_spec.rb +26 -0
- data/decidim-proposals/spec/commands/decidim/proposals/vote_proposal_spec.rb +47 -0
- data/decidim-proposals/spec/features/admin_manages_proposals_spec.rb +6 -11
- data/decidim-proposals/spec/features/process_admin_manages_proposals_spec.rb +6 -12
- data/decidim-proposals/spec/features/proposals_spec.rb +38 -12
- data/decidim-proposals/spec/shared/manage_proposals_examples.rb +3 -6
- data/decidim-proposals/spec/spec_helper.rb +2 -1
- data/decidim-results/app/controllers/decidim/results/application_controller.rb +1 -1
- data/decidim-results/app/views/decidim/results/results/_linked_results.html.erb +1 -1
- data/decidim-results/bin/rails +3 -3
- data/decidim-results/config/locales/it.yml +78 -0
- data/decidim-results/db/migrate/20170116104125_create_results.rb +2 -0
- data/decidim-results/db/migrate/20170129164553_remove_short_description_from_results.rb +2 -0
- data/decidim-results/db/migrate/20170215132624_add_reference_to_results.rb +2 -0
- data/decidim-results/db/migrate/20170410074358_remove_not_null_reference_results.rb +2 -0
- data/decidim-results/db/migrate/20170612101951_migrate_results_category.rb +15 -0
- data/decidim-results/decidim-results.gemspec +3 -1
- data/decidim-results/spec/features/admin_manages_results_spec.rb +5 -7
- data/decidim-results/spec/features/process_admin_manages_results_spec.rb +5 -8
- data/decidim-results/spec/shared/manage_results_examples.rb +3 -3
- data/decidim-results/spec/spec_helper.rb +2 -1
- data/decidim-surveys/README.md +24 -0
- data/decidim-surveys/Rakefile +3 -0
- data/decidim-surveys/app/assets/config/admin/decidim_surveys_manifest.js +1 -0
- data/decidim-surveys/app/assets/images/decidim/surveys/icon.svg +1 -0
- data/decidim-surveys/app/assets/javascripts/decidim/surveys/admin/auto_label_by_position.component.js.es6 +33 -0
- data/decidim-surveys/app/assets/javascripts/decidim/surveys/admin/dynamic_fields.component.js.es6 +95 -0
- data/decidim-surveys/app/assets/javascripts/decidim/surveys/admin/surveys.js.es6 +85 -0
- data/decidim-surveys/app/assets/stylesheets/decidim/surveys/surveys.scss +9 -0
- data/decidim-surveys/app/commands/decidim/surveys/admin/update_survey.rb +65 -0
- data/decidim-surveys/app/commands/decidim/surveys/answer_survey.rb +43 -0
- data/decidim-surveys/app/commands/decidim/surveys/create_survey.rb +19 -0
- data/decidim-surveys/app/controllers/decidim/surveys/admin/application_controller.rb +15 -0
- data/decidim-surveys/app/controllers/decidim/surveys/admin/surveys_controller.rb +55 -0
- data/decidim-surveys/app/controllers/decidim/surveys/application_controller.rb +13 -0
- data/decidim-surveys/app/controllers/decidim/surveys/surveys_controller.rb +39 -0
- data/decidim-surveys/app/forms/decidim/surveys/admin/survey_form.rb +19 -0
- data/decidim-surveys/app/forms/decidim/surveys/admin/survey_question_answer_option_form.rb +15 -0
- data/decidim-surveys/app/forms/decidim/surveys/admin/survey_question_form.rb +24 -0
- data/decidim-surveys/app/forms/decidim/surveys/survey_answer_form.rb +36 -0
- data/decidim-surveys/app/forms/decidim/surveys/survey_form.rb +22 -0
- data/decidim-surveys/app/helpers/decidim/surveys/admin/application_helper.rb +39 -0
- data/decidim-surveys/app/models/decidim/surveys/abilities/admin_user.rb +34 -0
- data/decidim-surveys/app/models/decidim/surveys/abilities/current_user.rb +47 -0
- data/decidim-surveys/app/models/decidim/surveys/abilities/process_admin_user.rb +44 -0
- data/decidim-surveys/app/models/decidim/surveys/application_record.rb +10 -0
- data/decidim-surveys/app/models/decidim/surveys/survey.rb +25 -0
- data/decidim-surveys/app/models/decidim/surveys/survey_answer.rb +27 -0
- data/decidim-surveys/app/models/decidim/surveys/survey_question.rb +18 -0
- data/decidim-surveys/app/queries/decidim/surveys/survey_user_answers.rb +28 -0
- data/decidim-surveys/app/views/decidim/surveys/admin/surveys/_answer_option.html.erb +23 -0
- data/decidim-surveys/app/views/decidim/surveys/admin/surveys/_form.html.erb +47 -0
- data/decidim-surveys/app/views/decidim/surveys/admin/surveys/_question.html.erb +57 -0
- data/decidim-surveys/app/views/decidim/surveys/admin/surveys/edit.html.erb +7 -0
- data/decidim-surveys/app/views/decidim/surveys/surveys/show.html.erb +102 -0
- data/decidim-surveys/bin/rails +15 -0
- data/decidim-surveys/config/i18n-tasks.yml +11 -0
- data/decidim-surveys/config/locales/ca.yml +69 -0
- data/decidim-surveys/config/locales/en.yml +73 -0
- data/decidim-surveys/config/locales/es.yml +69 -0
- data/decidim-surveys/config/locales/eu.yml +5 -0
- data/decidim-surveys/config/locales/fi.yml +5 -0
- data/decidim-surveys/config/locales/fr.yml +5 -0
- data/decidim-surveys/config/locales/it.yml +5 -0
- data/decidim-surveys/config/locales/nl.yml +5 -0
- data/decidim-surveys/db/migrate/20170511092231_create_decidim_surveys.rb +15 -0
- data/decidim-surveys/db/migrate/20170515090916_create_decidim_survey_questions.rb +12 -0
- data/decidim-surveys/db/migrate/20170515144119_create_decidim_survey_answers.rb +14 -0
- data/decidim-surveys/db/migrate/20170518085302_add_position_to_surveys_questions.rb +7 -0
- data/decidim-surveys/db/migrate/20170522075938_add_mandatory_to_surveys_questions.rb +7 -0
- data/decidim-surveys/db/migrate/20170524122229_add_question_type_to_surveys_questions.rb +7 -0
- data/decidim-surveys/db/migrate/20170525132233_add_answer_options_to_surveys_questions.rb +7 -0
- data/decidim-surveys/decidim-surveys.gemspec +22 -0
- data/decidim-surveys/lib/decidim/surveys.rb +14 -0
- data/decidim-surveys/lib/decidim/surveys/admin.rb +10 -0
- data/decidim-surveys/lib/decidim/surveys/admin_engine.rb +34 -0
- data/decidim-surveys/lib/decidim/surveys/engine.rb +25 -0
- data/decidim-surveys/lib/decidim/surveys/feature.rb +85 -0
- data/decidim-surveys/lib/decidim/surveys/survey_user_answers_serializer.rb +23 -0
- data/decidim-surveys/lib/decidim/surveys/test/factories.rb +39 -0
- data/decidim-surveys/spec/commands/decidim/surveys/admin/update_survey_spec.rb +147 -0
- data/decidim-surveys/spec/commands/decidim/surveys/answer_survey_spec.rb +71 -0
- data/decidim-surveys/spec/commands/decidim/surveys/create_survey_spec.rb +44 -0
- data/decidim-surveys/spec/factories.rb +3 -0
- data/decidim-surveys/spec/features/admin_manages_surveys_spec.rb +13 -0
- data/decidim-surveys/spec/features/process_admin_manages_surveys_spec.rb +13 -0
- data/decidim-surveys/spec/features/survey_spec.rb +235 -0
- data/decidim-surveys/spec/forms/decidim/surveys/admin/survey_form_spec.rb +64 -0
- data/decidim-surveys/spec/forms/decidim/surveys/admin/survey_question_form_spec.rb +36 -0
- data/decidim-surveys/spec/forms/decidim/surveys/survey_answer_form_spec.rb +36 -0
- data/decidim-surveys/spec/forms/decidim/surveys/survey_form_spec.rb +32 -0
- data/decidim-surveys/spec/models/decidim/surveys/abilities/admin_user_spec.rb +22 -0
- data/decidim-surveys/spec/models/decidim/surveys/abilities/current_user_spec.rb +19 -0
- data/decidim-surveys/spec/models/decidim/surveys/abilities/process_admin_user_spec.rb +23 -0
- data/decidim-surveys/spec/models/decidim/surveys/survey_answer_spec.rb +55 -0
- data/decidim-surveys/spec/models/decidim/surveys/survey_question_spec.rb +19 -0
- data/decidim-surveys/spec/models/decidim/surveys/survey_spec.rb +65 -0
- data/decidim-surveys/spec/queries/decidim/surveys/survey_user_answers_spec.rb +21 -0
- data/decidim-surveys/spec/services/decidim/surveys/surveys/survey_user_answer_serializer_spec.rb +34 -0
- data/decidim-surveys/spec/shared/edit_survey_examples.rb +213 -0
- data/decidim-surveys/spec/shared/export_survey_user_answers_examples.rb +47 -0
- data/decidim-surveys/spec/spec_helper.rb +4 -0
- data/decidim-system/app/controllers/decidim/system/devise/passwords_controller.rb +2 -0
- data/decidim-system/app/helpers/decidim/system/menu_helper.rb +0 -1
- data/decidim-system/bin/rails +3 -3
- data/decidim-system/config/locales/it.yml +66 -0
- data/decidim-system/db/migrate/20160919105637_devise_create_decidim_admins.rb +2 -0
- data/decidim-system/decidim-system.gemspec +2 -1
- data/decidim-system/spec/spec_helper.rb +3 -2
- data/decidim.gemspec +5 -4
- data/docs/geocoding.md +2 -2
- data/docs/how_to_create_a_plugin.md +11 -11
- data/lib/decidim.rb +1 -0
- data/lib/generators/decidim/app_generator.rb +3 -2
- data/lib/generators/decidim/demo_generator.rb +1 -1
- data/lib/generators/decidim/docker_generator.rb +2 -2
- data/lib/generators/decidim/install_generator.rb +3 -6
- data/lib/generators/decidim/templates/initializer.rb +2 -2
- metadata +130 -47
- data/decidim-admin/app/assets/javascripts/decidim/admin/sort_steps.js.es6 +0 -30
- data/decidim-budgets/spec/shared/admin_shared_context.rb +0 -13
- data/decidim-comments/spec/shared/admin_shared_context.rb +0 -13
- data/decidim-meetings/spec/shared/admin_shared_context.rb +0 -13
- data/decidim-proposals/spec/shared/admin_shared_context.rb +0 -13
- data/decidim-results/spec/shared/admin_shared_context.rb +0 -13
@@ -19,6 +19,9 @@ es:
|
|
19
19
|
subject: Tienes un nuevo comentario
|
20
20
|
reply_created:
|
21
21
|
subject: Uno de tus comentarios ha recibido respuesta
|
22
|
+
votes:
|
23
|
+
create:
|
24
|
+
error: Ha habido errores al votar el comentario.
|
22
25
|
components:
|
23
26
|
add_comment_form:
|
24
27
|
account_message: "<a href=\"%{sign_in_url}\">Entra con tu cuenta</a> o <a href=\"%{sign_up_url}\">regístrate</a> para dejar tu comentario.\n"
|
@@ -37,6 +40,7 @@ es:
|
|
37
40
|
alignment:
|
38
41
|
against: En contra
|
39
42
|
in_favor: A favor
|
43
|
+
deleted_user: Usuario eliminado
|
40
44
|
reply: Respuesta
|
41
45
|
report:
|
42
46
|
action: Denunciar
|
@@ -49,6 +53,7 @@ es:
|
|
49
53
|
offensive: Contiene racismo, sexismo, insultos, ataques personales, amenazas de muerte, solicitudes de suicidio o cualquier forma de discurso de odio.
|
50
54
|
spam: Contiene clickbait, publicidad o estafas.
|
51
55
|
title: Denunciar un problema
|
56
|
+
verified_user_group: Organización verificada
|
52
57
|
comment_order_selector:
|
53
58
|
order:
|
54
59
|
best_rated: Mejor valoración
|
@@ -0,0 +1,65 @@
|
|
1
|
+
it:
|
2
|
+
activerecord:
|
3
|
+
errors:
|
4
|
+
messages:
|
5
|
+
cannot_have_comments: non si possono fare commenti
|
6
|
+
decidim:
|
7
|
+
comments:
|
8
|
+
comment_notification_mailer:
|
9
|
+
comment_created:
|
10
|
+
new_comment_html: C'è un nuovo commento da parte di <b>%{commenter}</b> al link <b>%{commentable_link}</b>
|
11
|
+
hello: Ciao %{name},
|
12
|
+
manage_email_subscriptions_html: Puoi bloccare la ricezione di questo tipo di email variando le impostazioni su %{link}.
|
13
|
+
notifications_settings_link: pagina per le impostazioni delle notifiche
|
14
|
+
reply_created:
|
15
|
+
new_reply_html: C'è una nuova risposta al tuo commento da parte di <b>%{commenter}</b> in <b>%{commentable_link}</b>
|
16
|
+
mailer:
|
17
|
+
comment_notification:
|
18
|
+
comment_created:
|
19
|
+
subject: C'è un nuovo commento
|
20
|
+
reply_created:
|
21
|
+
subject: Hai ricevuto una nuova risposta ad un tuo commento
|
22
|
+
components:
|
23
|
+
add_comment_form:
|
24
|
+
account_message: '<a href="%{sign_in_url}">Entra col tuo account</a> or <a href="%{sign_up_url}">Registrati</a> per poter commentare. '
|
25
|
+
form:
|
26
|
+
body:
|
27
|
+
label: Commenta
|
28
|
+
placeholder: Cosa ne pensi?
|
29
|
+
form_error: Il testo è necessario, deve essere obbligatoriamente indicato (max %{length} caratteri).
|
30
|
+
submit: Invia
|
31
|
+
user_group_id:
|
32
|
+
label: Commenta come
|
33
|
+
opinion:
|
34
|
+
neutral: Neutro
|
35
|
+
title: Aggiungi il tuo commento
|
36
|
+
comment:
|
37
|
+
alignment:
|
38
|
+
against: Contro
|
39
|
+
in_favor: A favore
|
40
|
+
reply: Rispondi
|
41
|
+
report:
|
42
|
+
already_reported: Questo contenuto è già stato indicato e sarà revisionato da un utente Admnistrator.
|
43
|
+
close: Chiudi
|
44
|
+
description: Trovi questo contenuto inappropriato?
|
45
|
+
details: motivazione
|
46
|
+
reasons:
|
47
|
+
does_not_belong: Contiene un'attività illegale, istigazioni al suicidio, minacce, informazioni personali o riservate, oppure vi sono dei contenuti che reputi inappropriati per %{organization_name}.
|
48
|
+
offensive: Vi sono contenuti razzisti, sessisti, offensivi, attacchi di carattere personale, minacce di morte o altro tipo di minacci, istigazioni al suicidio o altre forme d'odio verbale.
|
49
|
+
spam: Contiene pubblicità, truffe, clickbait ("esca da click") o altro contenuto mirato ad attrarre traffico internet.
|
50
|
+
title: Segnala un problema
|
51
|
+
comment_order_selector:
|
52
|
+
order:
|
53
|
+
best_rated: Favoriti
|
54
|
+
most_discussed: Più discussi
|
55
|
+
older: Più vecchi
|
56
|
+
recent: Più recenti
|
57
|
+
title: 'Ordina per:'
|
58
|
+
comment_thread:
|
59
|
+
title: Conversazioni con %{authorName}
|
60
|
+
comments:
|
61
|
+
blocked_comments_warning: I commenti sono disabilitati per questa fase, ma puoi leggere i commenti delle fasi precedenti.
|
62
|
+
loading: Sto caricando i commenti ...
|
63
|
+
title: "%{count} commenti"
|
64
|
+
featured_comment:
|
65
|
+
title: Commento in primo piano
|
@@ -1,10 +1,12 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
class CreateCommentVotes < ActiveRecord::Migration[5.0]
|
2
4
|
def change
|
3
5
|
create_table :decidim_comments_comment_votes do |t|
|
4
6
|
t.integer :weight, null: false
|
5
7
|
t.references :decidim_comment, null: false, index: { name: "decidim_comments_comment_vote_comment" }
|
6
8
|
t.references :decidim_author, null: false, index: { name: "decidim_comments_comment_vote_author" }
|
7
|
-
|
9
|
+
|
8
10
|
t.timestamps
|
9
11
|
end
|
10
12
|
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
class UpdateRootCommentableForComments < ActiveRecord::Migration[5.0]
|
2
4
|
def up
|
3
5
|
Decidim::Comments::Comment.where(depth: 0).update_all(
|
@@ -10,8 +12,7 @@ class UpdateRootCommentableForComments < ActiveRecord::Migration[5.0]
|
|
10
12
|
end
|
11
13
|
end
|
12
14
|
|
13
|
-
def down
|
14
|
-
end
|
15
|
+
def down; end
|
15
16
|
|
16
17
|
private
|
17
18
|
|
@@ -11,23 +11,23 @@ module Decidim
|
|
11
11
|
included do
|
12
12
|
has_many :comments, as: :commentable, foreign_key: "decidim_commentable_id", foreign_type: "decidim_commentable_type", class_name: "Decidim::Comments::Comment"
|
13
13
|
|
14
|
-
# Public:
|
14
|
+
# Public: Whether the object's comments are visible or not.
|
15
15
|
def commentable?
|
16
16
|
true
|
17
17
|
end
|
18
18
|
|
19
|
-
# Public:
|
19
|
+
# Public: Whether the object can have new comments or not.
|
20
20
|
def accepts_new_comments?
|
21
21
|
true
|
22
22
|
end
|
23
23
|
|
24
|
-
# Public:
|
24
|
+
# Public: Whether the object's comments can have alignment or not. It enables the
|
25
25
|
# alignment selector in the add new comment form.
|
26
26
|
def comments_have_alignment?
|
27
27
|
false
|
28
28
|
end
|
29
29
|
|
30
|
-
# Public:
|
30
|
+
# Public: Whether the object's comments can have have votes or not. It enables the
|
31
31
|
# upvote and downvote buttons for comments.
|
32
32
|
def comments_have_votes?
|
33
33
|
false
|
@@ -82,7 +82,7 @@ module Decidim
|
|
82
82
|
it "sends an email to the author of the commentable" do
|
83
83
|
expect(CommentNotificationMailer)
|
84
84
|
.to receive(:comment_created)
|
85
|
-
.with(
|
85
|
+
.with(an_instance_of(Comment), commentable)
|
86
86
|
.and_call_original
|
87
87
|
|
88
88
|
command.call
|
@@ -120,7 +120,7 @@ module Decidim
|
|
120
120
|
it "sends an email to the author of the parent comment" do
|
121
121
|
expect(CommentNotificationMailer)
|
122
122
|
.to receive(:reply_created)
|
123
|
-
.with(
|
123
|
+
.with(an_instance_of(Comment), commentable, commentable.root_commentable)
|
124
124
|
.and_call_original
|
125
125
|
|
126
126
|
command.call
|
@@ -3,11 +3,8 @@
|
|
3
3
|
require "spec_helper"
|
4
4
|
|
5
5
|
describe "Admin manages comments", type: :feature do
|
6
|
-
include_context "admin"
|
7
|
-
it_behaves_like "manage moderations"
|
8
|
-
include_context "feature"
|
9
6
|
let(:manifest_name) { "dummy" }
|
10
|
-
|
7
|
+
let!(:dummy) { create :dummy_resource, feature: current_feature }
|
11
8
|
let!(:resources) { create_list(:dummy_resource, 3, feature: current_feature) }
|
12
9
|
let!(:reportables) do
|
13
10
|
resources.map do |resource|
|
@@ -15,9 +12,7 @@ describe "Admin manages comments", type: :feature do
|
|
15
12
|
end
|
16
13
|
end
|
17
14
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
visit decidim_admin.manage_feature_path(participatory_process_id: participatory_process, feature_id: current_feature)
|
22
|
-
end
|
15
|
+
include_context "feature admin"
|
16
|
+
|
17
|
+
it_behaves_like "manage moderations"
|
23
18
|
end
|
@@ -3,12 +3,8 @@
|
|
3
3
|
require "spec_helper"
|
4
4
|
|
5
5
|
describe "Process admin manages comments", type: :feature do
|
6
|
-
|
7
|
-
let(:
|
8
|
-
it_behaves_like "manage moderations"
|
9
|
-
include_context "feature"
|
10
|
-
let(:manifest_name) { "proposals" }
|
11
|
-
|
6
|
+
let(:manifest_name) { "dummy" }
|
7
|
+
let!(:dummy) { create :dummy_resource, feature: current_feature }
|
12
8
|
let!(:resources) { create_list(:dummy_resource, 3, feature: current_feature) }
|
13
9
|
let!(:reportables) do
|
14
10
|
resources.map do |resource|
|
@@ -16,9 +12,7 @@ describe "Process admin manages comments", type: :feature do
|
|
16
12
|
end
|
17
13
|
end
|
18
14
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
visit decidim_admin.manage_feature_path(participatory_process_id: participatory_process, feature_id: current_feature)
|
23
|
-
end
|
15
|
+
include_context "feature process admin"
|
16
|
+
|
17
|
+
it_behaves_like "manage moderations"
|
24
18
|
end
|
@@ -6,12 +6,17 @@ require "spec_helper"
|
|
6
6
|
module Decidim
|
7
7
|
module Comments
|
8
8
|
describe CommentNotificationMailer, type: :mailer do
|
9
|
-
let(:
|
10
|
-
let(:
|
11
|
-
let(:
|
9
|
+
let(:organization) { create(:organization) }
|
10
|
+
let(:participatory_process) { create(:participatory_process, organization: organization) }
|
11
|
+
let(:feature) { create(:feature, participatory_process: participatory_process) }
|
12
|
+
let(:commentable_author) { create(:user, organization: organization) }
|
13
|
+
let(:commentable) { create(:dummy_resource, author: commentable_author, feature: feature) }
|
14
|
+
let(:author) { create(:user, organization: organization) }
|
15
|
+
let(:comment) { create(:comment, author: author, commentable: commentable) }
|
16
|
+
let(:reply) { create(:comment, author: author, commentable: comment) }
|
12
17
|
|
13
18
|
describe "comment_created" do
|
14
|
-
let(:mail) { described_class.comment_created(
|
19
|
+
let(:mail) { described_class.comment_created(comment, commentable) }
|
15
20
|
|
16
21
|
let(:subject) { "Tens un nou comentari" }
|
17
22
|
let(:default_subject) { "You have a new comment" }
|
@@ -19,11 +24,11 @@ module Decidim
|
|
19
24
|
let(:body) { "Hi ha un nou comentari d" }
|
20
25
|
let(:default_body) { "There is a new comment" }
|
21
26
|
|
22
|
-
include_examples "localised email"
|
27
|
+
include_examples "author localised email"
|
23
28
|
end
|
24
29
|
|
25
30
|
describe "reply_created" do
|
26
|
-
let(:mail) { described_class.reply_created(
|
31
|
+
let(:mail) { described_class.reply_created(reply, comment, commentable) }
|
27
32
|
|
28
33
|
let(:subject) { "Tens una nova resposta del teu comentari" }
|
29
34
|
let(:default_subject) { "You have a new reply of your comment" }
|
@@ -31,7 +36,7 @@ module Decidim
|
|
31
36
|
let(:body) { "Hi ha una nova resposta de" }
|
32
37
|
let(:default_body) { "There is a new reply of your comment" }
|
33
38
|
|
34
|
-
include_examples "localised email"
|
39
|
+
include_examples "author localised email"
|
35
40
|
end
|
36
41
|
end
|
37
42
|
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "spec_helper"
|
4
|
+
|
5
|
+
shared_examples "author localised email" do
|
6
|
+
let(:author) { create(:user, locale: locale, organization: organization) }
|
7
|
+
let(:commentable_author) { create(:user, locale: locale, organization: organization) }
|
8
|
+
|
9
|
+
context "when the user has a custom locale" do
|
10
|
+
let(:locale) { "ca" }
|
11
|
+
|
12
|
+
it "uses the user's locale" do
|
13
|
+
expect(mail.subject).to eq(subject)
|
14
|
+
expect(mail.body.encoded).to match(body)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
context "otherwise" do
|
19
|
+
let(:locale) { nil }
|
20
|
+
|
21
|
+
it "uses the default locale" do
|
22
|
+
expect(mail.subject).to eq(default_subject)
|
23
|
+
expect(mail.body.encoded).to match(default_body)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -1,5 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
|
2
|
+
|
3
|
+
$LOAD_PATH.push File.expand_path("lib", __dir__)
|
3
4
|
|
4
5
|
# Maintain your gem's version:
|
5
6
|
require_relative "../decidim-core/lib/decidim/core/version"
|
@@ -19,7 +20,10 @@ Gem::Specification.new do |s|
|
|
19
20
|
s.add_dependency "database_cleaner", "~> 1.6.0"
|
20
21
|
s.add_dependency "capybara", "~> 2.14.0"
|
21
22
|
s.add_dependency "capybara-screenshot", "~> 1.0.14"
|
22
|
-
|
23
|
+
|
24
|
+
# Until https://github.com/rspec/rspec-rails/issues/1800 fixed
|
25
|
+
s.add_dependency "rspec-rails", "~> 3.5", "< 3.6"
|
26
|
+
|
23
27
|
s.add_dependency "rspec-repeat", "~> 1.0.2"
|
24
28
|
s.add_dependency "byebug"
|
25
29
|
s.add_dependency "wisper-rspec", "~> 0.0.3"
|
@@ -31,9 +35,10 @@ Gem::Specification.new do |s|
|
|
31
35
|
s.add_dependency "rails-controller-testing", "~> 1.0.1"
|
32
36
|
s.add_dependency "simplecov", "~> 0.13"
|
33
37
|
s.add_dependency "codecov", "~> 0.1.9"
|
34
|
-
s.add_dependency "rubocop", "~> 0.
|
38
|
+
s.add_dependency "rubocop", "~> 0.48.1"
|
35
39
|
s.add_dependency "db-query-matchers", "~> 0.9.0"
|
36
40
|
s.add_dependency "letter_opener_web", "~> 1.3.0"
|
37
41
|
s.add_dependency "rspec-html-matchers", "~> 0.9.1"
|
38
42
|
s.add_dependency "webmock", "~> 3.0.1"
|
43
|
+
s.add_dependency "puma", "~> 3.8.2"
|
39
44
|
end
|
@@ -12,14 +12,7 @@ module Decidim
|
|
12
12
|
#
|
13
13
|
# Returns a String with the path for a particular asset.
|
14
14
|
def self.asset(name)
|
15
|
-
File.expand_path(
|
16
|
-
File.join(
|
17
|
-
File.dirname(__FILE__),
|
18
|
-
"dev",
|
19
|
-
"assets",
|
20
|
-
name
|
21
|
-
)
|
22
|
-
)
|
15
|
+
File.expand_path(File.join(__dir__, "dev", "assets", name))
|
23
16
|
end
|
24
17
|
end
|
25
18
|
end
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
ENV["RAILS_ENV"] ||= "test"
|
4
4
|
|
5
|
-
root_path = File.
|
5
|
+
root_path = File.expand_path("..", Dir.pwd)
|
6
6
|
engine_spec_dir = File.join(Dir.pwd, "spec")
|
7
7
|
dummy_app_path = File.expand_path(File.join(root_path, "spec", "decidim_dummy_app"))
|
8
8
|
|
@@ -22,15 +22,17 @@ if ENV["SIMPLECOV"]
|
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
|
-
|
26
|
-
|
25
|
+
if ENV["CI"]
|
26
|
+
require "codecov"
|
27
|
+
SimpleCov.formatter = SimpleCov::Formatter::Codecov
|
28
|
+
end
|
27
29
|
end
|
28
30
|
|
29
31
|
require "rails"
|
30
32
|
require "active_support/core_ext/string"
|
31
33
|
require "decidim/core"
|
32
34
|
require "decidim/core/test"
|
33
|
-
require "#{
|
35
|
+
require "#{__dir__}/rspec_support/feature.rb"
|
34
36
|
|
35
37
|
begin
|
36
38
|
require "#{dummy_app_path}/config/environment"
|