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
@@ -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-surveys"
|
13
|
+
s.summary = "A 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"]
|
@@ -53,7 +53,7 @@ Decidim.register_feature(:surveys) do |feature|
|
|
53
53
|
end
|
54
54
|
|
55
55
|
feature.seeds do
|
56
|
-
Decidim::ParticipatoryProcess.
|
56
|
+
Decidim::ParticipatoryProcess.find_each do |process|
|
57
57
|
next unless process.steps.any?
|
58
58
|
|
59
59
|
feature = Decidim::Feature.create!(
|
@@ -77,7 +77,8 @@ Decidim.register_feature(:surveys) do |feature|
|
|
77
77
|
3.times do
|
78
78
|
Decidim::Surveys::SurveyQuestion.create!(
|
79
79
|
survey: survey,
|
80
|
-
body: Decidim::Faker::Localized.paragraph
|
80
|
+
body: Decidim::Faker::Localized.paragraph,
|
81
|
+
question_type: "short_answer"
|
81
82
|
)
|
82
83
|
end
|
83
84
|
end
|
@@ -9,7 +9,7 @@ module Decidim
|
|
9
9
|
let!(:survey) { create(:survey) }
|
10
10
|
let!(:position) { 0 }
|
11
11
|
let!(:question_type) { SurveyQuestion::TYPES.first }
|
12
|
-
let!(:survey_question) {
|
12
|
+
let!(:survey_question) { build(:survey_question, survey: survey, position: position, question_type: question_type) }
|
13
13
|
|
14
14
|
subject do
|
15
15
|
described_class.from_model(survey_question).with_context(current_feature: survey.feature)
|
@@ -6,7 +6,8 @@ module Decidim
|
|
6
6
|
module Surveys
|
7
7
|
describe SurveyQuestion do
|
8
8
|
let(:survey) { create(:survey) }
|
9
|
-
let(:
|
9
|
+
let(:question_type) { "short_answer" }
|
10
|
+
let(:survey_question) { build(:survey_question, survey: survey, question_type: question_type) }
|
10
11
|
subject { survey_question }
|
11
12
|
|
12
13
|
it { is_expected.to be_valid }
|
@@ -14,6 +15,11 @@ module Decidim
|
|
14
15
|
it "has an association of survey" do
|
15
16
|
expect(subject.survey).to eq(survey)
|
16
17
|
end
|
18
|
+
|
19
|
+
context "when question type doesn't exists in allowed types" do
|
20
|
+
let(:question_type) { "foo" }
|
21
|
+
it { is_expected.not_to be_valid }
|
22
|
+
end
|
17
23
|
end
|
18
24
|
end
|
19
25
|
end
|
@@ -6,12 +6,12 @@ module Decidim
|
|
6
6
|
class ApplicationController < ActionController::Base
|
7
7
|
include FormFactory
|
8
8
|
include PayloadInfo
|
9
|
+
|
9
10
|
protect_from_forgery with: :exception, prepend: true
|
10
11
|
|
11
12
|
helper Decidim::TranslationsHelper
|
12
13
|
helper Decidim::DecidimFormHelper
|
13
14
|
helper Decidim::ReplaceButtonsHelper
|
14
|
-
|
15
15
|
helper Decidim::System::MenuHelper
|
16
16
|
end
|
17
17
|
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<%= display_flash_messages %>
|
2
|
+
|
3
|
+
<% if Decidim::Organization.none? %>
|
4
|
+
<div class="flash callout warning">
|
5
|
+
<% guide = link_to t(".our_getting_started_guide"),
|
6
|
+
"https://github.com/decidim/decidim/blob/master/docs/getting_started.md",
|
7
|
+
target: :blank %>
|
8
|
+
|
9
|
+
<%= t(".no_organization_warning_html", guide: guide) %>
|
10
|
+
</div>
|
11
|
+
<% end %>
|
data/decidim-system/bin/rails
CHANGED
@@ -8,8 +8,8 @@ ENGINE_ROOT = File.expand_path("..", __dir__)
|
|
8
8
|
ENGINE_PATH = File.expand_path("../lib/decidim/system/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"
|
@@ -64,5 +64,9 @@ ca:
|
|
64
64
|
update:
|
65
65
|
error: S'ha produït un error en actualitzar aquesta organització.
|
66
66
|
success: L'organització s'ha actualitzat correctament.
|
67
|
+
shared:
|
68
|
+
notices:
|
69
|
+
no_organization_warning_html: Has de crear una organització per començar. Assegura't de llegir %{guide} abans.
|
70
|
+
our_getting_started_guide: la guia d'introducció
|
67
71
|
titles:
|
68
72
|
dashboard: Tauler de control
|
@@ -65,5 +65,9 @@ en:
|
|
65
65
|
update:
|
66
66
|
error: There was an error when updating this organization.
|
67
67
|
success: Organization updated successfully.
|
68
|
+
shared:
|
69
|
+
notices:
|
70
|
+
no_organization_warning_html: You must create an organization to get started. Make sure you read %{guide} before proceeding.
|
71
|
+
our_getting_started_guide: our getting started guide
|
68
72
|
titles:
|
69
73
|
dashboard: Dashboard
|
@@ -64,5 +64,9 @@ es:
|
|
64
64
|
update:
|
65
65
|
error: Se ha producido un error al actualizar esta organización.
|
66
66
|
success: Organización actualizada correctamente.
|
67
|
+
shared:
|
68
|
+
notices:
|
69
|
+
no_organization_warning_html: Debes crear una organización para comenzar. Asegúrate de leer %{guide} antes de continuar.
|
70
|
+
our_getting_started_guide: nuestra guía de inicio
|
67
71
|
titles:
|
68
72
|
dashboard: Panel de control
|
@@ -4,25 +4,25 @@ class DeviseCreateDecidimAdmins < ActiveRecord::Migration[5.0]
|
|
4
4
|
def change
|
5
5
|
create_table :decidim_system_admins do |t|
|
6
6
|
## Database authenticatable
|
7
|
-
t.string :email,
|
7
|
+
t.string :email, null: false, default: ""
|
8
8
|
t.string :encrypted_password, null: false, default: ""
|
9
9
|
|
10
10
|
## Recoverable
|
11
|
-
t.string
|
11
|
+
t.string :reset_password_token
|
12
12
|
t.datetime :reset_password_sent_at
|
13
13
|
|
14
14
|
## Rememberable
|
15
15
|
t.datetime :remember_created_at
|
16
16
|
|
17
17
|
## Lockable
|
18
|
-
t.integer
|
19
|
-
t.string
|
18
|
+
t.integer :failed_attempts, default: 0, null: false # Only if lock strategy is :failed_attempts
|
19
|
+
t.string :unlock_token # Only if unlock strategy is :email or :both
|
20
20
|
t.datetime :locked_at
|
21
21
|
|
22
22
|
t.timestamps null: false
|
23
23
|
end
|
24
24
|
|
25
|
-
add_index :decidim_system_admins, :email,
|
25
|
+
add_index :decidim_system_admins, :email, unique: true
|
26
26
|
add_index :decidim_system_admins, :reset_password_token, unique: true
|
27
27
|
end
|
28
28
|
end
|
data/decidim-system/db/seeds.rb
CHANGED
@@ -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-system"
|
13
|
+
s.summary = "System administration"
|
14
14
|
s.description = "System administration to create new organization in an installation."
|
15
15
|
|
16
16
|
s.files = Dir["{app,config,db,lib,vendor}/**/*", "Rakefile", "README.md"]
|
@@ -4,8 +4,8 @@ require "decidim/core/test/factories"
|
|
4
4
|
|
5
5
|
FactoryGirl.define do
|
6
6
|
factory :admin, class: Decidim::System::Admin do
|
7
|
-
sequence(:email)
|
8
|
-
password
|
7
|
+
sequence(:email) { |n| "admin#{n}@citizen.corp" }
|
8
|
+
password "password1234"
|
9
9
|
password_confirmation "password1234"
|
10
10
|
end
|
11
11
|
end
|
@@ -22,7 +22,7 @@ describe "Manage admins", type: :feature do
|
|
22
22
|
find("*[type=submit]").click
|
23
23
|
end
|
24
24
|
|
25
|
-
within ".flash" do
|
25
|
+
within ".success.flash" do
|
26
26
|
expect(page).to have_content("successfully")
|
27
27
|
end
|
28
28
|
|
@@ -42,7 +42,7 @@ describe "Manage admins", type: :feature do
|
|
42
42
|
find("*[type=submit]").click
|
43
43
|
end
|
44
44
|
|
45
|
-
within ".flash" do
|
45
|
+
within ".success.flash" do
|
46
46
|
expect(page).to have_content("successfully")
|
47
47
|
end
|
48
48
|
|
@@ -56,7 +56,7 @@ describe "Manage admins", type: :feature do
|
|
56
56
|
click_link "Destroy"
|
57
57
|
end
|
58
58
|
|
59
|
-
within ".flash" do
|
59
|
+
within ".success.flash" do
|
60
60
|
expect(page).to have_content("successfully")
|
61
61
|
end
|
62
62
|
|
@@ -1,7 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require "decidim/dev"
|
4
|
+
|
3
5
|
ENV["ENGINE_NAME"] = File.dirname(__dir__).split("/").last
|
4
6
|
|
7
|
+
Decidim::Dev.dummy_app_path = File.expand_path(File.join("..", "spec", "decidim_dummy_app"))
|
8
|
+
|
5
9
|
require "decidim/dev/test/base_spec_helper"
|
6
10
|
|
7
11
|
Dir["#{__dir__}/support/**/*.rb"].each { |f| require f }
|
data/decidim.gemspec
CHANGED
@@ -9,14 +9,14 @@ require_relative "decidim-core/lib/decidim/core/version"
|
|
9
9
|
Gem::Specification.new do |spec|
|
10
10
|
Decidim.add_default_gemspec_properties(spec)
|
11
11
|
|
12
|
-
spec.name
|
12
|
+
spec.name = "decidim"
|
13
13
|
|
14
|
-
spec.summary
|
15
|
-
spec.description
|
14
|
+
spec.summary = "Citizen participation framework for Ruby on Rails."
|
15
|
+
spec.description = "Citizen participation framework for Ruby on Rails."
|
16
16
|
|
17
|
-
spec.files
|
18
|
-
spec.bindir
|
19
|
-
spec.executables
|
17
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features|decidim-core)/}) }
|
18
|
+
spec.bindir = "bin"
|
19
|
+
spec.executables = ["decidim"]
|
20
20
|
spec.require_paths = ["lib"]
|
21
21
|
|
22
22
|
spec.add_dependency "decidim-core", Decidim.version
|
@@ -44,8 +44,8 @@
|
|
44
44
|
ENGINE_PATH = File.expand_path("..lib/decidim/<engine_name>/engine", __dir__)
|
45
45
|
|
46
46
|
# Set up gems listed in the Gemfile.
|
47
|
-
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("
|
48
|
-
require "bundler/setup"
|
47
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", __dir__)
|
48
|
+
require "bundler/setup"
|
49
49
|
|
50
50
|
require "rails/all"
|
51
51
|
require "rails/engine/commands"
|
@@ -96,7 +96,7 @@ module Decidim
|
|
96
96
|
|
97
97
|
def set_locales
|
98
98
|
inject_into_file "config/application.rb", after: "class Application < Rails::Application" do
|
99
|
-
"\n config.i18n.available_locales =
|
99
|
+
"\n config.i18n.available_locales = Decidim.available_locales\n config.i18n.default_locale = Decidim.default_locale"
|
100
100
|
end
|
101
101
|
end
|
102
102
|
|
@@ -67,39 +67,47 @@ module Decidim
|
|
67
67
|
def smtp_environment
|
68
68
|
inject_into_file "config/environments/production.rb",
|
69
69
|
after: "config.log_formatter = ::Logger::Formatter.new" do
|
70
|
-
|
71
|
-
|
72
|
-
config.action_mailer.smtp_settings = {
|
73
|
-
:address => Rails.application.secrets.smtp_address,
|
74
|
-
:port => Rails.application.secrets.smtp_port,
|
75
|
-
:authentication => Rails.application.secrets.smtp_authentication,
|
76
|
-
:user_name => Rails.application.secrets.smtp_username,
|
77
|
-
:password => Rails.application.secrets.smtp_password,
|
78
|
-
:domain => Rails.application.secrets.smtp_domain,
|
79
|
-
:enable_starttls_auto => Rails.application.secrets.smtp_starttls_auto,
|
80
|
-
:openssl_verify_mode => 'none'
|
81
|
-
}
|
82
|
-
|
83
|
-
if Rails.application.secrets.sendgrid
|
84
|
-
config.action_mailer.default_options = {
|
85
|
-
"X-SMTPAPI" => {
|
86
|
-
filters: {
|
87
|
-
clicktrack: { settings: { enable: 0 } },
|
88
|
-
opentrack: { settings: { enable: 0 } }
|
89
|
-
}
|
90
|
-
}.to_json
|
91
|
-
}
|
92
|
-
end
|
93
|
-
|
70
|
+
<<~RUBY.gsub(/^ *\|/, "")
|
71
|
+
|
|
72
|
+
| config.action_mailer.smtp_settings = {
|
73
|
+
| :address => Rails.application.secrets.smtp_address,
|
74
|
+
| :port => Rails.application.secrets.smtp_port,
|
75
|
+
| :authentication => Rails.application.secrets.smtp_authentication,
|
76
|
+
| :user_name => Rails.application.secrets.smtp_username,
|
77
|
+
| :password => Rails.application.secrets.smtp_password,
|
78
|
+
| :domain => Rails.application.secrets.smtp_domain,
|
79
|
+
| :enable_starttls_auto => Rails.application.secrets.smtp_starttls_auto,
|
80
|
+
| :openssl_verify_mode => 'none'
|
81
|
+
| }
|
82
|
+
|
|
83
|
+
| if Rails.application.secrets.sendgrid
|
84
|
+
| config.action_mailer.default_options = {
|
85
|
+
| "X-SMTPAPI" => {
|
86
|
+
| filters: {
|
87
|
+
| clicktrack: { settings: { enable: 0 } },
|
88
|
+
| opentrack: { settings: { enable: 0 } }
|
89
|
+
| }
|
90
|
+
| }.to_json
|
91
|
+
| }
|
92
|
+
| end
|
93
|
+
RUBY
|
94
94
|
end
|
95
95
|
end
|
96
96
|
|
97
97
|
def letter_opener_web
|
98
|
+
route <<~RUBY.gsub(/^ *\|/, "")
|
99
|
+
|
|
100
|
+
| if Rails.env.development?
|
101
|
+
| mount LetterOpenerWeb::Engine, at: "/letter_opener"
|
102
|
+
| end
|
103
|
+
RUBY
|
104
|
+
|
98
105
|
inject_into_file "config/environments/development.rb",
|
99
106
|
after: "config.action_mailer.raise_delivery_errors = false" do
|
100
|
-
|
101
|
-
|
102
|
-
config.action_mailer.delivery_method = :letter_opener_web
|
107
|
+
<<~RUBY.gsub(/^ *\|/, "")
|
108
|
+
|
|
109
|
+
| config.action_mailer.delivery_method = :letter_opener_web
|
110
|
+
RUBY
|
103
111
|
end
|
104
112
|
end
|
105
113
|
|
@@ -3,7 +3,7 @@
|
|
3
3
|
|
4
4
|
Decidim.configure do |config|
|
5
5
|
config.application_name = "My Application Name"
|
6
|
-
config.mailer_sender
|
6
|
+
config.mailer_sender = "change-me@domain.org"
|
7
7
|
config.authorization_handlers = [ExampleAuthorizationHandler]
|
8
8
|
|
9
9
|
# Uncomment this lines to set your preferred locales
|
@@ -16,6 +16,12 @@ Decidim.configure do |config|
|
|
16
16
|
# here_app_code: Rails.application.secrets.geocoder[:here_app_code]
|
17
17
|
# }
|
18
18
|
|
19
|
+
# Custom calculate reference method
|
20
|
+
# config.calculate_reference_method = lambda do |resource|
|
21
|
+
# # Implement your custom method to generate resources references
|
22
|
+
# "1234-#{resource.id}"
|
23
|
+
# end
|
24
|
+
|
19
25
|
# Currency unit
|
20
26
|
# config.currency_unit = "€"
|
21
27
|
|