decidim-sortitions 0.29.2 → 0.30.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. checksums.yaml +4 -4
  2. data/app/commands/decidim/sortitions/admin/create_sortition.rb +2 -6
  3. data/app/controllers/decidim/sortitions/sortitions_controller.rb +2 -2
  4. data/app/forms/decidim/sortitions/admin/sortition_form.rb +6 -3
  5. data/app/helpers/decidim/sortitions/admin/sortitions_helper.rb +5 -3
  6. data/app/helpers/decidim/sortitions/sortitions_helper.rb +18 -20
  7. data/app/models/decidim/sortitions/sortition.rb +14 -2
  8. data/app/queries/decidim/sortitions/admin/participatory_space_proposals.rb +6 -9
  9. data/app/queries/decidim/sortitions/filtered_sortitions.rb +2 -2
  10. data/app/views/decidim/sortitions/admin/sortitions/_form.html.erb +19 -4
  11. data/app/views/decidim/sortitions/admin/sortitions/show.html.erb +2 -2
  12. data/app/views/decidim/sortitions/sortitions/index.html.erb +8 -1
  13. data/app/views/decidim/sortitions/sortitions/show.html.erb +10 -9
  14. data/config/locales/ar.yml +0 -6
  15. data/config/locales/bg.yml +0 -6
  16. data/config/locales/ca.yml +11 -6
  17. data/config/locales/cs.yml +11 -6
  18. data/config/locales/de.yml +0 -6
  19. data/config/locales/el.yml +0 -6
  20. data/config/locales/en.yml +11 -6
  21. data/config/locales/es-MX.yml +11 -6
  22. data/config/locales/es-PY.yml +11 -6
  23. data/config/locales/es.yml +11 -6
  24. data/config/locales/eu.yml +11 -6
  25. data/config/locales/fi-plain.yml +0 -6
  26. data/config/locales/fi.yml +0 -6
  27. data/config/locales/fr-CA.yml +3 -6
  28. data/config/locales/fr.yml +3 -6
  29. data/config/locales/ga-IE.yml +0 -1
  30. data/config/locales/gl.yml +0 -6
  31. data/config/locales/hu.yml +0 -6
  32. data/config/locales/id-ID.yml +0 -6
  33. data/config/locales/is-IS.yml +0 -6
  34. data/config/locales/it.yml +0 -6
  35. data/config/locales/ja.yml +0 -6
  36. data/config/locales/lt.yml +0 -6
  37. data/config/locales/lv.yml +0 -6
  38. data/config/locales/nl.yml +0 -6
  39. data/config/locales/no.yml +0 -6
  40. data/config/locales/pl.yml +0 -6
  41. data/config/locales/pt-BR.yml +0 -6
  42. data/config/locales/pt.yml +0 -6
  43. data/config/locales/ro-RO.yml +10 -6
  44. data/config/locales/ru.yml +0 -6
  45. data/config/locales/sk.yml +0 -6
  46. data/config/locales/sv.yml +0 -6
  47. data/config/locales/tr-TR.yml +0 -6
  48. data/config/locales/uk.yml +0 -6
  49. data/config/locales/zh-CN.yml +0 -6
  50. data/config/locales/zh-TW.yml +0 -6
  51. data/db/migrate/20240828103823_add_deleted_at_to_decidim_sortitions_sortitions.rb +8 -0
  52. data/decidim-sortitions.gemspec +1 -1
  53. data/lib/decidim/api/sortition_type.rb +11 -12
  54. data/lib/decidim/api/sortitions_type.rb +4 -5
  55. data/lib/decidim/sortitions/component.rb +1 -0
  56. data/lib/decidim/sortitions/version.rb +1 -1
  57. metadata +19 -19
  58. data/app/views/decidim/sortitions/sortitions/_tags.html.erb +0 -15
@@ -4,7 +4,6 @@ uk:
4
4
  attributes:
5
5
  sortition:
6
6
  additional_info: Жеребкування відомостей
