Module: Decidim::Design::ShareHelper

Defined in:
decidim-design/app/helpers/decidim/design/share_helper.rb

Instance Method Summary collapse

Instance Method Details

#share_sectionsObject



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'decidim-design/app/helpers/decidim/design/share_helper.rb', line 6

def share_sections
  [
    {
      id: "usage",
      contents: [
        {
          type: :text,
          values: ["Make sure the partial <code>decidim/shared/share_modal</code> is present in the DOM. This partial is placed in the application layout."]
        },
        {
          type: :table,
          options: { headings: ["Share Button"] },
          items: share_table({}),
          cell_snippet: {
            cell: "decidim/share_button",
            args: []
          }
        }
      ]
    }
  ]
end

#share_table(*table_rows, **_opts) ⇒ Object



29
30
31
32
33
34
35
# File 'decidim-design/app/helpers/decidim/design/share_helper.rb', line 29

def share_table(*table_rows, **_opts)
  table_rows.each_with_index.map do
    row = []
    row << { method: :cell, args: ["decidim/share_button", nil] }
    row
  end
end