decidim-core 0.16.1 → 0.17.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-core might be problematic. Click here for more details.

Files changed (116) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/images/decidim/decidim-logo.svg +69 -60
  3. data/app/assets/javascripts/decidim.js.es6 +1 -0
  4. data/app/assets/javascripts/decidim/core/bundle.js +2 -0
  5. data/app/assets/javascripts/decidim/core/bundle.js.map +1 -0
  6. data/app/assets/javascripts/decidim/data_picker.js.es6 +6 -0
  7. data/app/assets/stylesheets/decidim/_variables.scss +17 -0
  8. data/app/assets/stylesheets/decidim/extras/_leaflet.scss +2 -2
  9. data/app/assets/stylesheets/decidim/layouts/_highlighted_banner.scss +0 -4
  10. data/app/assets/stylesheets/decidim/layouts/_home.scss +2 -2
  11. data/app/assets/stylesheets/decidim/modules/_address.scss +1 -1
  12. data/app/assets/stylesheets/decidim/modules/_author-avatar.scss +3 -2
  13. data/app/assets/stylesheets/decidim/modules/_badges.scss +7 -7
  14. data/app/assets/stylesheets/decidim/modules/_buttons.scss +52 -14
  15. data/app/assets/stylesheets/decidim/modules/_callout.scss +5 -5
  16. data/app/assets/stylesheets/decidim/modules/_cards.scss +9 -23
  17. data/app/assets/stylesheets/decidim/modules/_conference-nav.scss +1 -1
  18. data/app/assets/stylesheets/decidim/modules/_filters.scss +1 -1
  19. data/app/assets/stylesheets/decidim/modules/_horizontal-tabs.scss +2 -2
  20. data/app/assets/stylesheets/decidim/modules/_loading-spinner.scss +1 -1
  21. data/app/assets/stylesheets/decidim/modules/_main-container.scss +1 -1
  22. data/app/assets/stylesheets/decidim/modules/_map.scss +3 -3
  23. data/app/assets/stylesheets/decidim/modules/_navbar.scss +3 -3
  24. data/app/assets/stylesheets/decidim/modules/_omnipresent_banner.scss +1 -1
  25. data/app/assets/stylesheets/decidim/modules/_order-by.scss +1 -1
  26. data/app/assets/stylesheets/decidim/modules/_process-header.scss +1 -1
  27. data/app/assets/stylesheets/decidim/modules/_process-nav.scss +8 -8
  28. data/app/assets/stylesheets/decidim/modules/_process-phase.scss +4 -4
  29. data/app/assets/stylesheets/decidim/modules/_status-labels.scss +2 -2
  30. data/app/assets/stylesheets/decidim/modules/_timeline.scss +1 -1
  31. data/app/assets/stylesheets/decidim/modules/_typography.scss +2 -2
  32. data/app/assets/stylesheets/decidim/modules/_wizard-steps.scss +3 -3
  33. data/app/assets/stylesheets/decidim/utils/_mixins.scss +7 -1
  34. data/app/assets/stylesheets/decidim/vizzs/_areachart.scss +3 -7
  35. data/app/cells/decidim/activities_cell.rb +0 -2
  36. data/app/cells/decidim/card_m_cell.rb +3 -1
  37. data/app/cells/decidim/content_blocks/footer_sub_hero_cell.rb +0 -1
  38. data/app/cells/decidim/content_blocks/hero_cell.rb +0 -2
  39. data/app/cells/decidim/content_blocks/highlighted_content_banner_cell.rb +0 -2
  40. data/app/cells/decidim/content_blocks/last_activity_cell.rb +0 -2
  41. data/app/cells/decidim/content_blocks/metrics_cell.rb +0 -2
  42. data/app/cells/decidim/content_blocks/stats_cell.rb +0 -2
  43. data/app/cells/decidim/content_blocks/sub_hero_cell.rb +0 -2
  44. data/app/cells/decidim/follow_button_cell.rb +0 -4
  45. data/app/cells/decidim/pad_iframe_cell.rb +0 -4
  46. data/app/commands/decidim/create_omniauth_registration.rb +1 -1
  47. data/app/commands/decidim/create_report.rb +1 -1
  48. data/app/controllers/concerns/decidim/action_authorization.rb +6 -4
  49. data/app/controllers/concerns/decidim/locale_switcher.rb +14 -0
  50. data/app/controllers/concerns/decidim/participatory_space_context.rb +5 -6
  51. data/app/controllers/decidim/application_controller.rb +1 -1
  52. data/app/controllers/decidim/authorization_modals_controller.rb +5 -5
  53. data/app/controllers/decidim/static_map_controller.rb +2 -0
  54. data/app/frontend/entry.ts +1 -0
  55. data/app/helpers/decidim/cells_helper.rb +0 -1
  56. data/app/helpers/decidim/filters_helper.rb +10 -1
  57. data/app/helpers/decidim/layout_helper.rb +5 -0
  58. data/app/mailers/concerns/decidim/localised_mailer.rb +1 -1
  59. data/app/models/decidim/user.rb +1 -1
  60. data/app/permissions/decidim/permissions.rb +11 -11
  61. data/app/presenters/decidim/resource_locator_presenter.rb +13 -0
  62. data/app/queries/decidim/metrics/users_metric_manage.rb +2 -2
  63. data/app/services/decidim/action_authorizer.rb +51 -26
  64. data/app/services/decidim/email_notification_generator.rb +11 -0
  65. data/app/views/decidim/account/show.html.erb +2 -1
  66. data/app/views/decidim/authorization_modals/_content.html.erb +45 -0
  67. data/app/views/decidim/authorization_modals/show.html.erb +1 -41
  68. data/app/views/decidim/notification_mailer/event_received.html.erb +1 -1
  69. data/app/views/layouts/decidim/_application.html.erb +1 -0
  70. data/app/views/layouts/decidim/_organization_colors.html.erb +5 -0
  71. data/app/views/layouts/decidim/_wrapper.html.erb +3 -1
  72. data/config/locales/ar-SA.yml +180 -10
  73. data/config/locales/ca.yml +118 -120
  74. data/config/locales/cs-CZ.yml +3 -3
  75. data/config/locales/cs.yml +1282 -0
  76. data/config/locales/de.yml +29 -31
  77. data/config/locales/en.yml +148 -149
  78. data/config/locales/es-MX.yml +28 -30
  79. data/config/locales/es-PY.yml +28 -30
  80. data/config/locales/es.yml +124 -126
  81. data/config/locales/eu.yml +28 -30
  82. data/config/locales/fi-pl.yml +1 -1
  83. data/config/locales/fi-plain.yml +1260 -0
  84. data/config/locales/fi.yml +95 -97
  85. data/config/locales/fr.yml +28 -30
  86. data/config/locales/gl.yml +28 -30
  87. data/config/locales/hu.yml +44 -46
  88. data/config/locales/id-ID.yml +28 -30
  89. data/config/locales/it.yml +32 -34
  90. data/config/locales/nl.yml +29 -31
  91. data/config/locales/pl.yml +28 -30
  92. data/config/locales/pt-BR.yml +28 -30
  93. data/config/locales/pt.yml +28 -30
  94. data/config/locales/ru.yml +1 -2
  95. data/config/locales/sv.yml +29 -31
  96. data/config/locales/tr-TR.yml +28 -30
  97. data/config/locales/uk.yml +1 -2
  98. data/db/migrate/20190220023422_add_colors_to_decidim_organization.rb +7 -0
  99. data/lib/decidim/content_renderers/user_renderer.rb +4 -6
  100. data/lib/decidim/core.rb +10 -1
  101. data/lib/decidim/core/test.rb +1 -0
  102. data/lib/decidim/core/test/shared_examples/amendable/amendment_accepted_event_examples.rb +3 -3
  103. data/lib/decidim/core/test/shared_examples/amendable/amendment_created_event_examples.rb +3 -3
  104. data/lib/decidim/core/test/shared_examples/amendable/amendment_promoted_event_examples.rb +3 -3
  105. data/lib/decidim/core/test/shared_examples/amendable/amendment_rejected_event_examples.rb +3 -3
  106. data/lib/decidim/core/test/shared_examples/uncommentable_component_examples.rb +21 -0
  107. data/lib/decidim/core/version.rb +1 -1
  108. data/lib/decidim/data_portability_file_zipper.rb +12 -3
  109. data/lib/decidim/form_builder.rb +3 -9
  110. data/lib/decidim/has_resource_permission.rb +43 -0
  111. data/lib/decidim/settings_manifest.rb +5 -0
  112. data/lib/decidim/view_model.rb +2 -0
  113. data/vendor/assets/javascripts/datepicker-locales/foundation-datepicker.ca.js +6 -6
  114. data/vendor/assets/javascripts/datepicker-locales/foundation-datepicker.cs.js +14 -0
  115. data/vendor/assets/javascripts/foundation-datepicker.js +2 -10
  116. metadata +18 -7
