Module: Decidim::Design::IconographyHelper
- Includes:
- IconHelper, SocialShareButtonHelper
- Defined in:
- decidim-design/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
Methods included from SocialShareButtonHelper
#render_social_share_button, #render_social_share_buttons, #render_social_share_icon, #social_share_button_tag
Methods included from IconHelper
#component_icon, #manifest_icon, #resource_icon, #resource_type_icon, #resource_type_icon_key, #text_with_resource_icon
Methods included from LayoutHelper
#_icon_classes, #apple_favicon, #application_path, #current_url, #current_user_unread_data, #extended_navigation_bar, #external_icon, #favicon, #icon, #legacy_favicon, #role
Methods included from TooltipHelper
Methods included from ModalHelper
#decidim_drawer, #decidim_modal
Methods included from OrganizationHelper
#current_organization_name, #organization_colors, #organization_description_label, #organization_name
Methods included from TranslatableAttributes
Instance Method Details
#iconography_sections ⇒ Object
9 10 11 |
# File 'decidim-design/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 'decidim-design/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 'decidim-design/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 'decidim-design/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 'decidim-design/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 |