Class: ODDB::View::Admin::ActiveAgents

Inherits:
HtmlGrid::List show all
Defined in:
src/view/admin/sequence.rb

Direct Known Subclasses

RootActiveAgents

Constant Summary

COMPONENTS =
{
  [0,0] => :substance,
  [1,0] => :dose,
}
DEFAULT_CLASS =
HtmlGrid::Value
EMPTY_LIST =
true
OMIT_HEADER =
false
STRIPED_BG =
false
SORT_DEFAULT =
nil
SORT_HEADER =
false
LEGACY_INTERFACE =
false
LABELS =
false
CSS_HEAD_MAP =
{
  [1,0] => 'right',
}
CSS_MAP =
{
  [0,0] => 'list',
  [1,0] => 'list right',
}

Constants inherited from HtmlGrid::List

BACKGROUND_SUFFIX

Instance Method Summary (collapse)

Instance Method Details



48
49
50
51
52
53
54
55
56
57
58
59
# File 'src/view/admin/sequence.rb', line 48

def _compose_footer(offset)
  comp = if act = @model.first
           act.parent(@session.app)
         end
  input = galenic_form(comp)
  label = HtmlGrid::SimpleLabel.new(:galenic_form, input, @session, self)
  @grid.add [label, nil, input], *offset
  @grid.add_style 'list', *offset
  @grid.add_style 'list right', offset[0] + 1, offset[1]
  offset[1] += 1
  offset
end


45
46
47
# File 'src/view/admin/sequence.rb', line 45

def compose_footer(offset)
  _compose_footer offset
end

- (Object) dose(model)



60
61
62
# File 'src/view/admin/sequence.rb', line 60

def dose(model)
  model.dose.to_s if model
end

- (Object) galenic_form(model)



63
64
65
66
67
68
69
70
# File 'src/view/admin/sequence.rb', line 63

def galenic_form(model)
  element = HtmlGrid::Value.new(:galenic_form, model, @session, self)
  element.label = true
  if model && gf = model.galenic_form
    element.value = gf.send @session.language
  end
  element
end

- (Object) substance(model)



71
72
73
74
75
# File 'src/view/admin/sequence.rb', line 71

def substance(model)
  if model && sub = model.substance
    sub.send(@session.language)
  end
end