Module: Decidim::Design::IconographyHelper
- Includes:
- IconHelper, SocialShareButtonHelper
- Defined in:
- app/helpers/decidim/design/iconography_helper.rb
Instance Method Summary collapse
- #iconography_sections ⇒ Object
- #iconography_table(table_rows) ⇒ Object
- #remix_icons ⇒ Object
- #social_share_iconography_table ⇒ Object
- #social_share_icons ⇒ Object
Instance Method Details
#iconography_sections ⇒ Object
9 10 11 |
# File 'app/helpers/decidim/design/iconography_helper.rb', line 9 def iconography_sections (remix_icons + ).sort_by { |section| section[:id] } end |
#iconography_table(table_rows) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'app/helpers/decidim/design/iconography_helper.rb', line 13 def iconography_table(table_rows) = { class: "mx-auto w-4 h-4 text-gray fill-current flex-none" } table_rows.map do |table_cell| row = [] row << icon(table_cell[:name], **) row << content_tag(:code, table_cell[:icon]) row << table_cell[:category] row << table_cell[:description] row end end |
#remix_icons ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'app/helpers/decidim/design/iconography_helper.rb', line 27 def remix_icons Decidim.icons.categories.map do |category, values| { id: category, contents: [ { type: :table, options: { headings: %w(Icon Code Category Description) }, items: iconography_table(values.sort_by { |v| v[:icon] }) } ] } end end |
#social_share_iconography_table ⇒ Object
57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'app/helpers/decidim/design/iconography_helper.rb', line 57 def = { class: "mx-auto w-4 h-4 text-gray fill-current flex-none" } Decidim..manifests.map do |service| row = [] row << (service, **) row << content_tag(:code, service.name) row << "social-share" row << t("decidim.shared.share_modal.share_to", service: service.name) row end end |
#social_share_icons ⇒ Object
42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'app/helpers/decidim/design/iconography_helper.rb', line 42 def [ { id: "social-share", contents: [ { type: :table, options: { headings: %w(Icon Code Category Description) }, items: } ] } ] end |