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 ...@@ -142,6 +142,45 @@ component = R.hooksComponent "documentFormCreation" cpt where
[ H.text "Please enter at least one author" ] [ 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 -- Date
H.div H.div
...@@ -218,6 +257,7 @@ type FormData = ...@@ -218,6 +257,7 @@ type FormData =
, authors :: String , authors :: String
, date :: String , date :: String
, abstract :: String , abstract :: String
, language :: String
) )
defaultData :: Record FormData defaultData :: Record FormData
...@@ -227,6 +267,7 @@ defaultData = ...@@ -227,6 +267,7 @@ defaultData =
, authors : "" , authors : ""
, date : "" , date : ""
, abstract : "" , abstract : ""
, language : "EN"
} }
documentFormValidation :: Record FormData -> Effect VForm documentFormValidation :: Record FormData -> Effect VForm
...@@ -236,6 +277,7 @@ documentFormValidation r = foldl append mempty rules ...@@ -236,6 +277,7 @@ documentFormValidation r = foldl append mempty rules
[ FV.nonEmpty "title" r.title [ FV.nonEmpty "title" r.title
, FV.nonEmpty "source" r.source , FV.nonEmpty "source" r.source
, FV.nonEmpty "authors" r.authors , FV.nonEmpty "authors" r.authors
, FV.nonEmpty "language" r.language
, FV.date "date" r.date , 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