decidim-sortitions 0.23.3 → 0.24.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/models/decidim/sortitions/sortition.rb +0 -2
- data/app/queries/decidim/sortitions/admin/participatory_space_proposals.rb +1 -1
- data/app/views/decidim/sortitions/admin/sortitions/index.html.erb +5 -1
- data/app/views/decidim/sortitions/sortitions/_filters_small_view.html.erb +1 -1
- data/config/locales/ca.yml +2 -2
- data/config/locales/es.yml +1 -1
- data/config/locales/fi-plain.yml +1 -1
- data/config/locales/fi.yml +2 -2
- data/config/locales/is-IS.yml +4 -0
- data/config/locales/nl.yml +2 -2
- data/config/locales/pl.yml +3 -3
- data/config/locales/ru.yml +2 -2
- data/config/locales/uk.yml +2 -2
- data/lib/decidim/api/sortition_type.rb +29 -0
- data/lib/decidim/api/sortitions_type.rb +26 -0
- data/lib/decidim/sortitions.rb +1 -0
- data/lib/decidim/sortitions/api.rb +8 -0
- data/lib/decidim/sortitions/test/factories.rb +2 -2
- data/lib/decidim/sortitions/version.rb +1 -1
- metadata +17 -16
- data/app/types/decidim/sortitions/sortition_type.rb +0 -32
- data/app/types/decidim/sortitions/sortitions_type.rb +0 -32
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f43a4b7d47ec03462ea489ba092e189cb3f69cc1c346e9654f9fd2bd5fcccaf6
|
4
|
+
data.tar.gz: dc76a1377c798e1880be1be242b10f4af4739d64b9c1391cc160db0cce7dd7da
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9ab1c8845dbe0922886dbf4fe87a336effb73cdc1ba5960b9173433975417300a012c7062d706359e97642d7c08c219868bb894c09be1012f03751a6aa1394ca
|
7
|
+
data.tar.gz: c80f00226aca64b08fab59eef214722915dbd6e0d31521dbd52117f718b55ee7c7a45ed2cb0b467c2a77989d81c65f27f0545921c508a1348d29f6e8fd28bd7b
|
@@ -20,11 +20,9 @@ module Decidim
|
|
20
20
|
translatable_fields :title, :witnesses, :additional_info, :cancel_reason
|
21
21
|
|
22
22
|
belongs_to :decidim_proposals_component,
|
23
|
-
foreign_key: "decidim_proposals_component_id",
|
24
23
|
class_name: "Decidim::Component"
|
25
24
|
|
26
25
|
belongs_to :cancelled_by_user,
|
27
|
-
foreign_key: "cancelled_by_user_id",
|
28
26
|
class_name: "Decidim::User",
|
29
27
|
optional: true
|
30
28
|
|
@@ -42,7 +42,7 @@ module Decidim
|
|
42
42
|
.not_hidden
|
43
43
|
.where(component: sortition.decidim_proposals_component)
|
44
44
|
.where("decidim_proposals_proposals.created_at < ?", request_timestamp)
|
45
|
-
.where(
|
45
|
+
.where(decidim_categorizations: { decidim_category_id: category.id })
|
46
46
|
.order(id: :asc)
|
47
47
|
end
|
48
48
|
|
@@ -38,13 +38,17 @@
|
|
38
38
|
edit_sortition_path(sortition),
|
39
39
|
t("actions.edit", scope: "decidim.sortitions.admin"),
|
40
40
|
class: "action-icon--edit" %>
|
41
|
-
|
41
|
+
<% else %>
|
42
|
+
<span class="action-space icon"></span>
|
43
|
+
<% end %>
|
42
44
|
|
43
45
|
<% if allowed_to? :destroy, :sortition, sortition: sortition %>
|
44
46
|
<%= icon_link_to "circle-x",
|
45
47
|
confirm_destroy_sortition_path(sortition),
|
46
48
|
t("actions.destroy", scope: "decidim.sortitions.admin"),
|
47
49
|
class: "action-icon--remove" %>
|
50
|
+
<% else %>
|
51
|
+
<span class="action-space icon"></span>
|
48
52
|
<% end %>
|
49
53
|
</td>
|
50
54
|
</tr>
|
data/config/locales/ca.yml
CHANGED
@@ -140,8 +140,8 @@ ca:
|
|
140
140
|
sortition:
|
141
141
|
random_seed: Llavor aleatòria
|
142
142
|
selected_proposals:
|
143
|
-
one:
|
144
|
-
other:
|
143
|
+
one: proposta seleccionada
|
144
|
+
other: propostes seleccionades
|
145
145
|
view: Veure
|
146
146
|
sortition_author:
|
147
147
|
deleted: Participant eliminada
|
data/config/locales/es.yml
CHANGED
data/config/locales/fi-plain.yml
CHANGED
data/config/locales/fi.yml
CHANGED
@@ -34,10 +34,10 @@ fi:
|
|
34
34
|
pages:
|
35
35
|
home:
|
36
36
|
statistics:
|
37
|
-
sortitions_count:
|
37
|
+
sortitions_count: Satunnaistamiset
|
38
38
|
participatory_processes:
|
39
39
|
statistics:
|
40
|
-
sortitions_count:
|
40
|
+
sortitions_count: Satunnaistamiset
|
41
41
|
sortitions:
|
42
42
|
admin:
|
43
43
|
actions:
|
data/config/locales/is-IS.yml
CHANGED
@@ -22,6 +22,10 @@ is-IS:
|
|
22
22
|
email_outro: Þú hefur fengið þessa tilkynningu vegna þess að þú fylgist með "%{participatory_space_title}". Þú getur sleppt því frá fyrri tengilinn.
|
23
23
|
email_subject: Ný flokkun bætt við %{participatory_space_title}
|
24
24
|
notification_title: Flokkunin <a href="%{resource_path}">%{resource_title}</a> hefur verið bætt við %{participatory_space_title}
|
25
|
+
pages:
|
26
|
+
home:
|
27
|
+
statistics:
|
28
|
+
sortitions_count: Flokkanir
|
25
29
|
participatory_processes:
|
26
30
|
statistics:
|
27
31
|
sortitions_count: Flokkanir
|
data/config/locales/nl.yml
CHANGED
data/config/locales/pl.yml
CHANGED
@@ -36,10 +36,10 @@ pl:
|
|
36
36
|
pages:
|
37
37
|
home:
|
38
38
|
statistics:
|
39
|
-
sortitions_count:
|
39
|
+
sortitions_count: Wybory losowe
|
40
40
|
participatory_processes:
|
41
41
|
statistics:
|
42
|
-
sortitions_count:
|
42
|
+
sortitions_count: Wybory losowe
|
43
43
|
sortitions:
|
44
44
|
admin:
|
45
45
|
actions:
|
@@ -114,7 +114,7 @@ pl:
|
|
114
114
|
search: Szukaj
|
115
115
|
state: Status
|
116
116
|
filters_small_view:
|
117
|
-
close_modal: Zamknij
|
117
|
+
close_modal: Zamknij okno
|
118
118
|
filter: Filtr
|
119
119
|
filter_by: Filtruj według
|
120
120
|
unfold: Rozwiń
|
data/config/locales/ru.yml
CHANGED
data/config/locales/uk.yml
CHANGED
@@ -35,10 +35,10 @@ uk:
|
|
35
35
|
pages:
|
36
36
|
home:
|
37
37
|
statistics:
|
38
|
-
sortitions_count:
|
38
|
+
sortitions_count: Жеребкування
|
39
39
|
participatory_processes:
|
40
40
|
statistics:
|
41
|
-
sortitions_count:
|
41
|
+
sortitions_count: Жеребкування
|
42
42
|
sortitions:
|
43
43
|
admin:
|
44
44
|
actions:
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Sortitions
|
5
|
+
class SortitionType < Decidim::Api::Types::BaseObject
|
6
|
+
implements Decidim::Core::AuthorableInterface
|
7
|
+
implements Decidim::Comments::CommentableInterface
|
8
|
+
implements Decidim::Core::CategorizableInterface
|
9
|
+
|
10
|
+
description "A sortition"
|
11
|
+
|
12
|
+
field :id, GraphQL::Types::ID, "The internal ID for this sortition", null: false
|
13
|
+
field :dice, GraphQL::Types::Int, "The dice for this sortition", null: true
|
14
|
+
field :target_items, GraphQL::Types::Int, "The target items for this sortition", null: true
|
15
|
+
field :request_timestamp, Decidim::Core::DateType, "The request time stamp for this request", null: true
|
16
|
+
field :selected_proposals, [GraphQL::Types::Int, { null: true }], "The selected proposals for this sortition", null: true
|
17
|
+
field :created_at, Decidim::Core::DateTimeType, "When this sortition was created", null: true
|
18
|
+
field :updated_at, Decidim::Core::DateTimeType, "When this sortition was updated", null: true
|
19
|
+
field :witnesses, Decidim::Core::TranslatedFieldType, "The witnesses for this sortition", null: true
|
20
|
+
field :additional_info, Decidim::Core::TranslatedFieldType, "The additional info for this sortition", null: true
|
21
|
+
field :reference, GraphQL::Types::String, "The reference for this sortition", null: true
|
22
|
+
field :title, Decidim::Core::TranslatedFieldType, "The title for this sortition", null: true
|
23
|
+
field :cancel_reason, Decidim::Core::TranslatedFieldType, "The cancel reason for this sortition", null: true
|
24
|
+
field :cancelled_on, Decidim::Core::DateType, "When this sortition was cancelled", null: true
|
25
|
+
field :cancelled_by_user, Decidim::Core::UserType, "Who cancelled this sortition", null: true
|
26
|
+
field :candidate_proposals, [GraphQL::Types::Int, { null: true }], "The candidate proposal for this sortition", null: true
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Sortitions
|
5
|
+
class SortitionsType < Decidim::Api::Types::BaseObject
|
6
|
+
implements Decidim::Core::ComponentInterface
|
7
|
+
|
8
|
+
graphql_name "Sortitions"
|
9
|
+
description "A sortition component of a participatory space."
|
10
|
+
|
11
|
+
field :sortitions, Decidim::Sortitions::SortitionType.connection_type, null: true, connection: true
|
12
|
+
|
13
|
+
def sortitions
|
14
|
+
Sortition.where(component: object).includes(:component)
|
15
|
+
end
|
16
|
+
|
17
|
+
field :sortition, Decidim::Sortitions::SortitionType, null: true do
|
18
|
+
argument :id, GraphQL::Types::ID, required: true
|
19
|
+
end
|
20
|
+
|
21
|
+
def sortition(**args)
|
22
|
+
Sortition.where(component: object).find_by(id: args[:id])
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
data/lib/decidim/sortitions.rb
CHANGED
@@ -20,8 +20,8 @@ FactoryBot.define do
|
|
20
20
|
create(:user, :admin, organization: component.organization) if component
|
21
21
|
end
|
22
22
|
|
23
|
-
dice { Faker::Number.between(1, 6).to_i }
|
24
|
-
target_items { Faker::Number.between(1, 5).to_i }
|
23
|
+
dice { Faker::Number.between(from: 1, to: 6).to_i }
|
24
|
+
target_items { Faker::Number.between(from: 1, to: 5).to_i }
|
25
25
|
request_timestamp { Time.now.utc }
|
26
26
|
witnesses { Decidim::Faker::Localized.wrapped("<p>", "</p>") { generate_localized_title } }
|
27
27
|
additional_info { Decidim::Faker::Localized.wrapped("<p>", "</p>") { generate_localized_title } }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: decidim-sortitions
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.24.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Juan Salvador Perez Garcia
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-04-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: decidim-admin
|
@@ -16,70 +16,70 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 0.24.1
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.
|
26
|
+
version: 0.24.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: decidim-comments
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - '='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.
|
33
|
+
version: 0.24.1
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - '='
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.
|
40
|
+
version: 0.24.1
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: decidim-core
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - '='
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0.
|
47
|
+
version: 0.24.1
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - '='
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0.
|
54
|
+
version: 0.24.1
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: decidim-proposals
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - '='
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 0.
|
61
|
+
version: 0.24.1
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - '='
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 0.
|
68
|
+
version: 0.24.1
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: decidim-dev
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - '='
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 0.
|
75
|
+
version: 0.24.1
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - '='
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 0.
|
82
|
+
version: 0.24.1
|
83
83
|
description: This module makes possible to select amont a set of proposal by sortition
|
84
84
|
email:
|
85
85
|
- jsperezg@gmail.com
|
@@ -121,8 +121,6 @@ files:
|
|
121
121
|
- app/queries/decidim/sortitions/filtered_sortitions.rb
|
122
122
|
- app/services/decidim/sortitions/admin/draw.rb
|
123
123
|
- app/services/decidim/sortitions/sortition_search.rb
|
124
|
-
- app/types/decidim/sortitions/sortition_type.rb
|
125
|
-
- app/types/decidim/sortitions/sortitions_type.rb
|
126
124
|
- app/views/decidim/sortitions/admin/sortitions/_form.html.erb
|
127
125
|
- app/views/decidim/sortitions/admin/sortitions/confirm_destroy.html.erb
|
128
126
|
- app/views/decidim/sortitions/admin/sortitions/edit.html.erb
|
@@ -230,9 +228,12 @@ files:
|
|
230
228
|
- db/migrate/20181017110803_make_sortitions_authors_polymorphic.rb
|
231
229
|
- db/migrate/20200320105926_index_foreign_keys_in_decidim_sortitions_sortitions.rb
|
232
230
|
- db/migrate/20200827154036_add_commentable_counter_cache_to_sortitions.rb
|
231
|
+
- lib/decidim/api/sortition_type.rb
|
232
|
+
- lib/decidim/api/sortitions_type.rb
|
233
233
|
- lib/decidim/sortitions.rb
|
234
234
|
- lib/decidim/sortitions/admin.rb
|
235
235
|
- lib/decidim/sortitions/admin_engine.rb
|
236
|
+
- lib/decidim/sortitions/api.rb
|
236
237
|
- lib/decidim/sortitions/component.rb
|
237
238
|
- lib/decidim/sortitions/engine.rb
|
238
239
|
- lib/decidim/sortitions/test/factories.rb
|
@@ -249,14 +250,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
249
250
|
requirements:
|
250
251
|
- - ">="
|
251
252
|
- !ruby/object:Gem::Version
|
252
|
-
version: '2.
|
253
|
+
version: '2.7'
|
253
254
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
254
255
|
requirements:
|
255
256
|
- - ">="
|
256
257
|
- !ruby/object:Gem::Version
|
257
258
|
version: '0'
|
258
259
|
requirements: []
|
259
|
-
rubygems_version: 3.
|
260
|
+
rubygems_version: 3.1.2
|
260
261
|
signing_key:
|
261
262
|
specification_version: 4
|
262
263
|
summary: Decidim sortitions module
|
@@ -1,32 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Decidim
|
4
|
-
module Sortitions
|
5
|
-
SortitionType = GraphQL::ObjectType.define do
|
6
|
-
interfaces [
|
7
|
-
-> { Decidim::Core::AuthorableInterface },
|
8
|
-
-> { Decidim::Comments::CommentableInterface },
|
9
|
-
-> { Decidim::Core::CategorizableInterface }
|
10
|
-
]
|
11
|
-
|
12
|
-
name "Sortition"
|
13
|
-
description "A sortition"
|
14
|
-
|
15
|
-
field :id, !types.ID, "The internal ID for this sortition"
|
16
|
-
field :dice, types.Int, "The dice for this sortition"
|
17
|
-
field :targetItems, types.Int, "The target items for this sortition", property: :target_items
|
18
|
-
field :requestTimestamp, Decidim::Core::DateType, "The request time stamp for this request", property: :request_timestamp
|
19
|
-
field :selectedProposals, types[types.Int], "The selected proposals for this sortition", property: :selected_proposals
|
20
|
-
field :createdAt, Decidim::Core::DateTimeType, "When this sortition was created", property: :created_at
|
21
|
-
field :updatedAt, Decidim::Core::DateTimeType, "When this sortition was updated", property: :updated_at
|
22
|
-
field :witnesses, Decidim::Core::TranslatedFieldType, "The witnesses for this sortition"
|
23
|
-
field :additionalInfo, Decidim::Core::TranslatedFieldType, "The additional info for this sortition", property: :additional_info
|
24
|
-
field :reference, types.String, "The reference for this sortition"
|
25
|
-
field :title, Decidim::Core::TranslatedFieldType, "The title for this sortition"
|
26
|
-
field :cancelReason, Decidim::Core::TranslatedFieldType, "The cancel reason for this sortition", property: :cancel_reason
|
27
|
-
field :cancelledOn, Decidim::Core::DateType, "When this sortition was cancelled", property: :cancelled_on
|
28
|
-
field :cancelledByUser, Decidim::Core::UserType, "Who cancelled this sortition", property: :cancelled_by_user
|
29
|
-
field :candidateProposals, Decidim::Core::TranslatedFieldType, "The candidate proposal for this sortition", property: :candidate_proposals
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
@@ -1,32 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Decidim
|
4
|
-
module Sortitions
|
5
|
-
SortitionsType = GraphQL::ObjectType.define do
|
6
|
-
interfaces [-> { Decidim::Core::ComponentInterface }]
|
7
|
-
|
8
|
-
name "Sortitions"
|
9
|
-
description "A sortition component of a participatory space."
|
10
|
-
|
11
|
-
connection :sortitions, SortitionType.connection_type do
|
12
|
-
resolve ->(component, _args, _ctx) {
|
13
|
-
SortitionTypeHelper.base_scope(component).includes(:component)
|
14
|
-
}
|
15
|
-
end
|
16
|
-
|
17
|
-
field(:sortition, SortitionType) do
|
18
|
-
argument :id, !types.ID
|
19
|
-
|
20
|
-
resolve ->(component, args, _ctx) {
|
21
|
-
SortitionTypeHelper.base_scope(component).find_by(id: args[:id])
|
22
|
-
}
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
module SortitionTypeHelper
|
27
|
-
def self.base_scope(component)
|
28
|
-
Sortition.where(component: component)
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|