decidim-anonymous_proposals 0.24.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE-AGPLv3.txt +661 -0
- data/README.md +55 -0
- data/Rakefile +9 -0
- data/app/assets/config/decidim_anonymous_proposals_manifest.js +0 -0
- data/app/assets/images/decidim/anonymous_proposals/icon.svg +1 -0
- data/app/commands/decidim/anonymous_proposals/create_proposal_command_overrides.rb +31 -0
- data/app/commands/decidim/anonymous_proposals/publish_proposal_command_overrides.rb +26 -0
- data/app/commands/decidim/anonymous_proposals/update_proposal_command_overrides.rb +32 -0
- data/app/controllers/decidim/anonymous_proposals/admin/application_controller.rb +12 -0
- data/app/controllers/decidim/anonymous_proposals/proposals_controller_additions.rb +24 -0
- data/app/controllers/decidim/anonymous_proposals/proposals_controller_overrides.rb +19 -0
- data/app/helpers/decidim/anonymous_proposals/application_helper.rb +10 -0
- data/app/models/concerns/decidim/anonymous_proposals/has_anonymous.rb +13 -0
- data/app/models/decidim/anonymous_proposals/application_record.rb +10 -0
- data/app/overrides/decidim/proposals/proposals/_wizard_header/contextual_info.html.erb.deface +4 -0
- data/app/overrides/decidim/proposals/proposals/index/contextual_info.html.erb.deface +2 -0
- data/app/overrides/decidim/proposals/proposals/index/new_anonymous_proposal.html.erb.deface +2 -0
- data/app/permissions/decidim/anonymous_proposals/permissions_overrides.rb +43 -0
- data/app/queries/decidim/anonymous_proposals/manageable_user_groups_overrides.rb +19 -0
- data/app/views/decidim/anonymous_proposals/shared/_anonymous_proposals_announcement.html.erb +10 -0
- data/app/views/decidim/anonymous_proposals/shared/_anonymous_proposals_new_announcement.html.erb +10 -0
- data/config/i18n-tasks.yml +10 -0
- data/config/locales/de.yml +30 -0
- data/config/locales/en.yml +31 -0
- data/config/locales/es.yml +30 -0
- data/config/locales/eu.yml +30 -0
- data/lib/decidim/anonymous_proposals/admin.rb +10 -0
- data/lib/decidim/anonymous_proposals/admin_engine.rb +27 -0
- data/lib/decidim/anonymous_proposals/engine.rb +62 -0
- data/lib/decidim/anonymous_proposals/test/factories.rb +13 -0
- data/lib/decidim/anonymous_proposals/version.rb +14 -0
- data/lib/decidim/anonymous_proposals.rb +11 -0
- data/lib/tasks/anonymous_proposals.rake +21 -0
- metadata +105 -0
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
namespace :decidim_anonymous_proposals do
|
4
|
+
desc "Create anonymous groups for organizations"
|
5
|
+
task :generate_anonymous_group, [:name, :nickname, :email, :organization_id] => :environment do |_, args|
|
6
|
+
organizations = args.organization_id.present? ? Decidim::Organization.where(id: args.organization_id) : Decidim::Organization.all
|
7
|
+
|
8
|
+
organizations.each do |organization|
|
9
|
+
if Decidim::UserGroup.where(organization: organization).anonymous.exists? && (update_args = args.to_h.slice(:name, :nickname, :email)).present?
|
10
|
+
Decidim::UserGroup.where(organization: organization).anonymous.first.update(update_args)
|
11
|
+
else
|
12
|
+
Decidim::UserGroup.where(organization: organization).create(
|
13
|
+
name: args.name || "Anonymous",
|
14
|
+
nickname: args.nickname || "anonymous",
|
15
|
+
email: args.email || "anonymous@example.org",
|
16
|
+
extended_data: { anonymous: true }
|
17
|
+
)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
metadata
ADDED
@@ -0,0 +1,105 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: decidim-anonymous_proposals
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.24.3
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Eduardo Martínez
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2021-11-24 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: decidim-core
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 0.24.3
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 0.24.3
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: deface
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.5'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.5'
|
41
|
+
description: Transform proposals component to allow not signed in users creation of
|
42
|
+
proposals.
|
43
|
+
email:
|
44
|
+
- entantoencuanto.rb@gmail.com
|
45
|
+
executables: []
|
46
|
+
extensions: []
|
47
|
+
extra_rdoc_files: []
|
48
|
+
files:
|
49
|
+
- LICENSE-AGPLv3.txt
|
50
|
+
- README.md
|
51
|
+
- Rakefile
|
52
|
+
- app/assets/config/decidim_anonymous_proposals_manifest.js
|
53
|
+
- app/assets/images/decidim/anonymous_proposals/icon.svg
|
54
|
+
- app/commands/decidim/anonymous_proposals/create_proposal_command_overrides.rb
|
55
|
+
- app/commands/decidim/anonymous_proposals/publish_proposal_command_overrides.rb
|
56
|
+
- app/commands/decidim/anonymous_proposals/update_proposal_command_overrides.rb
|
57
|
+
- app/controllers/decidim/anonymous_proposals/admin/application_controller.rb
|
58
|
+
- app/controllers/decidim/anonymous_proposals/proposals_controller_additions.rb
|
59
|
+
- app/controllers/decidim/anonymous_proposals/proposals_controller_overrides.rb
|
60
|
+
- app/helpers/decidim/anonymous_proposals/application_helper.rb
|
61
|
+
- app/models/concerns/decidim/anonymous_proposals/has_anonymous.rb
|
62
|
+
- app/models/decidim/anonymous_proposals/application_record.rb
|
63
|
+
- app/overrides/decidim/proposals/proposals/_wizard_header/contextual_info.html.erb.deface
|
64
|
+
- app/overrides/decidim/proposals/proposals/index/contextual_info.html.erb.deface
|
65
|
+
- app/overrides/decidim/proposals/proposals/index/new_anonymous_proposal.html.erb.deface
|
66
|
+
- app/permissions/decidim/anonymous_proposals/permissions_overrides.rb
|
67
|
+
- app/queries/decidim/anonymous_proposals/manageable_user_groups_overrides.rb
|
68
|
+
- app/views/decidim/anonymous_proposals/shared/_anonymous_proposals_announcement.html.erb
|
69
|
+
- app/views/decidim/anonymous_proposals/shared/_anonymous_proposals_new_announcement.html.erb
|
70
|
+
- config/i18n-tasks.yml
|
71
|
+
- config/locales/de.yml
|
72
|
+
- config/locales/en.yml
|
73
|
+
- config/locales/es.yml
|
74
|
+
- config/locales/eu.yml
|
75
|
+
- lib/decidim/anonymous_proposals.rb
|
76
|
+
- lib/decidim/anonymous_proposals/admin.rb
|
77
|
+
- lib/decidim/anonymous_proposals/admin_engine.rb
|
78
|
+
- lib/decidim/anonymous_proposals/engine.rb
|
79
|
+
- lib/decidim/anonymous_proposals/test/factories.rb
|
80
|
+
- lib/decidim/anonymous_proposals/version.rb
|
81
|
+
- lib/tasks/anonymous_proposals.rake
|
82
|
+
homepage: https://github.com/PopulateTools/decidim-module-anonymous_proposals
|
83
|
+
licenses:
|
84
|
+
- AGPL-3.0
|
85
|
+
metadata: {}
|
86
|
+
post_install_message:
|
87
|
+
rdoc_options: []
|
88
|
+
require_paths:
|
89
|
+
- lib
|
90
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
91
|
+
requirements:
|
92
|
+
- - ">="
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: '2.6'
|
95
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
96
|
+
requirements:
|
97
|
+
- - ">="
|
98
|
+
- !ruby/object:Gem::Version
|
99
|
+
version: '0'
|
100
|
+
requirements: []
|
101
|
+
rubygems_version: 3.1.2
|
102
|
+
signing_key:
|
103
|
+
specification_version: 4
|
104
|
+
summary: A decidim anonymous_proposals module
|
105
|
+
test_files: []
|