7
- decidim_category_id: Категорії підбірки пропозицій, серед яких ви хочете провести жеребкування
8
7
  decidim_proposals_component_id: Набір пропозицій
9
8
  dice: Вислід жеребкування. У присутності свідків киньте шостигранну гральну кістку, або знайдіть якийсь інший спосіб одержати випадкове число від 1 до 6, і введіть тут. Це сприяє якості та гарантує випадковість висліду
10
9
  target_items: Кількість пропозицій, що підлягають відбору (вказує кількість пропозицій, які потрібно обрати, кинувши жереб по тій сукупності пропозицій, яку ви обрали раніше)
@@ -42,7 +41,6 @@ uk:
42
41
  models:
43
42
  sortition:
44
43
  fields:
45
- category: Категорія
46
44
  created_at: Дата створення
47
45
  decidim_proposals_component: Складова пропозицій
48
46
  dice: Гральна кістка
@@ -62,7 +60,6 @@ uk:
62
60
  title: Оновити відомості про жеребкування
63
61
  update: Оновити
64
62
  form:
65
- all_categories: Усі категорії
66
63
  select_proposal_component: Оберіть набір пропозицій
67
64
  index:
68
65
  title: Жеребкування
@@ -105,11 +102,8 @@ uk:
105
102
  other: вибраних пропозицій
106
103
  show:
107
104
  algorithm: Код алгоритму жеребкування
108
- any_category: з усіх категорій
109
105
  cancelled: Скасоване жеребкування
110
106
  candidate_proposal_ids: Порядок та назви жеребкованих пропозицій
111
- candidate_proposals_info: 'Жеребкування було проведено серед пропозицій (%{category_label}), з наступними назвами (напівжирним шрифтом виділені обрані пропозиції) '
112
- category: з категорії %{category}
113
107
  dice_result: (1) Вислід кидання гральної кістки
114
108
  introduction: 'На цій сторінці показані висліди жеребкування %{reference}. За допомогою цього жеребкування було обрано випадковим чином %{target_items} пропозицій з рівним розподілом імовірності з числа пропозицій, перелічених нижче. Разом з вислідами, відомості, які відображені на цій сторінці, містять все, що необхідно для щонайбільших гарантій та для відтворення вислідів. Ключ до якості цього жеребкування - це подвійна випадковість, забезпечена шляхом кидання гральної кістки (засвідченого свідками) і точного часу жеребкування, введеного до алгоритму, який виробляє випадкову добірку. Задіяний як початкове число час жеребкування настільки точний (секунди), що люди нездатні його контролювати. Таким чином завдяки подвійним "неконтрольованим" входовим даним забезпечується справедливий вислід. '
115
109
  mathematical_result: Добуток (1) x (2)
@@ -4,7 +4,6 @@ zh-CN:
4
4
  attributes:
5
5
  sortition:
6
6
  additional_info: 排序信息
7
- decidim_category_id: 您想要应用绘图的一组建议的类别
8
7
  decidim_proposals_component_id: 提案集
9
8
  dice: 死亡登记的结果。 旋转一个6边的死亡或寻找另一个随机的方法生成一个从1到6之间的数字。 然后在这里当着一些证人的面输入由此产生的号码。 这有助于提高结果的质量并保证结果的随机性
10
9
  target_items: 要选择的建议数量 (表示您想要选择的建议的数量,您先前选择的建议群组)
@@ -40,7 +39,6 @@ zh-CN:
40
39
  models:
41
40
  sortition:
42
41
  fields:
43
- category: 类别
44
42
  created_at: 创建日期
45
43
  decidim_proposals_component: 二. 提议的构成部分
46
44
  dice: 爱好
@@ -60,7 +58,6 @@ zh-CN:
60
58
  title: 更新有关分类的信息
61
59
  update: 更新
62
60
  form:
63
- all_categories: 所有类别
64
61
  select_proposal_component: 选择提案集
65
62
  index:
66
63
  title: 联谊会
@@ -97,11 +94,8 @@ zh-CN:
97
94
  other: 选定的建议
98
95
  show:
99
96
  algorithm: 排序算法
