-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/acquisition simple html writer (#385)
* Add acquisiton class to body. Create Acquisition class. * Add operation and plan classes to html writer. * Add objective and requirement classes to html writer. * Add event class to html writer. Fix objective class. * Add pass class to html writer. fix event class typos and requires * Add instrument and platform classes. * Add environment, instrumentationEvent, instrumentationEventList, requestedDate classes. fix platform class. * Add Revision class. fix html_requirement file name. * Fixes to requestedDate, requirement, acquisition, and plan. fix key to retrieve acquisition array. * Bugfixes to html writer for acquisitions section * fix revision datetime in revision class for mdJson reader * HTML formatting to fit standard of rest of page * Add acquisition button to sidebar within body * Add acquisition class. Update body class to include acquisition class. * Add remaining classes used for acquisition. * fix access to acquisition within metadata
- Loading branch information
1 parent
1587fa6
commit a925c26
Showing
15 changed files
with
1,504 additions
and
0 deletions.
There are no files selected for viewing
195 changes: 195 additions & 0 deletions
195
lib/adiwg/mdtranslator/writers/simple_html/sections/html_acquisition.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,195 @@ | ||
require_relative 'html_scope' | ||
require_relative 'html_plan' | ||
require_relative 'html_requirement' | ||
require_relative 'html_objective' | ||
require_relative 'html_platform' | ||
require_relative 'html_instrument' | ||
require_relative 'html_operation' | ||
require_relative 'html_event' | ||
require_relative 'html_pass' | ||
require_relative 'html_environment' | ||
|
||
module ADIWG | ||
module Mdtranslator | ||
module Writers | ||
module Simple_html | ||
class Html_Acquisition | ||
def initialize(html) | ||
@html = html | ||
end | ||
|
||
def writeHtml(hAcquisition) | ||
scopeClass = Html_Scope.new(@html) | ||
planClass = Html_Plan.new(@html) | ||
requirementClass = Html_Requirement.new(@html) | ||
objectiveClass = Html_Objective.new(@html) | ||
platformClass = Html_Platform.new(@html) | ||
instrumentClass = Html_Instrument.new(@html) | ||
operationClass = Html_Operation.new(@html) | ||
eventClass = Html_Event.new(@html) | ||
passClass = Html_Pass.new(@html) | ||
environmentClass = Html_Environment.new(@html) | ||
|
||
# scope | ||
unless hAcquisition[:scope].empty? | ||
@html.div do | ||
@html.h5('Scope', {'class' => 'h5'}) | ||
@html.div(:class => 'block') do | ||
scopeClass.writeHtml(hDataQuality[:scope]) | ||
end | ||
end | ||
end | ||
|
||
# plan | ||
unless hAcquisition[:plans].empty? | ||
@html.div(:class =>'block') do | ||
@html.div do | ||
@html.h4('Plans', {'class' => 'h4'}) | ||
hAcquisition[:plans].each do |plan| | ||
@html.div(:class =>'block') do | ||
@html.div do | ||
@html.h5('Plan', {'class' => 'h5'}) | ||
planClass.writeHtml(plan) | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end | ||
|
||
# requirement | ||
unless hAcquisition[:requirements].empty? | ||
@html.div(:class =>'block') do | ||
@html.div do | ||
@html.h4('Requirements', {'class' => 'h4'}) | ||
hAcquisition[:requirements].each do |requirement| | ||
@html.div(:class =>'block') do | ||
@html.div do | ||
@html.h5('Requirement', {'class' => 'h5'}) | ||
requirementClass.writeHtml(requirement) | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end | ||
|
||
# objective | ||
unless hAcquisition[:objectives].empty? | ||
@html.div(:class =>'block') do | ||
@html.div do | ||
@html.h4('Objectives', {'class' => 'h4'}) | ||
hAcquisition[:objectives].each do |objective| | ||
@html.div(:class =>'block') do | ||
@html.div do | ||
@html.h5('Objective', {'class' => 'h5'}) | ||
objectiveClass.writeHtml(objective) | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end | ||
|
||
|
||
# platform | ||
unless hAcquisition[:platforms].empty? | ||
@html.div(:class =>'block') do | ||
@html.div do | ||
@html.h4('Platforms', {'class' => 'h4'}) | ||
hAcquisition[:platforms].each do |platform| | ||
@html.div(:class =>'block') do | ||
@html.div do | ||
@html.h5('Platform', {'class' => 'h5'}) | ||
platformClass.writeHtml(platform) | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end | ||
|
||
# Instrument | ||
unless hAcquisition[:instruments].empty? | ||
@html.div(:class =>'block') do | ||
@html.div do | ||
@html.h4('Instrument', {'class' => 'h4'}) | ||
hAcquisition[:instruments].each do |instrument| | ||
@html.div(:class =>'block') do | ||
@html.div do | ||
@html.h5('Instrument', {'class' => 'h5'}) | ||
instrumentClass.writeHtml(instrument) | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end | ||
|
||
# operation | ||
unless hAcquisition[:operations].empty? | ||
@html.div(:class =>'block') do | ||
@html.div do | ||
@html.h4('Operations', {'class' => 'h4'}) | ||
hAcquisition[:operations].each do |operations| | ||
@html.div(:class =>'block') do | ||
@html.div do | ||
@html.h5('Operation', {'class' => 'h5'}) | ||
operationClass.writeHtml(operations) | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end | ||
|
||
# Event | ||
unless hAcquisition[:events].empty? | ||
@html.div(:class =>'block') do | ||
@html.div do | ||
@html.h4('Events', {'class' => 'h4'}) | ||
hAcquisition[:events].each do |event| | ||
@html.div(:class =>'block') do | ||
@html.div do | ||
@html.h5('Event', {'class' => 'h5'}) | ||
eventClass.writeHtml(event) | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end | ||
|
||
# Pass | ||
unless hAcquisition[:passes].empty? | ||
@html.div(:class =>'block') do | ||
@html.div do | ||
@html.h4('Passes', {'class' => 'h4'}) | ||
hAcquisition[:passes].each do |pass| | ||
@html.div(:class =>'block') do | ||
@html.div do | ||
@html.h5('Pass', {'class' => 'h5'}) | ||
passClass.writeHtml(pass) | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end | ||
|
||
# Environment | ||
unless hAcquisition[:environment].empty? | ||
@html.div do | ||
@html.h5('Scope', {'class' => 'h5'}) | ||
@html.div(:class => 'block') do | ||
environmentClass.writeHtml(hAcquisition[:environment]) | ||
end | ||
end | ||
end | ||
|
||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
lib/adiwg/mdtranslator/writers/simple_html/sections/html_environment.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
module ADIWG | ||
module Mdtranslator | ||
module Writers | ||
module Simple_html | ||
class Html_Environment | ||
def initialize(html) | ||
@html = html | ||
end | ||
|
||
def writeHtml(hEnvironment) | ||
# averageAirTemperature | ||
unless hEnvironment[:averageAirTemperature].nil? | ||
@html.em('Average Air Temperature: ') | ||
@html.text!(hEnvironment[:averageAirTemperature].to_s) | ||
@html.br | ||
end | ||
|
||
# maxRelativeHumidity | ||
unless hEnvironment[:maxRelativeHumidity].nil? | ||
@html.em('Maximum Relative Humidity: ') | ||
@html.text!(hEnvironment[:maxRelativeHumidity].to_s) | ||
@html.br | ||
end | ||
|
||
# maxAltitude | ||
unless hEnvironment[:maxAltitude].nil? | ||
@html.em('Maximum Altitude: ') | ||
@html.text!(hEnvironment[:maxAltitude].to_s) | ||
@html.br | ||
end | ||
|
||
# meteorologicalConditions | ||
unless hEnvironment[:meteorologicalConditions].nil? | ||
@html.em('Meteorological Conditions: ') | ||
@html.text!(hEnvironment[:meteorologicalConditions]) | ||
@html.br | ||
end | ||
|
||
# solarAzimuth | ||
unless hEnvironment[:solarAzimuth].nil? | ||
@html.em('Solar Azimuth: ') | ||
@html.text!(hEnvironment[:solarAzimuth].to_s) | ||
@html.br | ||
end | ||
|
||
# solarElevation | ||
unless hEnvironment[:solarElevation].nil? | ||
@html.em('Solar Elevation: ') | ||
@html.text!(hEnvironment[:solarElevation].to_s) | ||
@html.br | ||
end | ||
|
||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
Oops, something went wrong.