Sha256: 75490f8b965d42fc0c5f95f0c63eb9072e6cddfa55fc1d38b2ef008caf2afcfe

Contents?: true

Size: 1.12 KB

Versions: 3

Compression:

Stored size: 1.12 KB

Contents

#!/usr/bin/env ruby
# Html::View::Drugs::Patinfo -- de.oddb.org -- 30.10.2007 -- hwyss@ywesee.com

require 'oddb/html/view/document'
require 'oddb/html/view/drugs/template'

module ODDB
  module Html
    module View
      module Drugs
class PatinfoComposite < HtmlGrid::DivComposite
  include Snapback
  COMPONENTS = {
    [0,0] => :snapback, 
    [0,1] => InlineSearch, 
    [0,2] => :name,
    [0,3] => :chapters,
    [0,4] => :document,
  }
  CSS_ID_MAP = [ 'snapback', 'result-search', 'title', 'chapters' ]
  CSS_MAP = { 0 => 'before-searchbar' }
  def document(model)
    if((fi = model.patinfo) && (doc = fi.send(@session.language)))
      Document.new(doc, @session, self)
    end
  end
  def chapters(model)
    if((fi = model.patinfo) && (doc = fi.send(@session.language)))
      ChapterNames.new(:patinfo, doc, @session, self)
    end
  end
end
class Patinfo < Template
  CONTENT = PatinfoComposite
  def _title
    name = @model.name.send(@session.language)
    if name.nil? && @model.respond_to?(:product)
      name = @model.product.name.send(@session.language)
    end
    super.push name
  end
end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
de.oddb-2.0.1 lib/oddb/html/view/drugs/patinfo.rb
ramaze.ch.oddb.org-1.0.0 lib/oddb/html/view/drugs/patinfo.rb
de.oddb-2.0.0 lib/oddb/html/view/drugs/patinfo.rb