@@ -154,13 +154,12 @@ uk:
154
154
  granted_at: 'Надано: %{timestamp}'
155
155
  started_at: 'Розпочато: %{timestamp}'
156
156
  authorization_modals:
157
- show:
157
+ content:
158
158
  expired:
159
159
  authorize: Знову підтвердити свою особу за допомогою "%{authorization}"
160
160
  explanation: Строк дії підтвердження вашої особи вичерпався. Щоб виконати цю дію, вам потрібно знову підтвердити свою особу за допомогою "%{authorization}".
161
161
  title: Строк дії підтвердження особи вичерпався
162
162
  incomplete:
163
- cancel: Скасувати
164
163
  explanation: 'Незважаючи на те, що ви наразі підтвердили свою особу за допомогою "%{authorization}", ми просимо вас знову підтвердити свою особу, оскільки нам не вистачає наступних даних:'
165
164
  invalid_field: "Поле %{field}"
166
165
  reauthorize: Заново підтвердити свою особу
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ class AddColorsToDecidimOrganization < ActiveRecord::Migration[5.2]
4
+ def change
5
+ add_column :decidim_organizations, :colors, :jsonb, default: {}
6
+ end
7
+ end
@@ -19,12 +19,10 @@ module Decidim
19
19
  # @return [String] the content ready to display (contains HTML)
