Commit 926a5693 authored by Alexandre Delanoë's avatar Alexandre Delanoë

[UE] User Experience from home to first results.

parent 684733b9
......@@ -30,6 +30,7 @@ import Routing.Hash.Aff (setHash)
import Thermite (PerformAction, Render, Spec, _render, cotransform, focus, foreach, modifyState, simpleSpec, withState)
import Unsafe.Coerce (unsafeCoerce)
import Landing as L
type State =
......@@ -91,7 +92,8 @@ addcorpusviewSpec = simpleSpec performAction render
render :: Render State props Action
render dispatch _ state _ =
[
div [className "container"]
div [className "container"] [L.jumboTitle]
, div [className "container"]
[
div [className "jumbotron"]
[ div [className "row"]
......
......@@ -6,7 +6,8 @@ import DOM (DOM)
import Network.HTTP.Affjax (AJAX)
import Prelude hiding (div)
import React.DOM (a, button, div, footer, h1, h3, hr, i, img, li, p, span, text, ul)
import React.DOM.Props (_data, _id, aria, className, href, onClick, role, src, style, tabIndex, target, title)
import React.DOM.Props (Props, _data, _id, aria, className, href, onClick, role, src, style, tabIndex, target, title)
import React (ReactElement)
import Routing.Hash.Aff (setHash)
import Thermite (PerformAction, Render, Spec, simpleSpec)
import Thermite as T
......@@ -49,15 +50,8 @@ performAction Login _ _ = void do
performAction SignUp _ _ = void do
T.modifyState \state -> state
loginSpec :: forall props eff . Spec (console::CONSOLE, ajax::AJAX, dom::DOM | eff) State props Action
loginSpec = simpleSpec performAction render
where
render :: Render State props Action
render dispatch _ state _ =
[ div [className "container" ]
[ div [className "jumbotron" ]
jumboTitle :: ReactElement
jumboTitle = div [className "jumbotron" ]
[ div [className "row" ]
[ div [className "col-md-8 content"]
[ h1 [] [ text "Gargantext"]
......@@ -77,30 +71,41 @@ loginSpec = simpleSpec performAction render
, div [ className "col-md-2 content"]
[p [ className "right" ]
[ div [_id "logo-designed" ]
[ img [ src "images/logo.png", title "Logo designed by dacha and anoe" ]
[ img [ src "images/logo.png", title "Project hosted by CNRS (France, Europa, Solar System)" ]
[]
]
]
]
]
]
]
, div [className "container"]
[ div [className "row"]
imageEnter :: Props -> ReactElement
imageEnter action = div [className "row"]
[ div [className "col-md-offset-5 col-md-6 content"]
[ img [ src "images/Gargantextuel-212x300.jpg"
, title "Gargantextuel drawn by Cecile Meadel"
, _id "funnyimg"
, onClick \_ -> dispatch $ Enter , title "Click and test by yourself"
] []
, title "Click and test by yourself"
, action
]
[]
]
]
, div [ className "container" ]
[ div [ className "row" ]
home :: forall props eff . Spec (console::CONSOLE, ajax::AJAX, dom::DOM | eff) State props Action
home = simpleSpec performAction render
where
render :: Render State props Action
render dispatch _ state _ =
[ div [ className "container" ] [ jumboTitle ]
, div [ className "container" ] [ imageEnter (onClick \_ -> dispatch $ Enter)]
, div [ className "container" ] [ blocksRandomText ]
, div [ className "container" ] [ hr [] [], footerLegalInfo ]
]
blocksRandomText :: ReactElement
blocksRandomText = div [ className "row" ]
[ div [ className "col-md-4 content" ]
[ h3 []
[ a [ href "#", title "Random sentences in Gargantua's Books chapters, historically true" ]
......@@ -141,28 +146,26 @@ loginSpec = simpleSpec performAction render
]
]
]
]
, div [className "container"]
[
hr [] []
, footer []
[ p []
[ text "Gargantext "
, span [className "glyphicon glyphicon-registration-mark" ]
[]
footerLegalInfo :: ReactElement
footerLegalInfo = footer [] [ p [] [ text "Gargantext "
, span [className "glyphicon glyphicon-registration-mark" ] []
, text ", version 4.0"
, a [ href "http://www.cnrs.fr", target "blank", title "Institution that enables this project." ]
, a [ href "http://www.cnrs.fr"
, target "blank"
, title "Project hosted by CNRS."
]
[ text ", Copyrights "
, span [ className "glyphicon glyphicon-copyright-mark" ]
[]
, span [ className "glyphicon glyphicon-copyright-mark" ] []
, text " CNRS 2017-Present"
]
, a [ href "http://gitlab.iscpif.fr/humanities/gargantext/blob/stable/LICENSE", target "blank", title "Legal instructions of the project." ]
, a [ href "http://gitlab.iscpif.fr/humanities/gargantext/blob/stable/LICENSE"
, target "blank"
, title "Legal instructions of the project."
]
[ text ", Licences aGPLV3 and CECILL variant Affero compliant" ]
, text "."
]
]
]
]
......@@ -145,7 +145,7 @@ pagesComponent s =
where
selectSpec :: Routes -> Spec (ajax :: AJAX, console :: CONSOLE, dom :: DOM | eff) AppState props Action
selectSpec Login = focus _loginState _loginAction LN.renderSpec
selectSpec Home = wrap $ focus _landingState _landingAction L.loginSpec
selectSpec Home = wrap $ focus _landingState _landingAction L.home
selectSpec AddCorpus = wrap $ focus _addCorpusState _addCorpusAction AC.addcorpusviewSpec
selectSpec DocView = wrap $ focus _docViewState _docViewAction DV.spec
selectSpec SearchView = wrap $ focus _searchState _searchAction S.searchSpec
......@@ -297,6 +297,7 @@ divDropdownRight = ul [className "nav navbar-nav pull-right"]
, className "glyphicon glyphicon-log-in"
, href "#/login"
, style {color:"white"}
, title "Log in and save your time"
-- TODO hover: bold
]
-- TODO if logged in
......
......@@ -6,11 +6,12 @@ import Control.Monad.Cont.Trans (lift)
import DOM (DOM)
import Network.HTTP.Affjax (AJAX)
import Prelude hiding (div)
import React.DOM (br', button, div, h3, input, text, i, span)
import React.DOM.Props (_id, _type, className, name, onClick, onInput, placeholder, value, aria)
import React.DOM (br', button, div, h3, input, text, i, span, img)
import React.DOM.Props (_id, _type, className, name, onClick, onInput, placeholder, value, aria, src, title)
import Routing.Hash.Aff (setHash)
import Thermite (PerformAction, Render, Spec, modifyState, simpleSpec)
import Unsafe.Coerce (unsafeCoerce)
import Landing as L
type State =
{
......@@ -55,7 +56,8 @@ searchSpec = simpleSpec performAction render
where
render :: Render State props Action
render dispatch _ state _ =
[ div [className "container"]
[ div [className "container"] [L.jumboTitle]
, div [className "container"]
[ div [className "jumbotron" ]
[ div [className "row" ]
[ div [className "col-md-10" ]
......
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