decidim-sortitions 0.28.4 → 0.29.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/helpers/decidim/sortitions/admin/sortitions_helper.rb +1 -1
- data/app/models/decidim/sortitions/sortition.rb +1 -1
- data/app/queries/decidim/sortitions/admin/participatory_space_proposals.rb +11 -18
- data/app/views/decidim/sortitions/admin/sortitions/index.html.erb +3 -3
- data/app/views/decidim/sortitions/admin/sortitions/show.html.erb +1 -1
- data/app/views/decidim/sortitions/sortitions/_linked_sortitions.html.erb +4 -4
- data/app/views/decidim/sortitions/sortitions/_sortition_author.html.erb +4 -4
- data/app/views/decidim/sortitions/sortitions/_sortition_cancel_author.html.erb +4 -4
- data/app/views/decidim/sortitions/sortitions/_tags.html.erb +1 -1
- data/app/views/decidim/sortitions/sortitions/show.html.erb +2 -2
- data/config/locales/sv.yml +12 -21
- data/decidim-sortitions.gemspec +2 -2
- data/lib/decidim/sortitions/admin_engine.rb +1 -1
- data/lib/decidim/sortitions/version.rb +1 -1
- metadata +17 -18
- data/app/views/decidim/sortitions/sortitions/_proposal_badge.html.erb +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d9783e97fec8a58e1d45ae868626336d6987eb753bd0868ce2f9789ac97fa051
|
4
|
+
data.tar.gz: c187aea3fb5cbd52fba26352e451a3f3ef50f0797760c1fe2140e00689a575a4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 42dd8e23c26e7d125295afc334adf9d623ababca039818fd0ca811f59540e1c6907c8434485802a375fb7bc51fc4b05bd062cd07bf5d4d7c39603e4e1fa3693c
|
7
|
+
data.tar.gz: d6fdab6f444ecc09408232b4cc6018042a28d71de0c6d7ffc78ab91510724cd02b32a85a49dfea95c72a1458ff88b1e3776d74f92548be4465428e3f43fe1bdb
|
@@ -7,7 +7,7 @@ module Decidim
|
|
7
7
|
include Decidim::TranslationsHelper
|
8
8
|
include Decidim::PaginateHelper
|
9
9
|
|
10
|
-
#
|
10
|
+
# Converts a list of components into a list of selectable options
|
11
11
|
def components_options(components)
|
12
12
|
components.map do |f|
|
13
13
|
[translated_attribute(f.name), f.id]
|
@@ -18,30 +18,23 @@ module Decidim
|
|
18
18
|
@request_timestamp = sortition.request_timestamp
|
19
19
|
end
|
20
20
|
|
21
|
-
# Given a
|
21
|
+
# Given a participatory process retrieves its proposals
|
22
22
|
#
|
23
23
|
# Returns an ActiveRecord::Relation.
|
24
24
|
def query
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
end
|
25
|
+
proposals = Decidim::Proposals::Proposal
|
26
|
+
.not_withdrawn
|
27
|
+
.published
|
28
|
+
.not_hidden
|
29
|
+
.where("decidim_proposals_proposals.created_at < ?", request_timestamp)
|
30
|
+
.where(component: sortition.decidim_proposals_component)
|
31
|
+
proposals = proposals.where.not(id: proposals.only_status(:rejected))
|
32
|
+
|
33
|
+
return proposals.order(id: :asc) if category.nil?
|
35
34
|
|
36
35
|
# categorization -> category
|
37
|
-
|
36
|
+
proposals
|
38
37
|
.joins(:categorization)
|
39
|
-
.except_withdrawn
|
40
|
-
.published
|
41
|
-
.except_rejected
|
42
|
-
.not_hidden
|
43
|
-
.where(component: sortition.decidim_proposals_component)
|
44
|
-
.where("decidim_proposals_proposals.created_at < ?", request_timestamp)
|
45
38
|
.where(decidim_categorizations: { decidim_category_id: category.id })
|
46
39
|
.order(id: :asc)
|
47
40
|
end
|
@@ -16,7 +16,7 @@
|
|
16
16
|
<th><%= t("models.sortition.fields.reference", scope: "decidim.sortitions.admin") %></th>
|
17
17
|
<th><%= t("models.sortition.fields.title", scope: "decidim.sortitions.admin") %></th>
|
18
18
|
<th><%= t("models.sortition.fields.created_at", scope: "decidim.sortitions.admin") %></th>
|
19
|
-
<th
|
19
|
+
<th></th>
|
20
20
|
</tr>
|
21
21
|
</thead>
|
22
22
|
<tbody>
|
@@ -25,9 +25,9 @@
|
|
25
25
|
<td><%= sortition.reference %></td>
|
26
26
|
<td>
|
27
27
|
<% if allowed_to? :update, :sortition, sortition: sortition %>
|
28
|
-
<%= link_to
|
28
|
+
<%= link_to decidim_escape_translated(sortition.title), edit_sortition_path(sortition) %>
|
29
29
|
<% else %>
|
30
|
-
<%=
|
30
|
+
<%= decidim_escape_translated(sortition.title) %>
|
31
31
|
<% end %>
|
32
32
|
</td>
|
33
33
|
<td><%= l sortition.created_at, format: :short %></td>
|
@@ -2,7 +2,7 @@
|
|
2
2
|
<div class="card" id="sortition">
|
3
3
|
<div class="item_show__header">
|
4
4
|
<h1 class="item_show__header-title">
|
5
|
-
<%=
|
5
|
+
<%= decidim_escape_translated(sortition.title) %>
|
6
6
|
</h1>
|
7
7
|
</div>
|
8
8
|
<div class="table-scroll">
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<div class="card card--action
|
1
|
+
<div class="card card--action">
|
2
2
|
<% resources.each do |sortition| %>
|
3
3
|
<div class="card--list__item">
|
4
4
|
<div class="card--list__text">
|
@@ -7,7 +7,7 @@
|
|
7
7
|
<% end %>
|
8
8
|
<div>
|
9
9
|
<%= link_to resource_locator(sortition).path, class: "card__link" do %>
|
10
|
-
<h5 class="card--list__heading"><%=
|
10
|
+
<h5 class="card--list__heading"><%= decidim_escape_translated(sortition.title) %></h5>
|
11
11
|
<% end %>
|
12
12
|
<div class="author">
|
13
13
|
<span class="author__avatar">
|
@@ -19,8 +19,8 @@
|
|
19
19
|
</div>
|
20
20
|
</div>
|
21
21
|
</div>
|
22
|
-
<div
|
23
|
-
<span
|
22
|
+
<div>
|
23
|
+
<span>
|
24
24
|
<%= sortition.selected_proposals.size %>
|
25
25
|
</span> <%= t(".selected_proposals", count: proposal.selected_proposals.size) %>
|
26
26
|
</div>
|
@@ -1,11 +1,11 @@
|
|
1
|
-
<div
|
2
|
-
<div class="author
|
3
|
-
<span class="author__avatar
|
1
|
+
<div>
|
2
|
+
<div class="author">
|
3
|
+
<span class="author__avatar">
|
4
4
|
<%= image_tag present(sortition.author).avatar_url %>
|
5
5
|
</span>
|
6
6
|
<span class="author__name">
|
7
7
|
<% if sortition.author&.deleted? %>
|
8
|
-
<span class="label
|
8
|
+
<span class="label">
|
9
9
|
<%= t(".deleted") %>
|
10
10
|
</span>
|
11
11
|
<% else %>
|
@@ -1,11 +1,11 @@
|
|
1
|
-
<div
|
2
|
-
<div class="author
|
3
|
-
<span class="author__avatar
|
1
|
+
<div>
|
2
|
+
<div class="author">
|
3
|
+
<span class="author__avatar">
|
4
4
|
<%= image_tag present(sortition.cancelled_by_user).avatar_url %>
|
5
5
|
</span>
|
6
6
|
<span class="author__name">
|
7
7
|
<% if sortition.cancelled_by_user&.deleted? %>
|
8
|
-
<span class="label
|
8
|
+
<span class="label">
|
9
9
|
<%= t(".deleted") %>
|
10
10
|
</span>
|
11
11
|
<% else %>
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<% add_decidim_meta_tags({
|
2
2
|
description: decidim_sanitize_editor(translated_attribute(sortition.additional_info)),
|
3
|
-
title:
|
3
|
+
title: decidim_escape_translated(sortition.title),
|
4
4
|
url: sortition_url(sortition.to_param)
|
5
5
|
}) %>
|
6
6
|
|
@@ -21,7 +21,7 @@ edit_link(
|
|
21
21
|
|
22
22
|
<section class="layout-main__section layout-main__heading">
|
23
23
|
<h1 class="h1 decorator mb-4">
|
24
|
-
<%=
|
24
|
+
<%= decidim_escape_translated(sortition.title) %>
|
25
25
|
</h1>
|
26
26
|
<div class="layout-author">
|
27
27
|
<%= cell "decidim/author", present(sortition.author), context_actions: [:date], from: sortition, layout: :compact %>
|
data/config/locales/sv.yml
CHANGED
@@ -3,7 +3,7 @@ sv:
|
|
3
3
|
activemodel:
|
4
4
|
attributes:
|
5
5
|
sortition:
|
6
|
-
additional_info: Information om
|
6
|
+
additional_info: Information om tilldelningen
|
7
7
|
decidim_category_id: Kategorier för de förslag som du vill tillämpa lottningen på
|
8
8
|
decidim_proposals_component_id: Förslagen
|
9
9
|
dice: Tärningskast. Slå en sexsidig tärning inför vittnen, eller använd ett annat sätt att slumpmässigt skapa ett tal från 1 till 6, och skriv in resultatet. Detta bidrar till kvalitén och garanterar resultatets slumpmässighet
|
@@ -11,22 +11,22 @@ sv:
|
|
11
11
|
title: Titel
|
12
12
|
witnesses: Vittnen
|
13
13
|
models:
|
14
|
-
decidim/sortitions/create_sortition_event:
|
14
|
+
decidim/sortitions/create_sortition_event: Tilldelning
|
15
15
|
activerecord:
|
16
16
|
models:
|
17
17
|
decidim/sortitions/sortition:
|
18
|
-
one:
|
19
|
-
other:
|
18
|
+
one: Tilldelning
|
19
|
+
other: Tilldelningar
|
20
20
|
decidim:
|
21
21
|
components:
|
22
22
|
sortitions:
|
23
23
|
actions:
|
24
24
|
comment: Kommentera
|
25
|
-
name:
|
25
|
+
name: Tilldelningar
|
26
26
|
settings:
|
27
27
|
global:
|
28
|
-
comments_enabled:
|
29
|
-
comments_max_length: Maximal
|
28
|
+
comments_enabled: Kommentarer aktiverade
|
29
|
+
comments_max_length: Maximal längd för kommentarer (Lämna 0 för standardvärde)
|
30
30
|
events:
|
31
31
|
sortitions:
|
32
32
|
sortition_created:
|
@@ -39,7 +39,6 @@ sv:
|
|
39
39
|
actions:
|
40
40
|
destroy: Avbryt tilldelningen
|
41
41
|
edit: Redigera
|
42
|
-
new_sortition: Ny lottning
|
43
42
|
show: Detaljer om tilldelningen
|
44
43
|
models:
|
45
44
|
sortition:
|
@@ -60,10 +59,6 @@ sv:
|
|
60
59
|
title: Avbryta tilldelningen
|
61
60
|
create:
|
62
61
|
error: Det gick inte att skapa en ny tilldelning.
|
63
|
-
success: Lottningen har skapats.
|
64
|
-
destroy:
|
65
|
-
error: Det går inte att avbryta lottningen.
|
66
|
-
success: Lottningen har avbrutits.
|
67
62
|
edit:
|
68
63
|
title: Uppdatera informationen om tilldelningen
|
69
64
|
update: Uppdatera
|
@@ -71,16 +66,14 @@ sv:
|
|
71
66
|
all_categories: Alla kategorier
|
72
67
|
select_proposal_component: Välj förslagen som ska behandlas
|
73
68
|
index:
|
74
|
-
title:
|
69
|
+
title: Tilldelningar
|
75
70
|
new:
|
76
|
-
confirm: När du trycker på knappen Nästa registrerar Decidim datum och tid (till och med sekunder) och tillsammans med tärningskastet används denna information för att generera ett slumpmässigt val. Åtgärden är oåterkallelig. När du har tryckt på knappen publiceras resultatet av dragningen tillsammans med de uppgifter som angetts i detta formulär och kan inte ändras. Gå igenom innehållet noggrant.
|
77
71
|
create: Skapa
|
78
72
|
title: Ny tilldelning
|
79
73
|
show:
|
80
74
|
selected_proposals: Förslag som valts för lottning
|
81
75
|
update:
|
82
76
|
error: Det gick inte att uppdatera tilldelningen.
|
83
|
-
success: Lottningen har uppdaterats.
|
84
77
|
admin_log:
|
85
78
|
sortition:
|
86
79
|
create: "%{user_name} skapade tilldelningen %{resource_name} i %{space_name}"
|
@@ -97,8 +90,6 @@ sv:
|
|
97
90
|
cancelled: Avbrutna
|
98
91
|
category: Kategori
|
99
92
|
state: Status
|
100
|
-
index:
|
101
|
-
empty: Det finns inga lottningar än.
|
102
93
|
linked_sortitions:
|
103
94
|
selected_proposals: Utvalda förslag
|
104
95
|
orders:
|
@@ -107,8 +98,8 @@ sv:
|
|
107
98
|
recent: Senaste
|
108
99
|
results_count:
|
109
100
|
count:
|
110
|
-
one:
|
111
|
-
other:
|
101
|
+
one: valt förslaget
|
102
|
+
other: valda förslag
|
112
103
|
show:
|
113
104
|
algorithm: Tilldelningens algoritmkod
|
114
105
|
any_category: från alla kategorier
|
@@ -116,9 +107,9 @@ sv:
|
|
116
107
|
candidate_proposal_ids: Förslagens ordning och ID i tilldelningen
|
117
108
|
candidate_proposals_info: 'Tilldelningen gjordes bland följande förslag (%{category_label}), med följande ID (de utvalda förslagen i fetstil) '
|
118
109
|
category: från kategorin %{category}
|
119
|
-
dice_result:
|
110
|
+
dice_result: (1) Tärningskast
|
120
111
|
introduction: 'Den här sidan innehåller resultaten från tilldelningen %{reference}. Med hjälp av tilldelningen har %{target_items} resultat valts ut slumpmässigt och med lika stor sannolikhet från listan med förslag nedan. Tillsammans med resultaten, innehåller informationen på denna sida allt som krävs för att garantera och återskapa resultaten. Nyckeln till kvalitén på tilldelningen är den dubblerade slumpmässigheten från ett bevittnat tärningskast samt den exakta tiden för tilldelningen, som matas in i en algoritm som genererar det slumpmässiga urvalet. Tidsfröet för tilldelningen är så exakt (sekunder) att den är omöjlig att styras av människor, vilket ger en dubblerad "okontrollerad" indata, i syfte att att garantera ett rättvist resultat. '
|
121
|
-
mathematical_result: Resultat (
|
112
|
+
mathematical_result: Resultat (1) x (2)
|
122
113
|
proposals_selected_by_sortition: Förslag valda genom tilldelning
|
123
114
|
sortition_reproducibility_details: Detaljer för tilldelningens reproducerbarhet
|
124
115
|
time_seed: (2) Tidsfrö
|
data/decidim-sortitions.gemspec
CHANGED
@@ -17,11 +17,11 @@ 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.
|
20
|
+
s.required_ruby_version = "~> 3.2.0"
|
21
21
|
|
22
22
|
s.name = "decidim-sortitions"
|
23
23
|
s.summary = "Decidim sortitions module"
|
24
|
-
s.description = "This module makes possible to select
|
24
|
+
s.description = "This module makes possible to select amount a set of proposal by sortition"
|
25
25
|
|
26
26
|
s.files = Dir.chdir(__dir__) do
|
27
27
|
`git ls-files -z`.split("\x0").select do |f|
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
module Decidim
|
4
4
|
module Sortitions
|
5
|
-
# This is the engine that runs on the administration interface of `
|
5
|
+
# This is the engine that runs on the administration interface of `decidim_sortitions`.
|
6
6
|
# It mostly handles rendering the created projects associated to a participatory
|
7
7
|
# process.
|
8
8
|
class AdminEngine < ::Rails::Engine
|
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.29.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: 2024-
|
11
|
+
date: 2024-07-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: decidim-admin
|
@@ -16,71 +16,71 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 0.29.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.
|
26
|
+
version: 0.29.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.
|
33
|
+
version: 0.29.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.
|
40
|
+
version: 0.29.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.
|
47
|
+
version: 0.29.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.
|
54
|
+
version: 0.29.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.
|
61
|
+
version: 0.29.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.
|
68
|
+
version: 0.29.0.rc1
|
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.29.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.
|
83
|
-
description: This module makes possible to select
|
82
|
+
version: 0.29.0.rc1
|
83
|
+
description: This module makes possible to select amount a set of proposal by sortition
|
84
84
|
email:
|
85
85
|
- jsperezg@gmail.com
|
86
86
|
executables: []
|
@@ -127,7 +127,6 @@ files:
|
|
127
127
|
- app/views/decidim/sortitions/sortitions/_count.html.erb
|
128
128
|
- app/views/decidim/sortitions/sortitions/_linked_sortitions.html.erb
|
129
129
|
- app/views/decidim/sortitions/sortitions/_proposal.html.erb
|
130
|
-
- app/views/decidim/sortitions/sortitions/_proposal_badge.html.erb
|
131
130
|
- app/views/decidim/sortitions/sortitions/_results_count.html.erb
|
132
131
|
- app/views/decidim/sortitions/sortitions/_sortition.html.erb
|
133
132
|
- app/views/decidim/sortitions/sortitions/_sortition_author.html.erb
|
@@ -264,14 +263,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
264
263
|
requirements:
|
265
264
|
- - "~>"
|
266
265
|
- !ruby/object:Gem::Version
|
267
|
-
version: 3.
|
266
|
+
version: 3.2.0
|
268
267
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
269
268
|
requirements:
|
270
|
-
- - "
|
269
|
+
- - ">"
|
271
270
|
- !ruby/object:Gem::Version
|
272
|
-
version:
|
271
|
+
version: 1.3.1
|
273
272
|
requirements: []
|
274
|
-
rubygems_version: 3.
|
273
|
+
rubygems_version: 3.4.10
|
275
274
|
signing_key:
|
276
275
|
specification_version: 4
|
277
276
|
summary: Decidim sortitions module
|