Commit 63991233 authored by Alexandre Delanoë's avatar Alexandre Delanoë

[DESGIGN] flex / rows fix

parent 2d8b3b0e
......@@ -106,7 +106,7 @@ addNodeView p@{ dispatch, nodeType, nodeTypes } = R.createElement el p []
-- , showConfig nt
]
else
H.button { className : "btn btn-primary"
H.button { className : "btn btn-primary flex-center"
, type : "button"
, onClick : mkEffectFn1 $ \_ -> setNodeType ( const
$ fromMaybe nt
......@@ -119,15 +119,19 @@ addNodeView p@{ dispatch, nodeType, nodeTypes } = R.createElement el p []
panelFooter :: R.State String -> R.State NodeType -> R.Element
panelFooter (name' /\ _) (nt /\ _) =
H.div {className: "panel-footer"}
[ H.button {className: "btn btn-primary text-center"
, type: "button"
, onClick: mkEffectFn1 $ \_ -> do
-- TODO
--setPopupOpen $ const Nothing
launchAff $ dispatch $ AddNode name' nt
} [H.text "Add"]
]
H.div { className: "panel-footer"}
[ H.div {} []
, H.div {className: "flex-center"}
[ H.button {className: "btn btn-primary"
, type: "button"
, style : { width: "100%" }
, onClick: mkEffectFn1 $ \_ -> do
-- TODO
--setPopupOpen $ const Nothing
launchAff $ dispatch $ AddNode name' nt
} [H.text "Add"]
]
]
-- END Create Node
......
......@@ -55,32 +55,46 @@ uploadFileViewCpt = R.hooksComponent "G.C.F.T.N.A.U.UploadFileView" cpt
fileType :: R.State FileType <- R.useState' CSV
lang :: R.State (Maybe Lang) <- R.useState' (Just EN)
pure $ H.div {} [
H.div {} [ H.input { type: "file"
, placeholder: "Choose file"
, on: {change: onChangeContents mFile}
}
]
, H.div {} [ R2.select {className: "col-md-12 form-control"
, on: {change: onChangeFileType fileType}
}
( map renderOptionFT [ CSV
, CSV_HAL
, WOS
, PresseRIS
]
)
]
, H.div {} [ R2.select {className: "col-md-12 form-control"
, on: {change: onChangeLang lang}
} (map renderOptionLang [EN, FR])
]
, H.div {} [ uploadButton {dispatch, fileType, lang, id, mFile, nodeType } ]
]
pure $
H.div {className:""}
[ H.div {className:"row"}
[ H.div {className:"col-md-6 flex-space-around"}
[ H.input { type: "file"
, placeholder: "Choose file"
, on: {change: onChangeContents mFile}
}
]
, H.div {className:"col-md-3 flex-space-around"}
[ R2.select {className: "form-control"
, on: {change: onChangeFileType fileType}
}
( map renderOptionFT [ CSV
, CSV_HAL
, WOS
, PresseRIS
]
)
]
, H.div {className:"col-md-3 flex-space-around"}
[ R2.select { className: "form-control"
, on: {change: onChangeLang lang}
} (map renderOptionLang [EN, FR])
]
]
, H.div { className : "panel-footer" }
[ H.div {} []
, H.div {className:"flex-center"}
[ uploadButton { dispatch
, fileType
, lang
, id
, mFile
, nodeType
}
]
]
]
renderOptionFT :: FileType -> R.Element
renderOptionFT opt = H.option {} [ H.text $ show opt ]
......@@ -132,7 +146,12 @@ uploadButtonCpt :: R.Component UploadButtonProps
uploadButtonCpt = R.hooksComponent "G.C.F.T.N.A.U.uploadButton" cpt
where
cpt {dispatch, fileType: (fileType /\ setFileType), id, lang: (lang /\ setLang), mFile: (mFile /\ setMFile), nodeType} _ = do
pure $ H.button {className: "btn btn-primary", disabled, on: {click: onClick}} [ H.text "Upload" ]
pure $ H.button { className: "btn btn-primary"
, "type" : "button"
, disabled
, style : { width: "100%" }
, on: {click: onClick}
} [ H.text "Upload" ]
where
disabled = case mFile of
Nothing -> "1"
......
......@@ -693,7 +693,7 @@ actionDownload GT.Corpus id session = downloadButton href label info
where
href = url session $ Routes.NodeAPI GT.Corpus (Just id) "export"
label = "Download Corpus"
info = "TODO: fix the backend route"
info = "Download as JSON"
actionDownload GT.Texts id session = downloadButton href label info
where
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment