- @title = @category.browser_title - @breadcrumbs = @category.breadcrumbs - add_css(@category.css) - add_javascript(@category.javascript) - add_head_content(@category.head_content) - content_for :head do - cache "#{@category.cache_key}/head", expires_in: 1.hour do %meta{ property: 'global-id', content: @category.to_global_id.to_param } - if @category.first_page? && !@category.has_filters? %meta{ name: 'robots', content: 'index, follow' } - else %meta{ name: 'robots', content: 'noindex, follow' } - if @category.first_page? %link{ href: category_url(@category), rel: 'canonical' } - else %link{ href: category_url(@category, page: @category.page), rel: 'canonical' } - if @category.second_page? %link{ href: category_url(@category), rel: 'prev' } - elsif !@category.first_page? %link{ href: url_for(page: @category.prev_page, only_path: false), rel: 'prev' } - unless @category.last_page? %link{ href: url_for(page: @category.next_page, only_path: false), rel: 'next' } %meta{ name: :description, content: @category.meta_description } %meta{ property: 'og:url', content: url_for(only_path: false) } %meta{ property: 'og:title', content: page_title } %meta{ property: 'og:type', content: 'website' } %meta{ property: 'og:image', content: @category.open_graph_asset.url } %meta{ property: 'og:image:secure_url', content: @category.open_graph_asset.url } = append_partials('storefront.category_head', category: @category) - content_for :drawer do - cache "#{@category.cache_key}/aside", expires_in: Workarea.config.cache_expirations.categories_fragment_cache do - if @category.facets.any? #mobile-filters-overlay.mobile-filters-overlay.hidden #mobile-filter-drawer.mobile-filters .mobile-filters__content .result-filters - @category.facets.each do |facet| = render "workarea/storefront/facets/#{facet.type}", facet: facet - cache @category.cache_key, expires_in: Workarea.config.cache_expirations.categories_fragment_cache do .view{ data: { analytics: category_view_analytics_data(@category).to_json } } .product-browse .header.header--center-at-small .grid.grid--middle .grid__cell.grid__cell--50-at-medium .header__title %h1= @category.name - unless @category.products.any? .grid__cell.grid__cell--50-at-medium %p = t('workarea.storefront.products.none_found') - if @category.has_filters? = link_to t('workarea.storefront.products.reset_filters'), category_path(@category) - else .grid__cell.grid__cell--50-at-medium .grid.grid--right.grid--middle .grid__cell.grid__cell--50-at-medium - cache "#{@category.cache_key}/aside", expires_in: Workarea.config.cache_expirations.categories_fragment_cache do - if @category.facets.any? .header__filter-button %button.button{ data: { mobile_filters: ''} }= t('workarea.storefront.products.filter_results') .grid__cell.grid__cell--50-at-medium = form_tag request.path, method: :get do = facet_hidden_inputs(@category.facets) .property = label_tag 'sort_top', nil, class: 'property__name' do %span.property__text= t('workarea.storefront.searches.sort_by') .value = select_tag :sort, options_for_select(@category.sorts, selected: @category.sort), id: 'sort_top', data: { form_submitting_control: '' } .hidden-if-js-enabled = button_tag t('workarea.storefront.searches.sort'), value: 'sort_products_top', class: 'button' = append_partials('storefront.category_browse_controls', category: @category) - if @category.content_blocks_for(:above_results).present? = render_content_blocks(@category.content_blocks_for(:above_results)) .pagination{ data: { analytics: product_list_analytics_data(@category.name).to_json, pagination: pagination_data(@category.products), back_to_top_button: '' } } .grid.grid--flush - @category.products.each_with_index do |product, position| = render_schema_org(product_schema(product)) = append_partials('storefront.category_browse_grid_item', product: product, position: position) .grid__cell.grid__cell--50.grid__cell--33-at-medium.grid__cell--20-at-wide{ data: { pagination_item: '' } } .product-summary = render 'workarea/storefront/products/summary', product: product - if show_pagination?(@category.products) .pagination__button = link_to t('workarea.storefront.pagination.next_page'), pagination_path_for(page: @category.next_page), class: 'button', data: { pagination_button: '' } - if @category.content_blocks_for(:below_results).present? = render_content_blocks(@category.content_blocks_for(:below_results))