22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
|
# File 'lib/adiwg/mdtranslator/writers/simple_html/sections/html_allocation.rb', line 22
def writeHtml(hAllocation)
responsibilityClass = Html_Responsibility.new(@html)
onlineClass = Html_OnlineResource.new(@html)
unless hAllocation[:id].nil?
@html.em('Source Allocation ID: ')
@html.text!(hAllocation[:id])
@html.br
end
unless hAllocation[:amount].nil?
@html.em('Amount: ')
@html.text!(hAllocation[:amount].to_s)
@html.br
end
unless hAllocation[:currency].nil?
@html.em('Currency: ')
@html.text!(hAllocation[:currency])
@html.br
end
unless hAllocation[:sourceId].nil?
hContact = Html_Document.getContact(hAllocation[:sourceId])
@html.em('Source Contact: ')
if hContact.empty?
@html.text!("Contact #{hAllocation[:sourceId]} not found!")
else
@html.a(hContact[:contactId], 'href' => '#CID_'+hContact[:contactId])
end
@html.br
end
unless hAllocation[:recipientId].nil?
hContact = Html_Document.getContact(hAllocation[:recipientId])
@html.em('Recipient Contact: ')
if hContact.empty?
@html.text!("Contact #{hAllocation[:recipientId]} not found!")
else
@html.a(hContact[:contactId], 'href' => '#CID_'+hContact[:contactId])
end
@html.br
end
unless hAllocation[:matching].nil?
@html.em('Matching Funds Provided: ')
@html.text!(hAllocation[:matching].to_s)
@html.br
end
hAllocation[:responsibleParties].each do |hResponsibility|
@html.div do
@html.div(hResponsibility[:roleName], 'class' => 'h5')
@html.div(:class => 'block') do
responsibilityClass.writeHtml(hResponsibility)
end
end
end
hAllocation[:onlineResources].each do |hOnline|
@html.div do
@html.div('Online Resource', {'class' => 'h5'})
@html.div(:class => 'block') do
onlineClass.writeHtml(hOnline)
end
end
end
unless hAllocation[:comment].nil?
@html.em('Comment: ')
@html.div(:class => 'block') do
@html.text!(hAllocation[:comment])
end
end
end
|