Sha256: 8c974eda76f106d71aa137dcd504990a4dabab15458b4d1cb31e9a1df581984d

Contents?: true

Size: 1.15 KB

Versions: 7

Compression:

Stored size: 1.15 KB

Contents

# -*- encoding : utf-8 -*-

include Card::Set::Type::File

view :closed_content do |args|
  _render_core :size=>:icon
end

view :source do |args|
  style = case
    when @mode==:closed ;  :icon
    when args[:size]    ;  args[:size]
    when main?          ;  :large
    else                ;  :medium
    end
  style = :original if style.to_sym == :full
  card.attach.url style
end


view :core, :type=>:file


format :html do

  view :core do |args|
    handle_source args do |source|
      source == 'missing' ? "<!-- image missing #{@card.name} -->" : image_tag(source)
    end
  end


  view :diff do |args|
    out = ''
    if @show_diff and @previous_revision
      card.selected_revision_id=@previous_revision.id
      out << _render_core
    end
    card.selected_revision_id=@revision.id
    out << _render_core
    out
  end

  view :editor, :type=>:file

end

format :css do
  view :core do |args|
    render_source
  end
  
  view :content do |args|
    render_core
  end
end

format :file do

  view :style do |args|  #should this be in model?
    ['', 'full'].member?( args[:style].to_s ) ? :original : args[:style]
  end
    
  view :core, :type=>:file

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
wagn-1.12.13 mods/standard/sets/type/image.rb
wagn-1.12.12 mods/standard/sets/type/image.rb
wagn-1.12.11 mods/standard/sets/type/image.rb
wagn-1.12.10 mods/standard/sets/type/image.rb
wagn-1.12.9 mods/standard/sets/type/image.rb
wagn-1.12.8 mods/standard/sets/type/image.rb
wagn-1.12.7 mods/standard/sets/type/image.rb