20
20
  def render
21
21
  content.gsub(GLOBAL_ID_REGEX) do |user_gid|
22
- begin
23
- user = GlobalID::Locator.locate(user_gid)
24
- Decidim::UserPresenter.new(user).display_mention
25
- rescue ActiveRecord::RecordNotFound => _ex
26
- ""
27
- end
22
+ user = GlobalID::Locator.locate(user_gid)
23
+ Decidim::UserPresenter.new(user).display_mention
24
+ rescue ActiveRecord::RecordNotFound => _ex
25
+ ""
28
26
  end
29
27
  end
30
28
  end
@@ -74,6 +74,7 @@ module Decidim
74
74
  autoload :Paddable, "decidim/paddable"
75
75
  autoload :OpenDataExporter, "decidim/open_data_exporter"
76
76
  autoload :IoEncoder, "decidim/io_encoder"
77
+ autoload :HasResourcePermission, "decidim/has_resource_permission"
77
78
 
78
79
  include ActiveSupport::Configurable
79
80
  # Loads seeds from all engines.
@@ -126,7 +127,7 @@ module Decidim
126
127
 
127
128
  # Exposes a configuration option: The application available locales.
128
129
  config_accessor :available_locales do
129
- %w(en ca de es es-PY eu fi fr gl hu it nl pt pt-BR ru sv uk)
130
+ %w(en ca de es es-MX es-PY eu fi-pl fi fr gl hu id it nl pl pt pt-BR ru sv tr uk)
130
131
  end
131
132
 
132
133
  # Exposes a configuration option: an array of symbols representing processors
@@ -252,6 +253,14 @@ module Decidim
252
253
  # Exposes a configuration option: an object to deliver SMS codes to users.
253
254
  config_accessor :sms_gateway_service
254
255
 
256
+ # Exposes a configuration option: an object to generate a timestamp from a
257
+ # document
258
+ config_accessor :timestamp_service
259
+
260
+ # Exposes a configuration option: an object to process a pdf and add a
261
+ # signature to the document
262
+ config_accessor :pdf_signature_service
263
+
255
264
  # Public: Registers a global engine. This method is intended to be used
256
265
  # by component engines that also offer unscoped functionality
257
266
  #
@@ -38,3 +38,4 @@ require "decidim/core/test/shared_examples/amendable/amendment_created_event_exa
38
38
  require "decidim/core/test/shared_examples/amendable/amendment_accepted_event_examples"
39
39
  require "decidim/core/test/shared_examples/amendable/amendment_rejected_event_examples"
40
40
  require "decidim/core/test/shared_examples/amendable/amendment_promoted_event_examples"
41
+ require "decidim/core/test/shared_examples/uncommentable_component_examples"
@@ -16,14 +16,14 @@ shared_examples "amendment accepted event" do
16
16
 
17
17
  describe "email_subject" do
18
18
  it "is generated correctly" do
19
- expect(subject.email_subject).to eq("An amendment accepted for #{amendable_title} from #{emendation_author_nickname}")
19
+ expect(subject.email_subject).to eq("Accepted amendment for #{amendable_title} from #{emendation_author_nickname}")
20
20
  end
21
21
  end
22
22
 
23
23
  describe "email_intro" do
24
24
  it "is generated correctly" do
25
25
  expect(subject.email_intro)
26
- .to eq("An emendation has been accepted for #{amendable_title}. You can see it from this page:")
26
+ .to eq("An amendment has been accepted for #{amendable_title}. You can see it from this page:")
27
27
  end
28
28
  end
29
29
 
@@ -37,7 +37,7 @@ shared_examples "amendment accepted event" do
37
37
  describe "notification_title" do
