Module: Decidim::Design::CardsHelper

Includes:
CardHelper
Defined in:
decidim-design/app/helpers/decidim/design/cards_helper.rb

Defined Under Namespace

Classes: DummyClass

Instance Method Summary collapse

Methods included from CardHelper

#card_for

Instance Method Details

#cards_sectionsObject



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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# File 'decidim-design/app/helpers/decidim/design/cards_helper.rb', line 22

def cards_sections
  [
    {
      id: "types",
      title: t("decidim.design.helpers.types"),
      contents: [
        {
          values: section_subtitle(title: t("decidim.design.helpers.card_l"), label: t("decidim.design.helpers.list"))
        },
        {
          type: :partial,
          template: "decidim/design/components/cards/static-card-l"
        },
        {
          type: :partial,
          template: "decidim/design/components/cards/static-card-l"
        },
        {
          values: section_subtitle(title: t("decidim.design.helpers.card_g"), label: t("decidim.design.helpers.grid"))
        },
        {
          type: :partial,
          layout: "decidim/design/shared/card_grid",
          template: ["decidim/design/components/cards/static-card-g", "decidim/design/components/cards/static-card-g"]
        },
        {
          values: section_subtitle(title: t("decidim.design.helpers.card_s"), label: t("decidim.design.helpers.search"))
        },
        {
          type: :partial,
          template: "decidim/design/components/cards/static-card-s"
        },
        {
          type: :partial,
          template: "decidim/design/components/cards/static-card-s"
        }
      ]
    },
    {
      id: "variations",
      title: t("decidim.design.helpers.variations"),
      contents: [
        {
          type: :text,
          values: [t("decidim.design.helpers.variations_cards_description")]
        },
        {
          values: section_subtitle(title: t("decidim.design.helpers.metadata_items"))
        },
        {
          type: :partial,
          layout: "decidim/design/shared/card_grid",
          template: ["decidim/design/components/cards/static-card-g-metadata", "decidim/design/components/cards/static-card-g-metadata-2"]
        },
        {
          type: :text,
          values: [t("decidim.design.helpers.metadata_text")]
        },
        {
          values: section_subtitle(title: t("decidim.design.helpers.highlight"))
        },
        {
          type: :partial,
          template: "decidim/design/components/cards/static-card-g-highlight"
        },
        {
          type: :text,
          values: [t("decidim.design.helpers.highlight_description")]
        },
        {
          values: section_subtitle(title: t("decidim.design.helpers.image_and_description"))
        },
        {
          type: :partial,
          template: "decidim/design/components/cards/static-card-l-image"
        },
        {
          type: :text,
          values: [t("decidim.design.helpers.blog_cards_html")]
        },
        {
          values: section_subtitle(title: t("decidim.design.helpers.description"))
        },
        {
          type: :partial,
          template: "decidim/design/components/cards/static-card-l-description"
        },
        {
          type: :text,
          values: [t("decidim.design.helpers.debates_cards_html")]
        },
        {
          values: section_subtitle(title: t("decidim.design.helpers.debates_cards_text"))
        },
        {
          type: :partial,
          template: "decidim/design/components/cards/static-card-l-meetings"
        },
        {
          type: :text,
          values: [t("decidim.design.helpers.meetings_html")]
        },
        {
          values: section_subtitle(title: t("decidim.design.helpers.block_text"))
        },
        {
          type: :partial,
          template: "decidim/design/components/cards/static-card-l-extra-data"
        },
        {
          type: :text,
          values: [t("decidim.design.helpers.accountability_cards_html")]
        },
        {
          type: :partial,
          template: "decidim/design/components/cards/static-card-l-extra-data-2"
        },
        {
          type: :text,
          values: [t("decidim.design.helpers.budget_card_html")]
        }
      ]
    },
    {
      id: "source_code",
      title: t("decidim.design.helpers.source_code"),
      contents: source_contents
    }
  ]
end

#source_contentsObject



153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
# File 'decidim-design/app/helpers/decidim/design/cards_helper.rb', line 153

def source_contents
  dummy_resource = DummyClass.new(
    id: 1000,
    organization: current_organization,
    title: t("decidim.design.helpers.dummy_title"),
    description: t("decidim.design.helpers.dummy_description")
  )

  contents = [
    { values: section_subtitle(title: t("decidim.design.helpers.generic_cards")) },
    cell_table_item(t("decidim.design.helpers.card_g"), { cell: "decidim/card_l", args: [dummy_resource], call_string: 'cell("decidim/card_l", _RESOURCE_)' }),
    cell_table_item(t("decidim.design.helpers.card_l"), { cell: "decidim/card_l", args: [dummy_resource], call_string: 'cell("decidim/card_g", _RESOURCE_)' }),
    cell_table_item(t("decidim.design.helpers.card_s"), { cell: "decidim/card_l", args: [dummy_resource], call_string: 'cell("decidim/card_s", _RESOURCE_)' })
  ]

  contents += accountability_items
  contents += blogs_items
  contents += budgets_items
  contents += debates_items
  contents += meetings_items
  contents += proposals_items
  contents += sortitions_items
  contents += assemblies_items
  contents += conferences_items
  contents += initiatives_items
  contents += participatory_processes_items

  contents
end