decidim-system 0.15.2 → 0.16.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-system might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9aefe648ca1aadc72b58ca371ca35ca84f0cfe7d8a94df357d1f2e02f454e205
4
- data.tar.gz: 2277de0cf16b81ad6506659b921246a2531063443100f5637cd810a327282596
3
+ metadata.gz: b9fa7037bf23a720929f90d8aa960090cedbd95b9fb48c675374d3ab02db61a1
4
+ data.tar.gz: fc83cba423d0f38aaa8d0ec69b81ba9928d49b6adfad7e60bc38d51107cbf5fc
5
5
  SHA512:
6
- metadata.gz: cae4ec4840fcb0810a95e5e8804f0f12fcb922e54037a8ba5fbb71d17e115274ae41ffbf8385a3cc98ecda5afb80f41ce7aa1c801b39fb8b0bd1a33ca9cc5b06
7
- data.tar.gz: 1f3816db13930592a7b95d97e75a0098e788cedc8c59a899f1cc37bf1c230e775f773235bc13be8727b5c899cc64c1c61252fd1bd170fe089120935308f593ce
6
+ metadata.gz: cab80db50a8a25145e7a78c86e84eaec14905eb537c507bbdde76636258cbfb3ef6aa856635afca5bc7c799b052d18300de444e1098a4b7560235eff8ac5fa16
7
+ data.tar.gz: c954c6f80af71861ba6529b387d3dd8ee72a2defa28584c0adee3c5a54ac455a24ca39efb301bed0295ab569cc92e5b5df1f1f547c39a66bb24b3b7552a8edcb
@@ -21,6 +21,7 @@ module Decidim
21
21
  Decidim::StaticPage.find_or_create_by!(organization: organization, slug: slug) do |page|
22
22
  page.title = localized_attribute(slug, :title)
23
23
  page.content = localized_attribute(slug, :content)
24
+ page.show_in_footer = true
24
25
  end
25
26
  end
26
27
  end
@@ -0,0 +1,57 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module System
5
+ # A command that will create default help pages for an organization.
6
+ class PopulateHelp < Rectify::Command
7
+ # Public: Initializes the command.
8
+ #
9
+ # organization - An organization
10
+ def initialize(organization)
11
+ @organization = organization
12
+ end
13
+
14
+ # Executes the command.
15
+ #
16
+ # Returns nothing.
17
+ def call
18
+ ActiveRecord::Base.transaction do
19
+ topic = Decidim::StaticPageTopic.create!(
20
+ title: multi_translation("decidim.help.main_topic.title", organization: @organization.name),
21
+ description: multi_translation("decidim.help.main_topic.description", organization: @organization.name),
22
+ organization: @organization,
23
+ weight: 0
24
+ )
25
+
26
+ Decidim::StaticPage.create!(
27
+ slug: "help",
28
+ title: multi_translation("decidim.help.main_topic.default_page.title", organization: @organization.name),
29
+ content: multi_translation("decidim.help.main_topic.default_page.content", organization: @organization.name),
30
+ topic: topic,
31
+ organization: @organization,
32
+ weight: 0
33
+ )
34
+
35
+ Decidim.participatory_space_manifests.each do |manifest|
36
+ scope = "decidim.help.participatory_spaces.#{manifest.name}"
37
+ next unless I18n.exists?(scope)
38
+
39
+ Decidim::StaticPage.create!(
40
+ title: multi_translation("#{scope}.title"),
41
+ content: multi_translation("#{scope}.page"),
42
+ slug: manifest.name,
43
+ topic: topic,
44
+ organization: @organization
45
+ )
46
+
47
+ ContextualHelpSection.set_content(@organization, manifest.name, multi_translation("#{scope}.contextual"))
48
+ end
49
+ end
50
+ end
51
+
52
+ def multi_translation(key, *arguments)
53
+ Decidim::TranslationsHelper.multi_translation(key, @organization.available_locales, *arguments)
54
+ end
55
+ end
56
+ end
57
+ end
@@ -27,6 +27,7 @@ module Decidim
27
27
  transaction do
28
28
  @organization = create_organization
29
29
  CreateDefaultPages.call(@organization)
30
+ PopulateHelp.call(@organization)
30
31
  CreateDefaultContentBlocks.call(@organization)
31
32
  invite_form = invite_user_form(@organization)
32
33
  return broadcast(:invalid) if invite_form.invalid?
@@ -50,8 +51,11 @@ module Decidim
50
51
  reference_prefix: form.reference_prefix,
51
52
  available_locales: form.available_locales,