100
- any_category: 来自所有类别
101
97
  cancelled: 取消排序方式
102
98
  candidate_proposal_ids: 排序建议订单和 ID
103
- candidate_proposals_info: '排序是在下列建议中进行的 (%{category_label}),具有以下ID(以选定建议的黑体字) '
104
- category: 来自 %{category} 类别
105
99
  dice_result: (1) 致残结果
106
100
  introduction: '此页面包含排序 %{reference}的结果。 通过这种道歉, 已经随机选择了 %{target_items} 个结果,并且显示在下面的一组建议中同样的概率分布。 本页所显示的信息连同结果,提供了最大限度保证和复制结果所需的所有信息。 这种区分的质量的关键是由证人核实的法官滚动所提供的双倍随机性和为产生随机选择的算法提供输入的吸附确切时间。 难度的时间种子非常精确(秒),人类无法控制,因此提供了双个“无法控制的”输入以保证结果的公允。 '
107
101
  mathematical_result: 结果(1) x (2)
@@ -4,7 +4,6 @@ zh-TW:
4
4
  attributes:
5
5
  sortition:
6
6
  additional_info: 隨機抽籤資訊
7
- decidim_category_id: 你想要在哪些提案類別中進行抽籤
8
7
  decidim_proposals_component_id: 提案集合
9
8
  dice: 擲骰子的結果。擲一顆六面骰子,或尋找其他隨機產生1到6之間的數字的方法,然後在一些證人面前輸入結果的數字。這有助於確保結果的品質和隨機性的保證。
10
9
  target_items: 被選出提案的數量(表示您希望在您之前選擇的提案組中通過抽籤選出的提案數量)
@@ -42,7 +41,6 @@ zh-TW:
42
41
  models:
43
42
  sortition:
44
43
  fields:
45
- category: 類別
46
44
  created_at: 創建日期
47
45
  decidim_proposals_component: 提案組成
48
46
  dice: 骰子
@@ -66,7 +64,6 @@ zh-TW:
66
64
  title: 更新抽籤資訊
67
65
  update: 更新
68
66
  form:
69
- all_categories: 所有類別
70
67
  select_proposal_component: 選擇提案集
71
68
  index:
72
69
  title: 抽籤
@@ -105,11 +102,8 @@ zh-TW:
105
102
  other: 選擇的提案
106
103
  show:
107
104
  algorithm: 抽籤排序算法
108
- any_category: 從所有類別中
109
105
  cancelled: 取消的抽籤
110
106
  candidate_proposal_ids: 隨機抽籤提案的順序和 ID
111
- candidate_proposals_info: '該抽籤是在以下提案中進行的 (%{category_label}),以下是這些提案的 ID (選中的提案以粗體標出) '
112
- category: 來自 %{category} 類別
113
107
  dice_result: (1) 骰子結果
114
108
  introduction: '本頁面包含了抽籤 %{reference} 的結果。透過這個抽籤,從下面顯示的提案集合中隨機且以等機率隨機選出了 %{target_items} 個結果。除了顯示的結果外,此頁面的資訊提供了最大化保證並重現結果所需的所有資訊。此抽籤質量的關鍵在於雙重隨機性,一方面是由證人驗證的擲骰子結果,另一方面是精確的抽籤時間提供的算法輸入以產生隨機選擇。抽籤的時間種子如此精確(秒級),以至於人類無法控制,從而提供雙重「不可控制」輸入,以保證公平結果。 '
115
109
  mathematical_result: 結果 (1) x (2)
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ class AddDeletedAtToDecidimSortitionsSortitions < ActiveRecord::Migration[7.0]
4
+ def change
5
+ add_column :decidim_sortitions_sortitions, :deleted_at, :datetime
6
+ add_index :decidim_sortitions_sortitions, :deleted_at
7
+ end
8
+ end
@@ -17,7 +17,7 @@ Gem::Specification.new do |s|
17
17
  "homepage_uri" => "https://decidim.org",
18
18
  "source_code_uri" => "https://github.com/decidim/decidim"
