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
132
Issues
132
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
f3f35ffb
Commit
f3f35ffb
authored
Mar 14, 2018
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[NAV|FIX] Login/signup link.
parent
638ebb8f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
61 deletions
+34
-61
Navigation.purs
src/Navigation.purs
+34
-61
No files found.
src/Navigation.purs
View file @
f3f35ffb
...
...
@@ -28,36 +28,36 @@ import UserPage as UP
type E e = (dom :: DOM, ajax :: AJAX, console :: CONSOLE | e)
type AppState =
{ currentRoute :: Maybe Routes
, landingState :: L.State
, loginState :: LN.State
{ currentRoute
:: Maybe Routes
, landingState
:: L.State
, loginState
:: LN.State
, addCorpusState :: AC.State
, docViewState :: DV.State
, searchState :: S.State
, userPage :: UP.State
, docViewState
:: DV.State
, searchState
:: S.State
, userPage
:: UP.State
}
initAppState :: AppState
initAppState =
{ currentRoute : Just Home
, landingState : L.initialState
, loginState : LN.initialState
{ currentRoute
: Just Home
, landingState
: L.initialState
, loginState
: LN.initialState
, addCorpusState : AC.initialState
, docViewState : DV.tdata
, searchState : S.initialState
, userPage : UP.initialState
, docViewState
: DV.tdata
, searchState
: S.initialState
, userPage
: UP.initialState
}
data Action
= Initialize
| LandingA L.Action
| LoginA LN.Action
| SetRoute Routes
| LandingA
L.Action
| LoginA
LN.Action
| SetRoute
Routes
| AddCorpusA AC.Action
| DocViewA DV.Action
| SearchA S.Action
| UserPageA UP.Action
| DocViewA
DV.Action
| SearchA
S.Action
| UserPageA
UP.Action
performAction :: forall eff props. PerformAction (dom :: DOM |eff) AppState props Action
...
...
@@ -93,7 +93,6 @@ _loginAction = prism LoginA \action ->
_-> Left action
_addCorpusState:: Lens' AppState AC.State
_addCorpusState = lens (\s -> s.addCorpusState) (\s ss -> s{addCorpusState = ss})
...
...
@@ -281,8 +280,6 @@ sidebarnavSpec = simpleSpec performAction render
]
]
]
---------------------------------------------------------------------------
---------------------------------------------------------------------------
---------------------------------------------------------------------------
, divDropdownRight
]
...
...
@@ -290,48 +287,24 @@ sidebarnavSpec = simpleSpec performAction render
]
]
--divDropdownRight :: Render AppState props Action
divDropdownRight :: ReactElement
divDropdownRight = ul [className "nav navbar-nav pull-right"]
[
-- TODO if logged in : enable dropdown
--li [className "dropdown"]
--[
a [
className "dropdown-toggle navbar-text"
, _data {toggle : "dropdown"}
-- , onClick \_ -> dispatch $ Login
, role "button"
, title "Username"
]
-- FIXME not sure about the className "login"
[ i [ className "login" ] []
, span [ aria {hidden : true}
-- TODO if logged in
--, className "glyphicon glyphicon-user"
-- else
, className "glyphicon glyphicon-log-in"
, style {color:"white"}
]
[]
-- 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"}
-- TODO hover: bold
]
-- TODO if logged in
--, text " username"
-- else
, text " Login / Signup"
]
-- , ul [className "dropdown-menu"]
-- [
-- , li [ className"divider"]
-- []
-- , li []
-- -- TODO if logged in show logout
-- [ a [tabIndex (-1), href "/auth/login" ]
-- [ span [className "glyphicon glyphicon-log-in",aria {hidden : true}] []
-- , text " Logout"
-- ]
-- ]
-- ]
--]
[text " Login / Signup"]
]
]
layoutSpec :: forall eff props. Spec (E eff) AppState props Action
...
...
@@ -353,11 +326,11 @@ dispatchAction dispatcher _ Home = do
pure unit
dispatchAction dispatcher _ Login = do
_ <- dispatcher $ SetRoute $ Login
_ <- dispatcher $ LoginA $ LN.NoOp
_ <- dispatcher $ LoginA
$ LN.NoOp
pure unit
dispatchAction dispatcher _ AddCorpus = do
_ <- dispatcher $ SetRoute $ AddCorpus
_ <- dispatcher $ SetRoute
$ AddCorpus
_ <- dispatcher $ AddCorpusA $ AC.LoadDatabaseDetails
pure unit
...
...
@@ -369,12 +342,12 @@ dispatchAction dispatcher _ DocView = do
dispatchAction dispatcher _ SearchView = do
_ <- dispatcher $ SetRoute $ SearchView
_ <- dispatcher $ SearchA $ S.NoOp
_ <- dispatcher $ SearchA
$ S.NoOp
pure unit
dispatchAction dispatcher _ UserPage = do
_ <- dispatcher $ SetRoute $ UserPage
_ <- dispatcher $ SetRoute
$ UserPage
_ <- dispatcher $ UserPageA $ UP.NoOp
pure unit
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