<commit_before>- assets ||= @assets
- page ||= @page
- with_pagination ||= false

- if assets.empty?
  %p
    = t("assets_extension.no_assets")
- else
  - if with_pagination && assets.respond_to?(:previous_page) && assets.previous_page
    = pagination_for(assets, pagination_parameters.merge(:depaginate => false, :params => {:controller => 'admin/assets', :action => 'index', :id => nil, :format => 'js'}))

  %ul
    - assets.each_with_index do |asset, index|
      - asset_type = asset.image? ? "image" : "link"
      %li{:class => "#{asset_type} asset", :id => "asset_#{asset.id}"}
        .front
          .thumbnail= image_tag asset.thumbnail(:thumbnail)
        .back
          .title
            = asset.title
          %ul.actions
            - if @page
              %li= link_to t('assets_extension.insert'), '#', :class => 'insert_asset', :rel => "#{Radiant.config['assets.insertion_size']}_#{asset.id}"
              %li= link_to t("assets_extension.attach"), new_admin_page_page_attachment_path(page, :asset_id => asset.id), :class => 'attach_asset'
            - else
              %li= link_to t('assets_extension.edit'), admin_asset_path(asset), :class => 'edit'
              %li= link_to t("assets_extension.remove"), remove_admin_asset_path(asset), :class => "delete"
            
  - if with_pagination && assets.respond_to?(:next_page) && assets.next_page
    = pagination_for(assets, pagination_parameters.merge(:depaginate => false, :param_name => 'p', :params => {:controller => 'admin/assets', :action => 'index', :id => nil, :format => 'js', :page_id => page.id, :pp => assets.per_page }))<commit_msg>bugfix for asset table outside page context<commit_after>- assets ||= @assets
- page ||= @page
- with_pagination ||= false

- if assets.empty?
  %p
    = t("assets_extension.no_assets")
- else
  - if with_pagination && assets.respond_to?(:previous_page) && assets.previous_page
    = pagination_for(assets, pagination_parameters.merge(:depaginate => false, :params => {:controller => 'admin/assets', :action => 'index', :id => nil, :format => 'js'}))

  %ul
    - assets.each_with_index do |asset, index|
      - asset_type = asset.image? ? "image" : "link"
      %li{:class => "#{asset_type} asset", :id => "asset_#{asset.id}"}
        .front
          .thumbnail= image_tag asset.thumbnail(:thumbnail)
        .back
          .title
            = asset.title
          %ul.actions
            - if @page
              %li= link_to t('assets_extension.insert'), '#', :class => 'insert_asset', :rel => "#{Radiant.config['assets.insertion_size']}_#{asset.id}"
              %li= link_to t("assets_extension.attach"), new_admin_page_page_attachment_path(page, :asset_id => asset.id), :class => 'attach_asset'
            - else
              %li= link_to t('assets_extension.edit'), admin_asset_path(asset), :class => 'edit'
              %li= link_to t("assets_extension.remove"), remove_admin_asset_path(asset), :class => "delete"
            
  - if with_pagination && assets.respond_to?(:next_page) && assets.next_page
    = pagination_for(assets, pagination_parameters.merge(:depaginate => false, :param_name => 'p', :params => {:controller => 'admin/assets', :action => 'index', :id => nil, :format => 'js', :page_id => (page && page.id), :pp => assets.per_page }))
{'fraction_non_alphanumeric': 0.17343844754396603, 'fraction_numerical': 0.0, 'mean_word_length': 3.2899869960988295, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 49, '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': '1450726', 'n_tokens_mistral': 1053, 'n_tokens_neox': 1048, 'n_words': 211}