7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
|
# File 'lib/decidim/votings/content_blocks/registry_manager.rb', line 7
def self.register!
Decidim.content_blocks.register(:homepage, :highlighted_votings) do |content_block|
content_block.cell = "decidim/votings/content_blocks/highlighted_votings"
content_block.public_name_key = "decidim.votings.content_blocks.highlighted_votings.name"
content_block.settings_form_cell = "decidim/votings/content_blocks/highlighted_votings_settings_form"
content_block.settings do |settings|
settings.attribute :max_results, type: :integer, default: 4
end
end
Decidim.content_blocks.register(:voting_landing_page, :hero) do |content_block|
content_block.cell = "decidim/votings/content_blocks/hero"
content_block.settings_form_cell = "decidim/content_blocks/participatory_space_hero_settings_form"
content_block.public_name_key = "decidim.content_blocks.hero.name"
content_block.images = [
{
name: :background_image,
uploader: "Decidim::BackgroundImageUploader"
}
]
content_block.settings do |settings|
settings.attribute :button_text, type: :text, translated: true
settings.attribute :button_url, type: :text, translated: true
end
content_block.default!
end
Decidim.content_blocks.register(:voting_landing_page, :title) do |content_block|
content_block.cell = "decidim/votings/content_blocks/main_data"
content_block.public_name_key = "decidim.votings.admin.content_blocks.main_data.name"
content_block.default!
end
Decidim.content_blocks.register(:voting_landing_page, :related_elections) do |content_block|
content_block.cell = "decidim/elections/content_blocks/related_elections"
content_block.settings_form_cell = "decidim/content_blocks/highlighted_elements_for_component_settings_form"
content_block.public_name_key = "decidim.votings.admin.content_blocks.related_elections.name"
content_block.component_manifest_name = "elections"
content_block.settings do |settings|
settings.attribute :component_id, type: :select, default: nil
end
end
Decidim.content_blocks.register(:voting_landing_page, :polling_stations) do |content_block|
content_block.cell = "decidim/votings/content_blocks/polling_stations"
content_block.public_name_key = "decidim.votings.admin.content_blocks.polling_stations.name"
content_block.default!
end
Decidim.content_blocks.register(:voting_landing_page, :stats) do |content_block|
content_block.cell = "decidim/votings/content_blocks/statistics"
content_block.public_name_key = "decidim.votings.admin.content_blocks.stats.name"
content_block.default!
end
Decidim.content_blocks.register(:voting_landing_page, :metrics) do |content_block|
content_block.cell = "decidim/votings/content_blocks/metrics"
content_block.public_name_key = "decidim.votings.admin.content_blocks.metrics.name"
end
Decidim.content_blocks.register(:voting_landing_page, :html) do |content_block|
content_block.cell = "decidim/content_blocks/html"
content_block.public_name_key = "decidim.content_blocks.html.name"
content_block.settings_form_cell = "decidim/content_blocks/html_settings_form"
content_block.settings do |settings|
settings.attribute :html_content, type: :text, translated: true
end
end
Decidim.content_blocks.register(:voting_landing_page, :related_documents) do |content_block|
content_block.cell = "decidim/content_blocks/participatory_space_documents"
content_block.public_name_key = "decidim.application.documents.related_documents"
end
Decidim.content_blocks.register(:voting_landing_page, :related_images) do |content_block|
content_block.cell = "decidim/content_blocks/participatory_space_images"
content_block.public_name_key = "decidim.application.photos.related_photos"
end
end
|