52
53
  available_authorizations: form.clean_available_authorizations,
54
+ users_registration_mode: form.users_registration_mode,
53
55
  badges_enabled: true,
54
- default_locale: form.default_locale
56
+ user_groups_enabled: true,
57
+ default_locale: form.default_locale,
58
+ send_welcome_notification: true
55
59
  )
56
60
  end
57
61
 
@@ -45,6 +45,7 @@ module Decidim
45
45
  organization.host = form.host
46
46
  organization.secondary_hosts = form.clean_secondary_hosts
47
47
  organization.available_authorizations = form.clean_available_authorizations
48
+ organization.users_registration_mode = form.users_registration_mode
48
49
 
49
50
  organization.save!
50
51
  end
@@ -14,11 +14,13 @@ module Decidim
14
14
  attribute :available_locales, Array
15
15
  attribute :default_locale, String
16
16
  attribute :reference_prefix
17
+ attribute :users_registration_mode, String
17
18
 
18
- validates :organization_admin_email, :organization_admin_name, :name, :host, :reference_prefix, presence: true
19
+ validates :organization_admin_email, :organization_admin_name, :name, :host, :reference_prefix, :users_registration_mode, presence: true
19
20
  validates :available_locales, presence: true
20
21
  validates :default_locale, presence: true
21
22
  validates :default_locale, inclusion: { in: :available_locales }
23
+ validates :users_registration_mode, inclusion: { in: Decidim::Organization.users_registration_modes }
22
24
  end
23
25
  end
24
26
  end
@@ -15,10 +15,11 @@ module Decidim
15
15
  attribute :host, String
16
16
  attribute :secondary_hosts, String
17
17
  attribute :available_authorizations, Array[String]
18
+ attribute :users_registration_mode, String
18
19
 
19
- validates :name, presence: true
20
- validates :host, presence: true
20
+ validates :name, :host, :users_registration_mode, presence: true
21
21
  validate :validate_organization_uniqueness
22
+ validates :users_registration_mode, inclusion: { in: Decidim::Organization.users_registration_modes }
22
23
 
23
24
  def map_model(model)
24
25
  self.secondary_hosts = model.secondary_hosts.join("\n")
@@ -12,6 +12,14 @@
12
12
  <p class="help-text"><%= t(".secondary_hosts_hint") %></p>
13
13
  </div>
14
14
 
15
+ <div class="field">
16
+ <%= f.label :users_registration_mode %>
17
+ <%= f.collection_radio_buttons :users_registration_mode,
18
+ Decidim::Organization.users_registration_modes,
19
+ :first,
20
+ ->(mode) { t("decidim.system.organizations.users_registration_mode.#{mode.first}") } %>
21
+ </div>
22
+
15
23
  <div class="field">
16
24
  <%= f.label :available_authorizations %>
17
25
  <%= f.collection_check_boxes :available_authorizations, Decidim.authorization_workflows, :name, :description %>
@@ -53,6 +53,14 @@
53
53
  </div>
54
54
  <% end %>
55
55
 
56
+ <div class="field">
57
+ <%= f.label :users_registration_mode %>
58
+ <%= f.collection_radio_buttons :users_registration_mode,
59
+ Decidim::Organization.users_registration_modes,
60
+ :first,
61
+ ->(mode) { t("decidim.system.organizations.users_registration_mode.#{mode.first}") } %>
62
+ </div>
63
+
56
64
  <div class="field">
57
65
  <%= f.label :available_authorizations %>
58
66
  <%= f.collection_check_boxes :available_authorizations, Decidim.authorization_workflows, :name, :description %>
@@ -63,6 +63,10 @@ ca:
63
63
  update:
64
64
  error: S'ha produït un error en actualitzar aquesta organització.
65
65
  success: L'organització s'ha actualitzat correctament.
66
+ users_registration_mode:
67
+ disabled: Només es port accedir amb comptes externs
68
+ enabled: Permetre als usuaris registrar-se i iniciar sessió
69
+ existing: No permetre que els usuaris es registrin, però permetre que els usuaris existents iniciïn sessió
66
70
  shared:
67
71
  notices:
68
72
  no_organization_warning_html: Has de crear una organització per començar. Assegura't de llegir %{guide} abans.
@@ -63,6 +63,10 @@ de:
63
63
  update:
64
64
  error: Beim Aktualisieren dieser Organisation ist ein Fehler aufgetreten.
65
65
  success: Die Organisation wurde erfolgreich aktualisiert.