38
38
  it "is generated correctly" do
39
39
  expect(subject.notification_title)
40
- .to include("The <a href=\"#{emendation_path}\">emendation</a> created by <a href=\"#{emendation_author_path}\">#{emendation_author_nickname}</a> has been accepted for <a href=\"#{amendable_path}\">#{amendable_title}</a> #{amendable_type}.") # rubocop:disable Metrics/LineLength
40
+ .to include("The <a href=\"#{emendation_path}\">amendment</a> created by <a href=\"#{emendation_author_path}\">#{emendation_author_nickname}</a> has been accepted for <a href=\"#{amendable_path}\">#{amendable_title}</a> #{amendable_type}.") # rubocop:disable Metrics/LineLength
41
41
  end
42
42
  end
43
43
  end
@@ -21,14 +21,14 @@ shared_examples "amendment created event" do
21
21
 
22
22
  describe "email_subject" do
23
23
  it "is generated correctly" do
24
- expect(subject.email_subject).to eq("A new amendment for #{amendable_title} from #{emendation_author_nickname}")
24
+ expect(subject.email_subject).to eq("New amendment for #{amendable_title} from #{emendation_author_nickname}")
25
25
  end
26
26
  end
27
27
 
28
28
  describe "email_intro" do
29
29
  it "is generated correctly" do
30
30
  expect(subject.email_intro)
31
- .to eq("A new emendation has been created for #{amendable_title}. You can see it from this page:")
31
+ .to eq("A new amendment has been created for #{amendable_title}. You can see it from this page:")
32
32
  end
33
33
  end
34
34
 
@@ -42,7 +42,7 @@ shared_examples "amendment created event" do
42
42
  describe "notification_title" do
43
43
  it "is generated correctly" do
44
44
  expect(subject.notification_title)
45
- .to include("A <a href=\"#{emendation_path}\">new emendation</a> has been created by <a href=\"#{emendation_author_path}\">#{emendation_author_nickname}</a> for <a href=\"#{amendable_path}\">#{amendable_title}</a> #{amendable_type}.") # rubocop:disable Metrics/LineLength
45
+ .to include("A <a href=\"#{emendation_path}\">new amendment</a> has been created by <a href=\"#{emendation_author_path}\">#{emendation_author_nickname}</a> for <a href=\"#{amendable_path}\">#{amendable_title}</a> #{amendable_type}.") # rubocop:disable Metrics/LineLength
46
46
  end
47
47
  end
48
48
  end
@@ -16,14 +16,14 @@ shared_examples "amendment promoted event" do
16
16
 
17
17
  describe "email_subject" do
18
18
  it "is generated correctly" do
19
- expect(subject.email_subject).to eq("An emendation from #{emendation_author_nickname} has been promoted")
19
+ expect(subject.email_subject).to eq("An amendment from #{emendation_author_nickname} has been published as a new proposal")
20
20
  end
21
21
  end
22
22
 
23
23
  describe "email_intro" do
24
24
  it "is generated correctly" do
25
25
  expect(subject.email_intro)
26
- .to eq("An emendation rejected for #{amendable_title} has been promoted to an independent #{amendable_type}. You can see it from this page:")
26
+ .to eq("A rejected amendment for #{amendable_title} has been published as a new #{amendable_type}. You can see it from this page:")
27
27
  end
28
28
  end
29
29
 
@@ -37,7 +37,7 @@ shared_examples "amendment promoted event" do
37
37
  describe "notification_title" do
38
38
  it "is generated correctly" do
39
39
  expect(subject.notification_title)
40
- .to include("A <a href=\"#{emendation_path}\">rejected emendation</a> for <a href=\"#{amendable_path}\">#{amendable_title}</a> #{amendable_type} has been promoted by <a href=\"#{emendation_author_path}\">#{emendation_author_nickname}</a>.") # rubocop:disable Metrics/LineLength
40
+ .to include("A <a href=\"#{emendation_path}\">rejected amendment</a> for <a href=\"#{amendable_path}\">#{amendable_title}</a> #{amendable_type} has been published as a new proposal by <a href=\"#{emendation_author_path}\">#{emendation_author_nickname}</a>.") # rubocop:disable Metrics/LineLength
41
41
  end
42
42
  end
43
43
  end
@@ -16,14 +16,14 @@ shared_examples "amendment rejected event" do
16
16
 
17
17
  describe "email_subject" do
18
18
  it "is generated correctly" do
19
- expect(subject.email_subject).to eq("An amendment rejected for #{amendable_title} from #{emendation_author_nickname}")
19
+ expect(subject.email_subject).to eq("Amendment rejected for #{amendable_title} from #{emendation_author_nickname}")
20
20
  end
