<commit_before>- content_for :title, I18n.t('libraries.index.libraries')

.admin.md-container
  %header.md-header.pt-dark
    %h1.admin__title
      = t '.libraries'

  %aside.md-master.spaced
    - if policy(Library).create?
      .pt-card
        %h2.admin__title= t '.create_a_new_library'
        = render 'form'

    .pt-dark
      .pt-callout.pt-icon-git-push
        = t '.libraries_on_gala'

  %main.md-detail.pt-dark
    %table.admin__table.pt-html-table.libraries__table
      %thead
        %th(scope="col")=# Logo
        %th(scope="col")= t 'activerecord.attributes.library.name'
        %th(scope="col")=# Url
        %th(scope="col")= t 'activerecord.attributes.library.description'
        %th(scope="col")=# Number of Cases
        %th(scope="col")=# Edit link
        %th(scope="col")=# Delete link

      %tbody
        - libraries.each do |library|
          %tr
            %td.library-logo{ style: library.define_color_variables }
              %img{ src: library.logo_url, alt: '' }

            %td
              = library.name
              - if library.visible_in_catalog?
                %span.pt-tag.pt-minimal.pt-intent-success
                  = t '.on_home_page'

            %td
              - unless library.url.blank?
                = link_to library.url,
                          class: %i[pt-button pt-minimal pt-icon-share],
                          aria: { label: I18n.t('activerecord.attributes.library.website') },
                          target: 'blank' do
                  -# Empty

            %td.library-description
              = truncate library.description, length: 140, separator: ' ' do
                &emsp;
                = link_to t('helpers.less.read_more'), library.catalog_path

            %td
              = link_to pluralize(library.cases_count, 'case'),
                        library.catalog_path,
                        class: %i[pt-button pt-icon-book library-button]

            %td
              - if policy(library).update?
                = link_to edit_library_path(library),
                          class: %i[pt-button pt-minimal pt-icon-cog],
                          aria: { label: I18n.t('helpers.edit') } do<commit_msg>fix: don’t include the “On Home Page” tag for non-editors<commit_after>- content_for :title, I18n.t('libraries.index.libraries')

.admin.md-container
  %header.md-header.pt-dark
    %h1.admin__title
      = t '.libraries'

  %aside.md-master.spaced
    - if policy(Library).create?
      .pt-card
        %h2.admin__title= t '.create_a_new_library'
        = render 'form'

    .pt-dark
      .pt-callout.pt-icon-git-push
        = t '.libraries_on_gala'

  %main.md-detail.pt-dark
    %table.admin__table.pt-html-table.libraries__table
      %thead
        %th(scope="col")=# Logo
        %th(scope="col")= t 'activerecord.attributes.library.name'
        %th(scope="col")=# Url
        %th(scope="col")= t 'activerecord.attributes.library.description'
        %th(scope="col")=# Number of Cases
        %th(scope="col")=# Edit link
        %th(scope="col")=# Delete link

      %tbody
        - libraries.each do |library|
          %tr
            %td.library-logo{ style: library.define_color_variables }
              %img{ src: library.logo_url, alt: '' }

            %td
              = library.name
              - if policy(Library).create? && library.visible_in_catalog?
                %span.pt-tag.pt-minimal.pt-intent-success
                  = t '.on_home_page'

            %td
              - unless library.url.blank?
                = link_to library.url,
                          class: %i[pt-button pt-minimal pt-icon-share],
                          aria: { label: I18n.t('activerecord.attributes.library.website') },
                          target: 'blank' do
                  -# Empty

            %td.library-description
              = truncate library.description, length: 140, separator: ' ' do
                &emsp;
                = link_to t('helpers.less.read_more'), library.catalog_path

            %td
              = link_to pluralize(library.cases_count, 'case'),
                        library.catalog_path,
                        class: %i[pt-button pt-icon-book library-button]

            %td
              - if policy(library).update?
                = link_to edit_library_path(library),
                          class: %i[pt-button pt-minimal pt-icon-cog],
                          aria: { label: I18n.t('helpers.edit') } do
{'fraction_non_alphanumeric': 0.12714317523936763, 'fraction_numerical': 0.004898686261411712, 'mean_word_length': 1.599537037037037, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '651726', 'n_tokens_mistral': 1413, 'n_tokens_neox': 1326, 'n_words': 235}