decidim-initiatives 0.24.3 → 0.25.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/cells/decidim/initiatives/content_blocks/highlighted_initiatives/show.erb +2 -0
- data/app/cells/decidim/initiatives/initiative_m_cell.rb +1 -3
- data/app/commands/decidim/initiatives/attachment_methods.rb +2 -1
- data/app/controllers/concerns/decidim/initiatives/admin/initiative_admin.rb +7 -0
- data/app/controllers/decidim/initiatives/admin/initiatives_controller.rb +7 -1
- data/app/controllers/decidim/initiatives/admin/initiatives_permissions_controller.rb +27 -0
- data/app/controllers/decidim/initiatives/admin/initiatives_types_controller.rb +0 -2
- data/app/controllers/decidim/initiatives/initiatives_controller.rb +4 -0
- data/app/controllers/decidim/initiatives/versions_controller.rb +6 -0
- data/app/forms/decidim/initiatives/admin/initiative_type_form.rb +5 -1
- data/app/forms/decidim/initiatives/initiative_form.rb +2 -1
- data/app/helpers/decidim/initiatives/admin/initiatives_helper.rb +25 -0
- data/app/jobs/decidim/initiatives/export_initiatives_job.rb +12 -5
- data/app/models/decidim/initiative.rb +21 -15
- data/app/models/decidim/initiatives_type.rb +3 -1
- data/app/packs/entrypoints/decidim_initiatives.js +6 -0
- data/app/packs/entrypoints/decidim_initiatives_admin.js +3 -0
- data/app/packs/entrypoints/decidim_initiatives_initiatives_votes.js +1 -0
- data/app/packs/entrypoints/decidim_initiatives_initiatives_votes.scss +1 -0
- data/app/packs/entrypoints/decidim_initiatives_print.js +1 -0
- data/app/packs/entrypoints/decidim_initiatives_print.scss +1 -0
- data/app/{assets/images/decidim/gamification/badges/initiatives.svg → packs/images/decidim/gamification/badges/decidim_gamification_badges_initiatives.svg} +0 -0
- data/app/{assets/images/decidim/initiatives/icon.svg → packs/images/decidim/initiatives/decidim_initiatives.svg} +0 -0
- data/app/{assets/javascripts/decidim/initiatives/admin/initiatives_types.js.es6 → packs/src/decidim/initiatives/admin/initiatives_types.js} +0 -0
- data/app/{assets/javascripts → packs/src}/decidim/initiatives/admin/invite_users.js +2 -2
- data/app/packs/src/decidim/initiatives/application.js +3 -0
- data/app/{assets/javascripts → packs/src}/decidim/initiatives/identity_selector_dialog.js +2 -2
- data/app/{assets/javascripts → packs/src}/decidim/initiatives/scoped_type.js +2 -2
- data/app/{assets/stylesheet/decidim/initiatives/admin.css.scss → packs/stylesheets/decidim/initiatives/admin.scss} +0 -0
- data/app/{assets/stylesheet/decidim/initiatives/initiatives-votes.css.scss → packs/stylesheets/decidim/initiatives/initiatives-votes.scss} +0 -0
- data/app/{assets/stylesheet → packs/stylesheets}/decidim/initiatives/initiatives.scss +3 -3
- data/app/{assets/stylesheet/decidim/initiatives/popularity_item.css.scss → packs/stylesheets/decidim/initiatives/popularity_item.scss} +0 -0
- data/app/{assets/stylesheet/decidim/initiatives/print-initiative.css.scss → packs/stylesheets/decidim/initiatives/print-initiative.scss} +0 -0
- data/app/{assets/stylesheet/decidim/initiatives/statistics.css.scss → packs/stylesheets/decidim/initiatives/statistics.scss} +0 -0
- data/app/queries/decidim/initiatives/admin/admin_users.rb +13 -8
- data/app/views/decidim/initiatives/admin/committee_requests/index.html.erb +1 -1
- data/app/views/decidim/initiatives/admin/exports/_dropdown.html.erb +19 -3
- data/app/views/decidim/initiatives/admin/initiatives/_form.html.erb +1 -1
- data/app/views/decidim/initiatives/admin/initiatives/index.html.erb +17 -14
- data/app/views/decidim/initiatives/admin/initiatives/show.html.erb +1 -1
- data/app/views/decidim/initiatives/admin/initiatives_types/_form.html.erb +1 -1
- data/app/views/decidim/initiatives/committee_requests/new.html.erb +2 -2
- data/app/views/decidim/initiatives/create_initiative/_share_committee_link.html.erb +1 -1
- data/app/views/decidim/initiatives/initiatives/_author.html.erb +4 -4
- data/app/views/decidim/initiatives/initiatives/_committee_members.html.erb +1 -1
- data/app/views/decidim/initiatives/initiatives/_filters.html.erb +1 -1
- data/app/views/decidim/initiatives/initiatives/_form.html.erb +2 -2
- data/app/views/decidim/initiatives/initiatives/index.html.erb +0 -3
- data/app/views/decidim/initiatives/initiatives/print.html.erb +1 -1
- data/app/views/decidim/initiatives/initiatives/show.html.erb +2 -2
- data/app/views/layouts/decidim/_initiative_header.html.erb +1 -1
- data/app/views/layouts/decidim/admin/initiative.html.erb +4 -51
- data/app/views/layouts/decidim/admin/initiatives.html.erb +1 -1
- data/app/views/layouts/decidim/admin/initiatives_votes.pdf.erb +1 -1
- data/app/views/layouts/decidim/initiative_creation.html.erb +1 -1
- data/app/views/layouts/decidim/initiative_signature_creation.html.erb +1 -1
- data/config/assets.rb +12 -0
- data/config/locales/ar.yml +2 -5
- data/config/locales/ca.yml +5 -6
- data/config/locales/cs.yml +5 -6
- data/config/locales/de.yml +5 -6
- data/config/locales/el.yml +2 -5
- data/config/locales/en.yml +8 -6
- data/config/locales/es-MX.yml +5 -6
- data/config/locales/es-PY.yml +5 -6
- data/config/locales/es.yml +5 -6
- data/config/locales/eu.yml +2 -5
- data/config/locales/fi-plain.yml +5 -6
- data/config/locales/fi.yml +5 -6
- data/config/locales/fr-CA.yml +2 -6
- data/config/locales/fr-LU.yml +613 -0
- data/config/locales/fr.yml +2 -6
- data/config/locales/gl.yml +5 -5
- data/config/locales/hu.yml +2 -6
- data/config/locales/id-ID.yml +2 -5
- data/config/locales/is-IS.yml +2 -5
- data/config/locales/it.yml +120 -5
- data/config/locales/ja.yml +112 -20
- data/config/locales/lb-LU.yml +1 -0
- data/config/locales/lv.yml +2 -5
- data/config/locales/nl.yml +5 -6
- data/config/locales/no.yml +2 -6
- data/config/locales/pl.yml +5 -6
- data/config/locales/pt-BR.yml +187 -5
- data/config/locales/pt.yml +2 -5
- data/config/locales/ro-RO.yml +45 -6
- data/config/locales/ru.yml +2 -5
- data/config/locales/sk.yml +2 -5
- data/config/locales/sv.yml +4 -6
- data/config/locales/tr-TR.yml +2 -6
- data/config/locales/uk.yml +2 -5
- data/config/locales/zh-CN.yml +2 -6
- data/db/migrate/20191002082220_move_signature_type_to_initative_type.rb +1 -1
- data/lib/decidim/api/initiative_api_type.rb +4 -0
- data/lib/decidim/initiatives/admin_engine.rb +70 -25
- data/lib/decidim/initiatives/engine.rb +5 -11
- data/lib/decidim/initiatives/participatory_space.rb +16 -3
- data/lib/decidim/initiatives/version.rb +1 -1
- metadata +41 -55
- data/app/assets/config/admin_decidim_initiatives_manifest.js +0 -4
- data/app/assets/config/decidim_initiatives_manifest.css +0 -3
- data/app/assets/config/decidim_initiatives_manifest.js +0 -5
- data/app/assets/javascripts/decidim/initiatives/application.js +0 -1
- data/app/helpers/decidim/initiatives/admin/initiative_admin_menu_helper.rb +0 -15
- data/config/locales/ja-JP.yml +0 -529
data/config/locales/pt.yml
CHANGED
@@ -68,6 +68,8 @@ pt:
|
|
68
68
|
search_placeholder:
|
69
69
|
title_or_description_or_id_string_or_author_name_or_author_nickname_cont: Pesquisar %{collection} por título, descrição, ID ou nome do autor.
|
70
70
|
menu:
|
71
|
+
components: Componentes
|
72
|
+
information: Informação
|
71
73
|
initiatives: Iniciativas
|
72
74
|
initiatives_types: Tipos de iniciativa
|
73
75
|
models:
|
@@ -461,11 +463,6 @@ pt:
|
|
461
463
|
vote: Assinar
|
462
464
|
layouts:
|
463
465
|
decidim:
|
464
|
-
admin:
|
465
|
-
initiative:
|
466
|
-
committee_members: Membros do Comité
|
467
|
-
components: Componentes
|
468
|
-
information: Informação
|
469
466
|
initiative_creation_header:
|
470
467
|
back: Retroceder
|
471
468
|
fill_data: Criar
|
data/config/locales/ro-RO.yml
CHANGED
@@ -88,8 +88,13 @@ ro:
|
|
88
88
|
search_placeholder:
|
89
89
|
title_or_description_or_id_string_or_author_name_or_author_nickname_cont: Căutați în %{collection} după titlu, descriere, ID sau numele autorului.
|
90
90
|
menu:
|
91
|
+
attachments: Atașamente
|
92
|
+
committee_members: Membrii Comitetului
|
93
|
+
components: Componente
|
94
|
+
information: Informare
|
91
95
|
initiatives: Inițiative
|
92
96
|
initiatives_types: Tipuri de inițiative
|
97
|
+
moderations: Moderări
|
93
98
|
models:
|
94
99
|
initiatives:
|
95
100
|
fields:
|
@@ -394,6 +399,17 @@ ro:
|
|
394
399
|
email_outro: Ați primit această notificare deoarece urmăriți %{author_nickname}. Puteți înceta să primiți notificări urmând linkul anterior.
|
395
400
|
email_subject: Inițiativă aprobată de %{author_nickname}
|
396
401
|
notification_title: Inițiativa <a href="%{resource_path}">%{resource_title}</a> a fost aprobată de <a href="%{author_path}">%{author_name} %{author_nickname}</a>.
|
402
|
+
revoke_membership_request:
|
403
|
+
email_intro: "%{author_nickname} a respins cererea dvs. pentru a face parte din comitetul promotorilor pentru inițiativa următoare %{resource_title}."
|
404
|
+
email_outro: 'Ați primit această notificare deoarece ați aplicat la această inițiativă: %{resource_title}.'
|
405
|
+
email_subject: "%{author_nickname} a respins cererea ta la comitetul promotorilor"
|
406
|
+
spawn_committee_request_event:
|
407
|
+
email_intro: "%{applicant_nickname} a aplicat pentru comitetul promotor al inițiativei dumneavoastră %{resource_title}. Pentru a accepta sau respinge cererea, accesați forma de editare a inițiativei dvs."
|
408
|
+
email_outro: 'Ați primit această notificare deoarece sunteți autorul acestei inițiative: %{resource_title}'
|
409
|
+
form:
|
410
|
+
add_attachments: Documente
|
411
|
+
attachment_legend: "(Opțional) Adăugați atașamente"
|
412
|
+
delete_attachment: Șterge
|
397
413
|
index:
|
398
414
|
title: Inițiative
|
399
415
|
initiative_signatures:
|
@@ -431,6 +447,12 @@ ro:
|
|
431
447
|
one: și încă o persoană
|
432
448
|
few: și încă %{count} persoane
|
433
449
|
other: și încă %{count} persoane
|
450
|
+
committee_members:
|
451
|
+
approve: Aprobă
|
452
|
+
confirm_revoke: Ești sigur?
|
453
|
+
invite_to_committee_help: Distribuie acest link pentru a invita alți participanți la comitetul promotorilor
|
454
|
+
no_members_yet: Nu există membri în comitetul promotorilor
|
455
|
+
title: Membrii comitetului
|
434
456
|
count:
|
435
457
|
title:
|
436
458
|
one: "Inițiativă %{count}"
|
@@ -471,11 +493,31 @@ ro:
|
|
471
493
|
recent: Cele mai recente
|
472
494
|
recently_published: Cel mai recent publicat
|
473
495
|
print:
|
496
|
+
address: Adresă
|
497
|
+
author_title: Autorul inițiativei
|
474
498
|
city: Localitate
|
499
|
+
email: Email
|
500
|
+
full_name: Numele complet
|
501
|
+
initiative:
|
502
|
+
attachments: Documentație atașată (vă rugăm să scrieți numele fiecărui document mai jos)
|
503
|
+
description: 'Descriere:'
|
504
|
+
title: 'Titlu:'
|
505
|
+
type: Tipul de inițiativă
|
506
|
+
phone_number: Număr de telefon
|
507
|
+
place_date: Locul, data
|
508
|
+
postal_code: Cod poștal/ZIP
|
509
|
+
print: Tipărește
|
510
|
+
province: Județ/stat
|
511
|
+
signature: Semnătură
|
475
512
|
result:
|
513
|
+
answer_title: S-a răspuns la această inițiativă
|
476
514
|
initiative_rejected_reason: Această inițiativă a fost respinsă din cauza lipsei de semnături.
|
477
515
|
show:
|
516
|
+
any_vote_method: Această inițiativă adună semnături online și personale.
|
517
|
+
edit: Editează
|
478
518
|
follow_description: Primiți o notificare atunci când există știri în această inițiativă
|
519
|
+
print: Imprimare inițiativă
|
520
|
+
send_to_technical_validation: Trimite la validarea tehnică
|
479
521
|
signatures_count:
|
480
522
|
one: " semnătură"
|
481
523
|
few: " semnături"
|
@@ -523,6 +565,9 @@ ro:
|
|
523
565
|
accepted: Acceptat
|
524
566
|
expired: Expirat
|
525
567
|
unavailable_scope: Domeniul de aplicare indisponibil
|
568
|
+
update:
|
569
|
+
error: A apărut o eroare
|
570
|
+
success: Inițiativa a fost actualizată
|
526
571
|
versions:
|
527
572
|
shared:
|
528
573
|
back_to_resource: Întoarce-te la inițiativă
|
@@ -535,12 +580,6 @@ ro:
|
|
535
580
|
vote: Semnare
|
536
581
|
layouts:
|
537
582
|
decidim:
|
538
|
-
admin:
|
539
|
-
initiative:
|
540
|
-
attachments: Atașamente
|
541
|
-
committee_members: Membrii Comitetului
|
542
|
-
components: Componente
|
543
|
-
information: Informare
|
544
583
|
initiative_creation_header:
|
545
584
|
back: Înapoi
|
546
585
|
fill_data: Crează
|
data/config/locales/ru.yml
CHANGED
@@ -46,6 +46,8 @@ ru:
|
|
46
46
|
actions:
|
47
47
|
new_initiative_type: Добавить вид почина
|
48
48
|
menu:
|
49
|
+
components: Составляющие
|
50
|
+
information: Сведения
|
49
51
|
initiatives: Почины
|
50
52
|
initiatives_types: Виды починов
|
51
53
|
models:
|
@@ -304,11 +306,6 @@ ru:
|
|
304
306
|
initiatives: Почины
|
305
307
|
layouts:
|
306
308
|
decidim:
|
307
|
-
admin:
|
308
|
-
initiative:
|
309
|
-
committee_members: Члены рабочей группы
|
310
|
-
components: Составляющие
|
311
|
-
information: Сведения
|
312
309
|
initiative_creation_header:
|
313
310
|
fill_data: Создать
|
314
311
|
finish: Закончить
|
data/config/locales/sk.yml
CHANGED
@@ -60,6 +60,8 @@ sk:
|
|
60
60
|
actions:
|
61
61
|
new_initiative_type: Nový typ iniciatívy
|
62
62
|
menu:
|
63
|
+
components: Komponenty
|
64
|
+
information: Informácie
|
63
65
|
initiatives: Iniciatívy
|
64
66
|
initiatives_types: Typy iniciatív
|
65
67
|
models:
|
@@ -393,11 +395,6 @@ sk:
|
|
393
395
|
vote: Hlasovanie
|
394
396
|
layouts:
|
395
397
|
decidim:
|
396
|
-
admin:
|
397
|
-
initiative:
|
398
|
-
committee_members: členovia komisie
|
399
|
-
components: Komponenty
|
400
|
-
information: Informácie
|
401
398
|
initiative_creation_header:
|
402
399
|
back: Späť
|
403
400
|
fill_data: Vytvoriť
|
data/config/locales/sv.yml
CHANGED
@@ -82,8 +82,12 @@ sv:
|
|
82
82
|
search_placeholder:
|
83
83
|
title_or_description_or_id_string_or_author_name_or_author_nickname_cont: Sök %{collection} med titel, beskrivning, ID eller författarnamn.
|
84
84
|
menu:
|
85
|
+
attachments: Bilagor
|
86
|
+
components: Komponenter
|
87
|
+
information: Information
|
85
88
|
initiatives: Initiativ
|
86
89
|
initiatives_types: Initiativtyper
|
90
|
+
moderations: Moderering
|
87
91
|
models:
|
88
92
|
initiatives:
|
89
93
|
fields:
|
@@ -533,12 +537,6 @@ sv:
|
|
533
537
|
vote: Underteckna
|
534
538
|
layouts:
|
535
539
|
decidim:
|
536
|
-
admin:
|
537
|
-
initiative:
|
538
|
-
attachments: Bilagor
|
539
|
-
committee_members: Kommittémedlemmar
|
540
|
-
components: Komponenter
|
541
|
-
information: Information
|
542
540
|
initiative_creation_header:
|
543
541
|
back: Tillbaka
|
544
542
|
fill_data: Skapa
|
data/config/locales/tr-TR.yml
CHANGED
@@ -85,6 +85,8 @@ tr:
|
|
85
85
|
search_placeholder:
|
86
86
|
title_or_description_or_id_string_or_author_name_or_author_nickname_cont: '%{collection} ''ı başlık, açıklama, kimlik veya yazar adına göre arayın.'
|
87
87
|
menu:
|
88
|
+
components: Bileşenler
|
89
|
+
information: Bilgi
|
88
90
|
initiatives: Girişimler
|
89
91
|
initiatives_types: Girişim türleri
|
90
92
|
models:
|
@@ -554,12 +556,6 @@ tr:
|
|
554
556
|
vote: İmza
|
555
557
|
layouts:
|
556
558
|
decidim:
|
557
|
-
admin:
|
558
|
-
initiative:
|
559
|
-
attachments: Ekli Dosyalar
|
560
|
-
committee_members: Komite üyeleri
|
561
|
-
components: Bileşenler
|
562
|
-
information: Bilgi
|
563
559
|
initiative_creation_header:
|
564
560
|
back: Geri
|
565
561
|
fill_data: Oluştur
|
data/config/locales/uk.yml
CHANGED
@@ -46,6 +46,8 @@ uk:
|
|
46
46
|
actions:
|
47
47
|
new_initiative_type: Додати різновид почину
|
48
48
|
menu:
|
49
|
+
components: Складові
|
50
|
+
information: Відомості
|
49
51
|
initiatives: Почини
|
50
52
|
initiatives_types: Різновиди починів
|
51
53
|
models:
|
@@ -304,11 +306,6 @@ uk:
|
|
304
306
|
initiatives: Почини
|
305
307
|
layouts:
|
306
308
|
decidim:
|
307
|
-
admin:
|
308
|
-
initiative:
|
309
|
-
committee_members: Члени робочого гурту
|
310
|
-
components: Складові
|
311
|
-
information: Відомості
|
312
309
|
initiative_creation_header:
|
313
310
|
fill_data: Внести
|
314
311
|
finish: Завершити
|
data/config/locales/zh-CN.yml
CHANGED
@@ -82,6 +82,8 @@ zh-CN:
|
|
82
82
|
search_placeholder:
|
83
83
|
title_or_description_or_id_string_or_author_name_or_author_nickname_cont: 按标题、描述、ID或作者名称搜索 %{collection}。
|
84
84
|
menu:
|
85
|
+
components: 组件
|
86
|
+
information: 信息
|
85
87
|
initiatives: 倡议
|
86
88
|
initiatives_types: 倡议类型
|
87
89
|
models:
|
@@ -479,12 +481,6 @@ zh-CN:
|
|
479
481
|
vote: 签名
|
480
482
|
layouts:
|
481
483
|
decidim:
|
482
|
-
admin:
|
483
|
-
initiative:
|
484
|
-
attachments: 附件
|
485
|
-
committee_members: 委员会成员
|
486
|
-
components: 组件
|
487
|
-
information: 信息
|
488
484
|
initiative_creation_header:
|
489
485
|
back: 后退
|
490
486
|
fill_data: 创建
|
@@ -22,7 +22,7 @@ class MoveSignatureTypeToInitativeType < ActiveRecord::Migration[5.2]
|
|
22
22
|
|
23
23
|
InitiativesType.reset_column_information
|
24
24
|
|
25
|
-
|
25
|
+
InitiativesType.find_each do |type|
|
26
26
|
type.signature_type = if type.online_signature_enabled && face_to_face_voting_allowed
|
27
27
|
:any
|
28
28
|
elsif type.online_signature_enabled && !face_to_face_voting_allowed
|
@@ -21,6 +21,10 @@ module Decidim
|
|
21
21
|
field :signature_type, GraphQL::Types::String, "Signature type of the initiative", null: true
|
22
22
|
|
23
23
|
field :initiatives, [Decidim::Initiatives::InitiativeType, { null: true }], "The initiatives that have this type", null: false
|
24
|
+
|
25
|
+
def banner_image
|
26
|
+
object.attached_uploader(:banner_image).path
|
27
|
+
end
|
24
28
|
end
|
25
29
|
end
|
26
30
|
end
|
@@ -44,6 +44,8 @@ module Decidim
|
|
44
44
|
end
|
45
45
|
end
|
46
46
|
|
47
|
+
resource :permissions, controller: "initiatives_permissions"
|
48
|
+
|
47
49
|
resource :answer, only: [:edit, :update]
|
48
50
|
end
|
49
51
|
|
@@ -79,41 +81,84 @@ module Decidim
|
|
79
81
|
end
|
80
82
|
end
|
81
83
|
|
82
|
-
initializer "
|
83
|
-
|
84
|
-
|
85
|
-
|
84
|
+
initializer "decidim_initiaves.admin_menu" do
|
85
|
+
Decidim.menu :admin_menu do |menu|
|
86
|
+
menu.add_item :initiatives,
|
87
|
+
I18n.t("menu.initiatives", scope: "decidim.admin"),
|
88
|
+
decidim_admin_initiatives.initiatives_path,
|
89
|
+
icon_name: "chat",
|
90
|
+
position: 2.4,
|
91
|
+
active: :inclusive,
|
92
|
+
if: allowed_to?(:enter, :space_area, space_name: :initiatives)
|
93
|
+
end
|
86
94
|
end
|
87
95
|
|
88
|
-
initializer "admin_decidim_initiatives.
|
89
|
-
|
90
|
-
|
96
|
+
initializer "admin_decidim_initiatives.admin_components_menu" do
|
97
|
+
Decidim.menu :admin_initiatives_components_menu do |menu|
|
98
|
+
current_participatory_space.components.each do |component|
|
99
|
+
caption = translated_attribute(component.name)
|
100
|
+
if component.primary_stat.present?
|
101
|
+
caption += content_tag(:span, component.primary_stat, class: component.primary_stat.zero? ? "component-counter component-counter--off" : "component-counter")
|
102
|
+
end
|
103
|
+
|
104
|
+
menu.add_item [component.manifest_name, component.id].join("_"),
|
105
|
+
caption.html_safe,
|
106
|
+
manage_component_path(component),
|
107
|
+
active: is_active_link?(manage_component_path(component)),
|
108
|
+
if: component.manifest.admin_engine # && user_role_config.component_is_accessible?(component.manifest_name)
|
109
|
+
end
|
91
110
|
end
|
92
111
|
end
|
93
112
|
|
94
|
-
initializer "
|
95
|
-
Decidim.menu :
|
96
|
-
menu.
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
113
|
+
initializer "admin_decidim_initiative.admin_menu" do
|
114
|
+
Decidim.menu :admin_initiative_menu do |menu|
|
115
|
+
menu.add_item :edit_initiative,
|
116
|
+
I18n.t("menu.information", scope: "decidim.admin"),
|
117
|
+
decidim_admin_initiatives.edit_initiative_path(current_participatory_space),
|
118
|
+
active: is_active_link?(decidim_admin_initiatives.edit_initiative_path(current_participatory_space)),
|
119
|
+
if: allowed_to?(:edit, :initiative, initiative: current_participatory_space)
|
120
|
+
|
121
|
+
menu.add_item :initiative_committee_requests,
|
122
|
+
I18n.t("menu.committee_members", scope: "decidim.admin"),
|
123
|
+
decidim_admin_initiatives.initiative_committee_requests_path(current_participatory_space),
|
124
|
+
active: is_active_link?(decidim_admin_initiatives.initiative_committee_requests_path(current_participatory_space)),
|
125
|
+
if: current_participatory_space.promoting_committee_enabled? && allowed_to?(:manage_membership, :initiative, initiative: current_participatory_space)
|
126
|
+
|
127
|
+
menu.add_item :components,
|
128
|
+
I18n.t("menu.components", scope: "decidim.admin"),
|
129
|
+
decidim_admin_initiatives.components_path(current_participatory_space),
|
130
|
+
active: is_active_link?(decidim_admin_initiatives.components_path(current_participatory_space)),
|
131
|
+
if: allowed_to?(:read, :component, initiative: current_participatory_space),
|
132
|
+
submenu: { target_menu: :admin_initiatives_components_menu, options: { container_options: { id: "components-list" } } }
|
133
|
+
|
134
|
+
menu.add_item :initiative_attachments,
|
135
|
+
I18n.t("menu.attachments", scope: "decidim.admin"),
|
136
|
+
decidim_admin_initiatives.initiative_attachments_path(current_participatory_space),
|
137
|
+
active: is_active_link?(decidim_admin_initiatives.initiative_attachments_path(current_participatory_space)),
|
138
|
+
if: allowed_to?(:read, :attachment, initiative: current_participatory_space)
|
139
|
+
|
140
|
+
menu.add_item :moderations,
|
141
|
+
I18n.t("menu.moderations", scope: "decidim.admin"),
|
142
|
+
decidim_admin_initiatives.moderations_path(current_participatory_space),
|
143
|
+
active: is_active_link?(decidim_admin_initiatives.moderations_path(current_participatory_space)),
|
144
|
+
if: allowed_to?(:read, :moderation)
|
102
145
|
end
|
103
146
|
end
|
104
147
|
|
105
148
|
initializer "admin_decidim_initiatives.admin_menu" do
|
106
149
|
Decidim.menu :admin_initiatives_menu do |menu|
|
107
|
-
menu.
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
150
|
+
menu.add_item :initiatives,
|
151
|
+
I18n.t("menu.initiatives", scope: "decidim.admin"),
|
152
|
+
decidim_admin_initiatives.initiatives_path,
|
153
|
+
position: 1.0,
|
154
|
+
active: is_active_link?(decidim_admin_initiatives.initiatives_path),
|
155
|
+
if: allowed_to?(:index, :initiative)
|
156
|
+
|
157
|
+
menu.add_item :initiatives_types,
|
158
|
+
I18n.t("menu.initiatives_types", scope: "decidim.admin"),
|
159
|
+
decidim_admin_initiatives.initiatives_types_path,
|
160
|
+
active: is_active_link?(decidim_admin_initiatives.initiatives_types_path),
|
161
|
+
if: allowed_to?(:manage, :initiative_type)
|
117
162
|
end
|
118
163
|
end
|
119
164
|
end
|
@@ -65,13 +65,6 @@ module Decidim
|
|
65
65
|
end
|
66
66
|
end
|
67
67
|
|
68
|
-
initializer "decidim_initiatives.assets" do |app|
|
69
|
-
app.config.assets.precompile += %w(
|
70
|
-
decidim_initiatives_manifest.js
|
71
|
-
decidim_initiatives_manifest.css
|
72
|
-
)
|
73
|
-
end
|
74
|
-
|
75
68
|
initializer "decidim_initiatives.content_blocks" do
|
76
69
|
Decidim.content_blocks.register(:homepage, :highlighted_initiatives) do |content_block|
|
77
70
|
content_block.cell = "decidim/initiatives/content_blocks/highlighted_initiatives"
|
@@ -92,10 +85,11 @@ module Decidim
|
|
92
85
|
|
93
86
|
initializer "decidim_initiatives.menu" do
|
94
87
|
Decidim.menu :menu do |menu|
|
95
|
-
menu.
|
96
|
-
|
97
|
-
|
98
|
-
|
88
|
+
menu.add_item :initiatives,
|
89
|
+
I18n.t("menu.initiatives", scope: "decidim"),
|
90
|
+
decidim_initiatives.initiatives_path,
|
91
|
+
position: 2.4,
|
92
|
+
active: :inclusive
|
99
93
|
end
|
100
94
|
end
|
101
95
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
Decidim.register_participatory_space(:initiatives) do |participatory_space|
|
4
|
-
participatory_space.icon = "
|
4
|
+
participatory_space.icon = "media/images/decidim_initiatives.svg"
|
5
5
|
participatory_space.stylesheet = "decidim/initiatives/initiatives"
|
6
6
|
|
7
7
|
participatory_space.context(:public) do |context|
|
@@ -21,6 +21,8 @@ Decidim.register_participatory_space(:initiatives) do |participatory_space|
|
|
21
21
|
participatory_space.query_type = "Decidim::Initiatives::InitiativeType"
|
22
22
|
|
23
23
|
participatory_space.register_resource(:initiative) do |resource|
|
24
|
+
resource.actions = %w(comment)
|
25
|
+
resource.permissions_class_name = "Decidim::Initiatives::Permissions"
|
24
26
|
resource.model_class_name = "Decidim::Initiative"
|
25
27
|
resource.card = "decidim/initiatives/initiative"
|
26
28
|
resource.searchable = true
|
@@ -59,7 +61,12 @@ Decidim.register_participatory_space(:initiatives) do |participatory_space|
|
|
59
61
|
title: Decidim::Faker::Localized.sentence(word_count: 5),
|
60
62
|
description: Decidim::Faker::Localized.sentence(word_count: 25),
|
61
63
|
organization: organization,
|
62
|
-
banner_image:
|
64
|
+
banner_image: ActiveStorage::Blob.create_after_upload!(
|
65
|
+
io: File.open(File.join(seeds_root, "city2.jpeg")),
|
66
|
+
filename: "banner_image.jpeg",
|
67
|
+
content_type: "image/jpeg",
|
68
|
+
metadata: nil
|
69
|
+
)
|
63
70
|
)
|
64
71
|
|
65
72
|
organization.top_scopes.each do |scope|
|
@@ -104,7 +111,13 @@ Decidim.register_participatory_space(:initiatives) do |participatory_space|
|
|
104
111
|
title: Decidim::Faker::Localized.sentence(word_count: 2),
|
105
112
|
description: Decidim::Faker::Localized.sentence(word_count: 5),
|
106
113
|
attached_to: initiative,
|
107
|
-
|
114
|
+
content_type: "image/jpeg",
|
115
|
+
file: ActiveStorage::Blob.create_after_upload!(
|
116
|
+
io: File.open(File.join(seeds_root, "city.jpeg")),
|
117
|
+
filename: "city.jpeg",
|
118
|
+
content_type: "image/jpeg",
|
119
|
+
metadata: nil
|
120
|
+
)
|
108
121
|
)
|
109
122
|
|
110
123
|
Decidim::Initiatives.default_components.each do |component_name|
|