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