Class: ODDB::View::Admin::PatinfoStatsCompanyList

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

Direct Known Subclasses

PatinfoStatsList

Constant Summary

COMPONENTS =
{
  [0,0]   => :date,
  [1,0]   => :email
}
CSS_CLASS =
'composite'
CSS_MAP =
{
  [0,0] => 'list',
  [1,0] => 'list',
}
DEFAULT_CLASS =

SORT_DEFAULT = :newest_date

HtmlGrid::Value
SORT_REVERSE =
true
SORT_HEADER =
false
LOOKANDFEEL_MAP =
{
  :date         =>  :patinfo_stats,
  :email        =>  :nbsp,
}
SUBHEADER =
View::Admin::CompanyHeader

Constants inherited from HtmlGrid::List

BACKGROUND_SUFFIX

Instance Method Summary (collapse)

Instance Method Details

- (Object) compose_list(model = @model, offset = [0,0])



55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'src/view/admin/patinfo_stats.rb', line 55

def compose_list(model=@model, offset=[0,0])
  model.each { |company|
    compose_subheader(company, offset)
    offset = resolve_offset(offset, self::class::OFFSET_STEP)
    slate_sequences = company.slate_sequences
    slate_sequences.each { |seq|
      compose_subheader_seq(seq, offset)
      offset = resolve_offset(offset, self::class::OFFSET_STEP)
      invoice_items = seq.invoice_items
      super(invoice_items, offset)
      offset[1] += invoice_items.size
    }
  }
end

- (Object) compose_subheader(company, offset)



69
70
71
72
73
74
# File 'src/view/admin/patinfo_stats.rb', line 69

def compose_subheader(company, offset)
  subheader = self::class::SUBHEADER.new(company, @session, self)
  @grid.add(subheader, *offset)
  @grid.add_style('list atc bold', *offset)
  @grid.set_colspan(offset.at(0), offset.at(1), full_colspan)
end

- (Object) compose_subheader_seq(seq, offset)



75
76
77
78
79
80
# File 'src/view/admin/patinfo_stats.rb', line 75

def compose_subheader_seq(seq, offset)
  @grid.add(seq_iks_link(seq), *offset)
  @grid.add_style('list seq indent bold', *offset)
  x, y = offset
  @grid.add_style('list seq', x + 1, y)
end

- (Object) date(model, session)



50
51
52
53
# File 'src/view/admin/patinfo_stats.rb', line 50

def date(model, session)
  time = model.time
  time.strftime("%A %d.%m.%Y   -  %H.%M Uhr %Z")
end


81
82
83
# File 'src/view/admin/patinfo_stats.rb', line 81

def seq_iks_link(seq)
  View::PointerLink.new(:iksnr_seqnr, seq, @session, self)
end