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

[TEMPLATE] adding footer to wrap function.

parent acee709f
...@@ -105,7 +105,6 @@ home = simpleSpec performAction render ...@@ -105,7 +105,6 @@ home = simpleSpec performAction render
[ div [ className "container" ] [ jumboTitle true ] [ div [ className "container" ] [ jumboTitle true ]
, div [ className "container" ] [ imageEnter (onClick \_ -> dispatch $ Enter)] , div [ className "container" ] [ imageEnter (onClick \_ -> dispatch $ Enter)]
, div [ className "container" ] [ blocksRandomText ] , div [ className "container" ] [ blocksRandomText ]
, div [ className "container" ] [ hr [] [], footerLegalInfo ]
] ]
blocksRandomText :: ReactElement blocksRandomText :: ReactElement
...@@ -152,24 +151,4 @@ blocksRandomText = div [ className "row" ] ...@@ -152,24 +151,4 @@ blocksRandomText = div [ className "row" ]
] ]
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 "Project hosted by CNRS."
]
[ text ", Copyrights "
, 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."
]
[ text ", Licences aGPLV3 and CECILL variant Affero compliant" ]
, text "."
]
]
...@@ -14,7 +14,7 @@ import Network.HTTP.Affjax (AJAX) ...@@ -14,7 +14,7 @@ import Network.HTTP.Affjax (AJAX)
import PageRouter (Routes(..)) import PageRouter (Routes(..))
import Prelude (class Applicative, class Bind, Unit, bind, id, map, negate, pure, unit, void, ($), (<>)) import Prelude (class Applicative, class Bind, Unit, bind, id, map, negate, pure, unit, void, ($), (<>))
import React (ReactElement) import React (ReactElement)
import React.DOM (a, div, img, li, span, text, ul, input, button) import React.DOM (a, div, img, li, span, text, ul, input, button, footer, p, hr)
import React.DOM.Props (_data, _id, aria, className, href, name, placeholder, _type, role, src, style, tabIndex, target, title) import React.DOM.Props (_data, _id, aria, className, href, name, placeholder, _type, role, src, style, tabIndex, target, title)
import Thermite (PerformAction, Render, Spec, _render, defaultRender, focus, modifyState, simpleSpec, withState) import Thermite (PerformAction, Render, Spec, _render, defaultRender, focus, modifyState, simpleSpec, withState)
import DocView as DV import DocView as DV
...@@ -35,7 +35,7 @@ type AppState = ...@@ -35,7 +35,7 @@ type AppState =
initAppState :: AppState initAppState :: AppState
initAppState = initAppState =
{ currentRoute : Just Home { currentRoute : Just Home
, landingState : L.initialState , landingState : L.initialState
, loginState : LN.initialState , loginState : LN.initialState
, addCorpusState : AC.initialState , addCorpusState : AC.initialState
...@@ -44,7 +44,6 @@ initAppState = ...@@ -44,7 +44,6 @@ initAppState =
, userPage : UP.initialState , userPage : UP.initialState
} }
data Action data Action
= Initialize = Initialize
| LandingA L.Action | LandingA L.Action
...@@ -100,7 +99,7 @@ _addCorpusAction = prism AddCorpusA \action -> ...@@ -100,7 +99,7 @@ _addCorpusAction = prism AddCorpusA \action ->
_-> Left action _-> Left action
_docViewState:: Lens' AppState DV.State _docViewState :: Lens' AppState DV.State
_docViewState = lens (\s -> s.docViewState) (\s ss -> s{docViewState = ss}) _docViewState = lens (\s -> s.docViewState) (\s ss -> s{docViewState = ss})
...@@ -142,7 +141,11 @@ pagesComponent s = ...@@ -142,7 +141,11 @@ pagesComponent s =
Nothing -> Nothing ->
selectSpec Home selectSpec Home
where where
selectSpec :: Routes -> Spec (ajax :: AJAX, console :: CONSOLE, dom :: DOM | eff) AppState props Action selectSpec :: Routes -> Spec ( ajax :: AJAX
, console :: CONSOLE
, dom :: DOM
| eff
) AppState props Action
selectSpec Login = focus _loginState _loginAction LN.renderSpec selectSpec Login = focus _loginState _loginAction LN.renderSpec
selectSpec Home = wrap $ focus _landingState _landingAction L.home selectSpec Home = wrap $ focus _landingState _landingAction L.home
selectSpec AddCorpus = wrap $ focus _addCorpusState _addCorpusAction AC.addcorpusviewSpec selectSpec AddCorpus = wrap $ focus _addCorpusState _addCorpusAction AC.addcorpusviewSpec
...@@ -157,14 +160,16 @@ wrap :: forall eff props. Spec (E eff) AppState props Action -> Spec (E eff) App ...@@ -157,14 +160,16 @@ wrap :: forall eff props. Spec (E eff) AppState props Action -> Spec (E eff) App
wrap spec = wrap spec =
fold fold
[ sidebarnavSpec [ sidebarnavSpec
--, tree
, innerContainer $ spec , innerContainer $ spec
, footerLegalInfo
] ]
where where
innerContainer :: Spec (E eff) AppState props Action -> Spec (E eff) AppState props Action innerContainer :: Spec (E eff) AppState props Action -> Spec (E eff) AppState props Action
innerContainer = over _render \render d p s c -> innerContainer = over _render \render d p s c ->
[ div [_id "page-wrapper"] [ div [_id "page-wrapper"]
[ [
div[className "container-fluid"] (render d p s c) div [className "container-fluid"] (render d p s c)
] ]
] ]
...@@ -255,15 +260,15 @@ sidebarnavSpec = simpleSpec performAction render ...@@ -255,15 +260,15 @@ sidebarnavSpec = simpleSpec performAction render
) )
<> [li [className "divider"] []] <> <> [li [className "divider"] []] <>
(map liNav [ LiNav { title : "Interactive chat" (map liNav [ LiNav { title : "Interactive chat"
, href : "https://chat.iscpif.fr/channel/gargantext" , href : "https://chat.iscpif.fr/channel/gargantext"
, icon : "fab fa-rocketchat" , icon : "fab fa-rocketchat"
, text : "Chat" , text : "Chat"
} }
, LiNav { title : "Asynchronous discussions" , LiNav { title : "Asynchronous discussions"
, href : "https://discourse.iscpif.fr/c/gargantext" , href : "https://discourse.iscpif.fr/c/gargantext"
, icon : "fab fa-discourse" , icon : "fab fa-discourse"
, text : "Forum" , text : "Forum"
} }
] ]
) )
<> [li [className "divider"] []] <> <> [li [className "divider"] []] <>
...@@ -366,3 +371,32 @@ dispatchAction dispatcher _ UserPage = do ...@@ -366,3 +371,32 @@ dispatchAction dispatcher _ UserPage = do
_ <- dispatcher $ SetRoute $ UserPage _ <- dispatcher $ SetRoute $ UserPage
_ <- dispatcher $ UserPageA $ UP.NoOp _ <- dispatcher $ UserPageA $ UP.NoOp
pure unit pure unit
footerLegalInfo :: forall props eff. Spec (dom :: DOM |eff) AppState props Action
footerLegalInfo = simpleSpec performAction render
where
render :: Render AppState props Action
render dispatch _ state _ = [div [ className "container" ] [ hr [] [], footerLegalInfo']]
where
footerLegalInfo' = footer [] [ p [] [ text "Gargantext "
, span [className "glyphicon glyphicon-registration-mark" ] []
, text ", version 4.0"
, a [ href "http://www.cnrs.fr"
, target "blank"
, title "Project hosted by CNRS."
]
[ text ", Copyrights "
, 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."
]
[ text ", Licences aGPLV3 and CECILL variant Affero compliant" ]
, text "."
]
]
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