<commit_before>- @page_title = t('shoppe.product_category.product_categories')

= content_for :header do
  %p.buttons=link_to t('shoppe.product_category.new_category'), :new_product_category, :class => 'button green'
  %h2.products= t('shoppe.product_category.product_categories')

.table
  %table.data
    %thead
      %tr
        %th= t('shoppe.product_category.name')
        - I18n.available_locales.each do |i|
          %th
    %tbody
      - if @product_categories_without_parent.empty?
        %tr.empty
          %td= t('shoppe.product_category.no_categories')
      - else
        - for cat in @product_categories_without_parent
          %tr
            %td= link_to cat.name, [:edit, cat]
            - I18n.available_locales.each do |i|
              - if cat.translations.where(locale: i).count >= 1
                %td= link_to i, edit_product_category_localisation_path(cat, cat.translations.where(locale: i).first.id)
              - else
                %td= link_to i, new_product_category_localisation_path(cat, locale_field: i)
          = nested_product_category_rows(cat)
<commit_msg>Fix bug where table body is not same width as header when no product category is added<commit_after>- @page_title = t('shoppe.product_category.product_categories')

= content_for :header do
  %p.buttons=link_to t('shoppe.product_category.new_category'), :new_product_category, :class => 'button green'
  %h2.products= t('shoppe.product_category.product_categories')

.table
  %table.data
    %thead
      %tr
        %th= t('shoppe.product_category.name')
        - unless @product_categories_without_parent.empty?
          - I18n.available_locales.each do |i|
            %th
    %tbody
      - if @product_categories_without_parent.empty?
        %tr.empty
          %td= t('shoppe.product_category.no_categories')
      - else
        - for cat in @product_categories_without_parent
          %tr
            %td= link_to cat.name, [:edit, cat]
            - I18n.available_locales.each do |i|
              - if cat.translations.where(locale: i).count >= 1
                %td= link_to i, edit_product_category_localisation_path(cat, cat.translations.where(locale: i).first.id)
              - else
                %td= link_to i, new_product_category_localisation_path(cat, locale_field: i)
          = nested_product_category_rows(cat)

{'fraction_non_alphanumeric': 0.1072340425531915, 'fraction_numerical': 0.005106382978723404, 'mean_word_length': 2.7082018927444795, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2269086', 'n_tokens_mistral': 748, 'n_tokens_neox': 733, 'n_words': 142}