Commit 8859246c authored by Sudhir Kumar's avatar Sudhir Kumar

search moved to top nav bar

parent 1ecdd6fa
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<title>CNRS GarganText</title> <title>CNRS GarganText</title>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link href="https://use.fontawesome.com/releases/v5.0.8/css/all.css" rel="stylesheet"> <link href="https://use.fontawesome.com/releases/v5.0.8/css/all.css" rel="stylesheet">
<link href="css/login.min.css" rel="stylesheet"> <!-- < link href="css/login.min.css" rel="stylesheet" > -->
<link href="css/bootstrap.min.css" rel="stylesheet"> <link href="css/bootstrap.min.css" rel="stylesheet">
<!-- <link href="css/lavish-bootstrap.css" rel="stylesheet"> --> <!-- <link href="css/lavish-bootstrap.css" rel="stylesheet"> -->
<link rel="stylesheet" type="text/css" href="css/menu.css"/> <link rel="stylesheet" type="text/css" href="css/menu.css"/>
......
...@@ -2,9 +2,12 @@ module Navigation where ...@@ -2,9 +2,12 @@ module Navigation where
import DOM import DOM
import Gargantext.Data.Lang import Gargantext.Data.Lang
import Prelude hiding (div)
import AddCorpusview as AC import AddCorpusview as AC
import AnnotationDocumentView as D import AnnotationDocumentView as D
import Control.Monad.Cont.Trans (lift)
import Control.Monad.Eff.Class (liftEff)
import Control.Monad.Eff.Console (CONSOLE) import Control.Monad.Eff.Console (CONSOLE)
import CorpusAnalysis as CA import CorpusAnalysis as CA
import Data.Array (concat) import Data.Array (concat)
...@@ -19,11 +22,11 @@ import Login as LN ...@@ -19,11 +22,11 @@ import Login as LN
import NTree as NT import NTree as NT
import Network.HTTP.Affjax (AJAX) import Network.HTTP.Affjax (AJAX)
import PageRouter (Routes(..)) import PageRouter (Routes(..))
import Prelude hiding (div)
import React (ReactElement) import React (ReactElement)
import React.DOM (a, button, div, footer, form, hr, i, img, input, li, p, span, text, ul) import React.DOM (a, button, div, footer, form, hr, i, img, input, li, p, span, text, ul)
import React.DOM.Props (Props, _data, _id, _type, aria, className, href, name, onChange, onClick, placeholder, role, src, style, tabIndex, target, title) import React.DOM.Props (Props, _data, _id, _type, aria, className, href, name, onChange, onClick, placeholder, role, src, style, tabIndex, target, title)
import React.DOM.Props as RP import React.DOM.Props as RP
import Routing.Hash.Aff (setHash)
import SearchForm as S import SearchForm as S
import Tabview as TV import Tabview as TV
import Thermite (PerformAction, Render, Spec, _render, cotransform, defaultRender, focus, modifyState, simpleSpec, withState) import Thermite (PerformAction, Render, Spec, _render, cotransform, defaultRender, focus, modifyState, simpleSpec, withState)
...@@ -91,6 +94,7 @@ performAction (Search s) _ _ = void do ...@@ -91,6 +94,7 @@ performAction (Search s) _ _ = void do
performAction Go _ _ = void do performAction Go _ _ = void do
_ <- lift $ setHash "/addCorpus"
modifyState id modifyState id
...@@ -246,7 +250,7 @@ layout0 :: forall eff props. Spec (E eff) AppState props Action ...@@ -246,7 +250,7 @@ layout0 :: forall eff props. Spec (E eff) AppState props Action
-> Spec (E eff) AppState props Action -> Spec (E eff) AppState props Action
layout0 layout = layout0 layout =
fold fold
[ layoutSidebar [ layoutSidebar divSearchBar
, outerLayout , outerLayout
, layoutFooter , layoutFooter
] ]
...@@ -254,9 +258,8 @@ layout0 layout = ...@@ -254,9 +258,8 @@ layout0 layout =
outerLayout :: Spec (E eff) AppState props Action outerLayout :: Spec (E eff) AppState props Action
outerLayout = outerLayout =
cont $ fold cont $ fold
[ ls a [ ls as
, rs b , rs bs ]
]
ls = over _render \render d p s c -> ls = over _render \render d p s c ->
[div [className "col-md-3"] (render d p s c)] [div [className "col-md-3"] (render d p s c)]
rs = over _render \render d p s c -> rs = over _render \render d p s c ->
...@@ -264,10 +267,9 @@ layout0 layout = ...@@ -264,10 +267,9 @@ layout0 layout =
cont = over _render \render d p s c -> cont = over _render \render d p s c ->
[ div [ className "row" ] (render d p s c) ] [ div [ className "row" ] (render d p s c) ]
a = fold [ focus _treeState _treeAction NT.treeview as = focus _treeState _treeAction NT.treeview
, divSearchBar
] bs = innerLayout $ layout
b = innerLayout $ layout
innerLayout :: Spec (E eff) AppState props Action innerLayout :: Spec (E eff) AppState props Action
-> Spec (E eff) AppState props Action -> Spec (E eff) AppState props Action
...@@ -278,12 +280,9 @@ layout0 layout = ...@@ -278,12 +280,9 @@ layout0 layout =
] ]
] ]
layoutSidebar :: forall props eff. Spec (E eff) AppState props Action
layoutSidebar :: forall props eff. Spec (dom :: DOM |eff) AppState props Action -> Spec (E eff) AppState props Action
layoutSidebar = simpleSpec performAction render layoutSidebar = over _render \render d p s c ->
where
render :: Render AppState props Action
render dispatch _ state _ =
[ div [ _id "dafixedtop" [ div [ _id "dafixedtop"
, className "navbar navbar-inverse navbar-fixed-top" , className "navbar navbar-inverse navbar-fixed-top"
, role "navigation" , role "navigation"
...@@ -291,9 +290,9 @@ layoutSidebar = simpleSpec performAction render ...@@ -291,9 +290,9 @@ layoutSidebar = simpleSpec performAction render
[ div [ className "navbar-inner" ] [ div [ className "navbar-inner" ]
[ divLogo [ divLogo
, div [ className "collapse navbar-collapse"] , div [ className "collapse navbar-collapse"]
[ divDropdownLeft $ [ divDropdownLeft]
, divDropdownRight <> render d p s c <>
] [ divDropdownRight ]
] ]
] ]
] ]
...@@ -430,24 +429,21 @@ divSearchBar = simpleSpec performAction render ...@@ -430,24 +429,21 @@ divSearchBar = simpleSpec performAction render
render :: Render AppState props Action render :: Render AppState props Action
render dispatch _ state _ = [div [ className "" ] [ searchbar']] render dispatch _ state _ = [div [ className "" ] [ searchbar']]
where where
searchbar' = ul [ className "nav navbar-nav" searchbar' = ul [ className "nav navbar-nav col-md-6 col-md-offset-3"
, style { "margin-left" : "0px"} , style { "marginLeft" : "15%"}
] [ div [className "navbar-form"] ] [ div [className "navbar-form"]
[ input [ className "search-query" [ input [ className "search-query"
, placeholder "Query, URL or FILE (works with Firefox or Chromium browsers)" , placeholder "Query, URL or FILE (works with Firefox or Chromium browsers)"
, _type "text" , _type "text"
, style { height: "35px" , style { height: "35px"
, width: "400px"
} }
, onChange \e -> dispatch $ Search (unsafeCoerce e).target.value , onChange \e -> dispatch $ Search (unsafeCoerce e).target.value
] [] ] []
, div [] , button [onClick \e -> dispatch Go, className "btn btn-primary"] [text "Enter"]
[ button [onClick \e -> dispatch Go, className "btn btn-primary", style {marginTop : "10px"}] [text "Enter"] ]
] ]
] ]
--divDropdownRight :: Render AppState props Action --divDropdownRight :: Render AppState props Action
divDropdownRight :: ReactElement divDropdownRight :: ReactElement
divDropdownRight = divDropdownRight =
......
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