decidim-core 0.4.4 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (136) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/config/decidim_core_manifest.js +1 -0
  3. data/app/assets/images/decidim/icons.svg +1 -1
  4. data/app/assets/javascripts/decidim.js.es6 +3 -0
  5. data/app/assets/javascripts/decidim/form_filter.component.js.es6 +39 -6
  6. data/app/assets/javascripts/decidim/form_filter.component.test.js +13 -10
  7. data/app/assets/javascripts/decidim/impersonation.js.es6 +16 -0
  8. data/app/assets/javascripts/decidim/select2.field.js.es6 +47 -0
  9. data/app/assets/javascripts/decidim/select2.js.es6 +8 -0
  10. data/app/assets/stylesheets/decidim/_decidim.scss +3 -0
  11. data/app/assets/stylesheets/decidim/extras/_announcement.scss +3 -0
  12. data/app/assets/stylesheets/decidim/extras/_callout.scss +1 -1
  13. data/app/assets/stylesheets/decidim/extras/_impersonation-bar.scss +22 -0
  14. data/app/assets/stylesheets/decidim/extras/_process_stats.scss +1 -1
  15. data/app/assets/stylesheets/decidim/extras/_proposal_form.scss +7 -0
  16. data/app/assets/stylesheets/decidim/extras/_reference.scss +1 -1
  17. data/app/assets/stylesheets/decidim/extras/_register_form.scss +1 -1
  18. data/app/assets/stylesheets/decidim/extras/_social_icons_mini.scss +1 -1
  19. data/app/assets/stylesheets/decidim/layouts/_home.scss +1 -1
  20. data/app/assets/stylesheets/decidim/layouts/_view.scss +1 -1
  21. data/app/assets/stylesheets/decidim/map.css +1 -1
  22. data/app/assets/stylesheets/decidim/modules/_author-avatar.scss +1 -1
  23. data/app/assets/stylesheets/decidim/modules/_callout.scss +1 -1
  24. data/app/assets/stylesheets/decidim/modules/_datepicker.scss +1 -1
  25. data/app/assets/stylesheets/decidim/modules/_definition-data.scss +1 -1
  26. data/app/assets/stylesheets/decidim/modules/_extra.scss +1 -1
  27. data/app/assets/stylesheets/decidim/modules/_flag.scss +1 -1
  28. data/app/assets/stylesheets/decidim/modules/_footer.scss +1 -1
  29. data/app/assets/stylesheets/decidim/modules/_forms.scss +1 -1
  30. data/app/assets/stylesheets/decidim/modules/_help.scss +1 -1
  31. data/app/assets/stylesheets/decidim/modules/_pagination.scss +1 -1
  32. data/app/assets/stylesheets/decidim/modules/_process-info.scss +1 -1
  33. data/app/assets/stylesheets/decidim/modules/_reference.scss +1 -1
  34. data/app/assets/stylesheets/decidim/modules/_reveal.scss +1 -1
  35. data/app/assets/stylesheets/decidim/modules/_signup.scss +1 -1
  36. data/app/assets/stylesheets/decidim/modules/_static-pages.scss +1 -1
  37. data/app/assets/stylesheets/decidim/modules/_tags.scss +1 -1
  38. data/app/assets/stylesheets/decidim/modules/_title-action.scss +1 -1
  39. data/app/assets/stylesheets/decidim/modules/_user-form.scss +1 -1
  40. data/app/assets/stylesheets/decidim/modules/_video.scss +1 -1
  41. data/app/assets/stylesheets/decidim/plugins/_select2.scss +63 -0
  42. data/app/assets/stylesheets/decidim/utils/_toggle-expand.scss +1 -1
  43. data/app/commands/decidim/invite_user.rb +5 -2
  44. data/app/controllers/concerns/decidim/devise_controllers.rb +6 -0
  45. data/app/controllers/concerns/decidim/impersonate_users.rb +67 -0
  46. data/app/controllers/concerns/decidim/needs_authorization.rb +0 -4
  47. data/app/controllers/decidim/application_controller.rb +7 -0
  48. data/app/controllers/decidim/devise/invitations_controller.rb +7 -0
  49. data/app/controllers/decidim/errors_controller.rb +1 -1
  50. data/app/controllers/decidim/features/base_controller.rb +1 -1
  51. data/app/controllers/decidim/participatory_process_widgets_controller.rb +0 -2
  52. data/app/controllers/decidim/scopes_controller.rb +29 -0
  53. data/app/forms/decidim/attachment_form.rb +14 -0
  54. data/app/forms/decidim/invite_user_form.rb +12 -1
  55. data/app/helpers/decidim/application_helper.rb +1 -0
  56. data/app/helpers/decidim/attachments_helper.rb +11 -0
  57. data/app/helpers/decidim/decidim_form_helper.rb +9 -8
  58. data/app/helpers/decidim/icon_helper.rb +12 -2
  59. data/app/helpers/decidim/participatory_process_helper.rb +0 -24
  60. data/app/helpers/decidim/scopes_helper.rb +15 -0
  61. data/app/helpers/decidim/translations_helper.rb +1 -1
  62. data/app/mailers/decidim/reported_mailer.rb +1 -1
  63. data/app/models/decidim/abilities/admin_ability.rb +1 -0
  64. data/app/models/decidim/abilities/everyone_ability.rb +2 -0
  65. data/app/models/decidim/abilities/user_manager_ability.rb +35 -0
  66. data/app/models/decidim/impersonation_log.rb +35 -0
  67. data/app/models/decidim/organization.rb +9 -0
  68. data/app/models/decidim/participatory_process.rb +1 -4
  69. data/app/models/decidim/scope.rb +65 -1
  70. data/app/models/decidim/scope_type.rb +16 -0
  71. data/app/models/decidim/user.rb +35 -4
  72. data/app/presenters/decidim/participatory_process_stats_presenter.rb +1 -1
  73. data/app/queries/decidim/freetext_scopes.rb +39 -0
  74. data/app/services/decidim/resource_search.rb +7 -6
  75. data/app/uploaders/decidim/attachment_uploader.rb +1 -1
  76. data/app/views/decidim/account/delete.html.erb +1 -1
  77. data/app/views/decidim/application/_documents.html.erb +4 -2
  78. data/app/views/decidim/participatory_processes/_statistics.html.erb +1 -1
  79. data/app/views/decidim/participatory_processes/show.html.erb +4 -0
  80. data/app/views/decidim/reported_mailer/hide.html.erb +1 -1
  81. data/app/views/decidim/reported_mailer/report.html.erb +1 -1
  82. data/app/views/decidim/shared/_announcement.html.erb +5 -0
  83. data/app/views/decidim/shared/_feature_announcement.html.erb +5 -0
  84. data/app/views/decidim/shared/_flag_modal.html.erb +1 -1
  85. data/app/views/decidim/shared/_tags.html.erb +10 -0
  86. data/app/views/devise/mailer/invitation_instructions.html.erb +13 -0
  87. data/app/views/devise/mailer/invitation_instructions.text.erb +11 -0
  88. data/app/views/layouts/decidim/_application.html.erb +1 -0
  89. data/app/views/layouts/decidim/_impersonation_warning.html.erb +10 -0
  90. data/app/views/layouts/decidim/_wrapper.html.erb +1 -1
  91. data/app/views/pages/home/_statistics.html.erb +1 -1
  92. data/app/views/pages/home/_sub_hero.html.erb +1 -1
  93. data/config/locales/ca.yml +10 -1
  94. data/config/locales/en.yml +9 -0
  95. data/config/locales/es.yml +10 -1
  96. data/config/locales/eu.yml +22 -1
  97. data/config/locales/fi.yml +1 -1
  98. data/config/locales/fr.yml +60 -0
  99. data/config/locales/it.yml +1 -1
  100. data/config/locales/nl.yml +1 -1
  101. data/config/locales/pl.yml +91 -0
  102. data/config/routes.rb +2 -0
  103. data/db/migrate/20170605162500_add_hierarchy_to_scopes.rb +70 -0
  104. data/db/migrate/20170713131206_add_admin_to_users.rb +6 -1
  105. data/db/migrate/20170713131308_migrate_user_roles_to_participatory_process_roles.rb +5 -1
  106. data/db/migrate/20170720135441_add_managed_to_users.rb +7 -0
  107. data/db/migrate/20170720140610_set_email_unique_in_organization_condition_for_managed_users.rb +12 -0
  108. data/db/migrate/20170724130558_create_impersonation_logs.rb +15 -0
  109. data/db/migrate/20170727125445_add_roles_to_users.rb +7 -0
  110. data/db/migrate/20170804125402_attachment_description_nullable.rb +7 -0
  111. data/db/migrate/20170808080905_add_announcement_to_participatory_processes.rb +7 -0
  112. data/db/migrate/20170809084005_add_scopes_enabled_to_participatory_processes.rb +7 -0
  113. data/db/seeds.rb +34 -10
  114. data/lib/decidim/core.rb +11 -5
  115. data/lib/decidim/core/engine.rb +1 -0
  116. data/lib/decidim/core/test.rb +2 -0
  117. data/lib/decidim/core/test/factories.rb +59 -22
  118. data/lib/decidim/core/test/shared_examples/announcements_examples.rb +58 -0
  119. data/lib/decidim/core/test/shared_examples/comments_examples.rb +15 -29
  120. data/lib/decidim/core/test/shared_examples/errors.rb +1 -1
  121. data/lib/decidim/core/test/shared_examples/has_attachments.rb +4 -9
  122. data/lib/decidim/core/test/shared_examples/manage_moderations_examples.rb +1 -8
  123. data/lib/decidim/core/test/shared_examples/paginated_resource_examples.rb +2 -2
  124. data/lib/decidim/core/test/shared_examples/process_announcements_examples.rb +33 -0
  125. data/lib/decidim/core/test/shared_examples/reports_examples.rb +1 -2
  126. data/lib/decidim/core/version.rb +6 -2
  127. data/lib/decidim/faker/localized.rb +4 -4
  128. data/lib/decidim/filter_form_builder.rb +7 -0
  129. data/lib/decidim/form_builder.rb +34 -5
  130. data/lib/decidim/scopable.rb +33 -0
  131. data/lib/decidim/settings_manifest.rb +10 -2
  132. data/lib/decidim/translatable_attributes.rb +0 -1
  133. metadata +61 -17
  134. data/app/helpers/decidim/organization_scopes_helper.rb +0 -42
  135. data/db/seeds/city3.jpeg +0 -0
  136. data/lib/tasks/factory_girl.rake +0 -17