19
19
  }
20
- s.required_ruby_version = "~> 3.2.0"
20
+ s.required_ruby_version = "~> 3.3.0"
21
21
 
22
22
  s.name = "decidim-sortitions"
23
23
  s.summary = "Decidim sortitions module"
@@ -5,25 +5,24 @@ module Decidim
5
5
  class SortitionType < Decidim::Api::Types::BaseObject
6
6
  implements Decidim::Core::AuthorableInterface
7
7
  implements Decidim::Comments::CommentableInterface
8
- implements Decidim::Core::CategorizableInterface
8
+ implements Decidim::Core::TaxonomizableInterface
9
+ implements Decidim::Core::TimestampsInterface
9
10
 
10
11
  description "A sortition"
11
12
 
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
13
  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
14
  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
15
  field :cancelled_by_user, Decidim::Core::UserType, "Who cancelled this sortition", null: true
16
+ field :cancelled_on, Decidim::Core::DateType, "When this sortition was cancelled", null: true
26
17
  field :candidate_proposals, [GraphQL::Types::Int, { null: true }], "The candidate proposal for this sortition", null: true
18
+ field :dice, GraphQL::Types::Int, "The dice for this sortition", null: true
19
+ field :id, GraphQL::Types::ID, "The internal ID for this sortition", null: false
20
+ field :reference, GraphQL::Types::String, "The reference for this sortition", null: true
21
+ field :request_timestamp, Decidim::Core::DateType, "The request time stamp for this request", null: true
22
+ field :selected_proposals, [GraphQL::Types::Int, { null: true }], "The selected proposals for this sortition", null: true
23
+ field :target_items, GraphQL::Types::Int, "The target items for this sortition", null: true
24
+ field :title, Decidim::Core::TranslatedFieldType, "The title for this sortition", null: true
25
+ field :witnesses, Decidim::Core::TranslatedFieldType, "The witnesses for this sortition", null: true
27
26
 
28
27
  def self.authorized?(object, context)
29
28
  context[:sortition] = object
@@ -6,16 +6,15 @@ module Decidim
6
6
  graphql_name "Sortitions"
7
7
  description "A sortition component of a participatory space."
8
8
 
9
- field :sortitions, Decidim::Sortitions::SortitionType.connection_type, null: true, connection: true
9
+ field :sortition, Decidim::Sortitions::SortitionType, "A single Sortition object", null: true do
10
+ argument :id, GraphQL::Types::ID, "The id of the Sortition requested", required: true
11
+ end
12
+ field :sortitions, Decidim::Sortitions::SortitionType.connection_type, "A collection of Sortitions", null: true, connection: true
10
13
 
11
14
  def sortitions
12
15
  Sortition.where(component: object).includes(:component)
13
16
  end
14
17
 
15
- field :sortition, Decidim::Sortitions::SortitionType, null: true do
16
- argument :id, GraphQL::Types::ID, required: true
17
- end
18
-
19
18
  def sortition(**args)
20
19
  Sortition.where(component: object).find_by(id: args[:id])
21
20
  end
@@ -17,6 +17,7 @@ Decidim.register_component(:sortitions) do |component|
17
17
  component.actions = %w(comment)
18
18
 
19
19
  component.settings(:global) do |settings|
20
+ settings.attribute :taxonomy_filters, type: :taxonomy_filters
20
21
  settings.attribute :comments_enabled, type: :boolean, default: true
21
22
  settings.attribute :comments_max_length, type: :integer, required: true
22
23
  end
@@ -3,7 +3,7 @@
3
3
  module Decidim
4
4
  module Sortitions
5
5
  def self.version
6
- "0.29.2"
6
+ "0.30.0.rc1"
7
7
  end
8
8
  end
