Commit 6e3f3063 authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski

Merge branch 'dev' into dev-async-tasks-local-storage

parents 58c34940 914fc19b
...@@ -12,6 +12,7 @@ import Effect.Class (liftEffect) ...@@ -12,6 +12,7 @@ import Effect.Class (liftEffect)
import Reactix as R import Reactix as R
import Reactix.DOM.HTML as H import Reactix.DOM.HTML as H
import Gargantext.License (license)
import Gargantext.Components.Lang (LandingLang(..)) import Gargantext.Components.Lang (LandingLang(..))
import Gargantext.Components.Forest (forest) import Gargantext.Components.Forest (forest)
import Gargantext.Components.GraphExplorer (explorerLayout) import Gargantext.Components.GraphExplorer (explorerLayout)
...@@ -60,7 +61,7 @@ appCpt = R.hooksComponent "G.C.App.app" cpt where ...@@ -60,7 +61,7 @@ appCpt = R.hooksComponent "G.C.App.app" cpt where
, showLogin: snd showLogin } , showLogin: snd showLogin }
let mCurrentRoute = fst route let mCurrentRoute = fst route
let backends = fromFoldable defaultBackends let backends = fromFoldable defaultBackends
let ff f session = R.fragment [ f session, version { session } ] let ff f session = R.fragment [ f session, footer { session } ]
let withSession sid f = let withSession sid f =
maybe' (const $ forested $ homeLayout LL_EN) (ff f) $ Sessions.lookup sid (fst sessions) maybe' (const $ forested $ homeLayout LL_EN) (ff f) $ Sessions.lookup sid (fst sessions)
...@@ -112,7 +113,7 @@ type ForestLayoutProps = ...@@ -112,7 +113,7 @@ type ForestLayoutProps =
forestLayout :: Record ForestLayoutProps -> R.Element forestLayout :: Record ForestLayoutProps -> R.Element
forestLayout { child, frontends, reload, route, sessions, showLogin } = do forestLayout { child, frontends, reload, route, sessions, showLogin } = do
R.fragment [ topBar {}, R2.row [main], footer { } ] R.fragment [ topBar {}, R2.row [main] ]
where where
main = main =
R.fragment R.fragment
...@@ -123,7 +124,7 @@ forestLayout { child, frontends, reload, route, sessions, showLogin } = do ...@@ -123,7 +124,7 @@ forestLayout { child, frontends, reload, route, sessions, showLogin } = do
-- Simple layout does not accommodate the tree -- Simple layout does not accommodate the tree
simpleLayout :: R.Element -> R.Element simpleLayout :: R.Element -> R.Element
simpleLayout child = R.fragment [ topBar {}, child, footer {}] simpleLayout child = R.fragment [ topBar {}, child, license]
mainPage :: R.Element -> R.Element mainPage :: R.Element -> R.Element
mainPage child = mainPage child =
...@@ -248,6 +249,9 @@ liNav (LiNav { title : title' ...@@ -248,6 +249,9 @@ liNav (LiNav { title : title'
] ]
] ]
---------------------------------------------------------------------------
-- | TODO put Version in the Tree/Root node
type VersionProps = type VersionProps =
( (
session :: Sessions.Session session :: Sessions.Session
...@@ -267,46 +271,38 @@ versionCpt = R.hooksComponent "G.C.A.version" cpt ...@@ -267,46 +271,38 @@ versionCpt = R.hooksComponent "G.C.A.version" cpt
v <- GV.getBackendVersion session v <- GV.getBackendVersion session
liftEffect $ setVer $ const v liftEffect $ setVer $ const v
pure $ H.div { className: "container" } [ pure $ H.div { className: "row" }
H.footer {} [ H.div { className: versionCheck GV.version ver}
[ [ H.h4 {} [H.text $ versionMessage GV.version ver]
H.span {} [ H.text $ "Frontend version: " <> GV.version <> ", " ] , H.div { className: "container" } [showVersions GV.version ver]
, H.span {} [ H.text $ "backend version: " <> ver ] ]
, warning ver GV.version ]
] where
] versionCheck v1 v2 = case v1 == v2 of
warning backendVer frontendVer = false -> "col alert alert-danger"
if backendVer == frontendVer then true -> "col alert alert-success"
H.div {} [] versionMessage v1 v2 = case v1 == v2 of
else false -> "Versions do not match"
H.div { className: "text-danger" } [ H.text "Versions do not match" ] true -> "Versions are up to date"
footer :: {} -> R.Element showVersions frontendVer backendVer =
H.div { className: "row" }
[ H.h5 {} [ H.text $ "Frontend version: " <> frontendVer ]
, H.h5 {} [ H.text $ "backend version: " <> backendVer ]
]
footer :: Record VersionProps -> R.Element
footer props = R.createElement footerCpt props [] footer props = R.createElement footerCpt props []
footerCpt :: R.Component () footerCpt :: R.Component VersionProps
footerCpt = R.hooksComponent "G.C.A.footer" cpt footerCpt = R.hooksComponent "G.C.A.footer" cpt
where where
cpt _ _ = do cpt { session } _ = do
pure $ H.div { className: "container" } pure $ H.div
[ H.hr {} { className: "container" }
, H.footer {} [ H.hr {}
[ H.p {} , H.footer {} [ version { session }
[ H.text "Gargantext " , license
, H.span {className: "glyphicon glyphicon-registration-mark"} [] ]
, H.a { href: "http://www.cnrs.fr"
, target: "blank"
, title: "Project hosted by CNRS."
}
[ H.text ", Copyrights "
, H.span { className: "glyphicon glyphicon-copyright-mark" } []
, H.text " CNRS 2017-Present"
] ]
, H.a { href: "http://gitlab.iscpif.fr/humanities/gargantext/blob/stable/LICENSE"
, target: "blank"
, title: "Legal instructions of the project."
}
[ H.text ", Licences aGPLV3 and CECILL variant Affero compliant" ]
, H.text "."
]]
]
...@@ -6,6 +6,7 @@ import Effect (Effect) ...@@ -6,6 +6,7 @@ import Effect (Effect)
import Reactix as R import Reactix as R
import Reactix.DOM.HTML as H import Reactix.DOM.HTML as H
import Routing.Hash (setHash) import Routing.Hash (setHash)
import Gargantext.License (license)
import Gargantext.Components.Lang.Landing.EnUS as En import Gargantext.Components.Lang.Landing.EnUS as En
import Gargantext.Components.Lang.Landing.FrFR as Fr import Gargantext.Components.Lang.Landing.FrFR as Fr
import Gargantext.Components.Data.Landing import Gargantext.Components.Data.Landing
...@@ -53,7 +54,9 @@ homeLayoutCpt = R.staticComponent "LayoutLanding" cpt ...@@ -53,7 +54,9 @@ homeLayoutCpt = R.staticComponent "LayoutLanding" cpt
H.span {} H.span {}
[ H.div { className: "container1" } [ jumboTitle landingData false ] [ H.div { className: "container1" } [ jumboTitle landingData false ]
, H.div { className: "container1" } [] -- TODO put research form , H.div { className: "container1" } [] -- TODO put research form
, H.div { className: "container1" } [ blocksRandomText' landingData ] ] , H.div { className: "container1" } [ blocksRandomText' landingData ]
, license
]
------------------------------------------------------------------------ ------------------------------------------------------------------------
......
module Gargantext.License where
import Prelude
import Reactix as R
import Reactix.DOM.HTML as H
license :: R.Element
license = H.p {}
[ H.text "Gargantext "
, H.span {className: "glyphicon glyphicon-registration-mark"} []
, H.a { href: "http://www.cnrs.fr"
, target: "blank"
, title: "Project hosted by CNRS."
}
[ H.text ", Copyrights "
, H.span { className: "glyphicon glyphicon-copyright-mark" } []
, H.text " CNRS 2017-Present"
]
, H.a { href: "http://gitlab.iscpif.fr/humanities/gargantext/blob/stable/LICENSE"
, target: "blank"
, title: "Legal instructions of the project."
}
[ H.text ", Licences aGPLV3 and CECILL variant Affero compliant" ]
, H.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