@@ -322,4 +322,4 @@ it:
322
322
  first: "« Primo"
323
323
  last: Ultimo »
324
324
  next: Successivo ›
325
- previous: "‹ Precedente"
325
+ previous: "‹ Precedente"
@@ -358,4 +358,4 @@ nl:
358
358
  last: Laatste »
359
359
  next: Volgende ›
360
360
  previous: "‹ Vorige"
361
- truncate: "…"
361
+ truncate: "…"
@@ -0,0 +1,91 @@
1
+ pl:
2
+ activemodel:
3
+ attributes:
4
+ account:
5
+ delete_reason: Powód usunięcia konta
6
+ user:
7
+ email: Twój email
8
+ name: Twoje imię
9
+ password: Nowe hasło
10
+ user_group_name: Nazwa organizacji
11
+ activerecord:
12
+ attributes:
13
+ decidim/user:
14
+ password: Hasło
15
+ password_confirmation: Potwierdzenie hasła
16
+ remember_me: Zapamiętaj mnie
17
+ carrierwave:
18
+ errors:
19
+ image_too_big: Obraz jest zbyt duży
20
+ decidim:
21
+ account:
22
+ delete:
23
+ confirm:
24
+ close: Zamknij okno
25
+ ok: Tak, chcę usunąć moje konto
26
+ question: Czy na pewno chcesz usunąć swoje konto?
27
+ title: Usuń moje konto
28
+ explanation: Proszę podać przyczynę, dla której chcesz usunąć swoje konto (opcjonalne).
29
+ destroy:
30
+ error: Podczas usuwania Twojego konta wystąpił błąd.
31
+ show:
32
+ change_password: Zmień hasło
33
+ update_account: Zaktualizuj konto
34
+ update:
35
+ error: Podczas aktualizowania konta wystąpił błąd.
36
+ application:
37
+ documents:
38
+ related_documents: Powiązane dokumenty
39
+ authorization_handlers:
40
+ decidim/dummy_authorization_handler:
41
+ fields:
42
+ document_number: Numer dokumentu
43
+ postal_code: Kod pocztowy
44
+ name: Przykładowa autoryzacja
45
+ foo_authorization:
46
+ fields:
47
+ bar: Bar
48
+ name: Autoryzacja Foo
49
+ authorizations:
50
+ create:
51
+ error: Podczas tworzenia autoryzacji wystąpił błąd.
52
+ errors:
53
+ internal_server_error:
54
+ try_later: Spróbuj ponownie później.
55
+ not_found:
56
+ content_doesnt_exist: Ten adres jest nieprawidłowy lub został usunięty.
57
+ features:
58
+ dummy:
59
+ actions:
60
+ bar: Bar
61
+ settings:
62
+ global:
63
+ comments_enabled: Włączone komentarze
64
+ step:
65
+ comments_blocked: Komentarze zablokowane
66
+ filters:
67
+ linked_classes:
68
+ meeting: Spotkania
69
+ proposal: Propozycje
70
+ forms:
71
+ default_image: Domyślny obraz
72
+ errors:
73
+ error: W tym polu wystąpił błąd.
74
+ menu:
75
+ more_information: Więcej informacji
76
+ processes: Procesy
77
+ own_user_groups:
78
+ index:
79
+ rejected: Odrzucone
80
+ pages:
81
+ index:
82
+ title: Więcej informacji
83
+ participatory_process_groups:
84
+ show:
85
+ title: Tytuł
86
+ participatory_process_steps:
87
+ index:
88
+ process_steps: Etapy procesu
89
+ participatory_processes:
90
+ scopes:
91
+ global: Zakres globalny
data/config/routes.rb CHANGED
@@ -55,6 +55,8 @@ Decidim::Core::Engine.routes.draw do
55
55
 