9
9
  end
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.29.2
4
+ version: 0.30.0.rc1
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: 2025-02-12 00:00:00.000000000 Z
11
+ date: 2025-02-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: decidim-admin
@@ -16,98 +16,98 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 0.29.2
19
+ version: 0.30.0.rc1
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.29.2
26
+ version: 0.30.0.rc1
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.29.2
33
+ version: 0.30.0.rc1
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.29.2
40
+ version: 0.30.0.rc1
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.29.2
47
+ version: 0.30.0.rc1
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.29.2
54
+ version: 0.30.0.rc1
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.29.2
61
+ version: 0.30.0.rc1
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.29.2
68
+ version: 0.30.0.rc1
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: decidim-assemblies
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - '='
74
74
  - !ruby/object:Gem::Version
75
- version: 0.29.2
75
+ version: 0.30.0.rc1
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.29.2
82
+ version: 0.30.0.rc1
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: decidim-dev
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - '='
88
88
  - !ruby/object:Gem::Version
89
- version: 0.29.2
89
+ version: 0.30.0.rc1
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - '='
95
95
  - !ruby/object:Gem::Version
96
- version: 0.29.2
96
+ version: 0.30.0.rc1
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: decidim-participatory_processes
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - '='
102
102
  - !ruby/object:Gem::Version
103
- version: 0.29.2
103
+ version: 0.30.0.rc1
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - '='
109
109
  - !ruby/object:Gem::Version
110
- version: 0.29.2
110
+ version: 0.30.0.rc1
111
111
  description: This module makes possible to select amount a set of proposal by sortition
112
112
  email:
113
113
  - jsperezg@gmail.com
@@ -160,7 +160,6 @@ files:
160
160
  - app/views/decidim/sortitions/sortitions/_sortition_author.html.erb
161
161
  - app/views/decidim/sortitions/sortitions/_sortition_cancel_author.html.erb
162
162
  - app/views/decidim/sortitions/sortitions/_sortitions.html.erb
163
- - app/views/decidim/sortitions/sortitions/_tags.html.erb
164
163
  - app/views/decidim/sortitions/sortitions/index.html.erb
165
164
  - app/views/decidim/sortitions/sortitions/index.js.erb
166
165
  - app/views/decidim/sortitions/sortitions/show.html.erb
@@ -263,6 +262,7 @@ files:
263
262
  - db/migrate/20181017110803_make_sortitions_authors_polymorphic.rb
264
263
  - db/migrate/20200320105926_index_foreign_keys_in_decidim_sortitions_sortitions.rb
265
264
  - db/migrate/20200827154036_add_commentable_counter_cache_to_sortitions.rb
265
+ - db/migrate/20240828103823_add_deleted_at_to_decidim_sortitions_sortitions.rb
266
266
  - decidim-sortitions.gemspec
267
267
  - lib/decidim/api/sortition_type.rb
268
268
  - lib/decidim/api/sortitions_type.rb
@@ -293,14 +293,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
293
293
  requirements:
294
294
  - - "~>"
295
295
  - !ruby/object:Gem::Version
296
- version: 3.2.0
296
+ version: 3.3.0
297
297
  required_rubygems_version: !ruby/object:Gem::Requirement
298
298
  requirements:
299
299
  - - ">="
300
300
  - !ruby/object:Gem::Version
301
301
  version: '0'
302
302
  requirements: []
303
- rubygems_version: 3.4.10
303
+ rubygems_version: 3.5.11
304
304
  signing_key:
305
305
  specification_version: 4
306
306
  summary: Decidim sortitions module
@@ -1,15 +0,0 @@
1
- <ul>
2
- <li>
3
- <%= link_to t("filters.active", scope: "decidim.sortitions.sortitions"),
4
- sortitions_path(filter: { with_any_state: "active" }) unless sortition.cancelled? %>
5
-
6
- <%= link_to t("filters.cancelled", scope: "decidim.sortitions.sortitions"),
7
- sortitions_path(filter: { with_any_state: "cancelled" }) if sortition.cancelled? %>
8
- </li>
9
-
10
- <% if sortition.category.present? %>
11
- <li>
12
- <%= link_to translated_attribute(sortition.category.name), sortitions_path(filter: { with_category: sortition.category.id }) %>
13
- </li>
14
- <% end %>
15
- </ul>