Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
purescript-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
142
Issues
142
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
purescript-gargantext
Commits
64a7d396
Commit
64a7d396
authored
Mar 20, 2018
by
Abinaya Sudhir
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
ssh://gitlab.iscpif.fr:20022/gargantext/purescript-gargantext
parents
b3b820f8
7588c9a6
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
144 additions
and
105 deletions
+144
-105
AddCorpusview.purs
src/AddCorpusview.purs
+52
-26
RandomText.purs
src/Gargantext/RandomText.purs
+1
-1
Landing.purs
src/Landing.purs
+4
-4
Navigation.purs
src/Navigation.purs
+87
-74
No files found.
src/AddCorpusview.purs
View file @
64a7d396
...
@@ -71,12 +71,11 @@ performAction NoOp _ _ = void do
...
@@ -71,12 +71,11 @@ performAction NoOp _ _ = void do
performAction (SelectDatabase selected) _ _ = void do
performAction (SelectDatabase selected) _ _ = void do
modifyState \( state) -> state { select_database = selected }
modifyState \( state) -> state { select_database = selected }
performAction (UnselectDatabase unselected) _ _ = void do
performAction (UnselectDatabase unselected) _ _ = void do
modifyState \( state) -> state { unselect_database = unselected }
modifyState \( state) -> state { unselect_database = unselected }
performAction (LoadDatabaseDetails) _ _ = void do
performAction (LoadDatabaseDetails) _ _ = void do
res <- lift $ getDatabaseDetails $ QueryString
{
query_query: "string",query_name: ["Pubmed"]}
res <- lift $ getDatabaseDetails $ QueryString
{
query_query: "string",query_name: ["Pubmed"]}
case res of
case res of
Left err -> cotransform $ \(state) -> state
Left err -> cotransform $ \(state) -> state
Right resData -> do
Right resData -> do
...
@@ -87,6 +86,55 @@ performAction GO _ _ = void do
...
@@ -87,6 +86,55 @@ performAction GO _ _ = void do
modifyState id
modifyState id
layoutModal :: forall e. { response :: Array Response | e} -> Array ReactElement
layoutModal state =
[button [ _type "button"
, _data { "toggle" : "modal"
, "target" : ".myModal"
}
][text "Launch modal"]
, div [ className "modal fade myModal"
, role "dialog"
, _data {show : true}
][ div [ className "modal-dialog"
, role "document"
] [ div [ className "modal-content"]
[ div [ className "modal-header"]
[ h5 [ className "modal-title"
]
[ text "CorpusView"
]
, button [ _type "button"
, className "close"
, _data { dismiss : "modal"}
] [ span [ aria {hidden : true}]
[ text "X"]
]
]
, div [ className "modal-body"]
[ ul [ className "list-group"] ( map fn1 state.response ) ]
, div [className "modal-footer"]
[ button [ _type "button"
, className "btn btn-secondary"
, _data {dismiss : "modal"}
] [ text "GO"]
]
]
]
]
]
where
fn1 (Response o) =
li [className "list-group-item justify-content-between"]
[
span [] [text o.name]
, span [className "badge badge-default badge-pill"] [ text $ show o.count]
]
layoutAddcorpus :: forall props eff . Spec (console::CONSOLE, ajax::AJAX, dom::DOM | eff) State props Action
layoutAddcorpus :: forall props eff . Spec (console::CONSOLE, ajax::AJAX, dom::DOM | eff) State props Action
layoutAddcorpus = simpleSpec performAction render
layoutAddcorpus = simpleSpec performAction render
...
@@ -100,29 +148,7 @@ layoutAddcorpus = simpleSpec performAction render
...
@@ -100,29 +148,7 @@ layoutAddcorpus = simpleSpec performAction render
div [className "jumbotron"]
div [className "jumbotron"]
[ div [className "row"]
[ div [className "row"]
[
[
div [className "col-md-6"]
div [className "col-md-6"] (layoutModal state)
[
button [_type "button", _data {"toggle" : "modal", "target" : ".myModal"}][text "Launch modal"]
, div [className "modal fade myModal",role "dialog", _data {show : true} ]
[ div [className "modal-dialog",role "document"]
[ div [className "modal-content"]
[ div [className "modal-header"]
[ h5 [className "modal-title"] [ text "CorpusView"]
, button [ _type "button",className "close", _data { dismiss : "modal"}]
[ span [aria {hidden : true}] [ text "X"]
]
]
, div [className "modal-body"]
[ ul [className "list-group"] $ map fn1 state.response
]
, div [className "modal-footer"]
[ button [ _type "button", className "btn btn-secondary", _data {dismiss : "modal"}]
[ text "GO"]
]
]
]
]
]
, div [className "col-md-6"]
, div [className "col-md-6"]
[
[
h3 [] [text "Corpusview"]
h3 [] [text "Corpusview"]
...
@@ -146,7 +172,7 @@ layoutAddcorpus = simpleSpec performAction render
...
@@ -146,7 +172,7 @@ layoutAddcorpus = simpleSpec performAction render
newtype QueryString = QueryString
newtype QueryString = QueryString
{
{
query_query :: String
query_query :: String
,
query_name :: Array String
, query_name :: Array String
}
}
queryString :: QueryString
queryString :: QueryString
...
...
src/RandomText.purs
→
src/
Gargantext/
RandomText.purs
View file @
64a7d396
...
@@ -17,7 +17,7 @@ randomChars : randomizes chars in a word.
...
@@ -17,7 +17,7 @@ randomChars : randomizes chars in a word.
TODO: add some tests as examples.
TODO: add some tests as examples.
-}
-}
module RandomText where
module
Gargantext.
RandomText where
import Prelude
import Prelude
...
...
src/Landing.purs
View file @
64a7d396
...
@@ -69,10 +69,10 @@ jumboTitle b = div jumbo
...
@@ -69,10 +69,10 @@ jumboTitle b = div jumbo
]
]
]
]
, 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 "Project hosted by CNRS (France, Europa, Solar System)" ]
[ img [ src "images/logo.png", title "Project hosted by CNRS (France, Europa, Solar System)" ]
[]
[]
]
]
]
]
]
]
...
...
src/Navigation.purs
View file @
64a7d396
...
@@ -4,8 +4,10 @@ import DOM
...
@@ -4,8 +4,10 @@ import DOM
import AddCorpusview as AC
import AddCorpusview as AC
import Control.Monad.Eff.Console (CONSOLE)
import Control.Monad.Eff.Console (CONSOLE)
import Data.Array (concat)
import Data.Either (Either(..))
import Data.Either (Either(..))
import Data.Foldable (fold)
import Data.Foldable (fold
, intercalate
)
import Data.Lens (Lens', Prism', lens, over, prism)
import Data.Lens (Lens', Prism', lens, over, prism)
import Data.Maybe (Maybe(Nothing, Just))
import Data.Maybe (Maybe(Nothing, Just))
import DocView as DV
import DocView as DV
...
@@ -177,7 +179,8 @@ routingSpec = simpleSpec performAction defaultRender
...
@@ -177,7 +179,8 @@ routingSpec = simpleSpec performAction defaultRender
layout0 :: forall eff props. Spec (E eff) AppState props Action -> Spec (E eff) AppState props Action
layout0 :: forall eff props. Spec (E eff) AppState props Action
-> Spec (E eff) AppState props Action
layout0 layout =
layout0 layout =
fold
fold
[ layoutSidebar
[ layoutSidebar
...
@@ -187,7 +190,8 @@ layout0 layout =
...
@@ -187,7 +190,8 @@ layout0 layout =
, layoutFooter
, layoutFooter
]
]
where
where
innerLayout :: Spec (E eff) AppState props Action -> Spec (E eff) AppState props Action
innerLayout :: Spec (E eff) AppState props Action
-> Spec (E eff) AppState props Action
innerLayout = over _render \render d p s c ->
innerLayout = over _render \render d p s c ->
[ div [_id "page-wrapper"]
[ div [_id "page-wrapper"]
[
[
...
@@ -233,7 +237,6 @@ divLogo = a [ className "navbar-brand logoSmall"
...
@@ -233,7 +237,6 @@ divLogo = a [ className "navbar-brand logoSmall"
] []
] []
]
]
divDropdownLeft :: ReactElement
divDropdownLeft :: ReactElement
divDropdownLeft = ul [className "nav navbar-nav"]
divDropdownLeft = ul [className "nav navbar-nav"]
[ ul [className "nav navbar-nav pull-left"]
[ ul [className "nav navbar-nav pull-left"]
...
@@ -247,46 +250,55 @@ divDropdownLeft = ul [className "nav navbar-nav"]
...
@@ -247,46 +250,55 @@ divDropdownLeft = ul [className "nav navbar-nav"]
] []
] []
, text " Info"
, text " Info"
]
]
, ul [className "dropdown-menu"]
, ul [className "dropdown-menu"] divLeftdropdownElements
(( map liNav [ LiNav { title : "Quick start, tutorials and methodology"
]
, href : "https://iscpif.fr/gargantext/your-first-map/"
, icon : "fas fa-book"
, text : "Documentation"
}
, LiNav { title : "Report bug here"
, href : "https://www.iscpif.fr/gargantext/feedback-and-bug-reports/"
, icon : "glyphicon glyphicon-bullhorn"
, text : "Feedback"
}
]
)
<> [li [className "divider"] []] <>
(map liNav [ LiNav { title : "Interactive chat"
, href : "https://chat.iscpif.fr/channel/gargantext"
, icon : "fab fa-rocketchat"
, text : "Chat"
}
, LiNav { title : "Asynchronous discussions"
, href : "https://discourse.iscpif.fr/c/gargantext"
, icon : "fab fa-discourse"
, text : "Forum"
}
]
)
<> [li [className "divider"] []] <>
[ liNav (LiNav { title : "More about us (you)"
, href : "http://iscpif.fr"
, icon : "fas fa-question-circle"
, text : "About"
}
)
]
)
]
]
]
]
]
-- WYSIWYG = Pure React
divLeftdropdownElements :: Array ReactElement
divLeftdropdownElements = menu
[ -- ===========================================================
[ LiNav { title : "Quick start, tutorials and methodology"
, href : "https://iscpif.fr/gargantext/your-first-map/"
, icon : "fas fa-book"
, text : "Documentation"
}
, LiNav { title : "Report bug here"
, href : "https://www.iscpif.fr/gargantext/feedback-and-bug-reports/"
, icon : "glyphicon glyphicon-bullhorn"
, text : "Feedback"
}
]
, -----------------------------------------------------------
[ LiNav { title : "Interactive chat"
, href : "https://chat.iscpif.fr/channel/gargantext"
, icon : "fab fa-rocketchat"
, text : "Chat"
}
, LiNav { title : "Asynchronous discussions"
, href : "https://discourse.iscpif.fr/c/gargantext"
, icon : "fab fa-discourse"
, text : "Forum"
}
]
,------------------------------------------------------------
[ LiNav { title : "More about us (you)"
, href : "http://iscpif.fr"
, icon : "fas fa-question-circle"
, text : "About"
}
]
] -- ===========================================================
menu :: Array (Array LiNav) -> Array ReactElement
menu ns = intercalate divider $ map (map liNav) ns
where
divider :: Array ReactElement
divider = [li [className "divider"] []]
data LiNav = LiNav { title :: String
data LiNav = LiNav { title :: String
, href :: String
, href :: String
, icon :: String
, icon :: String
...
@@ -312,42 +324,44 @@ liNav (LiNav { title:tit
...
@@ -312,42 +324,44 @@ liNav (LiNav { title:tit
-- TODO put the search form in the center of the navBar
-- TODO put the search form in the center of the navBar
divSearchBar :: ReactElement
divSearchBar :: ReactElement
divSearchBar = ul [ className "nav navbar-nav", style { "margin-left" : "146px"}]
divSearchBar = ul [ className "nav navbar-nav"
[ div [className "navbar-form"]
, style { "margin-left" : "146px"}
[ input [ className "search-query"
] [ div [className "navbar-form"]
, placeholder "Query, URL or FILE (works with Firefox or Chromium browsers)"
[ input [ className "search-query"
, _type "text"
, placeholder "Query, URL or FILE (works with Firefox or Chromium browsers)"
, style { height: "35px"
, _type "text"
, width : "450px"
, style { height: "35px"
-- , color: "white"
, width : "450px"
-- , background : "#A1C2D8"
-- , color: "white"
}
-- , background : "#A1C2D8"
] []
}
-- TODO add button in navbar (and "enter" execution)
] []
-- , div [] [button [][]]
-- TODO add button in navbar (and "enter" execution)
]
-- , div [] [button [][]]
]
]
]
--divDropdownRight :: Render AppState props Action
--divDropdownRight :: Render AppState props Action
divDropdownRight :: ReactElement
divDropdownRight :: ReactElement
divDropdownRight = ul [className "nav navbar-nav pull-right"]
divDropdownRight =
[
ul [className "nav navbar-nav pull-right"]
-- TODO if logged in : enable dropdown to logout
[
li [className "dropdown"]
-- TODO if logged in : enable dropdown to logout
[
li [className "dropdown"]
a [ aria {hidden : true}
[
, className "glyphicon glyphicon-log-in"
a [ aria {hidden : true}
, href "#/login"
, className "glyphicon glyphicon-log-in"
, style {color:"white"}
, href "#/login"
, title "Log in and save your time"
, style {color:"white"}
-- TODO hover: bold
, title "Log in and save your time"
]
-- TODO hover: bold
-- TODO if logged in
]
--, text " username"
-- TODO if logged in
-- else
--, text " username"
[text " Login / Signup"]
-- else
]
[text " Login / Signup"]
]
]
]
...
@@ -383,8 +397,7 @@ layoutSpec :: forall eff props. Spec (E eff) AppState props Action
...
@@ -383,8 +397,7 @@ layoutSpec :: forall eff props. Spec (E eff) AppState props Action
layoutSpec =
layoutSpec =
fold
fold
[ routingSpec
[ routingSpec
, container $
, container $ withState pagesComponent
withState pagesComponent
]
]
where
where
container :: Spec (E eff) AppState props Action -> Spec (E eff) AppState props Action
container :: Spec (E eff) AppState props Action -> Spec (E eff) AppState props Action
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment