decidim 0.0.1 → 0.0.2
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/.codeclimate.yml +4 -5
- data/.eslintignore +2 -0
- data/.eslintrc.json +2 -0
- data/.gitignore +1 -0
- data/.inch.yml +5 -0
- data/.mention-bot +8 -0
- data/.rubocop.yml +8 -31
- data/.ruby-version +1 -1
- data/.travis.yml +24 -14
- data/Dockerfile +1 -3
- data/Gemfile +1 -3
- data/Gemfile.lock +175 -138
- data/README.md +63 -5
- data/Rakefile +1 -1
- data/codecov.yml +1 -0
- data/decidim-admin/Rakefile +1 -1
- data/decidim-admin/app/assets/javascripts/decidim/admin/application.js.es6 +0 -1
- data/decidim-admin/app/assets/stylesheets/decidim/admin/_foundation_and_overrides.scss +1 -0
- data/decidim-admin/app/assets/stylesheets/decidim/admin/_icons.scss +9 -0
- data/decidim-admin/app/assets/stylesheets/decidim/admin/application.scss +1 -0
- data/decidim-admin/app/commands/decidim/admin/create_feature.rb +3 -1
- data/decidim-admin/app/commands/decidim/admin/create_participatory_process.rb +26 -14
- data/decidim-admin/app/commands/decidim/admin/destroy_feature.rb +5 -0
- data/decidim-admin/app/commands/decidim/admin/destroy_participatory_process_step.rb +29 -0
- data/decidim-admin/app/commands/decidim/admin/update_feature.rb +47 -0
- data/decidim-admin/app/commands/decidim/admin/update_organization.rb +3 -1
- data/decidim-admin/app/controllers/decidim/admin/features_controller.rb +37 -2
- data/decidim-admin/app/controllers/decidim/admin/participatory_process_step_activations_controller.rb +0 -16
- data/decidim-admin/app/controllers/decidim/admin/participatory_process_steps_controller.rb +10 -3
- data/decidim-admin/app/controllers/decidim/admin/static_pages_controller.rb +4 -4
- data/decidim-admin/app/controllers/decidim/admin/user_groups_controller.rb +32 -0
- data/decidim-admin/app/controllers/decidim/admin/users_controller.rb +87 -0
- data/decidim-admin/app/forms/decidim/admin/category_form.rb +1 -7
- data/decidim-admin/app/forms/decidim/admin/feature_form.rb +26 -0
- data/decidim-admin/app/forms/decidim/admin/organization_form.rb +2 -0
- data/decidim-admin/app/forms/decidim/admin/participatory_process_step_form.rb +1 -1
- data/decidim-admin/app/forms/decidim/admin/static_page_form.rb +2 -3
- data/decidim-admin/app/models/decidim/admin/abilities/admin_user.rb +6 -0
- data/decidim-admin/app/views/decidim/admin/features/_feature.html.erb +4 -1
- data/decidim-admin/app/views/decidim/admin/features/_form.html.erb +49 -0
- data/decidim-admin/app/views/decidim/admin/features/_settings_fields.html.erb +5 -0
- data/decidim-admin/app/views/decidim/admin/features/edit.html.erb +9 -0
- data/decidim-admin/app/views/decidim/admin/features/index.html.erb +6 -0
- data/decidim-admin/app/views/decidim/admin/features/new.html.erb +1 -1
- data/decidim-admin/app/views/decidim/admin/organization/_form.html.erb +8 -0
- data/decidim-admin/app/views/decidim/admin/participatory_process_attachments/_form.html.erb +1 -1
- data/decidim-admin/app/views/decidim/admin/participatory_process_steps/index.html.erb +2 -6
- data/decidim-admin/app/views/decidim/admin/user_groups/index.html.erb +32 -0
- data/decidim-admin/app/views/decidim/admin/users/_form.html.erb +6 -0
- data/decidim-admin/app/views/decidim/admin/users/index.html.erb +54 -0
- data/decidim-admin/app/views/decidim/admin/users/new.html.erb +11 -0
- data/decidim-admin/app/views/layouts/decidim/admin/_sidebar.html.erb +2 -0
- data/decidim-admin/app/views/layouts/decidim/admin/participatory_process.html.erb +1 -1
- data/decidim-admin/config/i18n-tasks.yml +1 -0
- data/decidim-admin/config/locales/ca.yml +103 -5
- data/decidim-admin/config/locales/en.yml +57 -4
- data/decidim-admin/config/locales/es.yml +103 -5
- data/decidim-admin/config/routes.rb +11 -0
- data/decidim-admin/decidim-admin.gemspec +2 -3
- data/decidim-admin/lib/decidim/admin/features/base_controller.rb +7 -3
- data/decidim-admin/lib/decidim/admin/test/factories.rb +8 -0
- data/decidim-admin/spec/commands/create_category_spec.rb +2 -1
- data/decidim-admin/spec/commands/create_feature_spec.rb +21 -2
- data/decidim-admin/spec/commands/create_participatory_process_spec.rb +13 -1
- data/decidim-admin/spec/commands/create_static_page_spec.rb +1 -1
- data/decidim-admin/spec/commands/destroy_participatory_process_step_spec.rb +45 -0
- data/decidim-admin/spec/commands/update_category_spec.rb +2 -1
- data/decidim-admin/spec/commands/update_feature_spec.rb +79 -0
- data/decidim-admin/spec/commands/update_organization_spec.rb +3 -2
- data/decidim-admin/spec/commands/update_static_page_spec.rb +3 -2
- data/decidim-admin/spec/factories.rb +2 -9
- data/decidim-admin/spec/features/admin_manages_features_spec.rb +84 -2
- data/decidim-admin/spec/features/admin_manages_organization_admins_spec.rb +71 -0
- data/decidim-admin/spec/features/admin_manages_user_groups_spec.rb +24 -0
- data/decidim-admin/spec/forms/category_form_spec.rb +3 -7
- data/decidim-admin/spec/forms/organization_form_spec.rb +8 -2
- data/decidim-admin/spec/forms/participatory_process_form_spec.rb +2 -1
- data/decidim-admin/spec/forms/participatory_process_step_form_spec.rb +2 -21
- data/decidim-admin/spec/forms/scope_form_spec.rb +1 -1
- data/decidim-admin/spec/forms/static_page_form_spec.rb +2 -7
- data/decidim-admin/spec/models/abilities/admin_user_spec.rb +22 -0
- data/decidim-admin/spec/shared/manage_process_attachments_examples.rb +2 -1
- data/decidim-admin/spec/shared/manage_process_steps_examples.rb +2 -15
- data/decidim-admin/spec/spec_helper.rb +3 -1
- data/decidim-api/Rakefile +1 -1
- data/decidim-api/decidim-api.gemspec +3 -3
- data/decidim-api/spec/factories.rb +2 -2
- data/decidim-api/spec/spec_helper.rb +3 -1
- data/decidim-comments/Rakefile +1 -1
- data/decidim-comments/app/assets/javascripts/decidim/comments/bundle.js +0 -0
- data/decidim-comments/app/commands/decidim/comments/vote_comment.rb +38 -0
- data/decidim-comments/app/frontend/application/icon.component.jsx +9 -4
- data/decidim-comments/app/frontend/application/icon.component.test.jsx +12 -2
- data/decidim-comments/app/frontend/comments/add_comment_form.component.jsx +43 -11
- data/decidim-comments/app/frontend/comments/add_comment_form.mutation.graphql +1 -4
- data/decidim-comments/app/frontend/comments/comment.component.jsx +67 -7
- data/decidim-comments/app/frontend/comments/comment.component.test.jsx +49 -1
- data/decidim-comments/app/frontend/comments/comment_data.fragment.graphql +3 -0
- data/decidim-comments/app/frontend/comments/comment_order_selector.component.jsx +51 -6
- data/decidim-comments/app/frontend/comments/comment_order_selector.component.test.jsx +12 -1
- data/decidim-comments/app/frontend/comments/comment_thread.component.jsx +11 -5
- data/decidim-comments/app/frontend/comments/comment_thread.component.test.jsx +13 -3
- data/decidim-comments/app/frontend/comments/comment_thread.fragment.graphql +1 -3
- data/decidim-comments/app/frontend/comments/comments.component.jsx +37 -11
- data/decidim-comments/app/frontend/comments/comments.component.test.jsx +44 -7
- data/decidim-comments/app/frontend/comments/comments.query.graphql +2 -2
- data/decidim-comments/app/frontend/comments/down_vote.fragment.graphql +6 -0
- data/decidim-comments/app/frontend/comments/down_vote.mutation.graphql +7 -0
- data/decidim-comments/app/frontend/comments/down_vote_button.component.jsx +84 -0
- data/decidim-comments/app/frontend/comments/down_vote_button.component.test.jsx +48 -0
- data/decidim-comments/app/frontend/comments/up_vote.fragment.graphql +6 -0
- data/decidim-comments/app/frontend/comments/up_vote.mutation.graphql +7 -0
- data/decidim-comments/app/frontend/comments/up_vote_button.component.jsx +84 -0
- data/decidim-comments/app/frontend/comments/up_vote_button.component.test.jsx +48 -0
- data/decidim-comments/app/frontend/comments/vote_button.component.jsx +19 -0
- data/decidim-comments/app/frontend/comments/vote_button_component.test.jsx +38 -0
- data/decidim-comments/app/frontend/support/generate_comments_data.js +7 -2
- data/decidim-comments/app/helpers/decidim/comments/comments_helper.rb +1 -1
- data/decidim-comments/app/models/decidim/comments/application_record.rb +9 -0
- data/decidim-comments/app/models/decidim/comments/comment.rb +19 -4
- data/decidim-comments/app/models/decidim/comments/comment_vote.rb +22 -0
- data/decidim-comments/app/models/decidim/comments/seed.rb +27 -0
- data/decidim-comments/app/queries/decidim/comments/comments_with_replies.rb +88 -0
- data/decidim-comments/app/resolvers/decidim/comments/vote_comment_resolver.rb +20 -0
- data/decidim-comments/app/types/decidim/comments/comment_mutation_type.rb +19 -0
- data/decidim-comments/app/types/decidim/comments/comment_type.rb +38 -2
- data/decidim-comments/config/locales/en.yml +1 -0
- data/decidim-comments/db/migrate/20161130143508_create_comments.rb +4 -2
- data/decidim-comments/db/migrate/20161219150806_create_comment_votes.rb +13 -0
- data/decidim-comments/decidim-comments.gemspec +0 -3
- data/decidim-comments/lib/decidim/comments/mutation_extensions.rb +9 -0
- data/decidim-comments/lib/decidim/comments/query_extensions.rb +3 -5
- data/decidim-comments/lib/decidim/comments/test/factories.rb +22 -0
- data/decidim-comments/spec/commands/vote_comment_spec.rb +124 -0
- data/decidim-comments/spec/factories.rb +2 -9
- data/decidim-comments/spec/features/comments_spec.rb +37 -0
- data/decidim-comments/spec/models/comment_spec.rb +34 -0
- data/decidim-comments/spec/models/comment_vote_spec.rb +44 -0
- data/decidim-comments/spec/models/seed_spec.rb +19 -0
- data/decidim-comments/spec/queries/comments_with_replies_spec.rb +86 -0
- data/decidim-comments/spec/spec_helper.rb +3 -1
- data/decidim-comments/spec/support/dummy.rb +1 -1
- data/decidim-comments/spec/types/comment_mutation_type_spec.rb +46 -0
- data/decidim-comments/spec/types/comment_type_spec.rb +57 -3
- data/{decidim-api → decidim-comments}/spec/types/mutation_type_spec.rb +11 -0
- data/decidim-dev/README.md +7 -11
- data/decidim-dev/decidim-dev.gemspec +5 -4
- data/decidim-dev/lib/decidim/dev.rb +20 -0
- data/decidim-dev/lib/decidim/dev/assets/Exampledocument.docx +0 -0
- data/decidim-dev/lib/decidim/dev/assets/Exampledocument.odt +0 -0
- data/decidim-dev/lib/decidim/dev/assets/Exampledocument.pdf +0 -0
- data/decidim-dev/lib/decidim/dev/assets/avatar.svg +14 -0
- data/decidim-dev/lib/decidim/dev/assets/city.jpeg +0 -0
- data/decidim-dev/lib/decidim/dev/assets/city2.jpeg +0 -0
- data/decidim-dev/lib/decidim/dev/assets/city3.jpeg +0 -0
- data/decidim-dev/lib/decidim/dev/assets/malicious.jpg +0 -0
- data/decidim-dev/lib/decidim/{common_rake.rb → dev/common_rake.rb} +1 -1
- data/decidim-dev/lib/decidim/{dummy_authorization_handler.rb → dev/dummy_authorization_handler.rb} +4 -4
- data/decidim-dev/lib/decidim/{test → dev/test}/authorization_shared_examples.rb +0 -8
- data/decidim-dev/lib/decidim/{test → dev/test}/base_spec_helper.rb +4 -1
- data/decidim-dev/lib/decidim/{test → dev/test}/i18n_spec.rb +1 -1
- data/decidim-dev/lib/decidim/{test → dev/test}/rspec_support/action_mailer.rb +0 -0
- data/decidim-dev/lib/decidim/{test → dev/test}/rspec_support/active_job.rb +0 -0
- data/decidim-dev/lib/decidim/{test → dev/test}/rspec_support/authenticated_controller_context.rb +0 -0
- data/decidim-dev/lib/decidim/{test → dev/test}/rspec_support/authorization_handlers.rb +1 -1
- data/decidim-dev/lib/decidim/{test → dev/test}/rspec_support/capybara.rb +3 -10
- data/decidim-dev/lib/decidim/{test → dev/test}/rspec_support/database_cleaner.rb +0 -0
- data/decidim-dev/lib/decidim/{test → dev/test}/rspec_support/engine_routes.rb +0 -0
- data/decidim-dev/lib/decidim/{test → dev/test}/rspec_support/factory_girl.rb +0 -0
- data/decidim-dev/lib/decidim/{test → dev/test}/rspec_support/feature.rb +10 -0
- data/decidim-dev/lib/decidim/{test → dev/test}/rspec_support/feature_context.rb +2 -2
- data/decidim-dev/lib/decidim/{test → dev/test}/rspec_support/helpers.rb +4 -0
- data/decidim-dev/lib/decidim/{test → dev/test}/rspec_support/i18n.rb +1 -0
- data/decidim-dev/lib/decidim/dev/test/rspec_support/phantomjs_polyfills/bind-polyfill.js +18 -0
- data/decidim-dev/lib/decidim/dev/test/rspec_support/phantomjs_polyfills/object-assign-polyfill.js +24 -0
- data/decidim-dev/lib/decidim/dev/test/rspec_support/phantomjs_polyfills/promise.js +233 -0
- data/decidim-dev/lib/decidim/{test → dev/test}/rspec_support/translation_helpers.rb +0 -0
- data/decidim-dev/lib/decidim/{test → dev/test}/rspec_support/warden.rb +0 -0
- data/decidim-dev/lib/decidim/{test → dev/test}/rspec_support/wisper.rb +0 -0
- data/decidim-dev/lib/generators/decidim/dummy_generator.rb +2 -2
- data/decidim-dev/lib/generators/decidim/templates/decidim_dev.rb +2 -0
- data/decidim-meetings/Rakefile +1 -1
- data/decidim-meetings/app/assets/images/decidim/meetings/icon.svg +1 -0
- data/decidim-meetings/app/commands/decidim/meetings/admin/create_meeting.rb +2 -0
- data/decidim-meetings/app/commands/decidim/meetings/admin/update_meeting.rb +2 -0
- data/decidim-meetings/app/controllers/decidim/meetings/meetings_controller.rb +30 -6
- data/decidim-meetings/app/forms/decidim/meetings/admin/meeting_form.rb +14 -0
- data/decidim-meetings/app/helpers/decidim/meetings/application_helper.rb +10 -0
- data/decidim-meetings/app/models/decidim/meetings/meeting.rb +18 -1
- data/decidim-meetings/app/services/decidim/meetings/meeting_search.rb +48 -0
- data/decidim-meetings/app/views/decidim/meetings/admin/meetings/_form.html.erb +9 -2
- data/decidim-meetings/app/views/decidim/meetings/meetings/_filters.html.erb +24 -0
- data/decidim-meetings/app/views/decidim/meetings/meetings/_meetings.html.erb +30 -0
- data/decidim-meetings/app/views/decidim/meetings/meetings/_tags.html.erb +10 -0
- data/decidim-meetings/app/views/decidim/meetings/meetings/index.html.erb +8 -26
- data/decidim-meetings/app/views/decidim/meetings/meetings/index.js.erb +2 -0
- data/decidim-meetings/app/views/decidim/meetings/meetings/show.html.erb +1 -0
- data/decidim-meetings/config/locales/ca.yml +7 -0
- data/decidim-meetings/config/locales/en.yml +7 -0
- data/decidim-meetings/config/locales/es.yml +7 -0
- data/decidim-meetings/db/migrate/20161130121354_create_meetings.rb +2 -0
- data/decidim-meetings/decidim-meetings.gemspec +2 -0
- data/decidim-meetings/lib/decidim/meetings/feature.rb +7 -2
- data/decidim-meetings/lib/decidim/meetings/list_engine.rb +3 -0
- data/decidim-meetings/spec/commands/create_meeting_spec.rb +21 -0
- data/decidim-meetings/spec/commands/update_meeting_spec.rb +17 -2
- data/decidim-meetings/spec/factories.rb +3 -3
- data/decidim-meetings/spec/features/explore_meetings_spec.rb +53 -0
- data/decidim-meetings/spec/forms/meeting_form_spec.rb +19 -1
- data/decidim-meetings/spec/models/meeting_spec.rb +20 -0
- data/decidim-meetings/spec/services/meeting_search_spec.rb +146 -0
- data/decidim-meetings/spec/shared/admin_shared_context.rb +4 -2
- data/decidim-meetings/spec/shared/manage_meetings_examples.rb +5 -2
- data/decidim-meetings/spec/spec_helper.rb +1 -1
- data/decidim-pages/Rakefile +1 -1
- data/decidim-pages/app/assets/images/decidim/pages/icon.svg +3 -0
- data/decidim-pages/app/commands/decidim/pages/admin/update_page.rb +1 -2
- data/decidim-pages/app/forms/decidim/pages/admin/page_form.rb +0 -1
- data/decidim-pages/app/views/decidim/pages/admin/pages/_form.html.erb +0 -1
- data/decidim-pages/app/views/decidim/pages/application/show.html.erb +3 -3
- data/decidim-pages/config/i18n-tasks.yml +1 -0
- data/decidim-pages/config/locales/ca.yml +5 -1
- data/decidim-pages/config/locales/en.yml +5 -1
- data/decidim-pages/config/locales/es.yml +5 -1
- data/decidim-pages/db/migrate/20170110145040_remove_commentable_flag_from_pages.rb +5 -0
- data/decidim-pages/lib/decidim/pages/feature.rb +13 -3
- data/decidim-pages/spec/commands/update_page_spec.rb +2 -1
- data/decidim-pages/spec/factories.rb +2 -2
- data/decidim-pages/spec/features/admin_spec.rb +0 -11
- data/decidim-pages/spec/features/page_show_spec.rb +13 -10
- data/decidim-pages/spec/forms/page_form_spec.rb +4 -4
- data/decidim-pages/spec/spec_helper.rb +3 -1
- data/decidim-proposals/Rakefile +1 -1
- data/decidim-proposals/app/assets/config/decidim_proposals_manifest.css +1 -0
- data/decidim-proposals/app/assets/config/decidim_proposals_manifest.js +1 -0
- data/decidim-proposals/app/assets/images/decidim/proposals/icon.svg +1 -0
- data/decidim-proposals/app/assets/javascripts/decidim/proposals/social_share.js +2 -0
- data/decidim-proposals/app/assets/stylesheets/decidim/proposals/social_share.css.scss +14 -0
- data/decidim-proposals/app/commands/decidim/proposals/create_proposal.rb +5 -3
- data/decidim-proposals/app/controllers/decidim/proposals/admin/proposals_controller.rb +3 -3
- data/decidim-proposals/app/controllers/decidim/proposals/proposal_votes_controller.rb +25 -0
- data/decidim-proposals/app/controllers/decidim/proposals/proposals_controller.rb +33 -6
- data/decidim-proposals/app/forms/decidim/proposals/admin/proposal_form.rb +7 -6
- data/decidim-proposals/app/forms/decidim/proposals/proposal_form.rb +6 -6
- data/decidim-proposals/app/helpers/decidim/proposals/application_helper.rb +3 -1
- data/decidim-proposals/app/helpers/decidim/proposals/proposal_votes_helper.rb +27 -0
- data/decidim-proposals/app/models/decidim/proposals/proposal.rb +8 -0
- data/decidim-proposals/app/models/decidim/proposals/proposal_vote.rb +20 -0
- data/decidim-proposals/app/services/decidim/proposals/proposal_search.rb +39 -11
- data/decidim-proposals/app/views/decidim/proposals/admin/proposals/_form.html.erb +2 -2
- data/decidim-proposals/app/views/decidim/proposals/proposal_votes/create.js.erb +5 -0
- data/decidim-proposals/app/views/decidim/proposals/proposals/_count.html.erb +1 -0
- data/decidim-proposals/app/views/decidim/proposals/proposals/_filters.html.erb +26 -0
- data/decidim-proposals/app/views/decidim/proposals/proposals/_proposal.html.erb +11 -2
- data/decidim-proposals/app/views/decidim/proposals/proposals/_proposals.html.erb +4 -0
- data/decidim-proposals/app/views/decidim/proposals/proposals/_share.html.erb +33 -0
- data/decidim-proposals/app/views/decidim/proposals/proposals/_vote_button.html.erb +13 -0
- data/decidim-proposals/app/views/decidim/proposals/proposals/_votes_count.html.erb +6 -0
- data/decidim-proposals/app/views/decidim/proposals/proposals/index.html.erb +11 -11
- data/decidim-proposals/app/views/decidim/proposals/proposals/index.js.erb +5 -0
- data/decidim-proposals/app/views/decidim/proposals/proposals/show.html.erb +31 -4
- data/decidim-proposals/config/i18n-tasks.yml +1 -0
- data/decidim-proposals/config/initializers/social_share_button.rb +4 -0
- data/decidim-proposals/config/locales/ca.yml +28 -2
- data/decidim-proposals/config/locales/en.yml +27 -1
- data/decidim-proposals/config/locales/es.yml +28 -2
- data/decidim-proposals/db/migrate/20170112115253_create_proposal_votes.rb +12 -0
- data/decidim-proposals/db/migrate/20170113114245_add_text_search_indexes.rb +6 -0
- data/decidim-proposals/db/migrate/20170118120151_add_counter_cache_votes_to_proposals.rb +5 -0
- data/decidim-proposals/decidim-proposals.gemspec +2 -1
- data/decidim-proposals/lib/decidim/proposals/engine.rb +8 -1
- data/decidim-proposals/lib/decidim/proposals/feature.rb +30 -4
- data/decidim-proposals/spec/commands/decidim/proposals/create_proposal_spec.rb +10 -3
- data/decidim-proposals/spec/factories.rb +9 -4
- data/decidim-proposals/spec/features/admin_manages_proposals_spec.rb +2 -0
- data/decidim-proposals/spec/features/process_admin_manages_proposals_spec.rb +2 -0
- data/decidim-proposals/spec/features/proposals_spec.rb +41 -31
- data/decidim-proposals/spec/features/vote_proposal_spec.rb +78 -0
- data/decidim-proposals/spec/forms/decidim/proposals/proposal_form_spec.rb +11 -10
- data/decidim-proposals/spec/helpers/proposal_votes_helper_spec.rb +28 -0
- data/decidim-proposals/spec/lib/decidim/proposals/feature_spec.rb +1 -1
- data/decidim-proposals/spec/models/decidim/proposals/proposal_spec.rb +20 -3
- data/decidim-proposals/spec/models/decidim/proposals/proposal_vote_spec.rb +43 -0
- data/decidim-proposals/spec/services/decidim/proposals/proposal_search_spec.rb +50 -4
- data/decidim-proposals/spec/shared/manage_proposals_examples.rb +1 -1
- data/decidim-proposals/spec/spec_helper.rb +1 -1
- data/decidim-system/Rakefile +1 -1
- data/decidim-system/app/commands/decidim/system/register_organization.rb +13 -12
- data/decidim-system/decidim-system.gemspec +2 -3
- data/decidim-system/spec/factories.rb +1 -1
- data/decidim-system/spec/spec_helper.rb +3 -1
- data/docs/social_providers.md +41 -0
- data/karma.conf.js +4 -2
- data/lib/generators/decidim/app_generator.rb +6 -0
- data/lib/generators/decidim/demo_generator.rb +2 -2
- data/lib/generators/decidim/install_generator.rb +5 -4
- data/lib/generators/decidim/templates/Gemfile.erb +3 -5
- data/lib/generators/decidim/templates/initializer.rb +1 -1
- data/lib/generators/decidim/templates/secrets.yml.erb +26 -0
- data/lib/generators/decidim/templates/social_share_button.rb +7 -0
- data/package.json +16 -6
- data/webpack.config.js +23 -8
- data/yarn.lock +401 -345
- metadata +130 -48
- data/Gemfile.common +0 -1
- data/decidim-admin/Gemfile +0 -6
- data/decidim-comments/Gemfile +0 -6
- data/decidim-comments/package.json +0 -21
- data/decidim-dev/Gemfile +0 -6
- data/decidim-dev/lib/decidim/test/rspec_support/bullet.rb +0 -15
- data/decidim-dev/lib/generators/decidim/templates/bullet.rb +0 -6
- data/decidim-system/Gemfile +0 -6
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Decidim [![Gem](https://img.shields.io/gem/v/decidim.svg)](https://rubygems.org/gems/decidim) [![Gem](https://img.shields.io/gem/dt/decidim.svg)](https://rubygems.org/gems/decidim) [![License: AGPL v3](https://img.shields.io/github/license/AjuntamentdeBarcelona/decidim.svg)](https://github.com/AjuntamentdeBarcelona/decidim/blob/master/LICENSE-AGPLv3.txt)
|
2
2
|
|
3
|
-
[[Documentation](https://github.com/AjuntamentdeBarcelona/decidim/tree/master/
|
3
|
+
[[Documentation](https://github.com/AjuntamentdeBarcelona/decidim/tree/master/docs)] - [[Demo](http://staging.decidim.codegram.com)]
|
4
4
|
|
5
5
|
### Code quality
|
6
6
|
[![Build Status](https://img.shields.io/travis/AjuntamentdeBarcelona/decidim/master.svg)](https://travis-ci.org/AjuntamentdeBarcelona/decidim)
|
@@ -9,6 +9,7 @@
|
|
9
9
|
[![codecov](https://img.shields.io/codecov/c/github/AjuntamentdeBarcelona/decidim.svg)](https://codecov.io/gh/AjuntamentdeBarcelona/decidim)
|
10
10
|
[![Dependency Status](https://img.shields.io/gemnasium/AjuntamentdeBarcelona/decidim.svg)](https://gemnasium.com/github.com/AjuntamentdeBarcelona/decidim)
|
11
11
|
[![Crowdin](https://d322cqt584bo4o.cloudfront.net/decidim/localized.svg)](https://crowdin.com/project/decidim/invite)
|
12
|
+
[![Inline docs](http://inch-ci.org/github/AjuntamentdeBarcelona/decidim.svg?branch=master)](http://inch-ci.org/github/AjuntamentdeBarcelona/decidim)
|
12
13
|
|
13
14
|
### Project management
|
14
15
|
[![GitHub pull requests](https://img.shields.io/github/issues-pr/AjuntamentdeBarcelona/decidim.svg)](https://github.com/AjuntamentdeBarcelona/decidim/pulls)
|
@@ -17,6 +18,20 @@
|
|
17
18
|
[![GitHub closed issues](https://img.shields.io/github/issues-closed/AjuntamentdeBarcelona/decidim.svg)](https://github.com/AjuntamentdeBarcelona/decidim/issues?utf8=%E2%9C%93&q=is%3Aissue%20is%3Aclosed)
|
18
19
|
[![GitHub contributors](https://img.shields.io/github/contributors/AjuntamentdeBarcelona/decidim.svg)](https://github.com/AjuntamentdeBarcelona/decidim/graphs/contributors)
|
19
20
|
|
21
|
+
---
|
22
|
+
|
23
|
+
## What do you need to do?
|
24
|
+
|
25
|
+
- [Contribute to the project](#how-to-contribute)
|
26
|
+
- [Create & browse development app](#browse-decidim)
|
27
|
+
- [Install "Decidim" for an organization](#installation-instructions)
|
28
|
+
- [Upgrade an already existing "Decidim" installation](#upgrade-instructions)
|
29
|
+
- [Use Docker to deploy "Decidim"](#docker-instructions)
|
30
|
+
- [Check current components](#components)
|
31
|
+
- [Further configuration](#further-configuration)
|
32
|
+
|
33
|
+
---
|
34
|
+
|
20
35
|
## Installation instructions
|
21
36
|
|
22
37
|
First of all, you need to install the `decidim` gem, which currently is in a *prerelease* status.
|
@@ -93,9 +108,10 @@ Also you can run it as a standalone container like this:
|
|
93
108
|
In order to develop on decidim, you'll need:
|
94
109
|
|
95
110
|
* **PostgreSQL** 9.4+
|
96
|
-
* **Ruby** 2.
|
111
|
+
* **Ruby** 2.4.0
|
97
112
|
* **NodeJS** with **yarn** (JavaScript dependency manager, can be installed with `npm install yarn`)
|
98
113
|
* **ImageMagick**
|
114
|
+
* **PhantomJS**
|
99
115
|
|
100
116
|
The easiest way to work on decidim is to clone decidim's repository and install its dependencies
|
101
117
|
|
@@ -108,8 +124,50 @@ $ yarn install
|
|
108
124
|
|
109
125
|
You have several rake tasks available for you:
|
110
126
|
|
111
|
-
* `rake development_app`: Creates a development app inside `decidim_development` which you can use to run an application with the gems in your path.
|
112
|
-
* `rake test_all`: Generates a test app for every engine and runs their tests.
|
113
|
-
* `rake generate_all`: Generates all the tests apps but doesn't run the tests - this is useful is you want to run them manually afterwards.
|
127
|
+
* `bundle exec rake development_app`: Creates a development app inside `decidim_development` which you can use to run an application with the gems in your path.
|
128
|
+
* `bundle exec rake test_all`: Generates a test app for every engine and runs their tests.
|
129
|
+
* `bundle exec rake generate_all`: Generates all the tests apps but doesn't run the tests - this is useful is you want to run them manually afterwards.
|
130
|
+
* `cd <component>` and do `bundle exec rspec spec` to run those particular tests.
|
131
|
+
|
132
|
+
|
133
|
+
### Browse Decidim
|
134
|
+
|
135
|
+
After you create a development app (`bundle exec rake development_app`):
|
136
|
+
- `cd development_app`
|
137
|
+
- `bundle exec rails s`
|
138
|
+
- Go to 'http://localhost:3000'
|
139
|
+
|
140
|
+
Optionally, you can log in as: user@decidim.org | decidim123456
|
141
|
+
|
142
|
+
Also, if you want to verify yourself against the default authorization handler use a document number ended with "X".
|
143
|
+
|
144
|
+
|
145
|
+
### Browse Admin Interface
|
146
|
+
|
147
|
+
After you create a development app (`bundle exec rake development_app`):
|
148
|
+
- `cd development_app`
|
149
|
+
- `bundle exec rails s`
|
150
|
+
- Go to 'http://localhost:3000/admin'
|
151
|
+
- Login data: admin@decidim.org | decidim123456
|
152
|
+
|
153
|
+
|
154
|
+
## Components
|
155
|
+
|
156
|
+
|
157
|
+
| Component | Description |
|
158
|
+
| ------------- |-------------|
|
159
|
+
| [Admin](https://github.com/AjuntamentdeBarcelona/decidim/tree/master/decidim-admin) | This library adds an administration dashboard so users can manage their organization, participatory processes and all other entities. |
|
160
|
+
| [API](https://github.com/AjuntamentdeBarcelona/decidim/tree/master/decidim-api) | This library exposes a GraphQL API to programatically interact with the Decidim platform via HTTP |
|
161
|
+
| [Comments](https://github.com/AjuntamentdeBarcelona/decidim/tree/master/decidim-comments) | The Comments module adds the ability to include comments to any resource which can be commentable by users. |
|
162
|
+
| [Core](https://github.com/AjuntamentdeBarcelona/decidim/tree/master/decidim-core) | The basics of Decidim: users, participatory processes, etc. This is the only required engine to run Decidim, all the others are optional. |
|
163
|
+
| [Dev](https://github.com/AjuntamentdeBarcelona/decidim/tree/master/decidim-dev) | This gem aids the local development of Decidim's features. |
|
164
|
+
| [Meeting](https://github.com/AjuntamentdeBarcelona/decidim/tree/master/decidim-meetings) | The Meeeting module adds meeting to any participatory process. It adds a CRUD engine to the admin and public view scoped inside the participatory process. |
|
165
|
+
| [Pages](https://github.com/AjuntamentdeBarcelona/decidim/tree/master/decidim-pages) | The Pages module adds static page capabilities to any participatory process. It basically provides an interface to include arbitrary HTML content to any step. |
|
166
|
+
| [Proposals](https://github.com/AjuntamentdeBarcelona/decidim/tree/master/decidim-proposals) | The Proposals module adds one of the main features of Decidim: allows users to contribute to a participatory process by creating proposals. |
|
167
|
+
| [System](https://github.com/AjuntamentdeBarcelona/decidim/tree/master/decidim-system) | Multitenant Admin to manage multiple organizations in a single installation |
|
168
|
+
|
169
|
+
## Further configuration
|
170
|
+
|
171
|
+
- [Social providers integration](https://github.com/AjuntamentdeBarcelona/decidim/blob/master/docs/social_providers.md): Enable sign up from social networks.
|
114
172
|
|
115
173
|
TODO: Improve guide.
|
data/Rakefile
CHANGED
@@ -4,7 +4,7 @@ require "rspec/core/rake_task"
|
|
4
4
|
require_relative "lib/generators/decidim/app_generator"
|
5
5
|
require_relative "lib/generators/decidim/docker_generator"
|
6
6
|
|
7
|
-
DECIDIM_GEMS = %w(core system admin api pages meetings comments).freeze
|
7
|
+
DECIDIM_GEMS = %w(core system admin api pages meetings proposals comments).freeze
|
8
8
|
|
9
9
|
RSpec::Core::RakeTask.new(:spec)
|
10
10
|
|
data/codecov.yml
CHANGED
data/decidim-admin/Rakefile
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
require "decidim/common_rake"
|
2
|
+
require "decidim/dev/common_rake"
|
@@ -36,7 +36,9 @@ module Decidim
|
|
36
36
|
@feature = Feature.create!(
|
37
37
|
manifest_name: manifest.name,
|
38
38
|
name: form.name,
|
39
|
-
participatory_process: participatory_process
|
39
|
+
participatory_process: participatory_process,
|
40
|
+
settings: @form.settings,
|
41
|
+
step_settings: form.step_settings
|
40
42
|
)
|
41
43
|
end
|
42
44
|
|
@@ -20,8 +20,8 @@ module Decidim
|
|
20
20
|
def call
|
21
21
|
return broadcast(:invalid) if form.invalid?
|
22
22
|
|
23
|
-
create_participatory_process
|
24
|
-
broadcast(:ok)
|
23
|
+
process = create_participatory_process
|
24
|
+
broadcast(:ok, process)
|
25
25
|
end
|
26
26
|
|
27
27
|
private
|
@@ -29,18 +29,30 @@ module Decidim
|
|
29
29
|
attr_reader :form
|
30
30
|
|
31
31
|
def create_participatory_process
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
32
|
+
transaction do
|
33
|
+
process = ParticipatoryProcess.create!(
|
34
|
+
title: form.title,
|
35
|
+
subtitle: form.subtitle,
|
36
|
+
slug: form.slug,
|
37
|
+
hashtag: form.hashtag,
|
38
|
+
description: form.description,
|
39
|
+
short_description: form.short_description,
|
40
|
+
hero_image: form.hero_image,
|
41
|
+
banner_image: form.banner_image,
|
42
|
+
promoted: form.promoted,
|
43
|
+
organization: form.current_organization
|
44
|
+
)
|
45
|
+
|
46
|
+
process.steps.create!(
|
47
|
+
title: TranslationsHelper.multi_translation(
|
48
|
+
"decidim.admin.participatory_process_steps.default_title",
|
49
|
+
form.current_organization.available_locales
|
50
|
+
),
|
51
|
+
active: true
|
52
|
+
)
|
53
|
+
|
54
|
+
process
|
55
|
+
end
|
44
56
|
end
|
45
57
|
end
|
46
58
|
end
|
@@ -26,11 +26,16 @@ module Decidim
|
|
26
26
|
|
27
27
|
def destroy_feature
|
28
28
|
transaction do
|
29
|
+
run_before_hooks
|
29
30
|
@feature.destroy!
|
30
31
|
run_hooks
|
31
32
|
end
|
32
33
|
end
|
33
34
|
|
35
|
+
def run_before_hooks
|
36
|
+
@feature.manifest.run_hooks(:before_destroy, @feature)
|
37
|
+
end
|
38
|
+
|
34
39
|
def run_hooks
|
35
40
|
@feature.manifest.run_hooks(:destroy, @feature)
|
36
41
|
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
module Decidim
|
3
|
+
module Admin
|
4
|
+
# A command that sets all steps in a participatory process as inactive
|
5
|
+
class DestroyParticipatoryProcessStep < Rectify::Command
|
6
|
+
# Public: Initializes the command.
|
7
|
+
#
|
8
|
+
# step - A ParticipatoryProcessStep that will be deactivated
|
9
|
+
def initialize(step)
|
10
|
+
@step = step
|
11
|
+
@participatory_process = step.participatory_process
|
12
|
+
end
|
13
|
+
|
14
|
+
# Executes the command. Broadcasts these events:
|
15
|
+
#
|
16
|
+
# - :ok when everything is valid.
|
17
|
+
# - :invalid if the data wasn't valid and we couldn't proceed.
|
18
|
+
#
|
19
|
+
# Returns nothing.
|
20
|
+
def call
|
21
|
+
return broadcast(:invalid, :last_step) if @participatory_process.steps.count == 1
|
22
|
+
return broadcast(:invalid, :active_step) if @step.active?
|
23
|
+
|
24
|
+
@step.destroy!
|
25
|
+
broadcast(:ok)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
module Decidim
|
3
|
+
module Admin
|
4
|
+
# This command gets called when a feature is created from the admin panel.
|
5
|
+
class UpdateFeature < Rectify::Command
|
6
|
+
attr_reader :form, :feature
|
7
|
+
|
8
|
+
# Public: Initializes the command.
|
9
|
+
#
|
10
|
+
# form - The form from which the data in this feature comes from.
|
11
|
+
# feature - The feature to update.
|
12
|
+
def initialize(form, feature)
|
13
|
+
@manifest = feature.manifest
|
14
|
+
@form = form
|
15
|
+
@feature = feature
|
16
|
+
end
|
17
|
+
|
18
|
+
# Public: Creates the Feature.
|
19
|
+
#
|
20
|
+
# Broadcasts :ok if created, :invalid otherwise.
|
21
|
+
def call
|
22
|
+
return broadcast(:invalid) if form.invalid?
|
23
|
+
|
24
|
+
transaction do
|
25
|
+
update_feature
|
26
|
+
run_hooks
|
27
|
+
end
|
28
|
+
|
29
|
+
broadcast(:ok)
|
30
|
+
end
|
31
|
+
|
32
|
+
private
|
33
|
+
|
34
|
+
def update_feature
|
35
|
+
@feature.update_attributes(
|
36
|
+
name: form.name,
|
37
|
+
settings: form.settings,
|
38
|
+
step_settings: form.step_settings
|
39
|
+
)
|
40
|
+
end
|
41
|
+
|
42
|
+
def run_hooks
|
43
|
+
@manifest.run_hooks(:update, @feature)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -37,11 +37,13 @@ module Decidim
|
|
37
37
|
def attributes
|
38
38
|
{
|
39
39
|
name: form.name,
|
40
|
+
twitter_handler: form.twitter_handler,
|
40
41
|
description: form.description,
|
41
42
|
welcome_text: form.welcome_text,
|
42
43
|
homepage_image: form.homepage_image || organization.homepage_image,
|
43
44
|
logo: form.logo || organization.logo,
|
44
|
-
default_locale: form.default_locale
|
45
|
+
default_locale: form.default_locale,
|
46
|
+
show_statistics: form.show_statistics
|
45
47
|
}
|
46
48
|
end
|
47
49
|
end
|
@@ -20,7 +20,13 @@ module Decidim
|
|
20
20
|
def new
|
21
21
|
authorize! :create, Feature
|
22
22
|
|
23
|
-
@
|
23
|
+
@feature = Feature.new(
|
24
|
+
name: default_name(manifest),
|
25
|
+
manifest_name: params[:type],
|
26
|
+
participatory_process: participatory_process
|
27
|
+
)
|
28
|
+
|
29
|
+
@form = form(FeatureForm).from_model(@feature)
|
24
30
|
end
|
25
31
|
|
26
32
|
def create
|
@@ -40,8 +46,33 @@ module Decidim
|
|
40
46
|
end
|
41
47
|
end
|
42
48
|
|
49
|
+
def edit
|
50
|
+
@feature = query_scope.find(params[:id])
|
51
|
+
authorize! :update, @feature
|
52
|
+
|
53
|
+
@form = form(FeatureForm).from_model(@feature)
|
54
|
+
end
|
55
|
+
|
56
|
+
def update
|
57
|
+
@feature = query_scope.find(params[:id])
|
58
|
+
@form = form(FeatureForm).from_params(params)
|
59
|
+
authorize! :update, @feature
|
60
|
+
|
61
|
+
UpdateFeature.call(@form, @feature) do
|
62
|
+
on(:ok) do
|
63
|
+
flash[:notice] = I18n.t("features.update.success", scope: "decidim.admin")
|
64
|
+
redirect_to action: :index
|
65
|
+
end
|
66
|
+
|
67
|
+
on(:invalid) do
|
68
|
+
flash.now[:alert] = I18n.t("features.update.error", scope: "decidim.admin")
|
69
|
+
render action: "new"
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
43
74
|
def destroy
|
44
|
-
@feature =
|
75
|
+
@feature = query_scope.find(params[:id])
|
45
76
|
authorize! :destroy, @feature
|
46
77
|
|
47
78
|
DestroyFeature.call(@feature) do
|
@@ -59,6 +90,10 @@ module Decidim
|
|
59
90
|
|
60
91
|
private
|
61
92
|
|
93
|
+
def query_scope
|
94
|
+
participatory_process.features
|
95
|
+
end
|
96
|
+
|
62
97
|
def manifest
|
63
98
|
Decidim.find_feature_manifest(params[:type])
|
64
99
|
end
|
@@ -24,22 +24,6 @@ module Decidim
|
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
27
|
-
def destroy
|
28
|
-
authorize! :deactivate, process_step
|
29
|
-
|
30
|
-
DeactivateParticipatoryProcessStep.call(process_step) do
|
31
|
-
on(:ok) do
|
32
|
-
flash[:notice] = I18n.t("participatory_process_step_activations.destroy.success", scope: "decidim.admin")
|
33
|
-
end
|
34
|
-
|
35
|
-
on(:invalid) do
|
36
|
-
flash.now[:alert] = I18n.t("participatory_process_step_activations.destroy.error", scope: "decidim.admin")
|
37
|
-
end
|
38
|
-
|
39
|
-
redirect_to participatory_process_steps_path(participatory_process)
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
27
|
private
|
44
28
|
|
45
29
|
def process_step
|
@@ -66,11 +66,18 @@ module Decidim
|
|
66
66
|
def destroy
|
67
67
|
@participatory_process_step = collection.find(params[:id])
|
68
68
|
authorize! :destroy, @participatory_process_step
|
69
|
-
@participatory_process_step.destroy!
|
70
69
|
|
71
|
-
|
70
|
+
DestroyParticipatoryProcessStep.call(@participatory_process_step) do
|
71
|
+
on(:ok) do
|
72
|
+
flash[:notice] = I18n.t("participatory_process_steps.destroy.success", scope: "decidim.admin")
|
73
|
+
redirect_to participatory_process_steps_path(participatory_process)
|
74
|
+
end
|
72
75
|
|
73
|
-
|
76
|
+
on(:invalid) do |reason|
|
77
|
+
flash[:alert] = I18n.t("participatory_process_steps.destroy.error.#{reason}", scope: "decidim.admin")
|
78
|
+
redirect_to participatory_process_steps_path(participatory_process)
|
79
|
+
end
|
80
|
+
end
|
74
81
|
end
|
75
82
|
|
76
83
|
private
|