21
21
  end
22
22
 
23
23
  describe "email_intro" do
24
24
  it "is generated correctly" do
25
25
  expect(subject.email_intro)
26
- .to eq("An emendation has been rejected for #{amendable_title}. You can see it from this page:")
26
+ .to eq("An amendment has been rejected for #{amendable_title}. You can see it from this page:")
27
27
  end
28
28
  end
29
29
 
@@ -37,7 +37,7 @@ shared_examples "amendment rejected event" do
37
37
  describe "notification_title" do
38
38
  it "is generated correctly" do
39
39
  expect(subject.notification_title)
40
- .to include("The <a href=\"#{emendation_path}\">emendation</a> created by <a href=\"#{emendation_author_path}\">#{emendation_author_nickname}</a> has been rejected for <a href=\"#{amendable_path}\">#{amendable_title}</a> #{amendable_type}.") # rubocop:disable Metrics/LineLength
40
+ .to include("The <a href=\"#{emendation_path}\">amendment</a> created by <a href=\"#{emendation_author_path}\">#{emendation_author_nickname}</a> has been rejected for <a href=\"#{amendable_path}\">#{amendable_title}</a> #{amendable_type}.") # rubocop:disable Metrics/LineLength
41
41
  end
42
42
  end
43
43
  end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "spec_helper"
4
+
5
+ shared_examples "an uncommentable component" do
6
+ let!(:component) do
7
+ create(:component,
8
+ manifest: manifest,
9
+ participatory_space: participatory_space)
10
+ end
11
+
12
+ it "doesn't displays comments count" do
13
+ component.update!(settings: { comments_enabled: false })
14
+
15
+ visit_component
16
+
17
+ ressources.each do |ressource|
18
+ expect(page).not_to have_link(resource_locator(ressource).path)
19
+ end
20
+ end
21
+ end
@@ -4,7 +4,7 @@ module Decidim
4
4
  # This holds the decidim-core version.
5
5
  module Core
6
6
  def self.version
7
- "0.16.1"
7
+ "0.17.0"
8
8
  end
9
9
  end
10
10
  end
@@ -11,7 +11,7 @@ module Decidim
11
11
  #
12
12
  # user - The user of data portability to be zipped.
13
13
  # data - An array of all data to be zipped.
14
- # images - An array of image urls to be inclueded in the zipped file.
14
+ # images - An array of image files to be inclueded in the zipped file.
15
15
  def initialize(user, data, images, token = nil)
16
16
  super(user, token)
17
17
  @export_data = data
@@ -42,11 +42,20 @@ module Decidim
42
42
  next if image.file.nil?
43
43
  folder_name = image_block.first.parameterize
44
44
  uploader = Decidim::ApplicationUploader.new(image.model, image.mounted_as)
45
- uploader.cache!(File.open(image.file.file))
46
- uploader.retrieve_from_store!(image.file.filename)
45
+ if image.file.respond_to? :file
46
+ uploader.cache!(File.open(image.file.file))
47
+ uploader.retrieve_from_store!(image.file.filename)
48
+ else
49
+ my_uploader = image.mounted_as
50
+ element = image.model
51
+
52
+ element.send(my_uploader).cache_stored_file!
53
+ element.send(my_uploader).retrieve_from_cache!(element.send(my_uploader).cache_name)
54
+ end
47
55
  my_image_path = File.open(image.file.file)
48
56
  next unless File.exist?(my_image_path)
49
57
  zipfile.add("#{folder_name}/#{image.file.filename}", my_image_path)
58
+ CarrierWave.clean_cached_files!
50
59
  end
51
60
  end
52
61
  zipfile.close
@@ -279,10 +279,7 @@ module Decidim
279
279
  datepicker_format = ruby_format_to_datepicker(I18n.t("date.formats.decidim_short"))
280
280
  data[:"date-format"] = datepicker_format
281
281
 
