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
42afb4c1
Commit
42afb4c1
authored
Apr 17, 2018
by
Abinaya Sudhir
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show corpus modal added
parent
d478bd35
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
6 deletions
+52
-6
AddCorpusview.purs
src/AddCorpusview.purs
+33
-0
Navigation.purs
src/Navigation.purs
+19
-6
No files found.
src/AddCorpusview.purs
View file @
42afb4c1
...
...
@@ -86,6 +86,39 @@ performAction GO _ _ = void do
modifyState id
modalSpec :: forall eff props. Boolean -> String -> Spec eff State props Action -> Spec eff State props Action
modalSpec sm t = over _render \render d p s c ->
[ div [ _id "loginModal", className $ "modal myModal" <> if sm then "" else " fade"
, role "dialog"
, _data {show : true}
][ div [ className "modal-dialog"
, role "document"
] [ div [ className "modal-content"]
[ div [ className "modal-header"]
[ h5 [ className "modal-title"
]
[ text $ t
]
, button [ _type "button"
, className "close"
, _data { dismiss : "modal"}
] [ span [ aria {hidden : true}]
[ text "X"]
]
]
, div [ className "modal-body"]
(render d p s c)
]
]
]
]
spec' :: forall eff props. Spec (console:: CONSOLE, ajax :: AJAX, dom :: DOM | eff) State props Action
spec' = modalSpec true "Search Results" layoutAddcorpus
layoutModal :: forall e. { response :: Array Response | e} -> Array ReactElement
layoutModal state =
[button [ _type "button"
...
...
src/Navigation.purs
View file @
42afb4c1
...
...
@@ -2,7 +2,6 @@ module Navigation where
import DOM
import Gargantext.Data.Lang
import Prelude hiding (div)
import AddCorpusview as AC
import AnnotationDocumentView as D
...
...
@@ -24,6 +23,7 @@ import Modal (modalShow)
import NTree as NT
import Network.HTTP.Affjax (AJAX)
import PageRouter (Routes(..))
import Prelude hiding (div)
import React (ReactElement)
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)
...
...
@@ -51,6 +51,7 @@ type AppState =
, search :: String
, corpusAnalysis :: CA.State
, showLogin :: Boolean
, showCorpus :: Boolean
}
initAppState :: AppState
...
...
@@ -68,6 +69,7 @@ initAppState =
, search : ""
, corpusAnalysis : CA.initialState
, showLogin : false
, showCorpus : false
}
data Action
...
...
@@ -86,6 +88,8 @@ data Action
| Go
| CorpusAnalysisA CA.Action
| ShowLogin
| ShowAddcorpus
performAction :: forall eff props. PerformAction ( dom :: DOM
...
...
@@ -101,9 +105,17 @@ performAction (ShowLogin) _ _ = void do
liftEff $ modalShow "loginModal"
modifyState $ _ {showLogin = true}
performAction (ShowAddcorpus) _ _ = void do
liftEff $ modalShow "addCorpus"
modifyState $ _ {showCorpus = true}
performAction Go _ _ = void do
_ <- lift $ setHash "/addCorpus"
modifyState id
liftEff $ modalShow "addCorpus"
modifyState $ _ {showCorpus = true}
-- _ <- lift $ setHash "/addCorpus"
--modifyState id
performAction _ _ _ = void do
...
...
@@ -237,7 +249,7 @@ pagesComponent s =
selectSpec CorpusAnalysis = layout0 $ focus _corpusState _corpusAction CA.spec'
-- selectSpec Login = focus _loginState _loginAction LN.renderSpec
selectSpec Home = layout0 $ focus _landingState _landingAction (L.layoutLanding EN)
selectSpec AddCorpus = layout0 $ focus _addCorpusState _addCorpusAction AC.layoutAddcorpus
--
selectSpec AddCorpus = layout0 $ focus _addCorpusState _addCorpusAction AC.layoutAddcorpus
selectSpec DocView = layout0 $ focus _docViewState _docViewAction DV.layoutDocview
selectSpec UserPage = layout0 $ focus _userPageState _userPageAction UP.layoutUser
selectSpec (AnnotationDocumentView i) = layout0 $ focus _annotationdocumentviewState _annotationdocumentviewAction D.docview
...
...
@@ -250,7 +262,6 @@ routingSpec :: forall props eff. Spec (dom :: DOM |eff) AppState props Action
routingSpec = simpleSpec performAction defaultRender
layout0 :: forall eff props. Spec (E eff) AppState props Action
-> Spec (E eff) AppState props Action
layout0 layout =
...
...
@@ -510,7 +521,9 @@ layoutSpec =
[ routingSpec
, container $ withState pagesComponent
, withState \st ->
focus _loginState _loginAction (LN.modalSpec st.showLogin "Login" LN.renderSpec)
fold [ focus _loginState _loginAction (LN.modalSpec st.showLogin "Login" LN.renderSpec)
, focus _addCorpusState _addCorpusAction (AC.modalSpec st.showCorpus "Search Results" AC.layoutAddcorpus)
]
]
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