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
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
Grégoire Locqueville
purescript-gargantext
Commits
fe05a811
Commit
fe05a811
authored
Mar 19, 2018
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Array] some functions needed (same as in Data.List from Haskell) searching for it.
parent
871b5c71
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
89 additions
and
43 deletions
+89
-43
AddCorpusview.purs
src/AddCorpusview.purs
+2
-3
Array.purs
src/Gargantext/Data/Array.purs
+34
-0
Navigation.purs
src/Navigation.purs
+53
-40
No files found.
src/AddCorpusview.purs
View file @
fe05a811
...
...
@@ -71,12 +71,11 @@ performAction NoOp _ _ = void do
performAction (SelectDatabase selected) _ _ = void do
modifyState \( state) -> state { select_database = selected }
performAction (UnselectDatabase unselected) _ _ = void do
modifyState \( state) -> state { unselect_database = unselected }
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
Left err -> cotransform $ \(state) -> state
Right resData -> do
...
...
@@ -173,7 +172,7 @@ layoutAddcorpus = simpleSpec performAction render
newtype QueryString = QueryString
{
query_query :: String
,
query_name :: Array String
, query_name :: Array String
}
queryString :: QueryString
...
...
src/Gargantext/Data/Array.purs
0 → 100644
View file @
fe05a811
module Gargantext.Data.Array where
import Control.Monad.Aff.Console (log)
import Data.Array
--
---- | The 'intersperse' function takes an element and a list and
---- \`intersperses\' that element between the elements of the list.
---- For example,
----
---- >>> intersperse ',' "abcde"
---- "a,b,c,d,e"
--intersperse :: a -> [a] -> [a]
--intersperse _ [] = []
--intersperse sep (x:xs) = x : prependToAll sep xs
--
--
---- We want to make every element in the 'intersperse'd list available
---- as soon as possible to avoid space leaks. Experiments suggested that
---- a separate top-level helper is more efficient than a local worker.
--prependToAll :: a -> [a] -> [a]
--prependToAll _ [] = []
--prependToAll sep (x:xs) = sep : x : prependToAll sep xs
--
---- | 'intercalate' @xs xss@ is equivalent to @('concat' ('intersperse' xs xss))@.
---- It inserts the list @xs@ in between the lists in @xss@ and concatenates the
---- result.
----
---- >>> intercalate ", " ["Lorem", "ipsum", "dolor"]
---- "Lorem, ipsum, dolor"
--intercalate :: [a] -> [[a]] -> [a]
--intercalate xs xss = concat (intersperse xs xss)
--
src/Navigation.purs
View file @
fe05a811
...
...
@@ -217,7 +217,6 @@ divLogo = a [ className "navbar-brand logoSmall"
] []
]
divDropdownLeft :: ReactElement
divDropdownLeft = ul [className "nav navbar-nav"]
[ ul [className "nav navbar-nav pull-left"]
...
...
@@ -231,8 +230,24 @@ divDropdownLeft = ul [className "nav navbar-nav"]
] []
, text " Info"
]
, ul [className "dropdown-menu"]
(( map liNav [ LiNav { title : "Quick start, tutorials and methodology"
, ul [className "dropdown-menu"] divLeftdropdownElements
]
]
]
-- TODO
-- import Gargantext.Data.Array
-- menu [[ LiNav, LiNav]
-- ,[ LiNav, LiNav]
-- ,[ LiNav ]
-- ]
-- where
-- menu = map linNav . foldl (\a b -> a <> b) . intercalate [divider]
-- where
-- divider = [li [className "divider"] []]
--
divLeftdropdownElements :: Array ReactElement
divLeftdropdownElements = (( map liNav [ LiNav { title : "Quick start, tutorials and methodology"
, href : "https://iscpif.fr/gargantext/your-first-map/"
, icon : "fas fa-book"
, text : "Documentation"
...
...
@@ -266,9 +281,6 @@ divDropdownLeft = ul [className "nav navbar-nav"]
)
]
)
]
]
]
data LiNav = LiNav { title :: String
...
...
@@ -296,42 +308,44 @@ liNav (LiNav { title:tit
-- TODO put the search form in the center of the navBar
divSearchBar :: ReactElement
divSearchBar = ul [ className "nav navbar-nav", style { "margin-left" : "146px"}]
[ div [className "navbar-form"]
[ input [ className "search-query"
, placeholder "Query, URL or FILE (works with Firefox or Chromium browsers)"
, _type "text"
, style { height: "35px"
, width : "450px"
-- , color: "white"
-- , background : "#A1C2D8"
}
] []
-- TODO add button in navbar (and "enter" execution)
-- , div [] [button [][]]
]
divSearchBar = ul [ className "nav navbar-nav"
, style { "margin-left" : "146px"}
] [ div [className "navbar-form"]
[ input [ className "search-query"
, placeholder "Query, URL or FILE (works with Firefox or Chromium browsers)"
, _type "text"
, style { height: "35px"
, width : "450px"
-- , color: "white"
-- , background : "#A1C2D8"
}
] []
-- TODO add button in navbar (and "enter" execution)
-- , div [] [button [][]]
]
]
--divDropdownRight :: Render AppState props Action
divDropdownRight :: ReactElement
divDropdownRight = ul [className "nav navbar-nav pull-right"]
[
-- TODO if logged in : enable dropdown to logout
li [className "dropdown"]
[
a [ aria {hidden : true}
, className "glyphicon glyphicon-log-in"
, href "#/login"
, style {color:"white"}
, title "Log in and save your time"
-- TODO hover: bold
]
-- TODO if logged in
--, text " username"
-- else
[text " Login / Signup"]
]
]
divDropdownRight =
ul [className "nav navbar-nav pull-right"]
[
-- TODO if logged in : enable dropdown to logout
li [className "dropdown"]
[
a [ aria {hidden : true}
, className "glyphicon glyphicon-log-in"
, href "#/login"
, style {color:"white"}
, title "Log in and save your time"
-- TODO hover: bold
]
-- TODO if logged in
--, text " username"
-- else
[text " Login / Signup"]
]
]
...
...
@@ -367,8 +381,7 @@ layoutSpec :: forall eff props. Spec (E eff) AppState props Action
layoutSpec =
fold
[ routingSpec
, container $
withState pagesComponent
, container $ withState pagesComponent
]
where
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