Class: ODDB::Html::View::Drugs::ResultComposite

Inherits:
HtmlGrid::DivComposite
  • Object
show all
Includes:
HtmlGrid::ErrorMessage
Defined in:
lib/oddb/html/view/drugs/result.rb

Constant Summary collapse

COMPONENTS =
{
  [0,0] => :title_found,
  [0,1] => :export_cvs,
  [0,2] => "explain_compare",
  [0,3] => InlineSearch,
  [0,4] => Packages,
  [0,5] => Legend,
}
CSS_ID_MAP =
['result-found', 'result-search', 'explain-compare',
'result-search', 'result-list', 'legend' ]
CSS_MAP =
{ 0 => 'lefthand', 2 => 'before-searchbar', 4 => 'result' }

Instance Method Summary collapse

Instance Method Details

#export_cvs(model) ⇒ Object



276
277
278
279
280
281
282
283
284
# File 'lib/oddb/html/view/drugs/result.rb', line 276

def export_cvs(model)
  button = HtmlGrid::Button.new(:export_csv, model, @session, self)
  query = @session.persistent_user_input(:query)
  dstype = @session.persistent_user_input(:dstype) || ODDB.config.default_dstype
  url = @lookandfeel._event_url(:proceed_export,
                                [ :query, query, :dstype, dstype ])
  button.onclick = "location.href='#{url}';"
  button
end

#initObject



272
273
274
275
# File 'lib/oddb/html/view/drugs/result.rb', line 272

def init
  super
  error_message
end

#title_found(model) ⇒ Object



285
286
287
# File 'lib/oddb/html/view/drugs/result.rb', line 285

def title_found(model)
  @lookandfeel.lookup(:title_found, @model.query, @model.total)
end