module IHP.IDE.CodeGen.View.NewJob where import IHP.ViewPrelude import IHP.IDE.ToolServer.Types import IHP.IDE.CodeGen.Types import IHP.IDE.CodeGen.View.Generators (renderPlan) data NewJobView = NewJobView { plan :: Either Text [GeneratorAction] , jobName :: Text , applicationName :: Text , applications :: [Text] } instance View NewJobView where html NewJobView { .. } = [hsx|
{renderFlashMessages}
{if isEmpty jobName then renderEmpty else renderPreview} {unless (isEmpty jobName) (renderPlan plan)}
|] where renderEmpty = [hsx|
{when (length applications /= 1) renderApplicationSelector}
|] renderApplicationOptions = forM_ applications (\x -> [hsx||]) renderApplicationSelector = [hsx| |] renderPreview = [hsx|
{applicationName}.Job.{jobName}
|]