Commit 93c0523c authored by Alexandre Delanoë's avatar Alexandre Delanoë

[TEXT/Clean] home/search/nav.

parent f3f35ffb
...@@ -56,133 +56,29 @@ loginSpec = simpleSpec performAction render ...@@ -56,133 +56,29 @@ loginSpec = simpleSpec performAction render
where where
render :: Render State props Action render :: Render State props Action
render dispatch _ state _ = render dispatch _ state _ =
[ [ div [className "container" ]
-- div [ _id "dafixedtop", className "navbar navbar-inverse navbar-fixed-top", role "navigation"] [ div [className "jumbotron" ]
-- [ div [className "container"] [ div [className "row" ]
-- [ [ div [className "col-md-8 content"]
-- div [ className "navbar-inner" ] [ h1 [] [ text "Gargantext"]
-- [ a [ className "navbar-brand logoSmall", href "/" ] , p [] [ text "Collaborative knowledge mapping experience" ]
-- [ img [ src "images/logoSmall.png", title "Back to home." ] , p [] [ a [ className "btn btn-success btn-lg spacing-class"
-- [] , href "https://iscpif.fr/gargantext/your-first-map/"
-- ] , target "blank"
-- ] , title "Your first map in less than 5 minutes"
-- , div [className "navbar-collapse collapse"] ]
-- [ [ span [ aria {hidden : true}
, className "glyphicon glyphicon-hand-right"
-- ul [className "nav navbar-nav"] ] []
-- [ , text " Get's started"
-- ul [className "nav navbar-nav pull-left"] [ ]
-- li [className "dropdown"] ]
-- [
-- a [
-- className "dropdown-toggle navbar-text", _data {toggle: "dropdown"}, href "#", role "button", title "Informations about Gargantext" ]
-- [ span [ aria {hidden : true}, className "glyphicon glyphicon-info-sign" ]
-- []
-- , text "Info"
-- , i [ className "caret" ]
-- []
-- ]
-- , ul [className "dropdown-menu"]
-- [ li []
-- [ a [tabIndex (-1), target "blank", title "Documentation and tutorials", href "https://iscpif.fr/gargantext/your-first-map/"]
-- [text "Documentation"]
-- ]
-- , li [className "divider"] []
-- , li []
-- [
-- a [ tabIndex (-1), target "blank", title "About", href "/about/", title "More informations about the project, its sponsors and its authors"]
-- [ text "About"]
-- ]
-- ]
-- ]
-- ]
-- ]
-- , ul [className "nav navbar-nav pull-right"]
-- [
-- li [className "dropdown"]
-- [
-- a [ className "dropdown-toggle navbar-text", _data {toggle : "dropdown"}, href "#", role "button", title "That is your username" ]
-- [ i [ className "" ]
-- []
-- , span [ aria {hidden : true}, className "glyphicon glyphicon-user", style {color:"white"} ]
-- []
-- , i [ className "caret" ]
-- []
-- ]
-- , ul [className "dropdown-menu"]
-- [
-- li []
-- [ a [tabIndex (-1), target "blank", title "Send us a message (bug, thanks, congrats...)", href "https://www.iscpif.fr/gargantext/feedback-and-bug-reports/"]
-- [
-- span [ className "glyphicon glyphicon-bullhorn" ,aria {hidden : true}] []
-- , text "Report Feedback"
-- ]
-- ]
-- , li [ className"divider"]
-- []
-- , li []
-- [ a [tabIndex (-1), href "/auth/login" ]
-- [ span [className "glyphicon glyphicon-log-in",aria {hidden : true}] []
-- , text "login"
-- ]
-- ]
-- ]
-- ]
-- ]
-- ]
-- ]
-- ]
div [className "container"]
[
div [className "jumbotron"]
[
div [className "row"]
[
div [className "col-md-8 content"]
[
h1 []
[ text "Gargantext" ]
, p []
[ text "Collaborative knowledge mapping experience" ]
-- TODO : put the login in top right page [#54]
, p []
[
-- a [ className "btn btn-primary btn-lg spacing-class ", onClick \_ -> dispatch $ Submit , title "Click and test by yourself" ]
-- [ span [ className "glyphicon glyphicon-hand-right" ]
-- []
-- , text " Login"
-- ]
---- TODO: login / sign up will not be mandatory any more (mandatory to save/share your research only)
---- TODO: ask for login or account creation after 5 mn when user is not logged and has made one search at least
-- , a [ className "btn btn-warning btn-lg spacing-class", href "https://iscpif.fr/services/applyforourservices/", target "blank", title "Fill the form to sign up" ]
-- [ span [ aria {hidden : true}, className "glyphicon glyphicon-hand-right" ]
-- []
-- , text "Sign Up"
-- ]
a [ className "btn btn-success btn-lg spacing-class", href "https://iscpif.fr/gargantext/your-first-map/", target "blank", title "Fill the form to sign up" ]
[ span [ aria {hidden : true}, className "glyphicon glyphicon-hand-right" ]
[]
, text " Get's started"
]
]
, span [ aria {hidden : true}, className "glyphicon glyphicon-warning-sign" ]
[]
, i []
[ text "Some features may not work without a javascript optimized browser (Chromium for instance). " ]
] ]
, div [className "col-md-2 content"] , div [ className "col-md-2 content"]
[ [p [ className "right" ]
p [ className "right" ] [ div [_id "logo-designed" ]
[ div [_id "logo-designed" ] [ img [ src "images/logo.png", title "Logo designed by dacha and anoe" ]
[ img [ src "images/logo.png", title "Logo designed by dacha and anoe" ] []
[]
] ]
] ]
] ]
......
...@@ -26,6 +26,9 @@ import Thermite (PerformAction, Render, Spec, modifyState, simpleSpec) ...@@ -26,6 +26,9 @@ import Thermite (PerformAction, Render, Spec, modifyState, simpleSpec)
import Unsafe.Coerce (unsafeCoerce) import Unsafe.Coerce (unsafeCoerce)
-- TODO: ask for login (modal) or account creation after 15 mn when user is not logged and has made one search at least
newtype State = State newtype State = State
{ username :: String { username :: String
, password :: String , password :: String
......
...@@ -3,25 +3,21 @@ module Navigation where ...@@ -3,25 +3,21 @@ module Navigation where
import DOM import DOM
import AddCorpusview as AC import AddCorpusview as AC
import Control.Monad.Aff.Class (liftAff)
import Control.Monad.Eff (Eff)
import Control.Monad.Eff.Class (liftEff)
import Control.Monad.Eff.Console (CONSOLE) import Control.Monad.Eff.Console (CONSOLE)
import Data.Either (Either(..)) import Data.Either (Either(..))
import Data.Foldable (fold) import Data.Foldable (fold)
import Data.Lens (Lens', Prism', lens, over, prism) import Data.Lens (Lens', Prism', lens, over, prism)
import Data.Maybe (Maybe, Maybe(Nothing, Just)) import Data.Maybe (Maybe(Nothing, Just))
import Landing as L import Landing as L
import Login as LN import Login as LN
import Network.HTTP.Affjax (AJAX) import Network.HTTP.Affjax (AJAX)
import PageRouter (Routes(..)) import PageRouter (Routes(..))
import Prelude hiding (div) 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, i, img, li, span, text, ul, map') import React.DOM (a, div, img, li, span, text, ul)
import React.DOM.Props (_data, _id, aria, className, href, role, src, style, tabIndex, target, title, onClick) import React.DOM.Props (_data, _id, aria, className, href, 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
import Landing as Landing
import SearchForm as S import SearchForm as S
import UserPage as UP import UserPage as UP
...@@ -246,30 +242,33 @@ sidebarnavSpec = simpleSpec performAction render ...@@ -246,30 +242,33 @@ sidebarnavSpec = simpleSpec performAction render
, text " Info" , text " Info"
] ]
, ul [className "dropdown-menu"] , ul [className "dropdown-menu"]
(( map liNav [ LiNav { title : "Documentation and tutorials" (( map liNav [ LiNav { title : "Quick start, tutorials and methodology"
, href : "https://iscpif.fr/gargantext/your-first-map/" , href : "https://iscpif.fr/gargantext/your-first-map/"
, icon : "fas fa-book" , icon : "fas fa-book"
, text : "Documentation" , text : "Documentation"
} }
, LiNav { title : "Report bug here" , LiNav { title : "Report bug here"
, href : "https://www.iscpif.fr/gargantext/feedback-and-bug-reports/" , href : "https://www.iscpif.fr/gargantext/feedback-and-bug-reports/"
, icon : "glyphicon glyphicon-bullhorn" , icon : "glyphicon glyphicon-bullhorn"
, text : "Feedback" , text : "Feedback"
} }
, LiNav { title : "Interactive chat" ]
)
<> [li [className "divider"] []] <>
(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"] []] <>
[ liNav (LiNav { title : "About" [ liNav (LiNav { title : "More about us (you)"
, href : "http://iscpif.fr" , href : "http://iscpif.fr"
, icon : "fas fa-question-circle" , icon : "fas fa-question-circle"
, text : "About" , text : "About"
......
...@@ -6,8 +6,8 @@ import Control.Monad.Cont.Trans (lift) ...@@ -6,8 +6,8 @@ import Control.Monad.Cont.Trans (lift)
import DOM (DOM) import DOM (DOM)
import Network.HTTP.Affjax (AJAX) import Network.HTTP.Affjax (AJAX)
import Prelude hiding (div) import Prelude hiding (div)
import React.DOM (br', button, div, h3, input, text) import React.DOM (br', button, div, h3, input, text, i, span)
import React.DOM.Props (_id, _type, className, name, onClick, onInput, placeholder, value) import React.DOM.Props (_id, _type, className, name, onClick, onInput, placeholder, value, aria)
import Routing.Hash.Aff (setHash) import Routing.Hash.Aff (setHash)
import Thermite (PerformAction, Render, Spec, modifyState, simpleSpec) import Thermite (PerformAction, Render, Spec, modifyState, simpleSpec)
import Unsafe.Coerce (unsafeCoerce) import Unsafe.Coerce (unsafeCoerce)
...@@ -49,42 +49,37 @@ unsafeEventValue :: forall event. event -> String ...@@ -49,42 +49,37 @@ unsafeEventValue :: forall event. event -> String
unsafeEventValue e = (unsafeCoerce e).target.value unsafeEventValue e = (unsafeCoerce e).target.value
-- TODO: case loggedIn of True -> Just Tree ; False -> Nothing -- TODO: case loggedIn of True -> Just Tree ; False -> Nothing
-- TODO: put the search form in the center of the page -- TODO: put the search form in the center of the page
-- TODO put Gargantext logo as search button
searchSpec :: forall props eff . Spec (console::CONSOLE, ajax::AJAX, dom::DOM | eff) State props Action searchSpec :: forall props eff . Spec (console::CONSOLE, ajax::AJAX, dom::DOM | eff) State props Action
searchSpec = simpleSpec performAction render 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"]
div [className "container"] [ div [className "jumbotron" ]
[ [ div [className "row" ]
div [className "jumbotron"] [ div [className "col-md-10" ]
[
div [className "row"]
[
div [className "col-md-10"]
[ br' []
, br' []
, div [className "form-group"]
[
input [className "form-control",
_id "id_password",
name "query",
placeholder "Enter Query",
_type "text",
value state.query,
onInput \e -> dispatch (SetQuery (unsafeEventValue e))
] []
, br'[]
]
]
, div [className "col-md-2"]
[ br' [] [ br' []
, br' [] , br' []
-- TODO put Gargantext logo as search button , div [ className "form-group"]
, button [onClick \_ -> dispatch GO] [text "GO"] [ input [ className "form-control"
] , _id "id_password"
] , name "query"
] , placeholder "Query, URL or FILE (optimized experience with Firefox or Chromium browsers)"
, _type "text"
, value state.query
, onInput \e -> dispatch (SetQuery (unsafeEventValue e))
] []
, br'[]
]
]
, div [className "col-md-2"]
[ br' []
, br' []
, button [onClick \_ -> dispatch GO] [text "GO"]
]
, br' []
]
]
]
] ]
]
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