Sha256: c4d41eb5f0489d4d6def0a1f088b9fa47204472a167b10ce8008369f882e015a

Contents?: true

Size: 1.19 KB

Versions: 7

Compression:

Stored size: 1.19 KB

Contents

# frozen_string_literal: true

module Decidim
  module Design
    module FollowHelper
      def follow_sections
        [
          {
            id: "usage",
            contents: [
              {
                type: :text,
                values: ["Make sure the partial <code>decidim/shared/login_modal</code> is present in the DOM.
                          This partial is placed in the application layout when the user is logged in."]
              },
              {
                type: :table,
                options: { headings: ["Follow Button"] },
                items: follow_table(
                  { partial: "decidim/design/components/follow/static-follow-default" },
                  { partial: "decidim/design/components/follow/static-follow-unfollow" }
                ),
                cell_snippet: {
                  cell: "decidim/follow_button",
                  args: [Decidim::User.first]
                }
              }
            ]
          }
        ]
      end

      def follow_table(*table_rows, **_opts)
        table_rows.map do |table_cell|
          row = []
          row << render(partial: table_cell[:partial])
          row
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
decidim-design-0.28.4 app/helpers/decidim/design/follow_helper.rb
decidim-design-0.28.3 app/helpers/decidim/design/follow_helper.rb
decidim-design-0.28.2 app/helpers/decidim/design/follow_helper.rb
decidim-design-0.28.1 app/helpers/decidim/design/follow_helper.rb
decidim-design-0.28.0 app/helpers/decidim/design/follow_helper.rb
decidim-design-0.28.0.rc5 app/helpers/decidim/design/follow_helper.rb
decidim-design-0.28.0.rc4 app/helpers/decidim/design/follow_helper.rb