56
56
  resources :pages, only: [:index, :show], format: false
57
57
 
58
+ get "/scopes/search", to: "scopes#search", as: :scopes_search
59
+
58
60
  get "/static_map", to: "static_map#show", as: :static_map
59
61
  get "/cookies/accept", to: "cookie_policy#accept", as: :accept_cookies
60
62
 
@@ -0,0 +1,70 @@
1
+ # frozen_string_literal: true
2
+
3
+ class AddHierarchyToScopes < ActiveRecord::Migration[5.0]
4
+ class Scope < ApplicationRecord
5
+ self.table_name = :decidim_scopes
6
+ end
7
+
8
+ class Organization < ApplicationRecord
9
+ self.table_name = :decidim_organizations
10
+ end
11
+
12
+ def self.up
13
+ # schema migration
14
+ create_table :decidim_scope_types do |t|
15
+ t.references :decidim_organization, foreign_key: true, index: true
16
+ t.jsonb :name, null: false
17
+ t.jsonb :plural, null: false
18
+ end
19
+
20
+ # retrieve current data
21
+ current_data = Scope.select(:id, :name, :decidim_organization_id).as_json
22
+
23
+ change_table :decidim_scopes do |t|
24
+ t.remove_index :name
25
+ t.remove :name
26
+ t.jsonb :name
27
+ t.references :scope_type, foreign_key: { to_table: :decidim_scope_types }, index: true
28
+ t.references :parent, foreign_key: { to_table: :decidim_scopes }
29
+ t.string :code
30
+ t.integer :part_of, array: true, default: [], null: false
31
+ t.index :part_of, using: "gin"
32
+ end
33
+
34
+ current_data.each do |s|
35
+ locales = Organization.find(s["decidim_organization_id"]).available_locales
36
+ name = s["name"].gsub(/'/, "''")
37
+ execute("
38
+ UPDATE decidim_scopes
39
+ SET name = '#{Hash[locales.map { |locale| [locale, name] }].to_json}',
40
+ code = #{quote(s["id"])}
41
+ WHERE id = #{s["id"]}
42
+ ")
43
+ end
44
+
45
+ change_column_null :decidim_scopes, :name, false
46
+ change_column_null :decidim_scopes, :code, false
47
+ add_index :decidim_scopes, [:decidim_organization_id, :code], unique: true
48
+ end
49
+
50
+ def self.down
51
+ # schema migration
52
+ change_table :decidim_scopes do |t|
53
+ t.remove_index [:decidim_organization_id, :code]
54
+ t.change :name, :string, null: false, index: :uniqueness
55
+ t.remove :scope_type_id, :parent_id, :code, :part_of
56
+ end
57
+ add_index :decidim_scopes, :name, unique: true
58
+ drop_table :decidim_scope_types
59
+
60
+ # post migration data fixes
61
+ Scope.select(:id, :name).as_json.each do |s|
62
+ name = quote(JSON.parse(s["name"]).values.first)
63
+ execute("
64
+ UPDATE decidim_scopes
65
+ SET name = #{name}
66
+ WHERE id = #{s["id"]}
67
+ ")
68
+ end
69
+ end
70
+ end
@@ -3,6 +3,11 @@
3
3
  class AddAdminToUsers < ActiveRecord::Migration[5.1]
4
4
  def up
5
5
  add_column :decidim_users, :admin, :boolean, null: false, default: false
6
- Decidim::User.where("roles @> ?", "{admin}").update_all(admin: true)
6
+
7
+ execute <<~SQL
8
+ UPDATE decidim_users
9
+ SET admin = true
10
+ WHERE roles @> '{admin}'
11
+ SQL
7
12
  end
8
13
  end
@@ -1,9 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class MigrateUserRolesToParticipatoryProcessRoles < ActiveRecord::Migration[5.1]
4
+ class User < ApplicationRecord
5
+ self.table_name = :decidim_users
6
+ end
7
+
4
8
  def up
5
9
  participatory_processes = Decidim::ParticipatoryProcess.includes(:organization).all
6
- Decidim::User.find_each do |user|
10
+ User.find_each do |user|
7
11
  next if user.roles.empty? || user.roles.include?("admin")
8
12
 
9
13
  processes = participatory_processes.select { |process| process.organization == user.organization }
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ class AddManagedToUsers < ActiveRecord::Migration[5.1]
4
+ def change
5
+ add_column :decidim_users, :managed, :boolean, null: false, default: false
6
+ end
7
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ class SetEmailUniqueInOrganizationConditionForManagedUsers < ActiveRecord::Migration[5.1]
4
+ def change
5
+ remove_index :decidim_users, %w(email decidim_organization_id)
6
+ add_index :decidim_users,
7
+ %w(email decidim_organization_id),
8
+ where: "(deleted_at IS NULL) AND (managed = 'f')",
9
+ name: "index_decidim_users_on_email_and_decidim_organization_id",
10
+ unique: true
11
+ end
12
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ class CreateImpersonationLogs < ActiveRecord::Migration[5.1]
4
+ def change
5
+ create_table :decidim_impersonation_logs do |t|
6
+ t.references :decidim_admin, index: true
7
+ t.references :decidim_user, index: true
8
+ t.datetime :started_at
9
+ t.datetime :ended_at
10
+ t.datetime :expired_at
11
+
12
+ t.timestamps
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ class AddRolesToUsers < ActiveRecord::Migration[5.1]
4
+ def change
5
+ add_column :decidim_users, :roles, :string, array: true, default: []
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ class AttachmentDescriptionNullable < ActiveRecord::Migration[5.1]
4
+ def change
5
+ change_column :decidim_attachments, :description, :jsonb, null: true
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ class AddAnnouncementToParticipatoryProcesses < ActiveRecord::Migration[5.1]
4
+ def change
5
+ add_column :decidim_participatory_processes, :announcement, :jsonb
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ class AddScopesEnabledToParticipatoryProcesses < ActiveRecord::Migration[5.1]
4
+ def change
5
+ add_column :decidim_participatory_processes, :scopes_enabled, :boolean, null: false, default: true
6
+ end
7
+ end
data/db/seeds.rb CHANGED
@@ -3,6 +3,8 @@
3
3
  if !Rails.env.production? || ENV["SEED"]
4
4
  require "decidim/faker/localized"
5
5
 
6
+ seeds_root = File.join(__dir__, "seeds")
7
+
6
8
  organization = Decidim::Organization.first || Decidim::Organization.create!(
7
9
  name: Faker::Company.name,
8
10
  twitter_handler: Faker::Hipster.word,
@@ -15,17 +17,41 @@ if !Rails.env.production? || ENV["SEED"]
15
17
  description: Decidim::Faker::Localized.wrapped("<p>", "</p>") do
16
18
  Decidim::Faker::Localized.sentence(15)
17
19
  end,
18
- homepage_image: File.new(File.join(__dir__, "seeds", "homepage_image.jpg")),
19
- default_locale: I18n.default_locale,
20
- available_locales: [:en, :ca, :es],
20
+ homepage_image: File.new(File.join(seeds_root, "homepage_image.jpg")),
21
+ default_locale: Decidim.default_locale,
22
+ available_locales: Decidim.available_locales,
21
23
  reference_prefix: Faker::Name.suffix
22
24
  )
23
25
 
26
+ province = Decidim::ScopeType.create!(
27
+ name: Decidim::Faker::Localized.literal("province"),
28
+ plural: Decidim::Faker::Localized.literal("provinces"),
29
+ organization: organization
30
+ )
31
+
32
+ municipality = Decidim::ScopeType.create!(
33
+ name: Decidim::Faker::Localized.literal("municipality"),
34
+ plural: Decidim::Faker::Localized.literal("municipalities"),
35
+ organization: organization
36
+ )
37
+
24
38
  3.times.each do
25
- Decidim::Scope.create!(
26
- name: Faker::Address.unique.state,
39
+ parent = Decidim::Scope.create!(
40
+ name: Decidim::Faker::Localized.literal(Faker::Address.unique.state),
41
+ code: Faker::Address.unique.country_code,
42
+ scope_type: province,
27
43
  organization: organization
28
44
  )
45
+
46
+ 5.times.each do
47
+ Decidim::Scope.create!(
48
+ name: Decidim::Faker::Localized.literal(Faker::Address.unique.city),
49
+ code: parent.code + "-" + Faker::Address.unique.state_abbr,
50
+ scope_type: municipality,
51
+ organization: organization,
52
+ parent: parent
53
+ )
54
+ end
29
55
  end
30
56
 
31
57
  Decidim::User.find_or_initialize_by(email: "admin@example.org").update!(
@@ -70,8 +96,6 @@ if !Rails.env.production? || ENV["SEED"]
70
96
  end
71
97
  end
72
98
 
73
- seeds_root = File.join(__dir__, "seeds")
74
-
75
99
  process_groups = []
76
100
  3.times do
77
101
  process_groups << Decidim::ParticipatoryProcessGroup.create!(
@@ -98,8 +122,7 @@ if !Rails.env.production? || ENV["SEED"]
98
122
  end,
99
123
  hero_image: File.new(File.join(seeds_root, "city.jpeg")),
100
124
  banner_image: File.new(File.join(seeds_root, "city2.jpeg")),
101
- promoted: true,
102
- published_at: 2.weeks.ago,
125
+ promoted: true, published_at: 2.weeks.ago,
103
126
  organization: organization,
104
127
  meta_scope: Decidim::Faker::Localized.word,
105
128
  developer_group: Decidim::Faker::Localized.sentence(1),
@@ -108,7 +131,8 @@ if !Rails.env.production? || ENV["SEED"]
108
131
  participatory_scope: Decidim::Faker::Localized.sentence(1),
109
132
  participatory_structure: Decidim::Faker::Localized.sentence(2),
110
133
  end_date: 2.month.from_now.at_midnight,
111
- participatory_process_group: process_groups.sample
134
+ participatory_process_group: process_groups.sample,
135
+ scope: Faker::Boolean.boolean(0.5) ? nil : Decidim::Scope.reorder("RANDOM()").first
112
136
  )
113
137
  end
114
138
 
data/lib/decidim/core.rb CHANGED
@@ -1,4 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
1
  # frozen_string_literal: true
3
2
 
4
3
  require "decidim/core/engine"
@@ -19,6 +18,7 @@ module Decidim
19
18
  autoload :Authorable, "decidim/authorable"
20
19
  autoload :Notifiable, "decidim/notifiable"
21
20
  autoload :Publicable, "decidim/publicable"
21
+ autoload :Scopable, "decidim/scopable"
22
22
  autoload :Features, "decidim/features"
23
23
  autoload :HasAttachments, "decidim/has_attachments"
24
24
  autoload :FeatureValidator, "decidim/feature_validator"
@@ -94,7 +94,9 @@ module Decidim
94
94
  end
95
95
 
96
96
  # Exposes a configuration option: The application default locale.
97
- config_accessor :default_locale { :en }
97
+ config_accessor :default_locale do
98
+ :en
99
+ end
98
100
 
99
101
  # Exposes a configuration option: an object to configure geocoder
100
102
  config_accessor :geocoder
@@ -120,7 +122,9 @@ module Decidim
120
122
  end
121
123
 
122
124
  # Exposes a configuration option: the currency unit
123
- config_accessor :currency_unit { "€" }
125
+ config_accessor :currency_unit do
126
+ "€"
127
+ end
124
128
 
125
129
  # Exposes a configuration option: The maximum file size of an attachment.
126
130
  config_accessor :maximum_attachment_size do
@@ -128,13 +132,15 @@ module Decidim
128
132
  end
129
133
 
130
134
  # The number of reports which an object can receive before hiding it
131
- config_accessor :max_reports_before_hiding { 3 }
135
+ config_accessor :max_reports_before_hiding do
136
+ 3
137
+ end
132
138
 
133
139
  # A base path for the uploads. If set, make sure it ends in a slash.
134
140
  # Uploads will be set to `<base_path>/uploads/`. This can be useful if you
135
141
  # want to use the same uploads place for both staging and production
136
142
  # environments, but in different folders.
137
- config_accessor :base_uploads_path { nil }
143
+ config_accessor :base_uploads_path
138
144
 
139
145
  # Public: Registers a feature, usually held in an external library or in a
140
146
  # separate folder in the main repository. Exposes a DSL defined by
@@ -81,6 +81,7 @@ module Decidim
81
81
  Decidim.configure do |config|
82
82
  config.abilities << "Decidim::Abilities::EveryoneAbility"
83
83
  config.abilities << "Decidim::Abilities::AdminAbility"
84
+ config.abilities << "Decidim::Abilities::UserManagerAbility"
84
85
  config.abilities << "Decidim::Abilities::ParticipatoryProcessAdminAbility"
85
86
  config.abilities << "Decidim::Abilities::ParticipatoryProcessCollaboratorAbility"
86
87
  config.abilities << "Decidim::Abilities::ParticipatoryProcessModeratorAbility"
@@ -9,6 +9,8 @@ require "decidim/core/test/shared_examples/has_scope"
9
9
  require "decidim/core/test/shared_examples/has_category"
10
10
  require "decidim/core/test/shared_examples/has_reference"
11
11
  require "decidim/core/test/shared_examples/comments_examples"
12
+ require "decidim/core/test/shared_examples/announcements_examples"
13
+ require "decidim/core/test/shared_examples/process_announcements_examples"
12
14
  require "decidim/core/test/shared_examples/reportable"
13
15
  require "decidim/core/test/shared_examples/reports_examples"
14
16
  require "decidim/core/test/shared_examples/manage_moderations_examples"