.grid.grid--auto.grid--flush.grid--center .grid__cell .card{ class: card_classes(:attributes, local_assigns[:active]) } = link_to edit_search_customization_path(model), class: 'card__header' do %span.card__header-text= t('workarea.admin.cards.attributes.title') = inline_svg 'workarea/admin/icons/attributes.svg', class: 'card__icon' - if local_assigns[:active].blank? .card__body %ul.list-reset %li %strong= t('workarea.admin.fields.active') = check_box_tag 'customization', 'active', model.active, disabled: true %li %strong= t('workarea.admin.search_customizations.cards.attribtes.search_id') = model.id %li %strong= t('workarea.admin.search_customizations.cards.attribtes.search_terms') = model.query %li %strong= t('workarea.admin.fields.rewrite') = model.rewrite.presence || t('workarea.admin.cards.attributes.no_value') %li %strong= t('workarea.admin.fields.redirect') = model.redirect.presence || t('workarea.admin.cards.attributes.no_value') %li %strong= t('workarea.admin.fields.updated_at') #{local_time_ago(model.updated_at)} %li %strong= t('workarea.admin.fields.created_at') #{local_time_ago(model.created_at)} = link_to edit_search_customization_path(model), class: 'card__button' do %span.button.button--small= t('workarea.admin.cards.attributes.button') .grid__cell .card{ class: card_classes(:featured_products, local_assigns[:active]) } = link_to select_featured_product_path(model.to_global_id), class: 'card__header' do %span.card__header-text= t('workarea.admin.search_customizations.cards.featured_products.title') = inline_svg 'workarea/admin/icons/featured_products.svg', class: 'card__icon' - if local_assigns[:active].blank? .card__body - if model.featured_products.empty? .card__empty-note %p= t('workarea.admin.search_customizations.cards.featured_products.no_featured_products') %p= t('workarea.admin.search_customizations.cards.featured_products.featured_products_description') = link_to select_featured_product_path(model.to_global_id), class: 'card__button' do %span.button.button--small= t('workarea.admin.search_customizations.cards.featured_products.add_featured_products') - else %ol.grid - model.featured_products.take(4).each_with_index do |product, i| %li.grid__cell.grid__cell--50 .card__photo-box - if i == 3 && model.featured_products.size > 4 %span.card__photo +#{model.featured_products.size - i} - else = image_tag product_image_url(product.primary_image, :medium), alt: product.name, class: 'card__photo' = link_to edit_featured_product_path(model.to_global_id), class: 'card__button' do %span.button.button--small= t('workarea.admin.search_customizations.cards.featured_products.manage_featured_product') .grid__cell = render 'workarea/admin/product_rules/card', product_list: model, active: local_assigns[:active] .grid__cell .card{ class: card_classes(:analyze, local_assigns[:active]) } = link_to analyze_search_customization_path(model), class: 'card__header' do %span.card__header-text= t('workarea.admin.search_customizations.cards.analyze.title') = inline_svg 'workarea/admin/icons/search.svg', class: 'card__icon' - if local_assigns[:active].blank? .card__body %p.card__empty-note= t('workarea.admin.search_customizations.cards.analyze.description') = link_to analyze_search_customization_path(model), class: 'card__button' do %span.button.button--small= t('workarea.admin.search_customizations.cards.analyze.title') .grid__cell .card{ class: card_classes(:insights, local_assigns[:active]) } = link_to insights_search_customization_path(model), class: 'card__header' do %span.card__header-text= t('workarea.admin.search_customizations.cards.insights.title') = inline_svg 'workarea/admin/icons/insights.svg', class: 'card__icon' - if local_assigns[:active].blank? .card__body %p.align-center %span.spark.spark--large {#{sparkline_analytics_data_for(model.insights.orders_sparkline).join(',')}} %span.heading.heading--4.align-center #{number_with_delimiter model.insights.orders} #{t('workarea.admin.search_customizations.cards.insights.orders')} #{insights_trend_icon(model.insights.orders_percent_change)} .grid.grid--center .grid__cell.grid__cell--50 %p.align-center %strong= number_with_delimiter model.insights.searches #{insights_trend_icon(model.insights.searches_percent_change)} %br #{t('workarea.admin.search_customizations.cards.insights.searches')} .grid__cell.grid__cell--50 %p.align-center %strong= number_to_currency model.insights.revenue #{insights_trend_icon(model.insights.revenue_percent_change)} %br #{t('workarea.admin.search_customizations.cards.insights.revenue')} .grid__cell.grid__cell--50 %p.align-center %strong= number_with_delimiter model.insights.units_sold #{insights_trend_icon(model.insights.units_sold_percent_change)} %br #{t('workarea.admin.search_customizations.cards.insights.units_sold')} %p.align-center = distance_of_time_in_words(model.insights.starts_at, model.insights.ends_at) = top_icon_for(model) = trending_icon_for(model) = link_to insights_search_customization_path(model), class: 'card__button' do %span.button.button--small= t('workarea.admin.search_customizations.cards.insights.view_details') .grid__cell = render 'workarea/admin/content/card', content: model.content, active: local_assigns[:active] .grid__cell = render 'workarea/admin/timeline/card', timeline: model.timeline, active: local_assigns[:active] .grid__cell = render 'workarea/admin/comments/card', commentable: model, active: local_assigns[:active]