282
- template = ""
283
- template += label(attribute, label_for(attribute) + required_for_attribute(attribute))
284
- template += @template.text_field(
285
- @object_name,
282
+ template = text_field(
286
283
  attribute,
287
284
  options.merge(data: data)
288
285
  )
@@ -300,10 +297,7 @@ module Decidim
300
297
  datepicker_format = ruby_format_to_datepicker(I18n.t("time.formats.decidim_short"))
301
298
  data[:"date-format"] = datepicker_format
302
299
 
303
- template = ""
304
- template += label(attribute, label_for(attribute) + required_for_attribute(attribute))
305
- template += @template.text_field(
306
- @object_name,
300
+ template = text_field(
307
301
  attribute,
308
302
  options.merge(data: data)
309
303
  )
@@ -354,7 +348,7 @@ module Decidim
354
348
 
355
349
  if object.errors[attribute].any?
356
350
  template += content_tag :p, class: "is-invalid-label" do
357
- safe_join object.errors[attribute], "<br/>"
351
+ safe_join object.errors[attribute], "<br/>".html_safe
358
352
  end
359
353
  end
360
354
 
@@ -0,0 +1,43 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "active_support/concern"
4
+
5
+ module Decidim
6
+ # A concern to include permission to a resource not related with components
7
+ # od a participatory space.
8
+ module HasResourcePermission
9
+ extend ActiveSupport::Concern
10
+
11
+ included do
12
+ # An association with the permissions settings for the resource
13
+ has_one :resource_permission, as: :resource, class_name: "Decidim::ResourcePermission"
14
+
15
+ delegate :resource_manifest, :resource_key, to: :class
16
+
17
+ alias_method :manifest, :resource_manifest
18
+
19
+ # Public: Whether the permissions for this object actions can be set at resource level.
20
+ def allow_resource_permissions?
21
+ false
22
+ end
23
+
24
+ # Public: Returns permissions for this object actions if they can be set at resource level.
25
+ def permissions
26
+ resource_permission&.permissions if allow_resource_permissions?
27
+ end
28
+ end
29
+
30
+ class_methods do
31
+ # Finds the resource manifest for the model.
32
+ #
33
+ # Returns a Decidim::ResourceManifest
34
+ def resource_manifest
35
+ Decidim.find_resource_manifest(self)
36
+ end
37
+
38
+ def resource_key
39
+ model_name.param_key
40
+ end
41
+ end
42
+ end
43
+ end
@@ -67,6 +67,10 @@ module Decidim
67
67
  @schema
68
68
  end
69
69
 
70
+ def required_attributes_for_authorization
71
+ attributes.select { |_, attribute| attribute.required_for_authorization? }
72
+ end
73
+
70
74
  # Semi-private: Attributes are an abstraction used by SettingsManifest
71
75
  # to encapsulate behavior related to each individual settings field. Shouldn't
72
76
  # be used from the outside.
@@ -87,6 +91,7 @@ module Decidim
87
91
  attribute :translated, Boolean, default: false
88
92
  attribute :editor, Boolean, default: false
89
93
  attribute :required, Boolean, default: true
94
+ attribute :required_for_authorization, Boolean, default: false
90
95
 
91
96
  validates :type, inclusion: { in: TYPES.keys }
92
97
 
@@ -11,6 +11,8 @@ module Decidim
11
11
  include Decidim::ActionAuthorizationHelper
12
12
  include Decidim::ReplaceButtonsHelper
13
13
 
14
+ delegate :current_organization, to: :controller
15
+
14
16
  def current_user
15
17
  context[:current_user]
16
18
  end
@@ -2,13 +2,13 @@
2
2
  * Catalan translation for foundation-datepicker, language file from bootstrap-datepicker
3
3
  * J. Garcia <jogaco.en@gmail.com>
4
4
  */
5
- ;(function($){
5
+ ; (function ($) {
6
6
  $.fn.fdatepicker.dates['ca'] = {
7
- days: ["Diumenge", "Dilluns", "Dimarts", "Dimecres", "Dijous", "Divendres", "Dissabte"],
8
- daysShort: ["Diu", "Dil", "Dmt", "Dmc", "Dij", "Div", "Dis"],
9
- daysMin: ["dg", "dl", "dt", "dc", "dj", "dv", "ds"],
10
- months: ["Gener", "Febrer", "Març", "Abril", "Maig", "Juny", "Juliol", "Agost", "Setembre", "Octubre", "Novembre", "Desembre"],
11
- monthsShort: ["Gen", "Feb", "Mar", "Abr", "Mai", "Jun", "Jul", "Ago", "Set", "Oct", "Nov", "Des"],
7
+ days: ["diumenge", "dilluns", "dimarts", "dimecres", "dijous", "divendres", "dissabte"],
8
+ daysShort: ["dg.", "dl.", "dt.", "dc.", "dj.", "dv.", "ds."],
9
+ daysMin: ["dg.", "dl.", "dt.", "dc.", "dj.", "dv.", "ds."],
10
+ months: ["gener", "febrer", "març", "abril", "maig", "juny", "juliol", "agost", "setembre", "octubre", "novembre", "desembre"],
11
+ monthsShort: ["gen.", "febr.", "març", "abr.", "maig", "juny", "jul.", "ag.", "set.", "oct.", "nov.", "des."],
12
12
  today: "Avui",
13
13
  clear: "Esborrar",
14
14
  weekStart: 1
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Czech translation for foundation-datepicker
3
+ * Matěj Koubík <matej@koubik.name>
4
+ */
5
+ ;(function($){
6
+ $.fn.fdatepicker.dates['cs'] = {
7
+ days: ["Neděle", "Pondělí", "Úterý", "Středa", "Čtvrtek", "Pátek", "Sobota", "Neděle"],
8
+ daysShort: ["Ne", "Po", "Út", "St", "Čt", "Pá", "So", "Ne"],
9
+ daysMin: ["N", "P", "Ú", "St", "Č", "P", "So", "N"],
10
+ months: ["Leden", "Únor", "Březen", "Duben", "Květen", "Červen", "Červenec", "Srpen", "Září", "Říjen", "Listopad", "Prosinec"],
11
+ monthsShort: ["Led", "Úno", "Bře", "Dub", "Kvě", "Čer", "Čnc", "Srp", "Zář", "Říj", "Lis", "Pro"],
12
+ today: "Dnes"
13
+ };
14
+ }(jQuery));
@@ -441,15 +441,7 @@
441
441
  else {
442
442
  date = this.isInput ? this.element.val() : this.element.data('date') || this.element.find('input').val();
443
443
  }
444
- if (date && date.length > this.formatText.length) {
445
- $(this.picker).addClass('is-invalid')
446
- $(this.element).addClass('is-invalid-input')
447
- return;
448
- } else {
449
- $(this.picker).removeClass('is-invalid')
450
- $(this.element).removeClass('is-invalid-input')
451
- }
452
-
444
+
453
445
  this.date = DPGlobal.parseDate(date, this.format, this.language);
454
446
 
455
447
  if (fromArgs) {
@@ -1430,4 +1422,4 @@
1430
1422
 
1431
1423
  $.fn.fdatepicker.DPGlobal = DPGlobal;
1432
1424
 
1433
- }(window.jQuery);
1425
+ }(window.jQuery);
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: decidim-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.16.1
4
+ version: 0.17.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josep Jaume Rey Peroy
@@ -130,14 +130,14 @@ dependencies:
130
130
  requirements:
131
131
  - - "~>"
132
132
  - !ruby/object:Gem::Version
133
- version: '4.6'
133
+ version: '4.3'
134
134
  type: :runtime
135
135
  prerelease: false
136
136
  version_requirements: !ruby/object:Gem::Requirement
137
137
  requirements:
138
138
  - - "~>"
139
139
  - !ruby/object:Gem::Version
140
- version: '4.6'
140
+ version: '4.3'
141
141
  - !ruby/object:Gem::Dependency
142
142
  name: devise-i18n
143
143
  requirement: !ruby/object:Gem::Requirement
@@ -732,28 +732,28 @@ dependencies:
732
732
  requirements:
733
733
  - - '='
734
734
  - !ruby/object:Gem::Version
735
- version: 0.16.1
735
+ version: 0.17.0
736
736
  type: :runtime
737
737
  prerelease: false
738
738
  version_requirements: !ruby/object:Gem::Requirement
739
739
  requirements:
740
740
  - - '='
741
741
  - !ruby/object:Gem::Version
742
- version: 0.16.1
742
+ version: 0.17.0
743
743
  - !ruby/object:Gem::Dependency
744
744
  name: decidim-dev
745
745
  requirement: !ruby/object:Gem::Requirement
746
746
  requirements:
747
747
  - - '='
748
748
  - !ruby/object:Gem::Version
749
- version: 0.16.1
749
+ version: 0.17.0
750
750
  type: :development
751
751
  prerelease: false
752
752
  version_requirements: !ruby/object:Gem::Requirement
753
753
  requirements:
754
754
  - - '='
755
755
  - !ruby/object:Gem::Version
756
- version: 0.16.1
756
+ version: 0.17.0
757
757
  description: Adds core features so other engines can hook into the framework.
758
758
  email:
759
759
  - josepjaume@gmail.com
@@ -795,6 +795,8 @@ files:
795
795
  - app/assets/javascripts/decidim/append_elements.js.es6
796
796
  - app/assets/javascripts/decidim/append_redirect_url_to_modals.js.es6
797
797
  - app/assets/javascripts/decidim/conferences.js.es6
798
+ - app/assets/javascripts/decidim/core/bundle.js
799
+ - app/assets/javascripts/decidim/core/bundle.js.map
798
800
  - app/assets/javascripts/decidim/data_picker.js.es6
799
801
  - app/assets/javascripts/decidim/editor.js.es6
800
802
  - app/assets/javascripts/decidim/filters.js.es6
@@ -1186,6 +1188,7 @@ files:
1186
1188
  - app/forms/decidim/user_interest_scope_form.rb
1187
1189
  - app/forms/decidim/user_interests_form.rb
1188
1190
  - app/forms/translatable_presence_validator.rb
1191
+ - app/frontend/entry.ts
1189
1192
  - app/helpers/decidim/action_authorization_helper.rb
1190
1193
  - app/helpers/decidim/amendments_helper.rb
1191
1194
  - app/helpers/decidim/application_helper.rb
@@ -1419,6 +1422,7 @@ files:
1419
1422
  - app/views/decidim/application/_document.html.erb
1420
1423
  - app/views/decidim/application/_documents.html.erb
1421
1424
  - app/views/decidim/application/_photos.html.erb
1425
+ - app/views/decidim/authorization_modals/_content.html.erb
1422
1426
  - app/views/decidim/authorization_modals/show.html.erb
1423
1427
  - app/views/decidim/cookie_policy/accept.js.erb
1424
1428
  - app/views/decidim/data_portability/export.html.erb
@@ -1544,6 +1548,7 @@ files:
1544
1548
  - app/views/layouts/decidim/_logo.html.erb
1545
1549
  - app/views/layouts/decidim/_mailer_logo.html.erb
1546
1550
  - app/views/layouts/decidim/_omnipresent_banner.html.erb
1551
+ - app/views/layouts/decidim/_organization_colors.html.erb
1547
1552
  - app/views/layouts/decidim/_social_media_links.html.erb
1548
1553
  - app/views/layouts/decidim/_topbar_search.html.erb
1549
1554
  - app/views/layouts/decidim/_user_menu.html.erb
@@ -1561,6 +1566,7 @@ files:
1561
1566
  - config/locales/ar-SA.yml
1562
1567
  - config/locales/ca.yml
1563
1568
  - config/locales/cs-CZ.yml
1569
+ - config/locales/cs.yml
1564
1570
  - config/locales/de.yml
1565
1571
  - config/locales/en.yml
1566
1572
  - config/locales/es-MX.yml
@@ -1568,6 +1574,7 @@ files:
1568
1574
  - config/locales/es.yml
1569
1575
  - config/locales/eu.yml
1570
1576
  - config/locales/fi-pl.yml
1577
+ - config/locales/fi-plain.yml
1571
1578
  - config/locales/fi.yml
1572
1579
  - config/locales/fr.yml
1573
1580
  - config/locales/gl.yml
@@ -1719,6 +1726,7 @@ files:
1719
1726
  - db/migrate/20181211090933_add_area_to_action_logs.rb
1720
1727
  - db/migrate/20181214101250_add_notification_types_to_users.rb
1721
1728
  - db/migrate/20181218171503_add_user_groups_switch_to_organizations.rb
1729
+ - db/migrate/20190220023422_add_colors_to_decidim_organization.rb
1722
1730
  - db/seeds.rb
1723
1731
  - db/seeds/homepage_image.jpg
1724
1732
  - lib/decidim/amendable.rb
@@ -1799,6 +1807,7 @@ files:
1799
1807
  - lib/decidim/core/test/shared_examples/scope_helper_examples.rb
1800
1808
  - lib/decidim/core/test/shared_examples/searchable_results_examples.rb
1801
1809
  - lib/decidim/core/test/shared_examples/simple_event.rb
1810
+ - lib/decidim/core/test/shared_examples/uncommentable_component_examples.rb
1802
1811
  - lib/decidim/core/test/shared_examples/user_localised_email_examples.rb
1803
1812
  - lib/decidim/core/version.rb
1804
1813
  - lib/decidim/data_portability.rb
@@ -1850,6 +1859,7 @@ files:
1850
1859
  - lib/decidim/has_component.rb
1851
1860
  - lib/decidim/has_private_users.rb
1852
1861
  - lib/decidim/has_reference.rb
1862
+ - lib/decidim/has_resource_permission.rb
1853
1863
  - lib/decidim/has_settings.rb
1854
1864
  - lib/decidim/hashtag.rb
1855
1865
  - lib/decidim/hashtaggable.rb
@@ -1895,6 +1905,7 @@ files:
1895
1905
  - vendor/assets/javascripts/appendAround.js
1896
1906
  - vendor/assets/javascripts/d3.js
1897
1907
  - vendor/assets/javascripts/datepicker-locales/foundation-datepicker.ca.js
1908
+ - vendor/assets/javascripts/datepicker-locales/foundation-datepicker.cs.js
1898
1909
  - vendor/assets/javascripts/datepicker-locales/foundation-datepicker.de.js
1899
1910
  - vendor/assets/javascripts/datepicker-locales/foundation-datepicker.es.js
1900
1911
  - vendor/assets/javascripts/datepicker-locales/foundation-datepicker.eu.js