decidim 0.3.2 → 0.4.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/.rubocop.yml +1 -1
- data/Gemfile.lock +49 -55
- data/README.md +2 -1
- data/Rakefile +4 -4
- data/decidim-admin/app/assets/stylesheets/decidim/admin/extra/_label-required.scss +3 -0
- data/decidim-admin/app/assets/stylesheets/decidim/admin/extra/_title_bar.scss +57 -1
- data/decidim-admin/app/commands/decidim/admin/create_participatory_process_admin.rb +28 -7
- data/decidim-admin/app/commands/decidim/admin/create_participatory_process_step.rb +2 -1
- data/decidim-admin/app/commands/decidim/admin/destroy_participatory_process_step.rb +5 -2
- data/decidim-admin/app/commands/decidim/admin/update_feature.rb +1 -0
- data/decidim-admin/app/commands/decidim/admin/update_organization.rb +10 -5
- data/decidim-admin/app/commands/decidim/admin/update_participatory_process.rb +4 -2
- data/decidim-admin/app/controllers/decidim/admin/application_controller.rb +2 -0
- data/decidim-admin/app/controllers/decidim/admin/concerns/has_attachments.rb +10 -1
- data/decidim-admin/app/controllers/decidim/admin/concerns/participatory_process_admin.rb +0 -5
- data/decidim-admin/app/controllers/decidim/admin/features/base_controller.rb +0 -1
- data/decidim-admin/app/controllers/decidim/admin/moderations_controller.rb +7 -4
- data/decidim-admin/app/controllers/decidim/admin/organization_controller.rb +9 -3
- data/decidim-admin/app/controllers/decidim/admin/participatory_process_user_roles_controller.rb +17 -0
- data/decidim-admin/app/controllers/decidim/admin/participatory_processes_controller.rb +11 -3
- data/decidim-admin/app/forms/decidim/admin/feature_form.rb +6 -0
- data/decidim-admin/app/forms/decidim/admin/organization_form.rb +5 -0
- data/decidim-admin/app/forms/decidim/admin/participatory_process_copy_form.rb +2 -3
- data/decidim-admin/app/forms/decidim/admin/participatory_process_form.rb +2 -0
- data/decidim-admin/app/forms/decidim/admin/static_page_form.rb +6 -0
- data/decidim-admin/app/helpers/decidim/admin/menu_helper.rb +1 -1
- data/decidim-admin/app/jobs/decidim/admin/newsletter_job.rb +9 -5
- data/decidim-admin/app/views/decidim/admin/attachments/_form.html.erb +1 -12
- data/decidim-admin/app/views/decidim/admin/features/_feature.html.erb +2 -2
- data/decidim-admin/app/views/decidim/admin/features/_form.html.erb +18 -0
- data/decidim-admin/app/views/decidim/admin/moderations/_report.html.erb +2 -2
- data/decidim-admin/app/views/decidim/admin/organization/_form.html.erb +5 -35
- data/decidim-admin/app/views/decidim/admin/participatory_process_groups/_form.html.erb +1 -1
- data/decidim-admin/app/views/decidim/admin/participatory_process_user_roles/index.html.erb +16 -0
- data/decidim-admin/app/views/decidim/admin/participatory_processes/_form.html.erb +2 -14
- data/decidim-admin/app/views/layouts/decidim/admin/_title_bar.html.erb +26 -19
- data/decidim-admin/app/views/layouts/decidim/admin/participatory_process.html.erb +2 -2
- data/decidim-admin/bin/rails +2 -2
- data/decidim-admin/config/i18n-tasks.yml +2 -0
- data/decidim-admin/config/locales/ca.yml +9 -5
- data/decidim-admin/config/locales/en.yml +9 -5
- data/decidim-admin/config/locales/es.yml +11 -5
- data/decidim-admin/config/locales/eu.yml +0 -5
- data/decidim-admin/config/locales/fr.yml +18 -23
- data/decidim-admin/config/locales/it.yml +0 -5
- data/decidim-admin/config/routes.rb +5 -3
- data/decidim-admin/decidim-admin.gemspec +2 -2
- data/decidim-admin/lib/decidim/admin/test/manage_attachments_examples.rb +1 -2
- data/decidim-admin/spec/commands/create_participatory_process_admin_spec.rb +42 -26
- data/decidim-admin/spec/commands/create_participatory_process_spec.rb +2 -1
- data/decidim-admin/spec/commands/create_participatory_process_step_spec.rb +56 -0
- data/decidim-admin/spec/commands/destroy_participatory_process_step_spec.rb +2 -2
- data/decidim-admin/spec/commands/update_feature_spec.rb +6 -0
- data/decidim-admin/spec/controllers/participatory_processes_controller_spec.rb +3 -6
- data/decidim-admin/spec/features/admin_copy_participatory_process_spec.rb +9 -9
- data/decidim-admin/spec/features/admin_manages_features_spec.rb +32 -0
- data/decidim-admin/spec/features/admin_manages_participatory_processes_spec.rb +3 -4
- data/decidim-admin/spec/forms/static_page_form_spec.rb +12 -0
- data/decidim-admin/spec/jobs/newsletter_job_spec.rb +3 -0
- data/decidim-admin/spec/shared/manage_process_admins_examples.rb +22 -0
- data/decidim-admin/spec/shared/manage_processes_examples.rb +6 -0
- data/decidim-admin/spec/spec_helper.rb +4 -0
- data/decidim-api/bin/rails +2 -2
- data/decidim-api/decidim-api.gemspec +3 -3
- data/decidim-api/spec/spec_helper.rb +4 -0
- data/decidim-api/spec/types/query_type_spec.rb +2 -2
- data/decidim-budgets/app/models/decidim/budgets/project.rb +5 -0
- data/decidim-budgets/bin/rails +2 -2
- data/decidim-budgets/config/locales/fr.yml +2 -2
- data/decidim-budgets/decidim-budgets.gemspec +2 -2
- data/decidim-budgets/lib/decidim/budgets/feature.rb +1 -1
- data/decidim-budgets/spec/spec_helper.rb +4 -0
- data/decidim-comments/app/assets/javascripts/decidim/comments/bundle.js +0 -0
- data/decidim-comments/app/commands/decidim/comments/create_comment.rb +10 -14
- data/decidim-comments/app/frontend/application/application.component.tsx +1 -1
- data/decidim-comments/app/frontend/comments/add_comment_form.component.test.tsx +33 -26
- data/decidim-comments/app/frontend/comments/add_comment_form.component.tsx +109 -83
- data/decidim-comments/app/frontend/comments/comment.component.test.tsx +29 -24
- data/decidim-comments/app/frontend/comments/comment.component.tsx +12 -5
- data/decidim-comments/app/frontend/comments/comment_thread.component.test.tsx +12 -7
- data/decidim-comments/app/frontend/comments/comment_thread.component.tsx +7 -2
- data/decidim-comments/app/frontend/comments/comments.component.tsx +26 -15
- data/decidim-comments/app/frontend/comments/down_vote_button.component.test.tsx +9 -4
- data/decidim-comments/app/frontend/comments/down_vote_button.component.tsx +56 -37
- data/decidim-comments/app/frontend/comments/up_vote_button.component.test.tsx +9 -4
- data/decidim-comments/app/frontend/comments/up_vote_button.component.tsx +31 -16
- data/decidim-comments/app/frontend/comments/vote_button.component.tsx +3 -0
- data/decidim-comments/app/mailers/decidim/comments/comment_notification_mailer.rb +8 -6
- data/decidim-comments/app/models/decidim/comments/comment.rb +13 -1
- 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 +2 -2
- data/decidim-comments/config/locales/ca.yml +2 -0
- data/decidim-comments/config/locales/en.yml +2 -0
- data/decidim-comments/config/locales/es.yml +2 -0
- data/decidim-comments/config/locales/fr.yml +2 -2
- data/decidim-comments/decidim-comments.gemspec +3 -3
- data/decidim-comments/lib/decidim/comments/commentable.rb +1 -0
- data/decidim-comments/spec/commands/create_comment_spec.rb +22 -54
- data/decidim-comments/spec/features/notifications_spec.rb +2 -6
- data/decidim-comments/spec/mailers/comment_notification_mailer_spec.rb +5 -4
- data/decidim-comments/spec/models/comment_spec.rb +32 -2
- data/decidim-comments/spec/shared/author_localised_email.rb +2 -3
- data/decidim-comments/spec/spec_helper.rb +4 -0
- data/decidim-dev/decidim-dev.gemspec +3 -4
- data/decidim-dev/lib/decidim/dev.rb +23 -1
- data/decidim-dev/lib/decidim/dev/common_rake.rb +3 -0
- data/decidim-dev/lib/decidim/dev/railtie.rb +3 -3
- data/decidim-dev/lib/decidim/dev/test/base_spec_helper.rb +4 -3
- data/decidim-dev/lib/decidim/dev/test/rspec_support/capybara.rb +3 -0
- data/decidim-dev/lib/decidim/dev/test/rspec_support/feature.rb +8 -0
- data/decidim-dev/lib/decidim/dev/test/rspec_support/feature_context.rb +4 -2
- data/decidim-dev/lib/decidim/dev/test/rspec_support/geocoder.rb +7 -2
- data/decidim-dev/lib/decidim/dev/test/rspec_support/phantomjs_polyfills/phantomjs-getOwnPropertyNames.js +16 -0
- data/decidim-dev/lib/decidim/dev/test/rspec_support/warden.rb +17 -1
- data/decidim-meetings/app/helpers/decidim/meetings/application_helper.rb +1 -0
- data/decidim-meetings/app/helpers/decidim/meetings/meetings_helper.rb +24 -0
- data/decidim-meetings/app/views/decidim/meetings/meetings/_meetings.html.erb +1 -1
- data/decidim-meetings/bin/rails +2 -2
- data/decidim-meetings/config/locales/ca.yml +1 -0
- data/decidim-meetings/config/locales/en.yml +2 -1
- data/decidim-meetings/config/locales/es.yml +1 -0
- data/decidim-meetings/config/locales/fr.yml +5 -5
- data/decidim-meetings/decidim-meetings.gemspec +2 -2
- data/decidim-meetings/lib/decidim/meetings/feature.rb +1 -1
- data/decidim-meetings/spec/features/admin_manages_meetings_attachments_spec.rb +1 -1
- data/decidim-meetings/spec/features/admin_manages_meetings_spec.rb +1 -1
- data/decidim-meetings/spec/features/explore_meetings_spec.rb +1 -1
- data/decidim-meetings/spec/features/process_admin_manages_meetings_attachments_spec.rb +1 -1
- data/decidim-meetings/spec/features/process_admin_manages_meetings_spec.rb +1 -1
- data/decidim-meetings/spec/helpers/meetings_helper_spec.rb +16 -0
- data/decidim-meetings/spec/spec_helper.rb +4 -0
- data/decidim-pages/app/models/decidim/pages/page.rb +5 -0
- data/decidim-pages/bin/rails +2 -2
- data/decidim-pages/decidim-pages.gemspec +2 -2
- data/decidim-pages/lib/decidim/pages/feature.rb +1 -1
- data/decidim-pages/spec/commands/destroy_page_spec.rb +1 -1
- data/decidim-pages/spec/spec_helper.rb +4 -0
- data/decidim-proposals/app/assets/config/decidim_proposals_manifest.js +1 -0
- data/decidim-proposals/app/assets/javascripts/decidim/proposals/add_proposal.js.es6 +23 -0
- data/decidim-proposals/app/forms/decidim/proposals/proposal_form.rb +7 -1
- data/decidim-proposals/app/models/decidim/proposals/proposal.rb +14 -2
- data/decidim-proposals/app/views/decidim/proposals/proposals/_proposal.html.erb +1 -0
- data/decidim-proposals/app/views/decidim/proposals/proposals/new.html.erb +5 -0
- data/decidim-proposals/bin/rails +2 -2
- data/decidim-proposals/config/locales/fr.yml +11 -11
- data/decidim-proposals/db/migrate/20170307085300_migrate_proposal_reports_data_to_reports.rb +1 -1
- data/decidim-proposals/decidim-proposals.gemspec +2 -2
- data/decidim-proposals/lib/decidim/proposals/feature.rb +1 -1
- data/decidim-proposals/spec/features/proposals_spec.rb +8 -2
- data/decidim-proposals/spec/models/decidim/proposals/proposal_spec.rb +35 -0
- data/decidim-proposals/spec/shared/create_proposal_examples.rb +20 -14
- data/decidim-proposals/spec/shared/manage_proposals_examples.rb +13 -16
- data/decidim-proposals/spec/shared/proposal_form_examples.rb +22 -16
- data/decidim-proposals/spec/spec_helper.rb +4 -0
- data/decidim-results/app/models/decidim/results/result.rb +10 -0
- data/decidim-results/bin/rails +2 -2
- data/decidim-results/config/locales/fr.yml +2 -2
- data/decidim-results/decidim-results.gemspec +2 -2
- data/decidim-results/lib/decidim/results/feature.rb +1 -1
- data/decidim-results/spec/features/comments_spec.rb +10 -0
- data/decidim-results/spec/spec_helper.rb +4 -0
- data/decidim-surveys/app/models/decidim/surveys/survey_question.rb +2 -0
- data/decidim-surveys/bin/rails +2 -2
- data/decidim-surveys/decidim-surveys.gemspec +2 -2
- data/decidim-surveys/lib/decidim/surveys/feature.rb +3 -2
- data/decidim-surveys/spec/forms/decidim/surveys/admin/survey_question_form_spec.rb +1 -1
- data/decidim-surveys/spec/models/decidim/surveys/survey_question_spec.rb +7 -1
- data/decidim-surveys/spec/spec_helper.rb +5 -0
- data/decidim-system/app/controllers/decidim/system/application_controller.rb +1 -1
- data/decidim-system/app/controllers/decidim/system/devise/sessions_controller.rb +1 -0
- data/decidim-system/app/helpers/decidim/system/menu_helper.rb +1 -1
- data/decidim-system/app/views/decidim/system/shared/_notices.html.erb +11 -0
- data/decidim-system/app/views/layouts/decidim/system/application.html.erb +1 -1
- data/decidim-system/app/views/layouts/decidim/system/login.html.erb +1 -1
- data/decidim-system/bin/rails +2 -2
- data/decidim-system/config/locales/ca.yml +4 -0
- data/decidim-system/config/locales/en.yml +4 -0
- data/decidim-system/config/locales/es.yml +4 -0
- data/decidim-system/db/migrate/20160919105637_devise_create_decidim_admins.rb +5 -5
- data/decidim-system/db/seeds.rb +1 -1
- data/decidim-system/decidim-system.gemspec +2 -2
- data/decidim-system/spec/factories.rb +2 -2
- data/decidim-system/spec/features/manage_admins_spec.rb +3 -3
- data/decidim-system/spec/spec_helper.rb +4 -0
- data/decidim.gemspec +6 -6
- data/docs/how_to_create_a_plugin.md +2 -2
- data/lib/generators/decidim/app_generator.rb +1 -1
- data/lib/generators/decidim/install_generator.rb +35 -27
- data/lib/generators/decidim/templates/Gemfile.erb +1 -0
- data/lib/generators/decidim/templates/initializer.rb +7 -1
- data/logo.svg +62 -0
- data/package.json +37 -35
- data/tsconfig.json +3 -0
- data/yarn.lock +1017 -486
- metadata +32 -25
- data/decidim-admin/app/assets/stylesheets/decidim/admin/extra/_language-chooser.scss +0 -4
@@ -10,7 +10,7 @@ fr:
|
|
10
10
|
meeting:
|
11
11
|
address: Adresse
|
12
12
|
decidim_category_id: Catégorie
|
13
|
-
decidim_scope_id:
|
13
|
+
decidim_scope_id: Zone d'application
|
14
14
|
description: Description
|
15
15
|
end_time: Heure de fin
|
16
16
|
location: Lieu
|
@@ -24,7 +24,7 @@ fr:
|
|
24
24
|
meetings:
|
25
25
|
actions:
|
26
26
|
attachments: Documents liés
|
27
|
-
close:
|
27
|
+
close: Clore
|
28
28
|
confirm_destroy: Êtes-vous sûr de vouloir supprimer cette rencontre?
|
29
29
|
destroy: Supprimer
|
30
30
|
edit: Modifier
|
@@ -34,7 +34,7 @@ fr:
|
|
34
34
|
admin:
|
35
35
|
meeting_closes:
|
36
36
|
edit:
|
37
|
-
close:
|
37
|
+
close: Clore
|
38
38
|
title: Clore la rencontre
|
39
39
|
meetings:
|
40
40
|
close:
|
@@ -64,7 +64,7 @@ fr:
|
|
64
64
|
category_prompt: Sélectionner une catégorie
|
65
65
|
date: Date
|
66
66
|
past: Passées
|
67
|
-
scopes:
|
67
|
+
scopes: Zone d'application
|
68
68
|
search: Rechercher
|
69
69
|
upcoming: À venir
|
70
70
|
filters_small_view:
|
@@ -95,5 +95,5 @@ fr:
|
|
95
95
|
meeting_results: 'Résultats associés :'
|
96
96
|
result_meetings: 'Rencontres connexes :'
|
97
97
|
proposals_from_meeting:
|
98
|
-
meeting_proposals: 'Propositions
|
98
|
+
meeting_proposals: 'Propositions créées à cette rencontre :'
|
99
99
|
proposal_meetings: 'Rencontre connexes :'
|
@@ -9,8 +9,8 @@ require_relative "../decidim-core/lib/decidim/core/version"
|
|
9
9
|
Gem::Specification.new do |s|
|
10
10
|
Decidim.add_default_gemspec_properties(s)
|
11
11
|
|
12
|
-
s.name
|
13
|
-
s.summary
|
12
|
+
s.name = "decidim-meetings"
|
13
|
+
s.summary = "A meetings component for decidim's participatory processes."
|
14
14
|
s.description = s.summary
|
15
15
|
|
16
16
|
s.files = Dir["{app,config,db,lib}/**/*", "Rakefile", "README.md"]
|
@@ -24,7 +24,7 @@ Decidim.register_feature(:meetings) do |feature|
|
|
24
24
|
end
|
25
25
|
|
26
26
|
feature.seeds do
|
27
|
-
Decidim::ParticipatoryProcess.
|
27
|
+
Decidim::ParticipatoryProcess.find_each do |process|
|
28
28
|
next unless process.steps.any?
|
29
29
|
|
30
30
|
feature = Decidim::Feature.create!(
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
require "spec_helper"
|
4
4
|
|
5
|
-
describe "Admin manages meetings attachments", type: :feature do
|
5
|
+
describe "Admin manages meetings attachments", type: :feature, serves_map: true do
|
6
6
|
let(:manifest_name) { "meetings" }
|
7
7
|
let!(:meeting) { create :meeting, scope: scope, feature: current_feature }
|
8
8
|
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
require "spec_helper"
|
4
4
|
|
5
|
-
describe "Admin manages meetings", type: :feature do
|
5
|
+
describe "Admin manages meetings", type: :feature, serves_map: true do
|
6
6
|
let(:manifest_name) { "meetings" }
|
7
7
|
let!(:meeting) { create :meeting, scope: scope, feature: current_feature }
|
8
8
|
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
require "spec_helper"
|
4
4
|
|
5
|
-
describe "Process admin manages meetings attachments", type: :feature do
|
5
|
+
describe "Process admin manages meetings attachments", type: :feature, serves_map: true do
|
6
6
|
let(:manifest_name) { "meetings" }
|
7
7
|
let!(:meeting) { create :meeting, scope: scope, feature: current_feature }
|
8
8
|
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
require "spec_helper"
|
4
4
|
|
5
|
-
describe "Process admin manages meetings", type: :feature do
|
5
|
+
describe "Process admin manages meetings", type: :feature, serves_map: true do
|
6
6
|
let(:manifest_name) { "meetings" }
|
7
7
|
let!(:meeting) { create :meeting, scope: scope, feature: current_feature }
|
8
8
|
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "spec_helper"
|
4
|
+
|
5
|
+
module Decidim
|
6
|
+
module Meetings
|
7
|
+
describe MeetingsHelper do
|
8
|
+
describe "meeting_description" do
|
9
|
+
it "truncates meeting description respecting the html tags" do
|
10
|
+
meeting = create(:meeting, description: { "en" => "<p>This is a long description with some <b>bold text</b></p>" })
|
11
|
+
expect(helper.meeting_description(meeting, 40)).to match("<p>This is a long description with some <b>bol</b>...")
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
data/decidim-pages/bin/rails
CHANGED
@@ -8,8 +8,8 @@ ENGINE_ROOT = File.expand_path("..", __dir__)
|
|
8
8
|
ENGINE_PATH = File.expand_path("../lib/decidim/pages/engine", __dir__)
|
9
9
|
|
10
10
|
# Set up gems listed in the Gemfile.
|
11
|
-
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("
|
12
|
-
require "bundler/setup"
|
11
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", __dir__)
|
12
|
+
require "bundler/setup"
|
13
13
|
|
14
14
|
require "rails/all"
|
15
15
|
require "rails/engine/commands"
|
@@ -9,8 +9,8 @@ require_relative "../decidim-core/lib/decidim/core/version"
|
|
9
9
|
Gem::Specification.new do |s|
|
10
10
|
Decidim.add_default_gemspec_properties(s)
|
11
11
|
|
12
|
-
s.name
|
13
|
-
s.summary
|
12
|
+
s.name = "decidim-pages"
|
13
|
+
s.summary = "A pages component for decidim's participatory processes."
|
14
14
|
s.description = s.summary
|
15
15
|
|
16
16
|
s.files = Dir["{app,config,db,lib}/**/*", "Rakefile", "README.md"]
|
@@ -45,7 +45,7 @@ Decidim.register_feature(:pages) do |feature|
|
|
45
45
|
end
|
46
46
|
|
47
47
|
feature.seeds do
|
48
|
-
Decidim::ParticipatoryProcess.
|
48
|
+
Decidim::ParticipatoryProcess.find_each do |process|
|
49
49
|
next unless process.steps.any?
|
50
50
|
|
51
51
|
feature = Decidim::Feature.create!(
|
@@ -7,7 +7,7 @@ module Decidim
|
|
7
7
|
describe DestroyPage, :db do
|
8
8
|
describe "call" do
|
9
9
|
let(:feature) { create(:feature, manifest_name: "pages") }
|
10
|
-
let!(:page)
|
10
|
+
let!(:page) { create(:page, feature: feature) }
|
11
11
|
let(:command) { described_class.new(feature) }
|
12
12
|
|
13
13
|
it "broadcasts ok" do
|
@@ -0,0 +1,23 @@
|
|
1
|
+
$(() => {
|
2
|
+
window.DecidimProposals = window.DecidimProposals || {};
|
3
|
+
|
4
|
+
window.DecidimProposals.bindProposalAddress = () => {
|
5
|
+
const $checkbox = $('#proposal_has_address');
|
6
|
+
const $addressInput = $('#address_input');
|
7
|
+
|
8
|
+
if ($checkbox.length > 0) {
|
9
|
+
const toggleInput = () => {
|
10
|
+
if ($checkbox[0].checked) {
|
11
|
+
$addressInput.show();
|
12
|
+
} else {
|
13
|
+
$addressInput.hide();
|
14
|
+
}
|
15
|
+
}
|
16
|
+
toggleInput();
|
17
|
+
$checkbox.on('change', toggleInput);
|
18
|
+
}
|
19
|
+
};
|
20
|
+
|
21
|
+
window.DecidimProposals.bindProposalAddress();
|
22
|
+
});
|
23
|
+
|
@@ -14,11 +14,13 @@ module Decidim
|
|
14
14
|
attribute :category_id, Integer
|
15
15
|
attribute :scope_id, Integer
|
16
16
|
attribute :user_group_id, Integer
|
17
|
+
attribute :has_address, Boolean
|
17
18
|
|
18
19
|
validates :title, :body, presence: true, etiquette: true
|
19
20
|
validates :title, length: { maximum: 150 }
|
20
21
|
validates :body, length: { maximum: 500 }, etiquette: true
|
21
|
-
validates :address, geocoding: true, if: -> {
|
22
|
+
validates :address, geocoding: true, if: ->(form) { Decidim.geocoder.present? && form.has_address? }
|
23
|
+
validates :address, presence: true, if: ->(form) { form.has_address? }
|
22
24
|
validates :category, presence: true, if: ->(form) { form.category_id.present? }
|
23
25
|
validates :scope, presence: true, if: ->(form) { form.scope_id.present? }
|
24
26
|
|
@@ -47,6 +49,10 @@ module Decidim
|
|
47
49
|
def scope
|
48
50
|
@scope ||= process_scope || organization_scopes.where(id: scope_id).first
|
49
51
|
end
|
52
|
+
|
53
|
+
def has_address?
|
54
|
+
current_feature.settings.geocoding_enabled? && has_address
|
55
|
+
end
|
50
56
|
end
|
51
57
|
end
|
52
58
|
end
|
@@ -21,8 +21,8 @@ module Decidim
|
|
21
21
|
|
22
22
|
geocoded_by :address, http_headers: ->(proposal) { { "Referer" => proposal.feature.organization.host } }
|
23
23
|
|
24
|
-
scope :accepted,
|
25
|
-
scope :rejected,
|
24
|
+
scope :accepted, -> { where(state: "accepted") }
|
25
|
+
scope :rejected, -> { where(state: "rejected") }
|
26
26
|
|
27
27
|
def self.order_randomly(seed)
|
28
28
|
transaction do
|
@@ -91,6 +91,18 @@ module Decidim
|
|
91
91
|
def reported_content_url
|
92
92
|
ResourceLocatorPresenter.new(self).url
|
93
93
|
end
|
94
|
+
|
95
|
+
# Public: Overrides the `notifiable?` Notifiable concern method.
|
96
|
+
# When a proposal is commented the proposal's author is notified if it is not the same
|
97
|
+
# who has commented the proposal and if the proposal's author has comment notifications enabled.
|
98
|
+
def notifiable?(context)
|
99
|
+
context[:author] != author && author.comments_notifications?
|
100
|
+
end
|
101
|
+
|
102
|
+
# Public: Overrides the `users_to_notify` Notifiable concern method.
|
103
|
+
def users_to_notify
|
104
|
+
[author]
|
105
|
+
end
|
94
106
|
end
|
95
107
|
end
|
96
108
|
end
|
@@ -8,6 +8,7 @@
|
|
8
8
|
<div class="card__author author-data author-data--small">
|
9
9
|
<%= render partial: "author", locals: { proposal: proposal } %>
|
10
10
|
</div>
|
11
|
+
<%= feature_reference(proposal, class: "reference--text-left") %>
|
11
12
|
</div>
|
12
13
|
<%= render partial: "proposal_badge", locals: { proposal: proposal } %>
|
13
14
|
<p><%= truncate(proposal.body, length: 100) %></p>
|
@@ -20,6 +20,9 @@
|
|
20
20
|
|
21
21
|
<% if feature_settings.geocoding_enabled? %>
|
22
22
|
<div class="field">
|
23
|
+
<%= form.check_box :has_address %>
|
24
|
+
</div>
|
25
|
+
<div class="field" id="address_input">
|
23
26
|
<%= form.text_field :address %>
|
24
27
|
</div>
|
25
28
|
<% end %>
|
@@ -50,3 +53,5 @@
|
|
50
53
|
</div>
|
51
54
|
</div>
|
52
55
|
</div>
|
56
|
+
|
57
|
+
<%= javascript_include_tag "decidim/proposals/add_proposal" %>
|
data/decidim-proposals/bin/rails
CHANGED
@@ -8,8 +8,8 @@ ENGINE_ROOT = File.expand_path("..", __dir__)
|
|
8
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("
|
12
|
-
require "bundler/setup"
|
11
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", __dir__)
|
12
|
+
require "bundler/setup"
|
13
13
|
|
14
14
|
require "rails/all"
|
15
15
|
require "rails/engine/commands"
|
@@ -4,7 +4,7 @@ fr:
|
|
4
4
|
proposal:
|
5
5
|
body: Corps de texte
|
6
6
|
category_id: Catégorie
|
7
|
-
scope_id:
|
7
|
+
scope_id: Zone d'application
|
8
8
|
title: Titre
|
9
9
|
user_group_id: Créer une proposition en tant que
|
10
10
|
proposal_answer:
|
@@ -21,12 +21,12 @@ fr:
|
|
21
21
|
comments_enabled: Commentaires activés
|
22
22
|
geocoding_enabled: Géocodage activé
|
23
23
|
official_proposals_enabled: Propositions officielles activées
|
24
|
-
proposal_answering_enabled:
|
24
|
+
proposal_answering_enabled: '"Réponses aux propositions" activé'
|
25
25
|
vote_limit: Limite de vote
|
26
26
|
step:
|
27
27
|
comments_blocked: Commentaires bloqués
|
28
28
|
creation_enabled: Module propositions activé
|
29
|
-
proposal_answering_enabled:
|
29
|
+
proposal_answering_enabled: '"Réponses aux propositions" activé'
|
30
30
|
votes_blocked: Votes bloqués
|
31
31
|
votes_enabled: Votes activés
|
32
32
|
votes_hidden: Cacher les votes (si les votes sont activés, le compte des votes sera caché)
|
@@ -43,7 +43,7 @@ fr:
|
|
43
43
|
name: Proposition
|
44
44
|
proposal_answers:
|
45
45
|
edit:
|
46
|
-
accepted:
|
46
|
+
accepted: Retenue
|
47
47
|
answer_proposal: Répondre
|
48
48
|
rejected: Refusée
|
49
49
|
title: Réponse à la proposition %{title}
|
@@ -62,7 +62,7 @@ fr:
|
|
62
62
|
create: Créer
|
63
63
|
title: Créer une proposition
|
64
64
|
answers:
|
65
|
-
accepted:
|
65
|
+
accepted: Retenues
|
66
66
|
not_answered: Resté sans réponse
|
67
67
|
rejected: Refusée
|
68
68
|
create:
|
@@ -73,7 +73,7 @@ fr:
|
|
73
73
|
fields:
|
74
74
|
category: Catégorie
|
75
75
|
official_proposal: Proposition officielle
|
76
|
-
scope:
|
76
|
+
scope: Zone d'application
|
77
77
|
state: Etat
|
78
78
|
title: Titre
|
79
79
|
proposals:
|
@@ -82,7 +82,7 @@ fr:
|
|
82
82
|
one: 1 proposition
|
83
83
|
other: "%{count} propositions"
|
84
84
|
filters:
|
85
|
-
accepted:
|
85
|
+
accepted: Retenues
|
86
86
|
activity: Activité
|
87
87
|
all: Toutes
|
88
88
|
category: Catégorie
|
@@ -92,10 +92,10 @@ fr:
|
|
92
92
|
origin: Retour à l'original
|
93
93
|
rejected: Refusée
|
94
94
|
related_to: Liée à
|
95
|
-
scopes:
|
95
|
+
scopes: Zones d'application
|
96
96
|
search: Rechercher
|
97
97
|
state: État
|
98
|
-
voted:
|
98
|
+
voted: Votées
|
99
99
|
filters_small_view:
|
100
100
|
close_modal: Fermer la fenêtre de dialogue
|
101
101
|
filter: Filtrer
|
@@ -111,7 +111,7 @@ fr:
|
|
111
111
|
new:
|
112
112
|
back: Retour
|
113
113
|
select_a_category: Veuillez sélectionner une catégorie
|
114
|
-
send:
|
114
|
+
send: Publier
|
115
115
|
title: Nouvelle proposition
|
116
116
|
orders:
|
117
117
|
label: 'Classement des propositions par:'
|
@@ -119,7 +119,7 @@ fr:
|
|
119
119
|
random: Aléatoire
|
120
120
|
recent: Les plus récents
|
121
121
|
show:
|
122
|
-
proposal_accepted_reason: 'Cette proposition a été
|
122
|
+
proposal_accepted_reason: 'Cette proposition a été retenue parce que :'
|
123
123
|
proposal_rejected_reason: 'Cette proposition a été refusée parce que:'
|
124
124
|
report: Signaler
|
125
125
|
vote_button:
|
data/decidim-proposals/db/migrate/20170307085300_migrate_proposal_reports_data_to_reports.rb
CHANGED
@@ -7,7 +7,7 @@ class MigrateProposalReportsDataToReports < ActiveRecord::Migration[5.0]
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def change
|
10
|
-
Decidim::Proposals::ProposalReport.
|
10
|
+
Decidim::Proposals::ProposalReport.find_each do |proposal_report|
|
11
11
|
moderation = Decidim::Moderation.find_or_create_by!(reportable: proposal_report.proposal,
|
12
12
|
participatory_process: proposal_report.proposal.feature.participatory_process)
|
13
13
|
Decidim::Report.create!(moderation: moderation,
|
@@ -9,8 +9,8 @@ require_relative "../decidim-core/lib/decidim/core/version"
|
|
9
9
|
Gem::Specification.new do |s|
|
10
10
|
Decidim.add_default_gemspec_properties(s)
|
11
11
|
|
12
|
-
s.name
|
13
|
-
s.summary
|
12
|
+
s.name = "decidim-proposals"
|
13
|
+
s.summary = "A proposals component for decidim's participatory processes."
|
14
14
|
s.description = s.summary
|
15
15
|
|
16
16
|
s.files = Dir["{app,config,db,lib}/**/*", "Rakefile", "README.md"]
|