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

Merge remote-tracking branch 'origin/445-dev-doc-upload-language' into dev-merge

parents 34ac667f a0999426
......@@ -142,6 +142,45 @@ component = R.hooksComponent "documentFormCreation" cpt where
[ H.text "Please enter at least one author" ]
]
]
,
-- Language
H.div
{ className: intercalate " "
[ "form-group"
, (fv.hasError' "language") ?
"form-group--error" $
mempty
]
}
[
H.div { className: "form-group__label"}
[
H.label {} [ H.text "Language" ]
]
,
H.div { className: "form-group__field" }
[
B.formSelect (
bindStateKey "language"
)
[
H.option
{value: "EN"}
[ H.text "EN"]
,
H.option
{ value: "FR" }
[ H.text "FR"]
,
H.option
{ value: "Nothing" }
[ H.text "Nothing"]
, H.option
{ value: "All" }
[ H.text "All"]
]
]
]
,
-- Date
H.div
......@@ -218,6 +257,7 @@ type FormData =
, authors :: String
, date :: String
, abstract :: String
, language :: String
)
defaultData :: Record FormData
......@@ -227,6 +267,7 @@ defaultData =
, authors : ""
, date : ""
, abstract : ""
, language : "EN"
}
documentFormValidation :: Record FormData -> Effect VForm
......@@ -236,6 +277,7 @@ documentFormValidation r = foldl append mempty rules
[ FV.nonEmpty "title" r.title
, FV.nonEmpty "source" r.source
, FV.nonEmpty "authors" r.authors
, FV.nonEmpty "language" r.language
, FV.date "date" r.date
]
......
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