6
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
|
# File 'decidim-design/app/helpers/decidim/design/announcement_helper.rb', line 6
def announcement_sections
[
{
id: "callout_class",
contents: [
{
type: :text,
values: ["This attribute applies an status to the announcement. By default, it uses secondary color."]
},
{
type: :table,
options: { headings: ["Announcement", "Callout class"] },
items: announcement_table(
{ text: "I am an announcement", callout_class: nil },
{ text: "I am an announcement", callout_class: "alert" },
{ text: "I am an announcement", callout_class: "warning" },
{ text: "I am an announcement", callout_class: "success" }
),
cell_snippet: {
cell: "decidim/announcement",
args: ["I am an annoucement"]
}
}
]
},
{
id: "plain_text_vs_hash",
contents: [
{
type: :text,
values: ["You can provide as first argument both a plain text and a hash object"]
},
{
type: :table,
options: { headings: %w(Announcement Argument) },
items: announcement_table(
{ text: "I am just plain text", argument: '"I am just plain text"' },
{ text: { title: "This is the title", body: "This is the body" }, argument: '{ title: "This is the title", body: "This is the body" }' }
),
cell_snippet: {
cell: "decidim/announcement",
args: [{ title: "This is the title", body: "This is the body" }]
}
}
]
}
]
end
|