Class: ODDB::Html::View::Drugs::Admin::Sequences

Inherits:
List
  • Object
show all
Includes:
HtmlGrid::FormMethods
Defined in:
lib/oddb/html/view/drugs/admin/product.rb

Constant Summary collapse

COMPONENTS =
{
  [0,0] => :uid,
  [1,0] => :compositions,
}
EVENT =
:new_sequence
OMIT_HEADER =
true

Constants inherited from List

List::BACKGROUND_ROW, List::BACKGROUND_SUFFIX, List::LEGACY_INTERFACE, List::SORT_DEFAULT

Instance Method Summary collapse

Methods inherited from List

#query_args, #query_key, #sort_link

Instance Method Details



30
31
32
# File 'lib/oddb/html/view/drugs/admin/product.rb', line 30

def compose_footer(offset)
  @grid.add submit(@model), *offset
end

#compositions(model) ⇒ Object



22
23
24
25
26
27
28
29
# File 'lib/oddb/html/view/drugs/admin/product.rb', line 22

def compositions(model)
  lang = @session.language
  model.compositions.collect { |comp|
    comp.active_agents.collect { |act|
      [act.substance.name.send(lang), act.dose].join(' ')
    }.join(', ')
  }.join(' + ')
end

#hidden_fields(context) ⇒ Object



33
34
35
# File 'lib/oddb/html/view/drugs/admin/product.rb', line 33

def hidden_fields(context)
  super << context.hidden("uid", @container.model.uid)
end

#uid(model) ⇒ Object



36
37
38
39
40
41
# File 'lib/oddb/html/view/drugs/admin/product.rb', line 36

def uid(model)
  link = HtmlGrid::Link.new(:uid, model, @session, self)
  link.href = @lookandfeel._event_url(:sequence, :uid => model.uid)
  link.value = model.uid
  link
end