lib/adiwg/mdtranslator/writers/html/sections/html_allocation.rb in adiwg-mdtranslator-2.1.2 vs lib/adiwg/mdtranslator/writers/html/sections/html_allocation.rb in adiwg-mdtranslator-2.2.0

- old
+ new

@@ -1,11 +1,14 @@ # HTML writer # allocation # History: +# Stan Smith 2017-08-31 refactored for mdJson 2.3 schema update # Stan Smith 2017-04-04 original script +require_relative 'html_onlineResource' + module ADIWG module Mdtranslator module Writers module Html @@ -15,10 +18,20 @@ @html = html end def writeHtml(hAllocation) + # classes used + onlineClass = Html_OnlineResource.new(@html) + + # allocation - id + unless hAllocation[:id].nil? + @html.em('Source Allocation ID: ') + @html.text!(hAllocation[:id]) + @html.br + end + # allocation - amount unless hAllocation[:amount].nil? @html.em('Amount: ') @html.text!(hAllocation[:amount].to_s) @html.br @@ -50,9 +63,19 @@ # allocation - matching {Boolean} unless hAllocation[:matching].nil? @html.em('Matching Funds Provided: ') @html.text!(hAllocation[:matching].to_s) @html.br + end + + # allocation - online resource [] + hAllocation[:onlineResources].each do |hOnline| + @html.details do + @html.summary('Online Resource', {'class' => 'h5'}) + @html.section(:class => 'block') do + onlineClass.writeHtml(hOnline) + end + end end # allocation - comment unless hAllocation[:comment].nil? @html.em('Comment: ')