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
@@ -13,12 +13,12 @@ module Decidim
|
|
13
13
|
|
14
14
|
def new
|
15
15
|
authorize! :new, StaticPage
|
16
|
-
@form = StaticPageForm.
|
16
|
+
@form = form(StaticPageForm).instance
|
17
17
|
end
|
18
18
|
|
19
19
|
def create
|
20
20
|
authorize! :new, StaticPage
|
21
|
-
@form = StaticPageForm.from_params(form_params)
|
21
|
+
@form = form(StaticPageForm).from_params(form_params)
|
22
22
|
|
23
23
|
CreateStaticPage.call(@form) do
|
24
24
|
on(:ok) do
|
@@ -35,13 +35,13 @@ module Decidim
|
|
35
35
|
|
36
36
|
def edit
|
37
37
|
authorize! :update, page
|
38
|
-
@form = StaticPageForm.from_model(page)
|
38
|
+
@form = form(StaticPageForm).from_model(page)
|
39
39
|
end
|
40
40
|
|
41
41
|
def update
|
42
42
|
@page = collection.find(params[:id])
|
43
43
|
authorize! :update, page
|
44
|
-
@form = StaticPageForm.from_params(form_params)
|
44
|
+
@form = form(StaticPageForm).from_params(form_params)
|
45
45
|
|
46
46
|
UpdateStaticPage.call(page, @form) do
|
47
47
|
on(:ok) do
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Admin
|
5
|
+
# Controller that allows managing user groups at the admin panel.
|
6
|
+
#
|
7
|
+
class UserGroupsController < ApplicationController
|
8
|
+
def index
|
9
|
+
authorize! :index, UserGroup
|
10
|
+
@user_groups = collection
|
11
|
+
end
|
12
|
+
|
13
|
+
def verify
|
14
|
+
@user_group = collection.find(params[:id])
|
15
|
+
authorize! :verify, @user_group
|
16
|
+
|
17
|
+
@user_group.verify!
|
18
|
+
|
19
|
+
flash[:notice] = I18n.t("user_groups.verify.success", scope: "decidim.admin")
|
20
|
+
redirect_to decidim_admin.user_groups_path
|
21
|
+
end
|
22
|
+
|
23
|
+
private
|
24
|
+
|
25
|
+
def collection
|
26
|
+
UserGroup
|
27
|
+
.includes(:memberships)
|
28
|
+
.where(decidim_user_group_memberships: { decidim_user_id: current_organization.users })
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,87 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
require_dependency "decidim/admin/application_controller"
|
3
|
+
|
4
|
+
module Decidim
|
5
|
+
module Admin
|
6
|
+
# Controller that allows managing all admins at the admin panel.
|
7
|
+
#
|
8
|
+
class UsersController < Admin::ApplicationController
|
9
|
+
def index
|
10
|
+
authorize! :index, User
|
11
|
+
@users = collection
|
12
|
+
end
|
13
|
+
|
14
|
+
def new
|
15
|
+
authorize! :new, User
|
16
|
+
@form = form(InviteAdminForm).instance
|
17
|
+
end
|
18
|
+
|
19
|
+
def create
|
20
|
+
authorize! :new, User
|
21
|
+
|
22
|
+
default_params = {
|
23
|
+
organization: current_organization,
|
24
|
+
invitation_instructions: "invite_admin",
|
25
|
+
roles: %w(admin),
|
26
|
+
invited_by: current_user
|
27
|
+
}
|
28
|
+
|
29
|
+
@form = form(InviteAdminForm).from_params(params.merge(default_params))
|
30
|
+
|
31
|
+
InviteUser.call(@form) do
|
32
|
+
on(:ok) do
|
33
|
+
flash[:notice] = I18n.t("users.create.success", scope: "decidim.admin")
|
34
|
+
redirect_to users_path
|
35
|
+
end
|
36
|
+
|
37
|
+
on(:invalid) do
|
38
|
+
flash.now[:alert] = I18n.t("users.create.error", scope: "decidim.admin")
|
39
|
+
render :new
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
def resend_invitation
|
45
|
+
authorize! :invite, user
|
46
|
+
|
47
|
+
InviteUserAgain.call(user, "invite_admin") do
|
48
|
+
on(:ok) do
|
49
|
+
flash[:notice] = I18n.t("users.resend_invitation.success", scope: "decidim.admin")
|
50
|
+
end
|
51
|
+
|
52
|
+
on(:invalid) do
|
53
|
+
flash[:alert] = I18n.t("users.resend_invitation.error", scope: "decidim.admin")
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
redirect_to users_path
|
58
|
+
end
|
59
|
+
|
60
|
+
def destroy
|
61
|
+
authorize! :destroy, user
|
62
|
+
|
63
|
+
RemoveUserRole.call(user, "admin") do
|
64
|
+
on(:ok) do
|
65
|
+
flash[:notice] = I18n.t("users.destroy.success", scope: "decidim.admin")
|
66
|
+
end
|
67
|
+
|
68
|
+
on(:invalid) do
|
69
|
+
flash[:alert] = I18n.t("users.destroy.error", scope: "decidim.admin")
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
redirect_to users_path
|
74
|
+
end
|
75
|
+
|
76
|
+
private
|
77
|
+
|
78
|
+
def user
|
79
|
+
@user ||= collection.find(params[:id])
|
80
|
+
end
|
81
|
+
|
82
|
+
def collection
|
83
|
+
@collection ||= current_organization.admins
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
@@ -13,15 +13,9 @@ module Decidim
|
|
13
13
|
mimic :category
|
14
14
|
|
15
15
|
validates :name, :description, translatable_presence: true
|
16
|
-
validates :current_process, presence: true
|
17
16
|
validates :parent_id, inclusion: { in: :parent_categories_ids }, allow_blank: true
|
18
17
|
|
19
|
-
|
20
|
-
|
21
|
-
def initialize(attributes = {})
|
22
|
-
@current_process = attributes.delete("current_process") || attributes.delete(:current_process)
|
23
|
-
super
|
24
|
-
end
|
18
|
+
delegate :current_process, to: :context, prefix: false
|
25
19
|
|
26
20
|
def parent_categories
|
27
21
|
@parent_categories ||= current_process.categories.first_class.where.not(id: id)
|
@@ -11,6 +11,32 @@ module Decidim
|
|
11
11
|
|
12
12
|
translatable_attribute :name, String
|
13
13
|
validates :name, translatable_presence: true
|
14
|
+
|
15
|
+
attribute :settings, Object
|
16
|
+
attribute :manifest
|
17
|
+
|
18
|
+
attribute :step_settings, Hash[String => Object]
|
19
|
+
attribute :participatory_process
|
20
|
+
|
21
|
+
def map_model(model)
|
22
|
+
self.attributes = model.attributes
|
23
|
+
self.settings = model.settings
|
24
|
+
end
|
25
|
+
|
26
|
+
def settings?
|
27
|
+
settings.manifest.attributes.any?
|
28
|
+
end
|
29
|
+
|
30
|
+
def step_settings?
|
31
|
+
return false unless participatory_process.steps.any?
|
32
|
+
|
33
|
+
step_settings
|
34
|
+
.values
|
35
|
+
.map(&:manifest)
|
36
|
+
.flat_map(&:attributes)
|
37
|
+
.flat_map(&:keys)
|
38
|
+
.any?
|
39
|
+
end
|
14
40
|
end
|
15
41
|
end
|
16
42
|
end
|
@@ -10,9 +10,11 @@ module Decidim
|
|
10
10
|
mimic :organization
|
11
11
|
|
12
12
|
attribute :name, String
|
13
|
+
attribute :twitter_handler, String
|
13
14
|
attribute :default_locale, String
|
14
15
|
attribute :homepage_image
|
15
16
|
attribute :logo
|
17
|
+
attribute :show_statistics
|
16
18
|
|
17
19
|
translatable_attribute :description, String
|
18
20
|
translatable_attribute :welcome_text, String
|
@@ -16,7 +16,7 @@ module Decidim
|
|
16
16
|
attribute :start_date, DateTime
|
17
17
|
attribute :end_date, DateTime
|
18
18
|
|
19
|
-
validates :title,
|
19
|
+
validates :title, translatable_presence: true
|
20
20
|
|
21
21
|
validates :start_date, date: { before: :end_date, allow_blank: true, if: proc { |obj| obj.end_date.present? } }
|
22
22
|
validates :end_date, date: { after: :start_date, allow_blank: true, if: proc { |obj| obj.start_date.present? } }
|
@@ -6,17 +6,16 @@ module Decidim
|
|
6
6
|
include TranslatableAttributes
|
7
7
|
|
8
8
|
attribute :slug, String
|
9
|
-
attribute :organization, Decidim::Organization
|
10
9
|
translatable_attribute :title, String
|
11
10
|
translatable_attribute :content, String
|
12
11
|
|
13
12
|
mimic :static_page
|
14
13
|
|
15
|
-
validates :slug,
|
14
|
+
validates :slug, presence: true
|
16
15
|
validates :title, :content, translatable_presence: true
|
17
16
|
validate :slug, :slug_uniqueness
|
18
17
|
|
19
|
-
alias current_organization
|
18
|
+
alias organization current_organization
|
20
19
|
|
21
20
|
private
|
22
21
|
|
@@ -27,6 +27,12 @@ module Decidim
|
|
27
27
|
can :read, :admin_dashboard
|
28
28
|
can :manage, ParticipatoryProcessAttachment
|
29
29
|
can :manage, Scope
|
30
|
+
can [:create, :index, :new, :read, :invite], User
|
31
|
+
can [:destroy], [User] do |user_to_destroy|
|
32
|
+
user != user_to_destroy
|
33
|
+
end
|
34
|
+
|
35
|
+
can [:index, :verify], UserGroup
|
30
36
|
end
|
31
37
|
end
|
32
38
|
end
|
@@ -2,6 +2,7 @@
|
|
2
2
|
<td>
|
3
3
|
<%= link_to decidim.feature_path(participatory_process, feature), target: "_blank" do %>
|
4
4
|
<%= translated_attribute feature.name %>
|
5
|
+
<%= icon "external-link" %>
|
5
6
|
<% end %>
|
6
7
|
</td>
|
7
8
|
<td>
|
@@ -11,10 +12,12 @@
|
|
11
12
|
|
12
13
|
<% if feature.manifest.admin_engine %>
|
13
14
|
<%= link_to manage_feature_path(participatory_process, feature), class: "button small" do %>
|
14
|
-
<%= t "actions.
|
15
|
+
<%= t "actions.manage", scope: "decidim.admin" %>
|
15
16
|
<% end %>
|
16
17
|
<% end %>
|
17
18
|
|
19
|
+
<%= link_to t("actions.configure", scope: "decidim.admin"), url_for(action: :edit, id: feature, controller: "features"), class: "small button" if can? :update, feature %>
|
20
|
+
|
18
21
|
<%= link_to t("actions.destroy", scope: "decidim.admin"), url_for(action: :destroy, id: feature, controller: "features"), method: :delete, class: "small alert button", data: { confirm: t("actions.confirm_destroy", scope: "decidim.admin") } if can? :destroy, feature %>
|
19
22
|
</td>
|
20
23
|
</tr>
|
@@ -1,3 +1,52 @@
|
|
1
1
|
<div class="field">
|
2
2
|
<%= form.translated :text_field, :name, autofocus: true %>
|
3
|
+
|
4
|
+
<% if form.object.settings? %>
|
5
|
+
<fieldset class="global-settings">
|
6
|
+
<div class="card">
|
7
|
+
<div class="card-divider">
|
8
|
+
<legend><%= t ".global_settings" %></legend>
|
9
|
+
</div>
|
10
|
+
<div class="card-section">
|
11
|
+
<%= form.fields_for :settings, form.object.settings do |settings_fields| %>
|
12
|
+
<%= render partial: "decidim/admin/features/settings_fields",
|
13
|
+
locals: {
|
14
|
+
form: settings_fields,
|
15
|
+
feature: @feature,
|
16
|
+
settings_name: "global"
|
17
|
+
} %>
|
18
|
+
<% end %>
|
19
|
+
</div>
|
20
|
+
</div>
|
21
|
+
</fieldset>
|
22
|
+
<% end %>
|
23
|
+
|
24
|
+
<% if form.object.step_settings? %>
|
25
|
+
<fieldset class="step-settings">
|
26
|
+
<div class="card">
|
27
|
+
<div class="card-divider">
|
28
|
+
<legend><%= t ".step_settings" %></legend>
|
29
|
+
</div>
|
30
|
+
<div class="card-section">
|
31
|
+
<% participatory_process.steps.each do |step| %>
|
32
|
+
<fieldset class="step-settings-<%= step.id %>">
|
33
|
+
<legend><%= step.position + 1 %>. <%= translated_attribute step.title %></legend>
|
34
|
+
<% step_settings = form.object.step_settings[step.id.to_s] %>
|
35
|
+
|
36
|
+
<%= form.fields_for "step_settings", nil do |settings_fields| %>
|
37
|
+
<%= settings_fields.fields_for step.id.to_s, step_settings do |settings_fields| %>
|
38
|
+
<%= render partial: "decidim/admin/features/settings_fields",
|
39
|
+
locals: {
|
40
|
+
form: settings_fields,
|
41
|
+
feature: feature,
|
42
|
+
settings_name: "step"
|
43
|
+
} %>
|
44
|
+
<% end %>
|
45
|
+
<% end %>
|
46
|
+
</fieldset>
|
47
|
+
<% end %>
|
48
|
+
</div>
|
49
|
+
</div>
|
50
|
+
</fieldset>
|
51
|
+
<% end %>
|
3
52
|
</div>
|
@@ -0,0 +1,9 @@
|
|
1
|
+
<h3><%= t ".title", name: t("#{@feature.manifest.name}.name", scope: "decidim.features") %></h3>
|
2
|
+
|
3
|
+
<%= form_for([participatory_process, @form], url: participatory_process_feature_path(participatory_process, @feature), method: "put") do |form| %>
|
4
|
+
<%= render partial: 'form', object: form, locals: { feature: @feature } %>
|
5
|
+
|
6
|
+
<div class="actions">
|
7
|
+
<%= form.submit t(".update") %>
|
8
|
+
</div>
|
9
|
+
<% end %>
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<h3><%= t ".title", name: t("#{manifest.name}.name", scope: "decidim.features") %></h3>
|
2
2
|
|
3
3
|
<%= form_for([participatory_process, @form], url: participatory_process_features_path(type: params[:type]), method: "post") do |form| %>
|
4
|
-
<%= render partial: 'form', object: form %>
|
4
|
+
<%= render partial: 'form', object: form, locals: { feature: @feature } %>
|
5
5
|
|
6
6
|
<div class="actions">
|
7
7
|
<%= form.submit t(".add") %>
|
@@ -2,6 +2,10 @@
|
|
2
2
|
<%= form.text_field :name %>
|
3
3
|
</div>
|
4
4
|
|
5
|
+
<div class="field">
|
6
|
+
<%= form.text_field :twitter_handler %>
|
7
|
+
</div>
|
8
|
+
|
5
9
|
<div class="field">
|
6
10
|
<%= form.translated :editor, :description %>
|
7
11
|
</div>
|
@@ -21,3 +25,7 @@
|
|
21
25
|
<div class="field">
|
22
26
|
<%= form.file_field :logo %>
|
23
27
|
</div>
|
28
|
+
|
29
|
+
<div class="field">
|
30
|
+
<%= form.check_box :show_statistics %>
|
31
|
+
</div>
|
@@ -40,12 +40,8 @@
|
|
40
40
|
</td>
|
41
41
|
<td class="actions">
|
42
42
|
<%= link_to t("actions.edit", scope: "decidim.admin"), edit_participatory_process_step_path(participatory_process, step) if can? :update, step %>
|
43
|
-
<% if can?
|
44
|
-
|
45
|
-
<%= link_to t("actions.deactivate", scope: "decidim.admin"), participatory_process_step_activate_path(participatory_process, step), method: :delete, class: "small button secondary" %>
|
46
|
-
<% else %>
|
47
|
-
<%= link_to t("actions.activate", scope: "decidim.admin"), participatory_process_step_activate_path(participatory_process, step), method: :post, class: "small button secondary" %>
|
48
|
-
<% end %>
|
43
|
+
<% if can?(:activate, step) && !step.active? %>
|
44
|
+
<%= link_to t("actions.activate", scope: "decidim.admin"), participatory_process_step_activate_path(participatory_process, step), method: :post, class: "small button secondary" %>
|
49
45
|
<% end %>
|
50
46
|
<%= link_to t("actions.destroy", scope: "decidim.admin"), participatory_process_step_path(participatory_process, step), method: :delete, class: "small alert button", data: { confirm: t("actions.confirm_destroy", scope: "decidim.admin") } if can? :destroy, step %>
|
51
47
|
</td>
|
@@ -0,0 +1,32 @@
|
|
1
|
+
<% content_for :title do %>
|
2
|
+
<h2><%= t "decidim.admin.titles.user_groups" %></h2>
|
3
|
+
<% end %>
|
4
|
+
|
5
|
+
<table class="stack user-groups">
|
6
|
+
<thead>
|
7
|
+
<tr>
|
8
|
+
<th><%= t("models.user_group.fields.name", scope: "decidim.admin") %></th>
|
9
|
+
<th><%= t("models.user_group.fields.document_number", scope: "decidim.admin") %></th>
|
10
|
+
<th><%= t("models.user_group.fields.phone", scope: "decidim.admin") %></th>
|
11
|
+
<th><%= t("models.user_group.fields.users_count", scope: "decidim.admin") %></th>
|
12
|
+
<th><%= t("models.user_group.fields.created_at", scope: "decidim.admin") %></th>
|
13
|
+
<th class="actions"><%= t("actions.title", scope: "decidim.admin") %></th>
|
14
|
+
</tr>
|
15
|
+
</thead>
|
16
|
+
<tbody>
|
17
|
+
<% @user_groups.each do |user_group| %>
|
18
|
+
<tr data-user-group-id="<%= user_group.id %>">
|
19
|
+
<td><%= user_group.name %></td>
|
20
|
+
<td><%= user_group.document_number %></td>
|
21
|
+
<td><%= user_group.phone %></td>
|
22
|
+
<td><%= user_group.users.size %></td>
|
23
|
+
<td><%= l user_group.created_at, format: :short %></td>
|
24
|
+
<td class="actions">
|
25
|
+
<% if can?(:verify, user_group) && !user_group.verified? %>
|
26
|
+
<%= button_to t("actions.verify", scope: "decidim.admin"), decidim_admin.verify_user_group_path(user_group), method: :put %>
|
27
|
+
<% end %>
|
28
|
+
</td>
|
29
|
+
</tr>
|
30
|
+
<% end %>
|
31
|
+
</tbody>
|
32
|
+
</table>
|