<commit_before>
require('aurita')
require('aurita-gui')
require('aurita-gui/widget')

Aurita.import_module :gui, :helpers

module Aurita
module Plugins
module Wiki
module GUI
 
  class Media_Asset_Thumbnail < Aurita::GUI::Widget
  include Aurita::GUI
  include Aurita::GUI::Link_Helpers

    def initialize(entity, params={})
      if entity.is_a?(Hash) then
        params  = entity
        @entity = Wiki::Media_Asset.load(:media_asset_id => params[:media_asset_id])
        raise ::Exception.new(params.inspect) unless @entity
      else 
        @entity = entity
      end
      @thumbnail_size   = params[:thumbnail_size]
      @thumbnail_size ||= params[:size]
      @thumbnail_size ||= :thumb
      params.delete(:size)
      params.delete(:thumbnail_size)
      super()
    end

    def element
      HTML.div(:class => [ :media_asset_thumbnail, :bright_bg, @thumbnail_size ]) { 
        HTML.div(:class => [ :image, @thumbnail_size ]) { 
          HTML.img(:src => @entity.icon_path(:size => @thumbnail_size), 
                   :title => @entity.description) 
        } +
        HTML.div(:class => [:info, :default_bg, @thumbnail_size ]) { 
          HTML.div.title { link_to(@entity) { @entity.title } } + 
          HTML.div.tags { @entity.tags }
        }
      }
    end

  end

end
end<commit_msg>- Disabled Media_Asset.description for thumbnail titles (description is     an HTML text field).<commit_after>
require('aurita')
require('aurita-gui')
require('aurita-gui/widget')

Aurita.import_module :gui, :helpers

module Aurita
module Plugins
module Wiki
module GUI
 
  class Media_Asset_Thumbnail < Aurita::GUI::Widget
  include Aurita::GUI
  include Aurita::GUI::Link_Helpers

    def initialize(entity, params={})
      if entity.is_a?(Hash) then
        params  = entity
        @entity = Wiki::Media_Asset.load(:media_asset_id => params[:media_asset_id])
        raise ::Exception.new(params.inspect) unless @entity
      else 
        @entity = entity
      end
      @thumbnail_size   = params[:thumbnail_size]
      @thumbnail_size ||= params[:size]
      @thumbnail_size ||= :thumb
      params.delete(:size)
      params.delete(:thumbnail_size)
      super()
    end

    def element
      HTML.div(:class => [ :media_asset_thumbnail, :bright_bg, @thumbnail_size ]) { 
        HTML.div(:class => [ :image, @thumbnail_size ]) { 
          HTML.img(:src => @entity.icon_path(:size => @thumbnail_size))
        } +
        HTML.div(:class => [:info, :default_bg, @thumbnail_size ]) { 
          HTML.div.title { link_to(@entity) { @entity.title } } + 
          HTML.div.tags { @entity.tags }
        }
      }
    end

  end

end
end
{'fraction_non_alphanumeric': 0.13125235050770967, 'fraction_numerical': 0.0, 'mean_word_length': 2.8, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 16, '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': '2965465', 'n_tokens_mistral': 868, 'n_tokens_neox': 841, 'n_words': 164}