66
+ users_registration_mode:
67
+ disabled: Der Zugriff kann nur mit externen Konten erfolgen
68
+ enabled: Benutzern erlauben, sich zu registrieren und sich anzumelden
69
+ existing: Erlauben Sie Benutzern keine Registrierung, sondern erlauben Sie bestehenden Benutzern, sich anzumelden
66
70
  shared:
67
71
  notices:
68
72
  no_organization_warning_html: Sie müssen eine Organisation erstellen, um zu beginnen. Stellen Sie sicher, dass Sie %{guide} lesen, bevor Sie fortfahren.
@@ -63,6 +63,10 @@ en:
63
63
  update:
64
64
  error: There was an error when updating this organization.
65
65
  success: Organization updated successfully.
66
+ users_registration_mode:
67
+ disabled: Access only can be done with external accounts
68
+ enabled: Allow users to register and login
69
+ existing: Don't allow users to register, but allow existing users to login
66
70
  shared:
67
71
  notices:
68
72
  no_organization_warning_html: You must create an organization to get started. Make sure you read %{guide} before proceeding.
@@ -63,6 +63,10 @@ es-PY:
63
63
  update:
64
64
  error: Se ha producido un error al actualizar esta organización.
65
65
  success: Organización actualizada correctamente.
66
+ users_registration_mode:
67
+ disabled: El acceso solo se puede hacer con cuentas externas.
68
+ enabled: Permitir a los usuarios registrarse e iniciar sesión
69
+ existing: No permita que los usuarios se registren, pero permita que los usuarios existentes inicien sesión
66
70
  shared:
67
71
  notices:
68
72
  no_organization_warning_html: Debes crear una organización para comenzar. Asegúrate de leer %{guide} antes de continuar.
@@ -63,6 +63,10 @@ es:
63
63
  update:
64
64
  error: Se ha producido un error al actualizar esta organización.
65
65
  success: Organización actualizada correctamente.
66
+ users_registration_mode:
67
+ disabled: Solo se puede acceder desde cuentas externas
68
+ enabled: Permitir a los usuarios registrarse e iniciar sesión
69
+ existing: No permitir que los usuarios se registren, pero permitir que los usuarios existentes inicien sesión
66
70
  shared:
67
71
  notices:
68
72
  no_organization_warning_html: Debes crear una organización para comenzar. Asegúrate de leer %{guide} antes de continuar.
@@ -63,6 +63,10 @@ eu:
63
63
  update:
64
64
  error: Errorea gertatu da erakunde hau eguneratzean.
65
65
  success: Erakundea zuzen eguneratu da.
66
+ users_registration_mode:
67
+ disabled: Sarbidea soilik kanpoko kontuekin egin daiteke
68
+ enabled: Baimendu erabiltzaileei erregistratzea eta saioa hasteko
69
+ existing: Ez utzi erabiltzaileek erregistratu, baizik eta existitzen diren erabiltzaileei saioa hasteko
66
70
  shared:
67
71
  notices:
68
72
  no_organization_warning_html: Hasteko erakunde bat sortu behar duzu. Jarraitu aurretik ziurta zaitez %{guide} irakurri duzula.
@@ -63,6 +63,10 @@ fi-pl:
63
63
  update:
64
64
  error: Organisaation päivityksessä tapahtui virhe.
65
65
  success: Organisaatio päivitetty onnistuneesti.
66
+ users_registration_mode:
67
+ disabled: Pääsy alustalle ainoastaan ulkoisilla tileillä
68
+ enabled: Salli rekisteröityminen ja sisäänkirjautuminen käyttäjille
69
+ existing: Älä salli käyttäjien rekisteröitymistä, mutta salli olemassaolevien käyttäjien kirjautuminen
66
70
  shared:
67
71
  notices:
68
72
  no_organization_warning_html: Sinun on luotava organisaatio päästäksesi alkuun. Muista lukea %{guide} ennen jatkamista.
@@ -63,6 +63,10 @@ fi:
63
63
  update:
64
64
  error: Organisaation päivityksessä tapahtui virhe.
65
65
  success: Organisaatio päivitetty onnistuneesti.
66
+ users_registration_mode:
67
+ disabled: Pääsy alustalle ainoastaan ulkoisilla tileillä
68
+ enabled: Salli rekisteröityminen ja sisäänkirjautuminen käyttäjille
69
+ existing: Älä salli käyttäjien rekisteröitymistä, mutta salli olemassaolevien käyttäjien kirjautuminen
66
70
  shared:
67
71
  notices:
68
72
  no_organization_warning_html: Sinun on luotava organisaatio päästäksesi alkuun. Muista lukea %{guide} ennen jatkamista.
@@ -63,6 +63,10 @@ fr:
63
63
  update:
64
64
  error: Une erreur s'est produite lors de la mise à jour de cette organisation.
65
65
  success: Organisation mise à jour avec succès.
66
+ users_registration_mode:
67
+ disabled: L'accès n'est possible qu'avec des comptes externes
68
+ enabled: Autoriser les utilisateurs à s'inscrire et à se connecter
69
+ existing: Ne pas autoriser les utilisateurs à s'inscrire, mais autoriser les utilisateurs existants à se connecter
66
70
  shared:
67
71
  notices:
68
72
  no_organization_warning_html: Vous devez créer une organisation pour démarrer. Assurez-vous de lire %{guide} avant de continuer.
@@ -63,6 +63,10 @@ gl:
63
63
  update:
64
64
  error: Produciuse un erro ao actualizar esta organización.
65
65
  success: A organización actualizouse con éxito.
66
+ users_registration_mode:
67
+ disabled: O acceso só se pode facer con contas externas
68
+ enabled: Permitir aos usuarios rexistrarse e iniciar sesión
69
+ existing: Non permita que os usuarios se rexistren, pero permiten que os usuarios xa teñan acceso
66
70
  shared:
67
71
  notices:
68
72
  no_organization_warning_html: Debes crear unha organización para comezar. Asegúrate de ler %{guide} antes de continuar.
@@ -63,6 +63,10 @@ hu:
63
63
  update:
64
64
  error: Hiba történt a szervezet frissítése során.
65
65
  success: Szervezet frissítése sikeres.
66
+ users_registration_mode:
67
+ disabled: A hozzáférés csak külső fiókokkal végezhető el
68
+ enabled: Engedélyezze a felhasználók regisztrálását és bejelentkezését
69
+ existing: Ne engedélyezze a felhasználók regisztrációját, hanem engedélyezze a meglévő felhasználók számára a bejelentkezést
66
70
  shared:
67
71
  notices:
68
72
  no_organization_warning_html: 'A kezdéshez hozz létre egy szervezetet. Mielőtt folytatnád, olvasd el az útmutatót: %{guide}.'
@@ -63,6 +63,10 @@ it:
63
63
  update:
64
64
  error: C'è stato un errore durante l'aggiornamento di questa organizzazione.
65
65
  success: OK, l'Organizzazione è stata aggiornata.
66
+ users_registration_mode:
67
+ disabled: L'accesso può essere fatto solo con account esterni
68
+ enabled: Permetti agli utenti di registrarsi e accedere
69
+ existing: Non consentire agli utenti di registrarsi, ma consentire agli utenti esistenti di accedere
66
70
  shared:
67
71
  notices:
68
72
  no_organization_warning_html: È necessario creare un'organizzazione per iniziare. Assicurati di leggere %{guide} prima di procedere.
@@ -63,6 +63,10 @@ nl:
63
63
  update:
64
64
  error: Er is een fout opgetreden bij het bijwerken van deze organisatie.
65
65
  success: Organisatie is succesvol bijgewerkt.
66
+ users_registration_mode:
67
+ disabled: Alleen toegang is mogelijk met externe accounts
68
+ enabled: Sta gebruikers toe zich te registreren en in te loggen
69
+ existing: Sta niet toe dat gebruikers zich registreren, maar staan ​​bestaande gebruikers toe om in te loggen
66
70
  shared:
67
71
  notices:
68
72
  no_organization_warning_html: U moet een organisatie aanmaken om te beginnen. Zorg ervoor dat u %{guide} leest voordat u verder gaat.
@@ -63,6 +63,10 @@ pl:
63
63
  update:
64
64
  error: Podczas aktualizowania tej organizacji wystąpił błąd.
65
65
  success: Organizacja została zaktualizowana.
66
+ users_registration_mode:
67
+ disabled: Dostęp można uzyskać tylko za pomocą kont zewnętrznych
68
+ enabled: Zezwalaj użytkownikom na rejestrację i logowanie
69
+ existing: Nie zezwalaj użytkownikom na rejestrację, ale zezwalaj istniejącym użytkownikom na logowanie
66
70
  shared:
67
71
  notices:
68
72
  no_organization_warning_html: Aby rozpocząć, musisz utworzyć organizację. Przed kontynuowaniem przeczytaj, czy przeczytasz %{guide}.
@@ -63,6 +63,10 @@ pt-BR:
63
63
  update:
64
64
  error: Ocorreu um erro ao atualizar essa organização.
65
65
  success: Organização atualizada com sucesso.
66
+ users_registration_mode:
67
+ disabled: O acesso só pode ser feito com contas externas
68
+ enabled: Permitir que os usuários se registrem e efetuem login
69
+ existing: Não permitir que os usuários se registrem, mas permitir que usuários existentes façam login
66
70
  shared:
67
71
  notices:
68
72
  no_organization_warning_html: Você deve criar uma organização para começar. Certifique-se de ler %{guide} antes de prosseguir.
@@ -63,6 +63,10 @@ pt:
63
63
  update:
64
64
  error: Ocorreu um erro ao atualizar essa organização.
65
65
  success: Organização atualizada com sucesso.
66
+ users_registration_mode:
67
+ disabled: O acesso só pode ser feito com contas externas
68
+ enabled: Permitir que os usuários se registrem e efetuem login
69
+ existing: Não permitir que os usuários se registrem, mas permitir que usuários existentes façam login
66
70
  shared:
67
71
  notices:
68
72
  no_organization_warning_html: Você deve criar uma organização para começar. Certifique-se de ler %{guide} antes de prosseguir.
@@ -63,6 +63,10 @@ sv:
63
63
  update:
64
64
  error: Det uppstod ett fel vid uppdateringen av den här organisationen.
65
65
  success: Organisationen uppdaterades.
66
+ users_registration_mode:
67
+ disabled: Endast åtkomst kan göras med externa konton
68
+ enabled: Tillåt användare att registrera och logga in
69
+ existing: Låt inte användare registrera sig, men låta befintliga användare logga in
66
70
  shared:
67
71
  notices:
68
72
  no_organization_warning_html: Du måste skapa en organisation för att komma igång. Se till att du läser %{guide} innan du fortsätter.
@@ -10,5 +10,6 @@ if !Rails.env.production? || ENV["SEED"]
10
10
 
11
11
  Decidim::Organization.find_each do |organization|
12
12
  Decidim::System::CreateDefaultPages.call(organization)
13
+ Decidim::System::PopulateHelp.call(organization)
13
14
  end
14
15
  end
@@ -4,7 +4,7 @@ module Decidim
4
4
  # This holds the decidim-system version.
5
5
  module System
6
6
  def self.version
7
- "0.15.2"
7
+ "0.16.0"
8
8
  end
9
9
  end
10
10
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: decidim-system
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.2
4
+ version: 0.16.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josep Jaume Rey Peroy
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2019-01-08 00:00:00.000000000 Z
13
+ date: 2019-01-09 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: active_link_to
@@ -32,14 +32,14 @@ dependencies:
32
32
  requirements:
33
33
  - - '='
34
34
  - !ruby/object:Gem::Version
35
- version: 0.15.2
35
+ version: 0.16.0
36
36
  type: :runtime
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
40
  - - '='
41
41
  - !ruby/object:Gem::Version
42
- version: 0.15.2
42
+ version: 0.16.0
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: devise
45
45
  requirement: !ruby/object:Gem::Requirement
@@ -136,14 +136,14 @@ dependencies:
136
136
  requirements:
137
137
  - - '='
138
138
  - !ruby/object:Gem::Version
139
- version: 0.15.2
139
+ version: 0.16.0
140
140
  type: :development
141
141
  prerelease: false
142
142
  version_requirements: !ruby/object:Gem::Requirement
143
143
  requirements:
144
144
  - - '='
145
145
  - !ruby/object:Gem::Version
146
- version: 0.15.2
146
+ version: 0.16.0
147
147
  description: System administration to create new organization in an installation.
148
148
  email:
149
149
  - josepjaume@gmail.com
@@ -168,6 +168,7 @@ files:
168
168
  - app/commands/decidim/system/create_admin.rb
169
169
  - app/commands/decidim/system/create_default_content_blocks.rb
170
170
  - app/commands/decidim/system/create_default_pages.rb
171
+ - app/commands/decidim/system/populate_help.rb
171
172
  - app/commands/decidim/system/register_organization.rb
172
173
  - app/commands/decidim/system/update_admin.rb
173
174
  - app/commands/decidim/system/update_organization.rb
@@ -255,7 +256,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
255
256
  version: '0'
256
257
  requirements: []
257
258
  rubyforge_project:
258
- rubygems_version: 2.7.7
259
+ rubygems_version: 2.7.6
259
260
  signing_key:
260
261
  specification_version: 4
261
262
  summary: Decidim system administration