decidim-initiatives 0.13.1 → 0.14.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/config/decidim_initiatives_manifest.js +2 -1
- data/app/assets/images/decidim/gamification/badges/initiatives.svg +87 -0
- data/app/cells/decidim/initiatives/content_blocks/highlighted_initiatives/show.erb +29 -0
- data/app/cells/decidim/initiatives/content_blocks/highlighted_initiatives_cell.rb +27 -0
- data/app/cells/decidim/initiatives/initiative_cell.rb +1 -1
- data/app/cells/decidim/initiatives/initiative_m/author.erb +1 -1
- data/app/commands/decidim/initiatives/admin/publish_initiative.rb +5 -0
- data/app/commands/decidim/initiatives/admin/update_initiative.rb +7 -5
- data/app/controllers/decidim/initiatives/admin/initiative_attachments_controller.rb +0 -4
- data/app/controllers/decidim/initiatives/committee_requests_controller.rb +1 -0
- data/app/forms/decidim/initiatives/admin/initiative_form.rb +6 -6
- data/app/models/decidim/initiative.rb +9 -9
- data/app/permissions/decidim/initiatives/admin/permissions.rb +3 -3
- data/app/presenters/decidim/initiatives/admin_log/initiative_presenter.rb +2 -2
- data/app/queries/decidim/initiatives/outdated_validating_initiatives.rb +1 -1
- data/app/queries/decidim/initiatives/support_period_finished_initiatives.rb +1 -1
- data/app/views/decidim/initiatives/admin/initiatives/_form.html.erb +2 -2
- data/app/views/decidim/initiatives/committee_requests/new.html.erb +3 -7
- data/app/views/decidim/initiatives/initiatives/_filters.html.erb +6 -5
- data/app/views/decidim/initiatives/initiatives/index.html.erb +8 -0
- data/app/views/decidim/initiatives/initiatives/show.html.erb +9 -0
- data/app/views/layouts/decidim/_initiative_header_steps.html.erb +2 -2
- data/config/locales/ca.yml +15 -2
- data/config/locales/en.yml +15 -2
- data/config/locales/es-PY.yml +15 -2
- data/config/locales/es.yml +15 -2
- data/config/locales/eu.yml +15 -2
- data/config/locales/fi.yml +179 -166
- data/config/locales/fr.yml +15 -2
- data/config/locales/gl.yml +15 -2
- data/config/locales/hu.yml +363 -0
- data/config/locales/it.yml +15 -2
- data/config/locales/nl.yml +15 -2
- data/config/locales/pl.yml +15 -2
- data/config/locales/pt-BR.yml +21 -8
- data/config/locales/pt.yml +15 -2
- data/config/locales/ru.yml +7 -4
- data/config/locales/sv.yml +15 -2
- data/config/locales/uk.yml +7 -4
- data/db/migrate/20180726071704_rename_signature_time_fields_to_signature_date.rb +9 -0
- data/lib/decidim/initiatives/admin_engine.rb +1 -0
- data/lib/decidim/initiatives/engine.rb +16 -12
- data/lib/decidim/initiatives/initiatives_filter_form_builder.rb +3 -3
- data/lib/decidim/initiatives/participatory_space.rb +11 -3
- data/lib/decidim/initiatives/test/factories.rb +29 -29
- data/lib/decidim/initiatives/version.rb +1 -1
- metadata +18 -14
- data/app/views/decidim/initiatives/pages/home/_highlighted_initiatives.html.erb +0 -27
data/config/locales/nl.yml
CHANGED
@@ -6,8 +6,8 @@ nl:
|
|
6
6
|
description: Beschrijving
|
7
7
|
offline_votes: Face-to-face ondersteuning
|
8
8
|
scope_id: Bereik
|
9
|
-
|
10
|
-
|
9
|
+
signature_end_date: Einde van de periode om handtekeningen te verzamelen
|
10
|
+
signature_start_date: Begin van de periode om handtekeningen te verzamelen
|
11
11
|
signature_type: Handtekening verzamelingstype
|
12
12
|
signature_type_values:
|
13
13
|
any: Gemengd
|
@@ -82,6 +82,16 @@ nl:
|
|
82
82
|
email_outro: Je hebt deze melding ontvangen omdat je %{resource_title}volgt. Je kunt stoppen met het ontvangen van meldingen na de vorige link.
|
83
83
|
email_subject: Nieuwe mijlpaal voltooid!
|
84
84
|
notification_title: Het <a href="%{resource_path}">%{resource_title}</a> initiatief heeft de %{percentage}% handtekeningen behaald.
|
85
|
+
gamification:
|
86
|
+
badges:
|
87
|
+
initiatives:
|
88
|
+
description_another: Deze gebruiker heeft %{score} initiatieven gepubliceerd.
|
89
|
+
description_own: Je hebt %{score} initiatieven gepubliceerd.
|
90
|
+
explanation: Gebruikers krijgen deze badge door hun initiatieven gepubliceerd te krijgen.
|
91
|
+
name: Gepubliceerde initiatieven
|
92
|
+
next_level_in: Ontvang nog %{score} initiatieven die zijn gepubliceerd om het volgende niveau te bereiken!
|
93
|
+
unearned_another: Deze gebruiker heeft nog geen initiatieven gepubliceerd.
|
94
|
+
unearned_own: Je hebt nog geen initiatieven gepubliceerd.
|
85
95
|
initiatives:
|
86
96
|
admin:
|
87
97
|
committee_requests:
|
@@ -181,6 +191,9 @@ nl:
|
|
181
191
|
help_text: U staat op het punt lid te worden van de promotieraad van dit initiatief
|
182
192
|
spawn:
|
183
193
|
success: Je verzoek is verzonden aan de auteur van het initiatief.
|
194
|
+
content_blocks:
|
195
|
+
highlighted_initiatives:
|
196
|
+
name: Gemarkeerde initiatieven
|
184
197
|
create_initiative:
|
185
198
|
fill_data:
|
186
199
|
back: Terug
|
data/config/locales/pl.yml
CHANGED
@@ -6,8 +6,8 @@ pl:
|
|
6
6
|
description: Opis
|
7
7
|
offline_votes: Wsparcie twarzą w twarz
|
8
8
|
scope_id: Zakres
|
9
|
-
|
10
|
-
|
9
|
+
signature_end_date: Koniec okresu zbierania podpisu
|
10
|
+
signature_start_date: Początek okresu zbierania podpisu
|
11
11
|
signature_type: Typ kolekcji podpisu
|
12
12
|
signature_type_values:
|
13
13
|
any: Mieszany
|
@@ -88,6 +88,16 @@ pl:
|
|
88
88
|
email_outro: Otrzymałeś to powiadomienie, ponieważ obserwujesz %{resource_title}. Możesz przestać otrzymywać powiadomienia po poprzednim linku.
|
89
89
|
email_subject: Nowy kamień milowy zakończony!
|
90
90
|
notification_title: Inicjatywa <a href="%{resource_path}">%{resource_title}</a> osiągnęła %{percentage}% podpisów.
|
91
|
+
gamification:
|
92
|
+
badges:
|
93
|
+
initiatives:
|
94
|
+
description_another: Ten użytkownik otrzymał %{score} opublikowanych inicjatyw.
|
95
|
+
description_own: Masz opublikowanych %{score} inicjatyw.
|
96
|
+
explanation: Użytkownicy otrzymują tę odznakę, publikując swoje inicjatywy.
|
97
|
+
name: Opublikowane inicjatywy
|
98
|
+
next_level_in: Uzyskaj %{score} dodatkowych inicjatyw opublikowanych, aby przejść do następnego poziomu!
|
99
|
+
unearned_another: Ten użytkownik nie otrzymał jeszcze żadnych inicjatyw.
|
100
|
+
unearned_own: Nie opublikowano jeszcze żadnych inicjatyw.
|
91
101
|
initiatives:
|
92
102
|
admin:
|
93
103
|
committee_requests:
|
@@ -187,6 +197,9 @@ pl:
|
|
187
197
|
help_text: Zamierzasz poprosić o członkostwo w komitecie promującym tę inicjatywę
|
188
198
|
spawn:
|
189
199
|
success: Twoja prośba została wysłana do autora inicjatywy.
|
200
|
+
content_blocks:
|
201
|
+
highlighted_initiatives:
|
202
|
+
name: Wyróżnione inicjatywy
|
190
203
|
create_initiative:
|
191
204
|
fill_data:
|
192
205
|
back: Plecy
|
data/config/locales/pt-BR.yml
CHANGED
@@ -6,8 +6,8 @@ pt-BR:
|
|
6
6
|
description: Descrição
|
7
7
|
offline_votes: Suporte face a face
|
8
8
|
scope_id: Escopo
|
9
|
-
|
10
|
-
|
9
|
+
signature_end_date: Fim do período de coleta de assinaturas
|
10
|
+
signature_start_date: Início do período de coleta de assinaturas
|
11
11
|
signature_type: Tipo de coleta de assinatura
|
12
12
|
signature_type_values:
|
13
13
|
any: Misturado
|
@@ -82,6 +82,16 @@ pt-BR:
|
|
82
82
|
email_outro: Você recebeu esta notificação porque está seguindo %{resource_title}. Você pode parar de receber notificações após o link anterior.
|
83
83
|
email_subject: Novo marco concluído!
|
84
84
|
notification_title: A <a href="%{resource_path}">%{resource_title}</a> iniciativa obteve %{percentage}% de assinaturas.
|
85
|
+
gamification:
|
86
|
+
badges:
|
87
|
+
initiatives:
|
88
|
+
description_another: Este usuário obteve %{score} iniciativas publicadas.
|
89
|
+
description_own: Você tem %{score} iniciativas publicadas.
|
90
|
+
explanation: Os usuários recebem esse selo ao publicar suas iniciativas.
|
91
|
+
name: Iniciativas publicadas
|
92
|
+
next_level_in: Obtenha mais %{score} iniciativas publicadas para alcançar o próximo nível!
|
93
|
+
unearned_another: Este usuário ainda não publicou nenhuma iniciativa.
|
94
|
+
unearned_own: Você não tem iniciativas publicadas ainda.
|
85
95
|
initiatives:
|
86
96
|
admin:
|
87
97
|
committee_requests:
|
@@ -126,22 +136,22 @@ pt-BR:
|
|
126
136
|
initiatives_type_scopes:
|
127
137
|
create:
|
128
138
|
error: ocorreu um erro
|
129
|
-
success: Um novo
|
139
|
+
success: Um novo âmbito para o tipo de iniciativa determinado foi criado
|
130
140
|
destroy:
|
131
|
-
success: O
|
141
|
+
success: O âmbito foi removido com sucesso
|
132
142
|
edit:
|
133
143
|
back: Costas
|
134
144
|
confirm_destroy: Você tem certeza?
|
135
145
|
destroy: Excluir
|
136
|
-
title: Editar o
|
146
|
+
title: Editar o âmbito do tipo de iniciativa
|
137
147
|
update: Atualizar
|
138
148
|
new:
|
139
149
|
back: Costas
|
140
150
|
create: Criar
|
141
|
-
title: Criar
|
151
|
+
title: Criar âmbito de tipo de iniciativa
|
142
152
|
update:
|
143
153
|
error: ocorreu um erro
|
144
|
-
success: O
|
154
|
+
success: O âmbito foi atualizado com sucesso
|
145
155
|
initiatives_types:
|
146
156
|
create:
|
147
157
|
error: ocorreu um erro
|
@@ -181,6 +191,9 @@ pt-BR:
|
|
181
191
|
help_text: Você está prestes a pedir para se tornar membro do comitê de promotores desta iniciativa
|
182
192
|
spawn:
|
183
193
|
success: Sua solicitação foi enviada ao autor da iniciativa.
|
194
|
+
content_blocks:
|
195
|
+
highlighted_initiatives:
|
196
|
+
name: Iniciativas destacadas
|
184
197
|
create_initiative:
|
185
198
|
fill_data:
|
186
199
|
back: Costas
|
@@ -188,7 +201,7 @@ pt-BR:
|
|
188
201
|
fill_data_help: "<ul> <li>Revise o conteúdo da sua iniciativa. Seu título é fácil de entender? O objetivo da sua iniciativa é claro?</li> <li>Você tem que escolher o tipo de assinatura. Pessoalmente, online ou uma combinação de ambos</li> <li>Qual é o âmbito geográfico da iniciativa? Distrito da cidade?</li> </ul>"
|
189
202
|
initiative_type: Tipo de iniciativa
|
190
203
|
more_information: "(Mais Informações)"
|
191
|
-
select_scope: Selecione um
|
204
|
+
select_scope: Selecione um âmbito
|
192
205
|
finish:
|
193
206
|
back: Costas
|
194
207
|
back_to_initiatives: De volta às iniciativas
|
data/config/locales/pt.yml
CHANGED
@@ -6,8 +6,8 @@ pt:
|
|
6
6
|
description: Descrição
|
7
7
|
offline_votes: Suporte face a face
|
8
8
|
scope_id: Escopo
|
9
|
-
|
10
|
-
|
9
|
+
signature_end_date: Fim do período de coleta de assinaturas
|
10
|
+
signature_start_date: Início do período de coleta de assinaturas
|
11
11
|
signature_type: Tipo de coleta de assinatura
|
12
12
|
signature_type_values:
|
13
13
|
any: Misturado
|
@@ -82,6 +82,16 @@ pt:
|
|
82
82
|
email_outro: Você recebeu esta notificação porque está seguindo %{resource_title}. Você pode parar de receber notificações após o link anterior.
|
83
83
|
email_subject: Novo marco concluído!
|
84
84
|
notification_title: A iniciativa <a href="%{resource_path}">%{resource_title}</a> alcançou os %{percentage}% de assinaturas.
|
85
|
+
gamification:
|
86
|
+
badges:
|
87
|
+
initiatives:
|
88
|
+
description_another: Este usuário obteve %{score} iniciativas publicadas.
|
89
|
+
description_own: Você tem %{score} iniciativas publicadas.
|
90
|
+
explanation: Os usuários recebem esse selo ao publicar suas iniciativas.
|
91
|
+
name: Iniciativas publicadas
|
92
|
+
next_level_in: Obtenha mais %{score} iniciativas publicadas para alcançar o próximo nível!
|
93
|
+
unearned_another: Este usuário ainda não publicou nenhuma iniciativa.
|
94
|
+
unearned_own: Você não tem iniciativas publicadas ainda.
|
85
95
|
initiatives:
|
86
96
|
admin:
|
87
97
|
committee_requests:
|
@@ -181,6 +191,9 @@ pt:
|
|
181
191
|
help_text: Você está prestes a pedir para se tornar membro do comitê de promotores desta iniciativa
|
182
192
|
spawn:
|
183
193
|
success: Sua solicitação foi enviada ao autor da iniciativa.
|
194
|
+
content_blocks:
|
195
|
+
highlighted_initiatives:
|
196
|
+
name: Iniciativas destacadas
|
184
197
|
create_initiative:
|
185
198
|
fill_data:
|
186
199
|
back: Costas
|
data/config/locales/ru.yml
CHANGED
@@ -6,8 +6,8 @@ ru:
|
|
6
6
|
description: Описание
|
7
7
|
offline_votes: Выражения поддержки на личных встречах
|
8
8
|
scope_id: Охват
|
9
|
-
|
10
|
-
|
9
|
+
signature_end_date: Конец периода сбора подписей
|
10
|
+
signature_start_date: Начало периода сбора подписей
|
11
11
|
signature_type: Вид сбора подписей
|
12
12
|
signature_type_values:
|
13
13
|
any: Смешанный
|
@@ -117,7 +117,7 @@ ru:
|
|
117
117
|
all: Все
|
118
118
|
created: Созданные
|
119
119
|
discarded: Отброшенные
|
120
|
-
published:
|
120
|
+
published: Обнародовано
|
121
121
|
rejected: Отклоненные
|
122
122
|
validating: Техническая проверка
|
123
123
|
filter_by: 'Отобрать по признаку:'
|
@@ -178,7 +178,7 @@ ru:
|
|
178
178
|
accepted: Принятые
|
179
179
|
created: Созданные
|
180
180
|
discarded: Отброшенные
|
181
|
-
published:
|
181
|
+
published: Обнародовано
|
182
182
|
rejected: Отклоненные
|
183
183
|
validating: Техническая проверка
|
184
184
|
committee_requests:
|
@@ -187,6 +187,9 @@ ru:
|
|
187
187
|
help_text: Вы собираетесь подать запрос на членство в рабочей группе по продвижению этого почина
|
188
188
|
spawn:
|
189
189
|
success: Ваш запрос отправлен автору почина.
|
190
|
+
content_blocks:
|
191
|
+
highlighted_initiatives:
|
192
|
+
name: Рекомендуемые почины
|
190
193
|
create_initiative:
|
191
194
|
fill_data:
|
192
195
|
back: Вернуться
|
data/config/locales/sv.yml
CHANGED
@@ -6,8 +6,8 @@ sv:
|
|
6
6
|
description: Beskrivning
|
7
7
|
offline_votes: Ansikte mot ansikte stöd
|
8
8
|
scope_id: Omfattning
|
9
|
-
|
10
|
-
|
9
|
+
signature_end_date: Slutet på signaturuppsamlingsperioden
|
10
|
+
signature_start_date: Början av signaturuppsamlingsperioden
|
11
11
|
signature_type: Signaturuppsamlingstyp
|
12
12
|
signature_type_values:
|
13
13
|
any: Blandad
|
@@ -82,6 +82,16 @@ sv:
|
|
82
82
|
email_outro: Du har fått den här meddelandet eftersom du följer %{resource_title}. Du kan sluta ta emot meddelanden efter föregående länk.
|
83
83
|
email_subject: Ny milstolpe färdigställd!
|
84
84
|
notification_title: <a href="%{resource_path}">%{resource_title}</a> initiativet har uppnått %{percentage}% av underskrifterna.
|
85
|
+
gamification:
|
86
|
+
badges:
|
87
|
+
initiatives:
|
88
|
+
description_another: Den här användaren har fått %{score} initiativ publicerade.
|
89
|
+
description_own: Du har %{score} initiativ publicerade.
|
90
|
+
explanation: Användare får detta märke genom att få sina initiativ publicerade.
|
91
|
+
name: Publicerade initiativ
|
92
|
+
next_level_in: Få %{score} fler initiativ publicerade för att nå nästa nivå!
|
93
|
+
unearned_another: Den här användaren har inte fått några initiativ publicerade än.
|
94
|
+
unearned_own: Du har ännu inte publicerat några initiativ.
|
85
95
|
initiatives:
|
86
96
|
admin:
|
87
97
|
committee_requests:
|
@@ -181,6 +191,9 @@ sv:
|
|
181
191
|
help_text: Du är på väg att begära att bli medlem av promotorutskottet för detta initiativ
|
182
192
|
spawn:
|
183
193
|
success: Din förfrågan har skickats till initiativtagaren.
|
194
|
+
content_blocks:
|
195
|
+
highlighted_initiatives:
|
196
|
+
name: Markerade initiativ
|
184
197
|
create_initiative:
|
185
198
|
fill_data:
|
186
199
|
back: Tillbaka
|
data/config/locales/uk.yml
CHANGED
@@ -6,8 +6,8 @@ uk:
|
|
6
6
|
description: Опис
|
7
7
|
offline_votes: Підтримка на особистих зустрічах
|
8
8
|
scope_id: Обсяг
|
9
|
-
|
10
|
-
|
9
|
+
signature_end_date: Кінець періоду збору підписів
|
10
|
+
signature_start_date: Початок періоду збору підписів
|
11
11
|
signature_type: Різновид збору підписів
|
12
12
|
signature_type_values:
|
13
13
|
any: Поєднаний
|
@@ -117,7 +117,7 @@ uk:
|
|
117
117
|
all: Усі
|
118
118
|
created: Створені
|
119
119
|
discarded: Відкинуті
|
120
|
-
published:
|
120
|
+
published: Оприлюднено
|
121
121
|
rejected: Відхилені
|
122
122
|
validating: Технічна перевірка
|
123
123
|
filter_by: 'Відібрати за ознакою:'
|
@@ -178,7 +178,7 @@ uk:
|
|
178
178
|
accepted: Прийняті
|
179
179
|
created: Створені
|
180
180
|
discarded: Відкинуті
|
181
|
-
published:
|
181
|
+
published: Оприлюднено
|
182
182
|
rejected: Відхилені
|
183
183
|
validating: Технічна перевірка
|
184
184
|
committee_requests:
|
@@ -187,6 +187,9 @@ uk:
|
|
187
187
|
help_text: Ви збираєтесь подати заявку на участь у робочому гурті з просування цього почину
|
188
188
|
spawn:
|
189
189
|
success: Ваш запит було надіслано автору почину.
|
190
|
+
content_blocks:
|
191
|
+
highlighted_initiatives:
|
192
|
+
name: Висвітлені почини
|
190
193
|
create_initiative:
|
191
194
|
fill_data:
|
192
195
|
back: Повернутись
|
@@ -0,0 +1,9 @@
|
|
1
|
+
# This migration comes from decidim_initiatives (originally 20171214161410)
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
class RenameSignatureTimeFieldsToSignatureDate < ActiveRecord::Migration[5.1]
|
5
|
+
def change
|
6
|
+
rename_column :decidim_initiatives, :signature_start_time, :signature_start_date
|
7
|
+
rename_column :decidim_initiatives, :signature_end_time, :signature_end_date
|
8
|
+
end
|
9
|
+
end
|
@@ -61,18 +61,10 @@ module Decidim
|
|
61
61
|
)
|
62
62
|
end
|
63
63
|
|
64
|
-
initializer "decidim_initiatives.
|
65
|
-
Decidim.
|
66
|
-
|
67
|
-
|
68
|
-
next unless highlighted_initiatives.any?
|
69
|
-
|
70
|
-
view_context.render(
|
71
|
-
partial: "decidim/initiatives/pages/home/highlighted_initiatives",
|
72
|
-
locals: {
|
73
|
-
highlighted_initiatives: highlighted_initiatives
|
74
|
-
}
|
75
|
-
)
|
64
|
+
initializer "decidim_initiatives.content_blocks" do
|
65
|
+
Decidim.content_blocks.register(:homepage, :highlighted_initiatives) do |content_block|
|
66
|
+
content_block.cell = "decidim/initiatives/content_blocks/highlighted_initiatives"
|
67
|
+
content_block.public_name_key = "decidim.initiatives.content_blocks.highlighted_initiatives.name"
|
76
68
|
end
|
77
69
|
end
|
78
70
|
|
@@ -89,6 +81,18 @@ module Decidim
|
|
89
81
|
active: :inclusive
|
90
82
|
end
|
91
83
|
end
|
84
|
+
|
85
|
+
initializer "decidim_initiatives.badges" do
|
86
|
+
Decidim::Gamification.register_badge(:initiatives) do |badge|
|
87
|
+
badge.levels = [1, 5, 15, 30, 50]
|
88
|
+
|
89
|
+
badge.reset = lambda { |user|
|
90
|
+
Decidim::Initiative.where(
|
91
|
+
author: user
|
92
|
+
).published.count
|
93
|
+
}
|
94
|
+
end
|
95
|
+
end
|
92
96
|
end
|
93
97
|
end
|
94
98
|
end
|
@@ -13,18 +13,18 @@ module Decidim
|
|
13
13
|
# - prompt - An optional String with the text to display as prompt.
|
14
14
|
#
|
15
15
|
# Returns a String.
|
16
|
-
def initiative_types_select(name, options = {})
|
16
|
+
def initiative_types_select(name, collection, options = {})
|
17
17
|
selected = object.send(name)
|
18
18
|
|
19
19
|
if selected.present?
|
20
20
|
if selected == "all"
|
21
|
-
types =
|
21
|
+
types = collection.all.map do |type|
|
22
22
|
[type.title[I18n.locale.to_s], type.id]
|
23
23
|
end
|
24
24
|
else
|
25
25
|
selected = selected.values if selected.is_a?(Hash)
|
26
26
|
selected = [selected] unless selected.is_a?(Array)
|
27
|
-
types =
|
27
|
+
types = collection.where(id: selected.map(&:to_i)).map do |type|
|
28
28
|
[type.title[I18n.locale.to_s], type.id]
|
29
29
|
end
|
30
30
|
end
|
@@ -29,6 +29,14 @@ Decidim.register_participatory_space(:initiatives) do |participatory_space|
|
|
29
29
|
seeds_root = File.join(__dir__, "..", "..", "..", "db", "seeds")
|
30
30
|
organization = Decidim::Organization.first
|
31
31
|
|
32
|
+
Decidim::ContentBlock.create(
|
33
|
+
organization: organization,
|
34
|
+
weight: 33,
|
35
|
+
scope: :homepage,
|
36
|
+
manifest_name: :highlighted_initiatives,
|
37
|
+
published_at: Time.current
|
38
|
+
)
|
39
|
+
|
32
40
|
3.times do |n|
|
33
41
|
type = Decidim::InitiativesType.create!(
|
34
42
|
title: Decidim::Faker::Localized.sentence(5),
|
@@ -56,9 +64,9 @@ Decidim.register_participatory_space(:initiatives) do |participatory_space|
|
|
56
64
|
scoped_type: Decidim::InitiativesTypeScope.reorder(Arel.sql("RANDOM()")).first,
|
57
65
|
state: state,
|
58
66
|
signature_type: "online",
|
59
|
-
|
60
|
-
|
61
|
-
published_at:
|
67
|
+
signature_start_date: Date.current - 7.days,
|
68
|
+
signature_end_date: Date.current + 7.days,
|
69
|
+
published_at: Time.current - 7.days,
|
62
70
|
author: Decidim::User.reorder(Arel.sql("RANDOM()")).first,
|
63
71
|
organization: organization
|
64
72
|
)
|
@@ -14,7 +14,7 @@ FactoryBot.define do
|
|
14
14
|
factory :initiatives_type_scope, class: Decidim::InitiativesTypeScope do
|
15
15
|
type { create(:initiatives_type) }
|
16
16
|
scope { create(:scope, organization: type.organization) }
|
17
|
-
supports_required 1000
|
17
|
+
supports_required { 1000 }
|
18
18
|
end
|
19
19
|
|
20
20
|
factory :initiative, class: Decidim::Initiative do
|
@@ -23,10 +23,10 @@ FactoryBot.define do
|
|
23
23
|
organization
|
24
24
|
author { create(:user, :confirmed, organization: organization) }
|
25
25
|
published_at { Time.current }
|
26
|
-
state "published"
|
27
|
-
signature_type "online"
|
28
|
-
|
29
|
-
|
26
|
+
state { "published" }
|
27
|
+
signature_type { "online" }
|
28
|
+
signature_start_date { Date.current - 1.day }
|
29
|
+
signature_end_date { Date.current + 120.days }
|
30
30
|
|
31
31
|
scoped_type do
|
32
32
|
create(:initiatives_type_scope,
|
@@ -39,47 +39,47 @@ FactoryBot.define do
|
|
39
39
|
end
|
40
40
|
|
41
41
|
trait :created do
|
42
|
-
state "created"
|
43
|
-
published_at nil
|
44
|
-
|
45
|
-
|
42
|
+
state { "created" }
|
43
|
+
published_at { nil }
|
44
|
+
signature_start_date { nil }
|
45
|
+
signature_end_date { nil }
|
46
46
|
end
|
47
47
|
|
48
48
|
trait :validating do
|
49
|
-
state "validating"
|
50
|
-
published_at nil
|
51
|
-
|
52
|
-
|
49
|
+
state { "validating" }
|
50
|
+
published_at { nil }
|
51
|
+
signature_start_date { nil }
|
52
|
+
signature_end_date { nil }
|
53
53
|
end
|
54
54
|
|
55
55
|
trait :published do
|
56
|
-
state "published"
|
56
|
+
state { "published" }
|
57
57
|
end
|
58
58
|
|
59
59
|
trait :accepted do
|
60
|
-
state "accepted"
|
60
|
+
state { "accepted" }
|
61
61
|
end
|
62
62
|
|
63
63
|
trait :discarded do
|
64
|
-
state "discarded"
|
64
|
+
state { "discarded" }
|
65
65
|
end
|
66
66
|
|
67
67
|
trait :rejected do
|
68
|
-
state "rejected"
|
68
|
+
state { "rejected" }
|
69
69
|
end
|
70
70
|
|
71
71
|
trait :online do
|
72
|
-
signature_type "online"
|
72
|
+
signature_type { "online" }
|
73
73
|
end
|
74
74
|
|
75
75
|
trait :offline do
|
76
|
-
signature_type "offline"
|
76
|
+
signature_type { "offline" }
|
77
77
|
end
|
78
78
|
|
79
79
|
trait :acceptable do
|
80
|
-
|
81
|
-
|
82
|
-
signature_type "online"
|
80
|
+
signature_start_date { Date.current - 3.months }
|
81
|
+
signature_end_date { Date.current - 2.months }
|
82
|
+
signature_type { "online" }
|
83
83
|
|
84
84
|
after(:build) do |initiative|
|
85
85
|
initiative.initiative_votes_count = initiative.scoped_type.supports_required + 1
|
@@ -87,9 +87,9 @@ FactoryBot.define do
|
|
87
87
|
end
|
88
88
|
|
89
89
|
trait :rejectable do
|
90
|
-
|
91
|
-
|
92
|
-
signature_type "online"
|
90
|
+
signature_start_date { Date.current - 3.months }
|
91
|
+
signature_end_date { Date.current - 2.months }
|
92
|
+
signature_type { "online" }
|
93
93
|
|
94
94
|
after(:build) do |initiative|
|
95
95
|
initiative.initiative_votes_count = initiative.scoped_type.supports_required - 1
|
@@ -114,18 +114,18 @@ FactoryBot.define do
|
|
114
114
|
factory :initiatives_committee_member, class: Decidim::InitiativesCommitteeMember do
|
115
115
|
initiative { create(:initiative) }
|
116
116
|
user { create(:user, :confirmed, organization: initiative.organization) }
|
117
|
-
state "accepted"
|
117
|
+
state { "accepted" }
|
118
118
|
|
119
119
|
trait :accepted do
|
120
|
-
state "accepted"
|
120
|
+
state { "accepted" }
|
121
121
|
end
|
122
122
|
|
123
123
|
trait :requested do
|
124
|
-
state "requested"
|
124
|
+
state { "requested" }
|
125
125
|
end
|
126
126
|
|
127
127
|
trait :rejected do
|
128
|
-
state "rejected"
|
128
|
+
state { "rejected" }
|
129
129
|
end
|
130
130
|
end
|
131
131
|
end
|