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

[FACTO] Langing.

parent 84b97575
...@@ -142,7 +142,7 @@ layoutAddcorpus = simpleSpec performAction render ...@@ -142,7 +142,7 @@ layoutAddcorpus = simpleSpec performAction render
render :: Render State props Action render :: Render State props Action
render dispatch _ state _ = render dispatch _ state _ =
[ [
div [className "container"] [L.jumboTitle false] div [className "container"] []
, div [className "container"] , div [className "container"]
[ [
div [className "jumbotron"] div [className "jumbotron"]
......
...@@ -158,10 +158,10 @@ layoutDocview = simpleSpec performAction render ...@@ -158,10 +158,10 @@ layoutDocview = simpleSpec performAction render
] ]
, table [ className "table"] , table [ className "table"]
[thead [ className "thead-dark"] [thead [ className "thead-dark"]
[tr [] [ th [scope "col"] [ b' [text "Date"] ] [tr [] [ th [scope "col"] [ b' [text ""] ]
, th [scope "col"] [ b' [text "Date"]]
, th [scope "col"] [ b' [text "Title"] ] , th [scope "col"] [ b' [text "Title"] ]
, th [scope "col"] [ b' [text "Source"] ] , th [scope "col"] [ b' [text "Source"] ]
, th [scope "col"] [ b' [text "Favorite"]]
, th [scope "col"] [ b' [text "Delete"] ] , th [scope "col"] [ b' [text "Delete"] ]
] ]
] ]
...@@ -464,10 +464,11 @@ tdata' d = TableData ...@@ -464,10 +464,11 @@ tdata' d = TableData
showRow :: {row :: Corpus, delete :: Boolean} -> ReactElement showRow :: {row :: Corpus, delete :: Boolean} -> ReactElement
showRow {row : (Corpus c), delete} = showRow {row : (Corpus c), delete} =
tr [] tr []
[ td [] [text c.date] [ td [] [div [className $ fa <> "fa-star"][]]
-- TODO show date: Year-Month-Day only
, td [] [text c.date]
, td [] [ a [ href "#/documentView/1"] [ text c.title ] ] , td [] [ a [ href "#/documentView/1"] [ text c.title ] ]
, td [] [text c.source] , td [] [text c.source]
, td [] [div [className $ fa <> "fa-star"][]]
, td [] [input [ _type "checkbox"] []] , td [] [input [ _type "checkbox"] []]
] ]
where where
......
...@@ -32,7 +32,11 @@ data Action ...@@ -32,7 +32,11 @@ data Action
| SignUp | SignUp
performAction :: forall eff props. PerformAction (console :: CONSOLE, ajax :: AJAX,dom::DOM | eff) State props Action performAction :: forall eff props. PerformAction ( console :: CONSOLE
, ajax :: AJAX
, dom :: DOM
| eff
) State props Action
performAction NoOp _ _ = void do performAction NoOp _ _ = void do
T.modifyState \state -> state T.modifyState \state -> state
...@@ -50,28 +54,34 @@ performAction Login _ _ = void do ...@@ -50,28 +54,34 @@ performAction Login _ _ = void do
performAction SignUp _ _ = void do performAction SignUp _ _ = void do
T.modifyState \state -> state T.modifyState \state -> state
jumboTitle :: Boolean -> ReactElement
jumboTitle b = div jumbo
docButton :: Button -> ReactElement
docButton (Button b) = a [ className "btn btn-success btn-lg spacing-class"
, href b.href
, target "blank"
, title b.title
] [ span [ aria {hidden : true}
, className "glyphicon glyphicon-hand-right"
] []
, text b.text
]
jumboTitle :: HomeData -> Boolean -> ReactElement
jumboTitle (HomeData hd) b = div jumbo
[ div [className "row" ] [ div [className "row" ]
[ div [className "col-md-8 content"] [ div [className "col-md-4 content"]
[ h1 [] [ text "Gargantext"] [ h1 [] [ text hd.name]
, p [] [ text "search map share" ] , p [] [ text hd.signature ]
, p [] [ a [ className "btn btn-success btn-lg spacing-class" , p [] [ docButton hd.docButton]
, href "https://iscpif.fr/gargantext/your-first-map/"
, target "blank"
, title "Your first map in less than 5 minutes"
]
[ span [ aria {hidden : true}
, className "glyphicon glyphicon-hand-right"
] []
, text " Documentation"
]
]
] ]
, div [ className "col-md-2 content"] , div [className "col-md-4 content"] []
, div [ className "col-md-4 content"]
[ p [ className "right" ] [ p [ className "right" ]
[ div [_id "logo-designed" ] [ div [_id "logo-designed" ]
[ img [ src "images/logo.png", title "Project hosted by CNRS (France, Europa, Solar System)" ] [ img [ src "images/logo.png"
, title hd.logoTitle
]
[] []
] ]
] ]
...@@ -84,12 +94,12 @@ jumboTitle b = div jumbo ...@@ -84,12 +94,12 @@ jumboTitle b = div jumbo
false -> [] false -> []
imageEnter :: Props -> ReactElement imageEnter :: HomeData -> Props -> ReactElement
imageEnter action = div [className "row"] imageEnter (HomeData hd) action = div [className "row"]
[ div [className "col-md-offset-5 col-md-6 content"] [ div [className "col-md-offset-5 col-md-6 content"]
[ img [ src "images/Gargantextuel-212x300.jpg" [ img [ src "images/Gargantextuel-212x300.jpg"
, _id "funnyimg" , _id "funnyimg"
, title "Click and test by yourself" , title hd.imageTitle
, action , action
] ]
[] []
...@@ -97,57 +107,96 @@ imageEnter action = div [className "row"] ...@@ -97,57 +107,96 @@ imageEnter action = div [className "row"]
] ]
layoutHome :: forall props eff . Spec (console::CONSOLE, ajax::AJAX, dom::DOM | eff) State props Action layoutHome :: forall props eff . Spec ( console :: CONSOLE
, ajax :: AJAX
, dom :: DOM
| eff
) State props Action
layoutHome = simpleSpec performAction render layoutHome = simpleSpec performAction render
where where
render :: Render State props Action render :: Render State props Action
render dispatch _ state _ = render dispatch _ state _ =
[ div [ className "container" ] [ jumboTitle true ] [ div [ className "container" ] [ jumboTitle homeData false ]
, div [ className "container" ] [ imageEnter (onClick \_ -> dispatch $ Enter)] , div [ className "container" ] [ imageEnter homeData (onClick \_ -> dispatch $ Enter)]
, div [ className "container" ] [ blocksRandomText ] , div [ className "container" ] [ blocksRandomText' homeData ]
] ]
blocksRandomText :: ReactElement
blocksRandomText = div [ className "row" ] blocksRandomText' :: HomeData -> ReactElement
[ div [ className "col-md-4 content" ] blocksRandomText' (HomeData hd) = blocksRandomText hd.blockTexts
[ h3 []
[ a [ href "#", title "Random sentences in Gargantua's Books chapters, historically true" ]
-- TODO click on icon and randomize the text below blocksRandomText :: BlockTexts -> ReactElement
[ i [className "fas fa-random"] [] blocksRandomText (BlockTexts bt) =
, text " Historic" div [ className "row" ] ( map showBlock bt.blocks )
] where
] showBlock :: BlockText -> ReactElement
, p [] showBlock (BlockText b) =
-- TODO use RandomText.randomSentences on this text (should be editable by user later) div [ className "col-md-4 content" ]
[ text "Chapter 1.XV. How Gargantua was put under other schoolmasters. Chapter 2.XXII. How Panurge served a Parisian lady a trick that pleased her not very well. Chapter 3.XXXVII. How Pantagruel persuaded Panurge to take counsel of a fool. Chapter 4.LXI. How Gaster invented means to get and preserve corn. Chapter 5.XXXVIII. Of the temple's admirable pavement." ] [ h3 [] [ a [ href b.href, title b.title]
] [ i [className b.icon] []
, div [ className "col-md-4 content" ] , text b.titleText
[ h3 [] ]
[ a [ href "#", title "Randomized words, semantically and syntaxically falses." ] ]
-- TODO click on icon and randomize the text below , p [] [ text b.text ]
[ i [className "fas fa-random"] []
, text " Presentation"
]
]
, p []
-- TODO use RandomText.randomWords on this text (should be editable by user later)
[ text "Autem nascetur iaculis, sedfusce enimsed cursus posuere consectetuer eu justo aliquammauris. Phasellus vero nisi porttitor elit quod, leo feliscras ultricies non tempor sagittis. Liberoduis facilisinam erat dapibusnam, lacus dui duis tristique volutpatut quis vestibulum magna. Nobis faucibusvestibulum dolores minim. Bibendumin malesuada adipiscing ante, mattis fames nequeetiam lorem. No diam id. Litora quisaenean commodo lobortisetiam neque, libero mollis scelerisque inceptos ullamcorper sea congue delenit possim. " ]
]
, div [ className "col-md-4 content" ]
[ h3 []
[ a [ href "#", title "Randomized letters, true or false ?" ]
-- TODO click on icon and randomize the text below
[ i [className "fas fa-random"] []
, text " Tutoreil"
]
] ]
, p []
-- TODO use RandomText.randomChars on this text (should be editable by user later)
[ text "Il paraît que l'rdore des lettres dans un mot n'a pas d'imtraopnce. La première et la dernière lettre doeivnt être à la bonne place. Le reste peut être dans un désordre total et on peut touojurs lire sans prolèbme. On ne lit donc pas chaque lettre en ellêem-me, mais le mot comme un tout. Un chaegmnent de référentiel et nous tranpossons ce résultat au texte luimê-me: l'rdore des mots est failbement important copamré au contexte du texte qui, lui, est copmté: comptexter avec Gargantext. "
, text " " data HomeData = HomeData { name :: String
, text "" , signature :: String
, logoTitle :: String
, imageTitle :: String
, docButton :: Button
, blockTexts :: BlockTexts
}
data Button = Button { title :: String
, text :: String
, href :: String
}
data BlockTexts = BlockTexts { blocks :: Array BlockText }
data BlockText = BlockText { title :: String
, href :: String
, titleText :: String
, icon :: String
, text :: String
}
homeData = HomeData { name : "Gargantext"
, signature : "search map share"
, logoTitle : "Project hosted by CNRS (France, Europa)"
, imageTitle: "Click and test by yourself"
, docButton : Button { title : "Your first map in less than 5 minutes"
, text : " Documentation"
, href : "https://iscpif.fr/gargantext/your-first-map/"
}
, blockTexts : BlockTexts {blocks : blockTexts}
}
blockTexts :: Array BlockText
blockTexts = [ BlockText { title : "Random sentences in Gargantua's Books chapters, historically true"
, href : "#"
, icon : "fas fa-random"
, titleText : " Historic"
, text : "Chapter 1.XV. How Gargantua was put under other schoolmasters. Chapter 2.XXII. How Panurge served a Parisian lady a trick that pleased her not very well. Chapter 3.XXXVII. How Pantagruel persuaded Panurge to take counsel of a fool. Chapter 4.LXI. How Gaster invented means to get and preserve corn. Chapter 5.XXXVIII. Of the temple's admirable pavement."
}
, BlockText { title : "Randomized words, semantically and syntaxically falses."
, href : "#"
, icon : "fas fa-random"
, titleText : " Presentation"
, text : "Autem nascetur iaculis, sedfusce enimsed cursus posuere consectetuer eu justo aliquammauris. Phasellus vero nisi porttitor elit quod, leo feliscras ultricies non tempor sagittis. Liberoduis facilisinam erat dapibusnam, lacus dui duis tristique volutpatut quis vestibulum magna. Nobis faucibusvestibulum dolores minim. Bibendumin malesuada adipiscing ante, mattis fames nequeetiam lorem. No diam id. Litora quisaenean commodo lobortisetiam neque, libero mollis scelerisque inceptos ullamcorper sea congue delenit possim."
}
, BlockText { title : "Randomized letters, true or false ?"
, href : "#"
, icon : "fas fa-random"
, titleText : " Tutoreil"
, text : "Il paraît que l'rdore des lettres dans un mot n'a pas d'imtraopnce. La première et la dernière lettre doeivnt être à la bonne place. Le reste peut être dans un désordre total et on peut touojurs lire sans prolèbme. On ne lit donc pas chaque lettre en ellêem-me, mais le mot comme un tout. Un chaegmnent de référentiel et nous tranpossons ce résultat au texte luimê-me: l'rdore des mots est failbement important copamré au contexte du texte qui, lui, est copmté: comptexter avec Gargantext."
}
] ]
]
]
...@@ -58,7 +58,7 @@ searchSpec = simpleSpec performAction render ...@@ -58,7 +58,7 @@ searchSpec = simpleSpec performAction render
where where
render :: Render State props Action render :: Render State props Action
render dispatch _ state _ = render dispatch _ state _ =
[ div [className "container"] [L.jumboTitle false] [ div [className "container"] []
, div [className "container"] , div [className "container"]
[ div [className "jumbotron" ] [ div [className "jumbotron" ]
[ div [className "row" ] [ div [className "row" ]
......
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