1 {-# LANGUAGE OverloadedStrings #-} 2 module View.Container 3 ( releaseTitle 4 --, htmlContainerEdit 5 ) where 6 7 import qualified Data.ByteString.Char8 as BSC 8 -- import Data.Foldable (fold) 9 -- import Data.Monoid ((<>)) 10 import qualified Data.Text as T 11 12 import qualified Store.Config as C 13 -- import Model.Volume.Types 14 -- import Model.Container.Types 15 -- import Model.Slot.Types 16 import Model.Release.Types 17 import Service.Messages 18 -- import Action.Types 19 -- import Action 20 -- import View.Form 21 22 --import {-# SOURCE #-} Controller.Container 23 24 releaseTitle :: Maybe Release -> Messages -> T.Text 25 releaseTitle rel = getMessage $ C.Path ["release", maybe "UNRELEASED" (BSC.pack . show) rel, "title"] 26 27 {- 28 htmlContainerForm :: Maybe Container -> FormHtml f 29 htmlContainerForm cont = do 30 field "name" $ inputText (containerName . containerRow =<< cont) 31 field "date" $ inputDate (containerDate . containerRow =<< cont) 32 field "release" $ inputEnum False (containerRelease =<< cont) 33 34 htmlContainerEdit :: Either Volume Container -> RequestContext -> FormHtml f 35 htmlContainerEdit (Left v) = htmlForm "Create container" createContainer (volumeId $ volumeRow v) (htmlContainerForm Nothing) (const mempty) 36 htmlContainerEdit (Right c) = htmlForm ("Edit container " <> fold (containerName $ containerRow c)) postContainer (containerSlotId $ containerId $ containerRow c) (htmlContainerForm $ Just c) (const mempty) 37 -}