Class: ODDB::Html::View::Drugs::CompareList
- Inherits:
-
List
- Object
- HtmlGrid::List
- List
- ODDB::Html::View::Drugs::CompareList
show all
- Includes:
- ProductMethods, Google, PackageMethods
- Defined in:
- lib/oddb/html/view/drugs/compare.rb
Constant Summary
collapse
- COMPONENTS =
{
[0,0] => :product,
[1,0] => :company,
[2,0] => :active_agents,
[3,0] => :size,
[4,0] => :price_exfactory,
[5,0] => :price_public,
[6,0] => :ddd_prices,
[7,0] => :difference,
[8,0] => :google,
}
- CSS_MAP =
css_map
- CSS_HEAD_MAP =
css_map
- EMPTY_LIST_KEY =
:empty_comparison
Constants inherited
from List
List::BACKGROUND_ROW, List::BACKGROUND_SUFFIX, List::LEGACY_INTERFACE, List::SORT_DEFAULT
Instance Method Summary
collapse
Methods included from Google
#google
#company
Methods inherited from List
#query_args, #sort_link
Instance Method Details
39
40
41
42
43
44
45
46
|
# File 'lib/oddb/html/view/drugs/compare.rb', line 39
def (offset=[0,0])
offset = super
mdl = @model.origin
_compose(mdl, offset)
css = ['origin', row_css(mdl, nil)].compact.join(' ')
@grid.set_row_attributes({'class' => css}, offset.at(1))
resolve_offset(offset, self::class::OFFSET_STEP)
end
|
#difference(model) ⇒ Object
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
# File 'lib/oddb/html/view/drugs/compare.rb', line 47
def difference(model)
if(model.respond_to?(:difference) && (difference = model.difference))
span = HtmlGrid::Span.new(model, @session, self)
if(difference < 0)
span.css_class = 'less'
elsif(difference > 0)
span.css_class = 'more'
else
span.css_class = 'same'
end
span.value = sprintf("%+2.1f%%", difference)
span
end
end
|
#query_key ⇒ Object
61
62
63
|
# File 'lib/oddb/html/view/drugs/compare.rb', line 61
def query_key
@model.origin.is_a?(Remote::Drugs::Package) ? :uid : :pzn
end
|