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
1
Merge Requests
1
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
Przemyslaw Kaminski
purescript-gargantext
Commits
7588c9a6
Commit
7588c9a6
authored
Mar 19, 2018
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[MENU] WYSIWYG
parent
fd0cc749
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
82 deletions
+48
-82
Array.purs
src/Gargantext/Data/Array.purs
+0
-34
Navigation.purs
src/Navigation.purs
+48
-48
No files found.
src/Gargantext/Data/Array.purs
deleted
100644 → 0
View file @
fd0cc749
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 @
7588c9a6
...
...
@@ -4,8 +4,10 @@ import DOM
import AddCorpusview as AC
import Control.Monad.Eff.Console (CONSOLE)
import Data.Array (concat)
import Data.Either (Either(..))
import Data.Foldable (fold)
import Data.Foldable (fold
, intercalate
)
import Data.Lens (Lens', Prism', lens, over, prism)
import Data.Maybe (Maybe(Nothing, Just))
import DocView as DV
...
...
@@ -161,7 +163,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 =
fold
[ layoutSidebar
...
...
@@ -171,7 +174,8 @@ layout0 layout =
, layoutFooter
]
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 ->
[ div [_id "page-wrapper"]
[
...
...
@@ -235,19 +239,12 @@ divDropdownLeft = ul [className "nav navbar-nav"]
]
]
-- 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"] []]
--
-- WYSIWYG = Pure React
divLeftdropdownElements :: Array ReactElement
divLeftdropdownElements = ( (map liNav [ LiNav { title : "Quick start, tutorials and methodology"
divLeftdropdownElements = menu
[ -- ===========================================================
[ LiNav { title : "Quick start, tutorials and methodology"
, href : "https://iscpif.fr/gargantext/your-first-map/"
, icon : "fas fa-book"
, text : "Documentation"
...
...
@@ -258,9 +255,8 @@ divLeftdropdownElements = ( (map liNav [ LiNav { title : "Quick start,
, text : "Feedback"
}
]
)
<> [li [className "divider"] []] <>
(map liNav [ LiNav { title : "Interactive chat"
, -----------------------------------------------------------
[ LiNav { title : "Interactive chat"
, href : "https://chat.iscpif.fr/channel/gargantext"
, icon : "fab fa-rocketchat"
, text : "Chat"
...
...
@@ -271,16 +267,20 @@ divLeftdropdownElements = ( (map liNav [ LiNav { title : "Quick start,
, text : "Forum"
}
]
)
<> [li [className "divider"] []] <>
[ liNav (LiNav { title : "More about us (you)"
,------------------------------------------------------------
[ 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
...
...
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