packages feed

casr-logbook 0.6.2 → 0.6.3

raw patch · 5 files changed

+48/−57 lines, 5 files

Files

casr-logbook.cabal view
@@ -1,5 +1,5 @@ name:               casr-logbook-version:            0.6.2+version:            0.6.3 license:            OtherLicense license-file:       LICENSE author:             Tony Morris <ʇǝu˙sıɹɹoɯʇ@ןןǝʞsɐɥ>
changelog view
@@ -1,3 +1,7 @@+0.6.3++* Update to instruction for flight time report.+ 0.6.2  * Update to instruction for flight time report.
src/Data/Aviation/Casr/Logbook/Html/Html.hs view
@@ -1,3 +1,4 @@+{-# OPTIONS_GHC -Wall #-} {-# LANGUAGE OverloadedStrings #-}  module Data.Aviation.Casr.Logbook.Html.Html(@@ -47,51 +48,9 @@  import Control.Applicative((*>)) import Control.Category((.), id)-import Control.Lens((^.), ( # ))+import Control.Lens import Control.Monad(when, (=<<), (>>=))-import Data.Aviation.Casr.Logbook.Types(-    arn-  , firstname-  , surname-  , logbookaviator-  , daytime-  , briefingTime-  , briefingName-  , examName-  , examTime-  , simulatorflightname-  , simulatortype-  , point-  , flightStart-  , flightEnd-  , flightpath-  , aircraftRegistration-  , aircraftflightname-  , flightaircraft-  , landingTime-  , zerotimeamount-  , flightPathList-  , Command(ICUS, Dual, InCommand, InCommandInstructing)-  , Rating(Rating)-  , Aircraft(Aircraft)-  , Engine(Single, Multi)-  , FlightPath-  , FlightPoint(FlightPoint)-  , Time(Time)-  , TimeAmount(TimeAmount)-  , DayNight(DayNight)-  , Briefing(Briefing)-  , Exam(Exam)-  , Location(Location)-  , Aviator(Aviator)-  , Entries(Entries)-  , Logbook(Logbook)-  , AircraftFlight(AircraftFlight)-  , SimulatorFlight(SimulatorFlight)-  , Briefing-  , Exam-  , Entry(BriefingEntry, ExamEntry, SimulatorFlightEntry, AircraftFlightEntry)-  )+import Data.Aviation.Casr.Logbook.Types import Data.Bool(not) import Data.Char(toUpper) import Data.Digit(DecDigit, charDecimal)@@ -137,7 +96,7 @@   ) import Text.Printf(printf) -import Prelude(show, fromIntegral, (/), (*), Double, undefined)+import Prelude(show, fromIntegral, (/), (*), Double)  htmlTimeAmount ::   TimeAmount@@ -268,9 +227,9 @@   do  fromString f       " "       fromString s-      when (not . null $ a) $ " "+      when (not . null $ a) " "       fromString (a >>= (\d -> [charDecimal # d]))-      when (not . null $ r) $ " "+      when (not . null $ r) " "       htmlRatingsShort r  htmlFlightPoint ::@@ -289,21 +248,35 @@   span_ [class_ "flightpath"] $     fold (intersperse (toHtmlRaw (" &mdash; " :: Text)) (htmlFlightPoint fl <$> flightPathList p)) +htmlInstruction ::+  Instruction+  -> Html ()+htmlInstruction i =+  let r = view instructionRating i+      l = view instructionLesson i+      a = view student l+  in  do  span_ [class_ "instructionrating"] (toHtmlRaw (shortStringRating r))+          span_ [class_ "commandphrase"] " for "+          span_ [class_ "commandaviator"] $ htmlAviatorShort a+          span_ [class_ "instructionlesson"] $ maybe mempty (\c -> toHtmlRaw (' ':c)) (view lesson l)+ htmlCommand ::   AircraftFlight   -> Command   -> Html () htmlCommand _ InCommand =   span_ [class_ "command incommand"] "In-Command"-htmlCommand _ (InCommandInstructing _) =-  undefined+htmlCommand _ (InCommandInstructing a) =+  do  span_ [class_ "command incommandinstruction"] "Instruction"+      span_ [class_ "commandphrase"] " as "+      span_ [class_ "commandinstruction"] $ htmlInstruction a htmlCommand _ (ICUS a) =   do  span_ [class_ "command incommandunderinstruction"] "In-Command Under-Instruction"-      span_ [class_ "commandphrase"] $ " by "+      span_ [class_ "commandphrase"] " by "       span_ [class_ "commandaviator"] $ htmlAviatorShort a htmlCommand _ (Dual a) =   do  span_ [class_ "command dualunderinstruction"] "Dual Under-Instruction"-      span_ [class_ "commandphrase"] $ " by "+      span_ [class_ "commandphrase"] " by "       span_ [class_ "commandaviator"] $ htmlAviatorShort a  htmlTimeAmountZero ::
src/Data/Aviation/Casr/Logbook/Reports/Meta/Html.hs view
@@ -37,8 +37,8 @@ htmlExpenseReport _ (ExpenseReport ag al b e s) =   div_ [class_ "expensereport"] $     do  a_ [id_ "RPT_Expense"] ""-        a_ [href_ (Text.pack ("#RPT_Expense"))] . span_ [class_ "entrytag"] $ "RPT"-        h3_ [class_ "expensereportname"] "Expense Report"     +        a_ [href_ (Text.pack "#RPT_Expense")] . span_ [class_ "entrytag"] $ "RPT"+        h3_ [class_ "expensereportname"] "Expense Report"         do  ul_ [] $               do  li_ [] $                     do  span_ [class_ "key"] "Aircraft: "@@ -68,9 +68,9 @@   -> Html () htmlReports b =   do  htmlFlightTimeReport b (getFlightTimeReport b)-      hr_ [] +      hr_ []       htmlSimulatorTimeReport b (getSimulatorTimeReport b)-      hr_ [] +      hr_ []       htmlTakeOffLanding90 b (takeoffslandings90 b)-      hr_ [] +      hr_ []       htmlExpenseReport b (logbookExpenseReport b)
src/Data/Aviation/Casr/Logbook/Types/Instruction.hs view
@@ -49,6 +49,20 @@   isn't _RAInstructionRating x &&   isn't _RASIInstructionRating x +shortStringRating ::+  InstructionRating+  -> String+shortStringRating GA3InstructionRating =+  "GA3"+shortStringRating GA2InstructionRating =+  "GA3"+shortStringRating GA1InstructionRating =+  "GA1"+shortStringRating RAInstructionRating =+  "RA"+shortStringRating RASIInstructionRating =+  "RA SI"+ data Instruction =   Instruction {     __instructionLesson :: InstructionLesson