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
@@ -6,15 +6,7 @@
|
|
6
6
|
<h5 class="card__title"><%= proposal.title %></h5>
|
7
7
|
<% end %>
|
8
8
|
<div class="card__author author-data author-data--small">
|
9
|
-
|
10
|
-
<div class="author author--inline">
|
11
|
-
<span class="author__avatar author__avatar--small">
|
12
|
-
<%= image_tag proposal.author_avatar_url %>
|
13
|
-
</span>
|
14
|
-
<span class="author__name"><%= proposal.author_name %></span>
|
15
|
-
<%= l proposal.created_at, format: "%d/%m/%Y" %>
|
16
|
-
</div>
|
17
|
-
</div>
|
9
|
+
<%= render partial: "author", locals: { proposal: proposal } %>
|
18
10
|
</div>
|
19
11
|
</div>
|
20
12
|
<%= render partial: "proposal_badge", locals: { proposal: proposal } %>
|
@@ -1,13 +1,9 @@
|
|
1
1
|
<div id="proposal-<%= proposal.id %>-vote-button">
|
2
2
|
<% if !current_user %>
|
3
3
|
<% if current_settings.votes_blocked? %>
|
4
|
-
|
5
|
-
<%= t('.votes_blocked') %>
|
6
|
-
</button>
|
4
|
+
<%= action_authorized_button_to :vote, t('.votes_blocked'), proposal_proposal_vote_path(proposal_id: proposal, from_proposals_list: from_proposals_list), class: "card__button button #{vote_button_classes(from_proposals_list)} disabled", disabled: true %>
|
7
5
|
<% else %>
|
8
|
-
|
9
|
-
<%= t('.vote') %>
|
10
|
-
</button>
|
6
|
+
<%= action_authorized_button_to :vote, t('.vote'), proposal_proposal_vote_path(proposal_id: proposal, from_proposals_list: from_proposals_list), class: "card__button button #{vote_button_classes(from_proposals_list)}" %>
|
11
7
|
<% end %>
|
12
8
|
<% else %>
|
13
9
|
<% if @voted_proposals ? @voted_proposals.include?(proposal.id) : proposal.voted_by?(current_user) %>
|
@@ -8,17 +8,7 @@
|
|
8
8
|
<div class="row column view-header">
|
9
9
|
<h2 class="heading2"><%= @proposal.title %></h2>
|
10
10
|
<div class="author-data">
|
11
|
-
|
12
|
-
<div class="author author--inline">
|
13
|
-
<span class="author__avatar">
|
14
|
-
<%= image_tag @proposal.author_avatar_url %>
|
15
|
-
</span>
|
16
|
-
<%= l @proposal.created_at, format: :long %>
|
17
|
-
<span class="author__name">
|
18
|
-
<%= @proposal.author_name %>
|
19
|
-
</span>
|
20
|
-
</div>
|
21
|
-
</div>
|
11
|
+
<%= render partial: "author", locals: { proposal: @proposal } %>
|
22
12
|
<div class="author-data__extra">
|
23
13
|
<button type="button" data-open="<%= current_user.present? ? 'flagModal' : 'loginModal' %>" title="<%= t('.report') %>" aria-controls="<%= current_user.present? ? 'flagModal' : 'loginModal' %>" aria-haspopup="true" tabindex="0">
|
24
14
|
<%= icon "flag", aria_label: t('.report'), class: 'icon--small' %>
|
data/decidim-proposals/bin/rails
CHANGED
@@ -4,11 +4,11 @@
|
|
4
4
|
# This command will automatically be run when you run "rails" with Rails gems
|
5
5
|
# installed from the root of your application.
|
6
6
|
|
7
|
-
ENGINE_ROOT = File.expand_path("
|
8
|
-
ENGINE_PATH = File.expand_path("
|
7
|
+
ENGINE_ROOT = File.expand_path("..", __dir__)
|
8
|
+
ENGINE_PATH = File.expand_path("../lib/decidim/proposals/engine", __dir__)
|
9
9
|
|
10
10
|
# Set up gems listed in the Gemfile.
|
11
|
-
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("
|
11
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
|
12
12
|
require "bundler/setup" if File.exist?(ENV["BUNDLE_GEMFILE"])
|
13
13
|
|
14
14
|
require "rails/all"
|
@@ -79,7 +79,13 @@ ca:
|
|
79
79
|
scope: Àmbit
|
80
80
|
state: Estat
|
81
81
|
title: Títol
|
82
|
+
proposal_votes:
|
83
|
+
create:
|
84
|
+
error: Hi ha hagut errors en votar la proposta.
|
82
85
|
proposals:
|
86
|
+
author:
|
87
|
+
deleted: Usuari eliminat
|
88
|
+
verified_user_group: Organització verificada
|
83
89
|
count:
|
84
90
|
proposals_count:
|
85
91
|
one: 1 proposta
|
@@ -81,7 +81,13 @@ en:
|
|
81
81
|
scope: Scope
|
82
82
|
state: State
|
83
83
|
title: Title
|
84
|
+
proposal_votes:
|
85
|
+
create:
|
86
|
+
error: There's been errors when voting the proposal.
|
84
87
|
proposals:
|
88
|
+
author:
|
89
|
+
deleted: Deleted user
|
90
|
+
verified_user_group: Verified organization
|
85
91
|
count:
|
86
92
|
proposals_count:
|
87
93
|
one: 1 proposal
|
@@ -79,7 +79,13 @@ es:
|
|
79
79
|
scope: Ámbito
|
80
80
|
state: Estado
|
81
81
|
title: Título
|
82
|
+
proposal_votes:
|
83
|
+
create:
|
84
|
+
error: Ha habido errores al votar la propuesta.
|
82
85
|
proposals:
|
86
|
+
author:
|
87
|
+
deleted: Usuario eliminado
|
88
|
+
verified_user_group: Organización verificada
|
83
89
|
count:
|
84
90
|
proposals_count:
|
85
91
|
one: 1 propuesta
|
@@ -121,8 +121,6 @@ eu:
|
|
121
121
|
most_voted: Bozkatuenak
|
122
122
|
random: Ausazkoa eran
|
123
123
|
recent: Berrienak
|
124
|
-
proposal:
|
125
|
-
view_proposal: Ikusi proposamena
|
126
124
|
show:
|
127
125
|
proposal_accepted_reason: 'Proposamen hau onartu da arrazoi hauengatik:'
|
128
126
|
proposal_rejected_reason: 'Proposamen hau baztertu da arrazoi hauengatik:'
|
@@ -108,8 +108,6 @@ fi:
|
|
108
108
|
most_voted: Eniten ääniä saaneet
|
109
109
|
random: Satunnainen
|
110
110
|
recent: Viimeisimmät
|
111
|
-
proposal:
|
112
|
-
view_proposal: Näytä ehdotus
|
113
111
|
show:
|
114
112
|
proposal_accepted_reason: 'Tämä ehdotus on hyväksytty, koska:'
|
115
113
|
proposal_rejected_reason: 'Tämä ehdotus on hylätty, koska:'
|
@@ -118,8 +118,6 @@ fr:
|
|
118
118
|
most_voted: Les plus votées
|
119
119
|
random: Aléatoire
|
120
120
|
recent: Les plus récents
|
121
|
-
proposal:
|
122
|
-
view_proposal: Voir la proposition
|
123
121
|
show:
|
124
122
|
proposal_accepted_reason: 'Cette proposition a été acceptée parce que :'
|
125
123
|
proposal_rejected_reason: 'Cette proposition a été refusée parce que:'
|
@@ -0,0 +1,147 @@
|
|
1
|
+
it:
|
2
|
+
activemodel:
|
3
|
+
attributes:
|
4
|
+
proposal:
|
5
|
+
body: Corpo del testo
|
6
|
+
category_id: Categoria
|
7
|
+
scope_id: Visibilità
|
8
|
+
title: Titolo
|
9
|
+
user_group_id: Crea proposta come
|
10
|
+
proposal_answer:
|
11
|
+
answer: Risposta
|
12
|
+
decidim:
|
13
|
+
features:
|
14
|
+
proposals:
|
15
|
+
actions:
|
16
|
+
create: Crea
|
17
|
+
vote: Vota
|
18
|
+
name: Proposte
|
19
|
+
settings:
|
20
|
+
global:
|
21
|
+
comments_enabled: Commenti abilitati
|
22
|
+
geocoding_enabled: Geocoding abilitato
|
23
|
+
official_proposals_enabled: Proposte ufficiali abilitate
|
24
|
+
proposal_answering_enabled: Risposta Proposte abilitata
|
25
|
+
vote_limit: Numero max di proposte votabili
|
26
|
+
step:
|
27
|
+
comments_blocked: Commenti bloccati
|
28
|
+
creation_enabled: Creazione delle Proposte abilitata
|
29
|
+
proposal_answering_enabled: Risposta Proposte abilitata
|
30
|
+
votes_blocked: Votazioni bloccate
|
31
|
+
votes_enabled: Votazioni abilitate
|
32
|
+
votes_hidden: Voti nascosti (se i voti sono abilitati, spuntando questa casella verrà nascosto il numero dei voti)
|
33
|
+
proposals:
|
34
|
+
actions:
|
35
|
+
answer: Risposta
|
36
|
+
new: Nuovo
|
37
|
+
title: Azioni
|
38
|
+
admin:
|
39
|
+
actions:
|
40
|
+
preview: Anteprima
|
41
|
+
exports:
|
42
|
+
proposals: Proposte
|
43
|
+
models:
|
44
|
+
proposal:
|
45
|
+
name: Proposta
|
46
|
+
proposal_answers:
|
47
|
+
edit:
|
48
|
+
accepted: Accettata
|
49
|
+
answer_proposal: Risposta
|
50
|
+
rejected: Rifiutata
|
51
|
+
title: Risposta per la proposta %{title}
|
52
|
+
proposals:
|
53
|
+
answer:
|
54
|
+
invalid: E' stato riscontrato un problema nella risposta per questa proposta
|
55
|
+
success: OK, risposta per la proposta registrata.
|
56
|
+
create:
|
57
|
+
invalid: Sono stati riscontrati dei problemi durante la creazione di questa proposta
|
58
|
+
success: OK, proposta creata.
|
59
|
+
form:
|
60
|
+
select_a_category: Scegli una categoria
|
61
|
+
index:
|
62
|
+
title: Proposte
|
63
|
+
new:
|
64
|
+
create: Crea
|
65
|
+
title: Crea una proposta
|
66
|
+
answers:
|
67
|
+
accepted: Accettata
|
68
|
+
not_answered: Non risposto
|
69
|
+
rejected: Rifiutata
|
70
|
+
create:
|
71
|
+
error: C'è stato un errore durante il salvataggio di questa proposta.
|
72
|
+
success: OK, la proposta è stata creata.
|
73
|
+
models:
|
74
|
+
proposal:
|
75
|
+
fields:
|
76
|
+
category: Categoria
|
77
|
+
official_proposal: Proposta ufficiale
|
78
|
+
scope: Visibilità
|
79
|
+
state: Stato
|
80
|
+
title: Titolo
|
81
|
+
proposals:
|
82
|
+
count:
|
83
|
+
proposals_count:
|
84
|
+
one: 1 proposta
|
85
|
+
other: "%{count} proposte"
|
86
|
+
filters:
|
87
|
+
accepted: Accettata
|
88
|
+
activity: Attività
|
89
|
+
category: Categoria
|
90
|
+
category_prompt: Scegli una categoria
|
91
|
+
citizenship: Cittadinanza
|
92
|
+
official: Ufficiale
|
93
|
+
origin: Origine
|
94
|
+
rejected: Rifiutata
|
95
|
+
related_to: Associata a
|
96
|
+
scopes: Visibilità
|
97
|
+
search: Cerca
|
98
|
+
state: Stato
|
99
|
+
voted: Votata
|
100
|
+
filters_small_view:
|
101
|
+
close_modal: Chiudi modalità
|
102
|
+
filter: Filtra
|
103
|
+
filter_by: Filtra per
|
104
|
+
unfold: Espandi
|
105
|
+
index:
|
106
|
+
new_proposal: Nuova proposta
|
107
|
+
view_proposal: Visualizza proposta
|
108
|
+
linked_proposals:
|
109
|
+
proposal_votes:
|
110
|
+
one: <span class="card--list__data__number">1</span>voto
|
111
|
+
other: <span class="card--list__data__number">%{count}</span>voti
|
112
|
+
new:
|
113
|
+
back: Indietro
|
114
|
+
select_a_category: Scegli una categoria
|
115
|
+
send: Invia
|
116
|
+
title: Nuova proposta
|
117
|
+
orders:
|
118
|
+
label: 'Ordina le proposte per:'
|
119
|
+
most_voted: Più votate
|
120
|
+
random: A caso
|
121
|
+
recent: le più recenti
|
122
|
+
proposal:
|
123
|
+
view_proposal: Visualizza la proposta
|
124
|
+
show:
|
125
|
+
proposal_accepted_reason: 'Questa proposta è stata accettata perché:'
|
126
|
+
proposal_rejected_reason: 'Questa proposta è stata rifiutata perché:'
|
127
|
+
vote_button:
|
128
|
+
already_voted: Già votata
|
129
|
+
no_votes_remaining: Sono finite le votazioni possibili
|
130
|
+
vote: Vota
|
131
|
+
votes_blocked: Votazioni disabilitate
|
132
|
+
votes_count:
|
133
|
+
count:
|
134
|
+
one: VOTO
|
135
|
+
other: VOTI
|
136
|
+
votes_limit:
|
137
|
+
vote_limit:
|
138
|
+
description: Invece di votare tutte le proposte possibili puoi soltanto votare fino a %{limit} proposte.
|
139
|
+
left: Restano
|
140
|
+
title: Hai ancora %{limit} voti
|
141
|
+
votes: Voti
|
142
|
+
resource_links:
|
143
|
+
included_proposals:
|
144
|
+
proposal_projects: 'Le proposte compaiono nei seguenti progetti:'
|
145
|
+
proposal_results: 'Le proposte compaiono nei seguenti risultati:'
|
146
|
+
proposals_from_meeting:
|
147
|
+
proposal_meetings: Meeting associati alla proposta
|
@@ -1,9 +1,11 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
class CreateProposalVotes < ActiveRecord::Migration[5.0]
|
2
4
|
def change
|
3
5
|
create_table :decidim_proposals_proposal_votes do |t|
|
4
6
|
t.references :decidim_proposal, null: false, index: { name: "decidim_proposals_proposal_vote_proposal" }
|
5
7
|
t.references :decidim_author, null: false, index: { name: "decidim_proposals_proposal_vote_author" }
|
6
|
-
|
8
|
+
|
7
9
|
t.timestamps
|
8
10
|
end
|
9
11
|
|
data/decidim-proposals/db/migrate/20170307085300_migrate_proposal_reports_data_to_reports.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
class MigrateProposalReportsDataToReports < ActiveRecord::Migration[5.0]
|
2
4
|
class Decidim::Proposals::ProposalReport < ApplicationRecord
|
3
5
|
belongs_to :user, foreign_key: "decidim_user_id", class_name: "Decidim::User"
|
@@ -6,16 +8,12 @@ class MigrateProposalReportsDataToReports < ActiveRecord::Migration[5.0]
|
|
6
8
|
|
7
9
|
def change
|
8
10
|
Decidim::Proposals::ProposalReport.all.each do |proposal_report|
|
9
|
-
moderation = Decidim::Moderation.find_or_create_by!(
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
user: proposal_report.user,
|
16
|
-
reason: proposal_report.reason,
|
17
|
-
details: proposal_report.details
|
18
|
-
})
|
11
|
+
moderation = Decidim::Moderation.find_or_create_by!(reportable: proposal_report.proposal,
|
12
|
+
participatory_process: proposal_report.proposal.feature.participatory_process)
|
13
|
+
Decidim::Report.create!(moderation: moderation,
|
14
|
+
user: proposal_report.user,
|
15
|
+
reason: proposal_report.reason,
|
16
|
+
details: proposal_report.details)
|
19
17
|
moderation.update_attributes!(report_count: moderation.report_count + 1)
|
20
18
|
end
|
21
19
|
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class MigrateProposalsCategory < ActiveRecord::Migration[5.1]
|
4
|
+
def change
|
5
|
+
# Create categorizations ensuring database integrity
|
6
|
+
execute('
|
7
|
+
INSERT INTO decidim_categorizations(decidim_category_id, categorizable_id, categorizable_type, created_at, updated_at)
|
8
|
+
SELECT decidim_category_id, decidim_proposals_proposals.id, \'Decidim::Proposals::Proposal\', NOW(), NOW()
|
9
|
+
FROM decidim_proposals_proposals
|
10
|
+
INNER JOIN decidim_categories ON decidim_categories.id = decidim_proposals_proposals.decidim_category_id
|
11
|
+
')
|
12
|
+
# Remove unused column
|
13
|
+
remove_column :decidim_proposals_proposals, :decidim_category_id
|
14
|
+
end
|
15
|
+
end
|
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
$LOAD_PATH.push File.expand_path("lib", __dir__)
|
2
4
|
|
3
5
|
# Maintain your gem's version:
|
4
6
|
require_relative "../decidim-core/lib/decidim/core/version"
|
@@ -17,7 +19,7 @@ Gem::Specification.new do |s|
|
|
17
19
|
s.add_dependency "decidim-comments", Decidim.version
|
18
20
|
s.add_dependency "rectify", "~> 0.9.1"
|
19
21
|
s.add_dependency "kaminari", "~> 1.0.1"
|
20
|
-
s.add_dependency
|
22
|
+
s.add_dependency "social-share-button", "~> 0.10.0"
|
21
23
|
|
22
24
|
s.add_development_dependency "decidim-dev", Decidim.version
|
23
25
|
s.add_development_dependency "decidim-meetings", Decidim.version
|