Sha256: 607dca6e4eef2f45e743a85bb7f315b1c8cd6c7e899cf25c56724efab226d47f
Contents?: true
Size: 1.81 KB
Versions: 62
Compression:
Stored size: 1.81 KB
Contents
module Workarea module Admin::TaxonsHelper def navigable_types [ [ t('workarea.admin.navigation_taxons.types.page'), 'page', { data: { new_navigation_taxon_endpoint: content_pages_path(format: :json) } } ], [ t('workarea.admin.navigation_taxons.types.category'), 'category', { data: { new_navigation_taxon_endpoint: catalog_categories_path(format: :json) } } ], [ t('workarea.admin.navigation_taxons.types.product'), 'product', { data: { new_navigation_taxon_endpoint: catalog_products_path(format: :json) } } ] ] end def taxonomy_select(name, current = nil) current = Navigation::Taxon.where(id: current).first content_tag( :div, hidden_field_tag(name, current.try(:id)) + render( 'workarea/admin/navigation_taxons/select', taxon: current ) + content_tag( :button, t('workarea.admin.navigation_taxons.select.reset_button'), value: 'reset', class: 'button button--small' ), data: { taxon_select: '' } ) end def taxon_icon(taxon, options = {}) if taxon.resource_name.category? inline_svg('workarea/admin/icons/categories.svg', options) elsif taxon.resource_name.page? inline_svg('workarea/admin/icons/pages.svg', options) else inline_svg('workarea/admin/icons/link.svg', options) end end def taxonomy_insert(taxon) content_tag( :div, render( 'workarea/admin/navigation_taxons/insert', parent: taxon.parent || Navigation::Taxon.root, taxon: taxon ), data: { taxon_insert: '' } ) end end end
Version data entries
62 entries across 62 versions & 1 rubygems