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
5d69cae0
Commit
5d69cae0
authored
Mar 14, 2018
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[UI] more relastic POCK for meeting.
parent
926a5693
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
214 additions
and
165 deletions
+214
-165
AddCorpusview.purs
src/AddCorpusview.purs
+1
-1
Chart.purs
src/Chart.purs
+11
-7
DocView.purs
src/DocView.purs
+111
-86
Landing.purs
src/Landing.purs
+9
-5
Navigation.purs
src/Navigation.purs
+9
-2
SearchForm.purs
src/SearchForm.purs
+1
-1
UserPage.purs
src/UserPage.purs
+72
-63
No files found.
src/AddCorpusview.purs
View file @
5d69cae0
...
@@ -92,7 +92,7 @@ addcorpusviewSpec = simpleSpec performAction render
...
@@ -92,7 +92,7 @@ addcorpusviewSpec = simpleSpec performAction render
render :: Render State props Action
render :: Render State props Action
render dispatch _ state _ =
render dispatch _ state _ =
[
[
div [className "container"] [L.jumboTitle]
div [className "container"] [L.jumboTitle
false
]
, div [className "container"]
, div [className "container"]
[
[
div [className "jumbotron"]
div [className "jumbotron"]
...
...
src/Chart.purs
View file @
5d69cae0
...
@@ -373,16 +373,20 @@ yAxisIndex = unsafeMkProps "yAxisIndex"
...
@@ -373,16 +373,20 @@ yAxisIndex = unsafeMkProps "yAxisIndex"
-- , p''
-- , p''
-- ]
-- ]
ex1
:: ReactElement
histogram
:: ReactElement
ex1
= echarts
histogram
= echarts
[ option
[ option
[ tooltip [trigger "axis"]
[ tooltip [trigger "axis"]
, grid [containLabel true]
, grid [containLabel true]
, legend [data' ["Query A", "Query B", "Query C"]]
, legend [data' ["Map terms coverage", "Favorites", "All"]]
-- , legend [data' ["Map Terms coverage", "Favorites", "All"]]
, xAxis
, xAxis
[ type' "category"
[ type' "category"
, axisTick [alignWithLabel true]
, axisTick [alignWithLabel true]
, data' ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "July", "Aug", "Sep", "Oct", "Nov", "Dec"]
, data' ["Jan" , "Feb", "Mar" , "Apr"
, "May", "Jun", "July", "Aug"
, "Sep", "Oct", "Nov" , "Dec"
]
]
]
, dataZoom [dz1,dz1,dz2,dz2]
, dataZoom [dz1,dz1,dz2,dz2]
, yAxis [ya1, ya2]
, yAxis [ya1, ya2]
...
@@ -423,7 +427,7 @@ ya2 = unsafeFromPropsArray
...
@@ -423,7 +427,7 @@ ya2 = unsafeFromPropsArray
]
]
sd1 = unsafeFromPropsArray
sd1 = unsafeFromPropsArray
[ name "
Query A
"
[ name "
Map terms coverage
"
, type' "line"
, type' "line"
, label [normal[showp true, position "top"]]
, label [normal[showp true, position "top"]]
, lineStyle [ normal
, lineStyle [ normal
...
@@ -436,7 +440,7 @@ sd1 = unsafeFromPropsArray
...
@@ -436,7 +440,7 @@ sd1 = unsafeFromPropsArray
]
]
sd2 = unsafeFromPropsArray
sd2 = unsafeFromPropsArray
[ name "
Query B
"
[ name "
Favorites
"
, type' "bar"
, type' "bar"
, label [normal[showp true, position "top"]]
, label [normal[showp true, position "top"]]
, yAxisIndex 1
, yAxisIndex 1
...
@@ -444,7 +448,7 @@ sd2 = unsafeFromPropsArray
...
@@ -444,7 +448,7 @@ sd2 = unsafeFromPropsArray
]
]
sd3 = unsafeFromPropsArray
sd3 = unsafeFromPropsArray
[ name "
Query C
"
[ name "
All
"
, type' "bar"
, type' "bar"
, label [normal[showp true, position "top"]]
, label [normal[showp true, position "top"]]
, yAxisIndex 1
, yAxisIndex 1
...
...
src/DocView.purs
View file @
5d69cae0
...
@@ -2,7 +2,7 @@ module DocView where
...
@@ -2,7 +2,7 @@ module DocView where
import Data.Argonaut
import Data.Argonaut
import Chart (
ex1
, p'')
import Chart (
histogram
, p'')
import Control.Monad.Aff (Aff, attempt)
import Control.Monad.Aff (Aff, attempt)
import Control.Monad.Aff.Class (liftAff)
import Control.Monad.Aff.Class (liftAff)
import Control.Monad.Cont.Trans (lift)
import Control.Monad.Cont.Trans (lift)
...
@@ -26,8 +26,8 @@ import Partial.Unsafe (unsafePartial)
...
@@ -26,8 +26,8 @@ import Partial.Unsafe (unsafePartial)
import Prelude (class Eq, class Ord, class Show, Unit, bind, map, not, pure, show, void, ($), (*), (+), (-), (/), (<), (<$>), (<>), (==), (>), (>=), (>>=))
import Prelude (class Eq, class Ord, class Show, Unit, bind, map, not, pure, show, void, ($), (*), (+), (-), (/), (<), (<$>), (<>), (==), (>), (>=), (>>=))
import React (ReactElement)
import React (ReactElement)
import React as R
import React as R
import React.DOM (a, b, b', br', div, h3, i, input, li, option, select, span, table, tbody, td, text, thead, t
r, ul
)
import React.DOM (a, b, b', br', div, h3, i, input, li, option, select, span, table, tbody, td, text, thead, t
h, tr, ul, nav
)
import React.DOM.Props (Props, _type, className, href, onChange, onClick, selected, value)
import React.DOM.Props (Props, _type, className, href, onChange, onClick, selected, value
, scope, _id, role, _data, aria
)
import ReactDOM as RDOM
import ReactDOM as RDOM
import Thermite (PerformAction, Render, Spec, cotransform, createReactSpec, modifyState, simpleSpec)
import Thermite (PerformAction, Render, Spec, cotransform, createReactSpec, modifyState, simpleSpec)
import Unsafe.Coerce (unsafeCoerce)
import Unsafe.Coerce (unsafeCoerce)
...
@@ -64,7 +64,7 @@ newtype Response = Response
...
@@ -64,7 +64,7 @@ newtype Response = Response
newtype Hyperdata = Hyperdata
newtype Hyperdata = Hyperdata
{
{
title :: String
title :: String
,
abstract
:: String
,
source
:: String
}
}
type State = CorpusTableData
type State = CorpusTableData
...
@@ -77,21 +77,21 @@ data Action
...
@@ -77,21 +77,21 @@ data Action
instance decodeHyperdata :: DecodeJson Hyperdata where
instance decodeHyperdata :: DecodeJson Hyperdata where
decodeJson json = do
decodeJson json = do
obj <- decodeJson json
obj
<- decodeJson json
title <- obj .? "title"
title
<- obj .? "title"
abstract <- obj .? "abstract
"
source <- obj .? "source
"
pure $ Hyperdata { title,
abstract
}
pure $ Hyperdata { title,
source
}
instance decodeResponse :: DecodeJson Response where
instance decodeResponse :: DecodeJson Response where
decodeJson json = do
decodeJson json = do
obj <- decodeJson json
obj
<- decodeJson json
cid <- obj .? "id"
cid
<- obj .? "id"
created <- obj .? "created"
created
<- obj .? "created"
favorite <- obj .? "favorite"
favorite
<- obj .? "favorite"
ngramCount <- obj .? "ngramCount"
ngramCount <- obj .? "ngramCount"
hyperdata <- obj .? "hyperdata"
hyperdata
<- obj .? "hyperdata"
pure $ Response { cid, created, favorite, ngramCount, hyperdata }
pure $ Response { cid, created, favorite, ngramCount, hyperdata }
...
@@ -119,49 +119,56 @@ spec = simpleSpec performAction render
...
@@ -119,49 +119,56 @@ spec = simpleSpec performAction render
render :: Render State _ Action
render :: Render State _ Action
render dispatch _ state@(TableData d) _ =
render dispatch _ state@(TableData d) _ =
[ div [className "container"]
[ div [className "container"]
[
[ div [className "row"]
div [className "jumbotron"]
[ div [className "col-md-3"]
[
[ br' []
div [className "row"]
, br' []
[ div [className "col-md-3"]
, div [className "tree"] [toHtml dispatch d.tree]
[ br' []
]
, br' []
, div [className "col-md-9"]
, div [className "tree"] [toHtml dispatch d.tree]
[ nav []
]
[ div [className "nav nav-tabs", _id "nav-tab",role "tablist"]
, div [className "col-md-9"]
[
[
a [ className "nav-item nav-link active"
br' []
, _id "nav-home-tab"
, br' []
, _data {toggle : "tab"}
, p''
, href "#nav-home"
, h3 [] [text "Chart Title"]
, role "tab"
, ex1
, aria {controls : "nav-home"}
, p''
, aria {selected:true}] [ text "Documents"]
, a [className "nav-item nav-link",_id "nav-profile-tab", _data {toggle : "tab"},href "#nav-profile",role "tab",aria {controls : "nav-profile"},aria {selected:true}] [ text "Sources"]
, div [] [b [] [text d.title]]
, div [] [ text "Search "
,a [className "nav-item nav-link",_id "nav-contact-tab", _data {toggle : "tab"},href "#nav-contact",role "tab",aria {controls : "nav-contact"},aria {selected:true}] [ text "Authors"]
, input [] []
,a [className "nav-item nav-link",_id "nav-contact-tab", _data {toggle : "tab"},href "#nav-contact",role "tab",aria {controls : "nav-contact"},aria {selected:true}] [ text "Terms"]
]
,a [className "nav-item nav-link",_id "nav-contact-tab", _data {toggle : "tab"},href "#nav-contact",role "tab",aria {controls : "nav-contact"},aria {selected:true}] [ text "(+)"]
, sizeDD d.pageSize dispatch
, br' []
, br' []
, textDescription d.currentPage d.pageSize d.totalRecords
, br' []
, br' []
, pagination dispatch d.totalPages d.currentPage
, br' []
, br' []
, table []
[thead [] [tr []
[ td [] [ b' [text "Date"]]
, td [] [ b' [text "Title"]]
, td [] [ b' [text "Source"]]
, td [] [ b' [text "Fav"]]
, td [] [ b' [text "Delete"]]
]]
, tbody [] $ map showRow d.rows
]
]
]
]
, br' []
, p''
, h3 [] [text "Chart Title"]
, histogram
, p''
, br' []
, div [] [ b [] [text d.title]
, text " Filter "
, input [] []
, sizeDD d.pageSize dispatch
, textDescription d.currentPage d.pageSize d.totalRecords
, pagination dispatch d.totalPages d.currentPage
]
, table [ className "table"]
[thead [ className "thead-dark"]
[tr [] [ th [scope "col"] [ b' [text "Date"] ]
, th [scope "col"] [ b' [text "Title"] ]
, th [scope "col"] [ b' [text "Source"] ]
, th [scope "col"] [ b' [text "Favorite"]]
, th [scope "col"] [ b' [text "Delete"] ]
]
]
, tbody [] $ map showRow d.rows
]
]
]
]
]
]
]
...
@@ -171,19 +178,13 @@ spec = simpleSpec performAction render
...
@@ -171,19 +178,13 @@ spec = simpleSpec performAction render
------------------------------------------------------------------------
------------------------------------------------------------------------
-- Realistic Tree for the UI
-- Realistic Tree for the UI
urlFacetDoc :: String
urlFacetDoc = "http://localhost:8009/index.html#/docView"
myCorpus :: Int -> String -> NTree (Tuple String String)
myCorpus :: Int -> String -> NTree (Tuple String String)
myCorpus n name = NNode n false name
myCorpus n name = NNode n false name
[ NLeaf (Tuple "Facets"
urlFacetDoc
)
[ NLeaf (Tuple "Facets"
"#/docView"
)
, NLeaf (Tuple "Graph"
urlFacetDoc
)
, NLeaf (Tuple "Graph"
"#/docView"
)
, NLeaf (Tuple "Dashboard"
urlFacetDoc
)
, NLeaf (Tuple "Dashboard"
"#/userPage"
)
]
]
urlFacetAuth :: String
urlFacetAuth = urlFacetDoc
exampleTree :: NTree (Tuple String String)
exampleTree :: NTree (Tuple String String)
exampleTree =
exampleTree =
NNode 1 true "My gargantext"
NNode 1 true "My gargantext"
...
@@ -199,22 +200,26 @@ exampleTree =
...
@@ -199,22 +200,26 @@ exampleTree =
------------------------------------------------------------------------
------------------------------------------------------------------------
-- TODO
-- TODO
-- alignment to the right
-- alignment to the right
nodeOptionsCorp = [ i [className "fab fa-whmcs" ] []]
nodeOptionsCorp activated = case activated of
true -> [ i [className "fab fa-whmcs" ] []]
false -> []
-- TODO
-- TODO
-- alignment to the right
-- alignment to the right
-- on hover make other options available:
-- on hover make other options available:
nodeOptionsView = [ i [className "fas fa-sync-alt" ] []
nodeOptionsView activated = case activated of
, i [className "fas fa-upload" ] []
true -> [ i [className "fas fa-sync-alt" ] []
, i [className "fas fa-share-alt"] []
, i [className "fas fa-upload" ] []
]
, i [className "fas fa-share-alt"] []
]
false -> []
toHtml :: _ -> FTree -> ReactElement
toHtml :: _ -> FTree -> ReactElement
toHtml d (NLeaf (Tuple name link)) =
toHtml d (NLeaf (Tuple name link)) =
li []
li []
[ a [ href link]
[ a [ href link]
( [ text (name <> " ")
( [ text (name <> " ")
] <> nodeOptionsView
] <> nodeOptionsView
false
)
)
]
]
toHtml d (NNode id open name ary) =
toHtml d (NNode id open name ary) =
...
@@ -222,7 +227,7 @@ toHtml d (NNode id open name ary) =
...
@@ -222,7 +227,7 @@ toHtml d (NNode id open name ary) =
[ li [] $
[ li [] $
( [ a [onClick $ (\e-> d $ ToggleFolder id)] [i [fldr open] []]
( [ a [onClick $ (\e-> d $ ToggleFolder id)] [i [fldr open] []]
, text $ " " <> name <> " "
, text $ " " <> name <> " "
] <> nodeOptionsCorp <>
] <> nodeOptionsCorp
false
<>
if open then
if open then
map (toHtml d) ary
map (toHtml d) ary
else []
else []
...
@@ -246,11 +251,11 @@ performAction LoadData _ _ = void do
...
@@ -246,11 +251,11 @@ performAction LoadData _ _ = void do
where
where
res2corpus (Response res) =
res2corpus (Response res) =
Corpus { _id : res.cid
Corpus { _id : res.cid
, url : ""
, url
: ""
, date : res.created
, date
: res.created
, title : (\(Hyperdata r) -> r.title) res.hyperdata
, title
: (\(Hyperdata r) -> r.title) res.hyperdata
, source :
(\(Hyperdata r) -> r.abstract
)res.hyperdata
, source :
(\(Hyperdata r) -> r.source
)res.hyperdata
, fav : res.favorite
, fav
: res.favorite
}
}
...
@@ -258,7 +263,11 @@ performAction (ToggleFolder i) _ _ = void (cotransform (\(TableData td) -> Table
...
@@ -258,7 +263,11 @@ performAction (ToggleFolder i) _ _ = void (cotransform (\(TableData td) -> Table
changePageSize :: PageSizes -> CorpusTableData -> CorpusTableData
changePageSize :: PageSizes -> CorpusTableData -> CorpusTableData
changePageSize ps (TableData td) = TableData $ td { pageSize = ps, totalPages = td.totalRecords / pageSizes2Int ps, currentPage = 1}
changePageSize ps (TableData td) =
TableData $ td { pageSize = ps
, totalPages = td.totalRecords / pageSizes2Int ps
, currentPage = 1
}
data PageSizes = PS10 | PS20 | PS50 | PS100
data PageSizes = PS10 | PS20 | PS50 | PS100
...
@@ -332,7 +341,9 @@ pagination d tp cp
...
@@ -332,7 +341,9 @@ pagination d tp cp
else
else
span []
span []
[ text " "
[ text " "
, a [href "javascript:void()", onClick (\e -> d $ ChangePage $ cp - 1)] [text "Previous"]
, a [ href "javascript:void()"
, onClick (\e -> d $ ChangePage $ cp - 1)
] [text "Previous"]
, text " "
, text " "
]
]
next = if cp == tp then
next = if cp == tp then
...
@@ -340,7 +351,9 @@ pagination d tp cp
...
@@ -340,7 +351,9 @@ pagination d tp cp
else
else
span []
span []
[ text " "
[ text " "
, a [href "javascript:void()", onClick (\e -> d $ ChangePage $ cp + 1)] [text "Next"]
, a [ href "javascript:void()"
, onClick (\e -> d $ ChangePage $ cp + 1)
] [text "Next"]
, text " "
, text " "
]
]
first = if cp == 1 then
first = if cp == 1 then
...
@@ -348,7 +361,9 @@ pagination d tp cp
...
@@ -348,7 +361,9 @@ pagination d tp cp
else
else
span []
span []
[ text " "
[ text " "
, a [href "javascript:void()", onClick (\e -> d $ ChangePage 1)] [text "1"]
, a [ href "javascript:void()"
, onClick (\e -> d $ ChangePage 1)
] [text "1"]
, text " "
, text " "
]
]
last = if cp == tp then
last = if cp == tp then
...
@@ -356,7 +371,9 @@ pagination d tp cp
...
@@ -356,7 +371,9 @@ pagination d tp cp
else
else
span []
span []
[ text " "
[ text " "
, a [href "javascript:void()", onClick (\e -> d $ ChangePage tp)] [text $ show tp]
, a [ href "javascript:void()"
, onClick (\e -> d $ ChangePage tp)
] [text $ show tp]
, text " "
, text " "
]
]
ldots = if cp >= 5 then
ldots = if cp >= 5 then
...
@@ -374,7 +391,9 @@ fnmid :: _ -> Int -> ReactElement
...
@@ -374,7 +391,9 @@ fnmid :: _ -> Int -> ReactElement
fnmid d i
fnmid d i
= span []
= span []
[ text " "
[ text " "
, a [href "javascript:void()", onClick (\e -> d $ ChangePage i)] [text $ show i]
, a [ href "javascript:void()"
, onClick (\e -> d $ ChangePage i)
] [text $ show i]
, text " "
, text " "
]
]
...
@@ -427,7 +446,7 @@ tdata = TableData
...
@@ -427,7 +446,7 @@ tdata = TableData
, currentPage : 1
, currentPage : 1
, pageSize : PS10
, pageSize : PS10
, totalRecords : 100
, totalRecords : 100
, title : "
Publications by title
"
, title : "
Documents
"
, tree : exampleTree
, tree : exampleTree
}
}
...
@@ -438,7 +457,7 @@ tdata' d = TableData
...
@@ -438,7 +457,7 @@ tdata' d = TableData
, currentPage : 1
, currentPage : 1
, pageSize : PS10
, pageSize : PS10
, totalRecords : 100
, totalRecords : 100
, title : "
Publications by title
"
, title : "
Documents
"
, tree : exampleTree
, tree : exampleTree
}
}
...
@@ -449,10 +468,13 @@ showRow {row : (Corpus c), delete} =
...
@@ -449,10 +468,13 @@ showRow {row : (Corpus c), delete} =
[ td [] [text c.date]
[ td [] [text c.date]
, td [] [text c.title]
, td [] [text c.title]
, td [] [text c.source]
, td [] [text c.source]
, td [] [
text $ show c.fav
]
, td [] [
div [className $ fa <> "fa-star"][]
]
, td [] [
input [ _type "checkbox"] []]
, td [] [input [ _type "checkbox"] []]
]
]
where
fa = case c.fav of
true -> "fas "
false -> "far "
...
@@ -477,3 +499,6 @@ loadData = do
...
@@ -477,3 +499,6 @@ loadData = do
--liftEff $ log $ "GET /api response: " <> show a.response
--liftEff $ log $ "GET /api response: " <> show a.response
let res = decodeJson a.response
let res = decodeJson a.response
pure res
pure res
src/Landing.purs
View file @
5d69cae0
...
@@ -50,12 +50,12 @@ performAction Login _ _ = void do
...
@@ -50,12 +50,12 @@ performAction Login _ _ = void do
performAction SignUp _ _ = void do
performAction SignUp _ _ = void do
T.modifyState \state -> state
T.modifyState \state -> state
jumboTitle :: ReactElement
jumboTitle ::
Boolean ->
ReactElement
jumboTitle
= div [className "jumbotron" ]
jumboTitle
b = div jumbo
[ div [className "row" ]
[ div [className "row" ]
[ div [className "col-md-8 content"]
[ div [className "col-md-8 content"]
[ h1 [] [ text "Gargantext"]
[ h1 [] [ text "Gargantext"]
, p [] [ text "
Collaborative knowledge mapping experienc
e" ]
, p [] [ text "
search map shar
e" ]
, p [] [ a [ className "btn btn-success btn-lg spacing-class"
, p [] [ a [ className "btn btn-success btn-lg spacing-class"
, href "https://iscpif.fr/gargantext/your-first-map/"
, href "https://iscpif.fr/gargantext/your-first-map/"
, target "blank"
, target "blank"
...
@@ -64,7 +64,7 @@ jumboTitle = div [className "jumbotron" ]
...
@@ -64,7 +64,7 @@ jumboTitle = div [className "jumbotron" ]
[ span [ aria {hidden : true}
[ span [ aria {hidden : true}
, className "glyphicon glyphicon-hand-right"
, className "glyphicon glyphicon-hand-right"
] []
] []
, text "
Get's started
"
, text "
Documentation
"
]
]
]
]
]
]
...
@@ -78,6 +78,10 @@ jumboTitle = div [className "jumbotron" ]
...
@@ -78,6 +78,10 @@ jumboTitle = div [className "jumbotron" ]
]
]
]
]
]
]
where
jumbo = case b of
true -> [className "jumbotron" ]
false -> []
imageEnter :: Props -> ReactElement
imageEnter :: Props -> ReactElement
...
@@ -98,7 +102,7 @@ home = simpleSpec performAction render
...
@@ -98,7 +102,7 @@ home = simpleSpec performAction render
where
where
render :: Render State props Action
render :: Render State props Action
render dispatch _ state _ =
render dispatch _ state _ =
[ div [ className "container" ] [ jumboTitle
]
[ div [ className "container" ] [ jumboTitle
true
]
, div [ className "container" ] [ imageEnter (onClick \_ -> dispatch $ Enter)]
, div [ className "container" ] [ imageEnter (onClick \_ -> dispatch $ Enter)]
, div [ className "container" ] [ blocksRandomText ]
, div [ className "container" ] [ blocksRandomText ]
, div [ className "container" ] [ hr [] [], footerLegalInfo ]
, div [ className "container" ] [ hr [] [], footerLegalInfo ]
...
...
src/Navigation.purs
View file @
5d69cae0
...
@@ -14,8 +14,8 @@ import Network.HTTP.Affjax (AJAX)
...
@@ -14,8 +14,8 @@ import Network.HTTP.Affjax (AJAX)
import PageRouter (Routes(..))
import PageRouter (Routes(..))
import Prelude (class Applicative, class Bind, Unit, bind, id, map, negate, pure, unit, void, ($), (<>))
import Prelude (class Applicative, class Bind, Unit, bind, id, map, negate, pure, unit, void, ($), (<>))
import React (ReactElement)
import React (ReactElement)
import React.DOM (a, div, img, li, span, text, ul)
import React.DOM (a, div, img, li, span, text, ul
, input
)
import React.DOM.Props (_data, _id, aria, className, href, role, src, style, tabIndex, target, title)
import React.DOM.Props (_data, _id, aria, className, href,
name, placeholder, _type,
role, src, style, tabIndex, target, title)
import Thermite (PerformAction, Render, Spec, _render, defaultRender, focus, modifyState, simpleSpec, withState)
import Thermite (PerformAction, Render, Spec, _render, defaultRender, focus, modifyState, simpleSpec, withState)
import DocView as DV
import DocView as DV
import SearchForm as S
import SearchForm as S
...
@@ -280,6 +280,13 @@ sidebarnavSpec = simpleSpec performAction render
...
@@ -280,6 +280,13 @@ sidebarnavSpec = simpleSpec performAction render
]
]
]
]
---------------------------------------------------------------------------
---------------------------------------------------------------------------
-- TODO put the search form in the center of the navBar
-- , ul [ className "nav navbar-nav"]
-- [ input [ className "form-control"
-- , placeholder "Query, URL or FILE (optimized experience with Firefox or Chromium browsers)"
-- , _type "text"
-- ] []
-- ]
, divDropdownRight
, divDropdownRight
]
]
]
]
...
...
src/SearchForm.purs
View file @
5d69cae0
...
@@ -56,7 +56,7 @@ searchSpec = simpleSpec performAction render
...
@@ -56,7 +56,7 @@ searchSpec = simpleSpec performAction render
where
where
render :: Render State props Action
render :: Render State props Action
render dispatch _ state _ =
render dispatch _ state _ =
[ div [className "container"] [L.jumboTitle]
[ div [className "container"] [L.jumboTitle
false
]
, div [className "container"]
, div [className "container"]
[ div [className "jumbotron" ]
[ div [className "jumbotron" ]
[ div [className "row" ]
[ div [className "row" ]
...
...
src/UserPage.purs
View file @
5d69cae0
...
@@ -8,6 +8,7 @@ import React.DOM (a, div, h3, h5, h6, img, li, nav, small, span, table, tbody, t
...
@@ -8,6 +8,7 @@ import React.DOM (a, div, h3, h5, h6, img, li, nav, small, span, table, tbody, t
import React.DOM.Props (_data, _id, aria, className, href, role, scope, src)
import React.DOM.Props (_data, _id, aria, className, href, role, scope, src)
import Thermite (PerformAction, Render, Spec, modifyState, simpleSpec)
import Thermite (PerformAction, Render, Spec, modifyState, simpleSpec)
import DocView as DV
type State = String
type State = String
...
@@ -31,10 +32,11 @@ userPageSpec = simpleSpec performAction render
...
@@ -31,10 +32,11 @@ userPageSpec = simpleSpec performAction render
where
where
render :: Render State props Action
render :: Render State props Action
render dispatch _ state _ =
render dispatch _ state _ =
[ div [className "container-fluid"]
[ -- TODO: div [className "tree"] [DV.toHtml dispatch d.tree]
div [className "container-fluid"]
[ div [className "row", _id "user-page-header"]
[ div [className "row", _id "user-page-header"]
[ div [className "col-md-2"]
[ div [className "col-md-2"]
[ h3 [] [text "UserName"]
[ h3 [] [text "User
Name"]
]
]
, div [className "col-md-8"] []
, div [className "col-md-8"] []
, div [className "col-md-2"]
, div [className "col-md-2"]
...
@@ -54,26 +56,21 @@ userPageSpec = simpleSpec performAction render
...
@@ -54,26 +56,21 @@ userPageSpec = simpleSpec performAction render
ul [className "list-group"]
ul [className "list-group"]
[
[
li [className "list-group-item justify-content-between"]
li [className "list-group-item justify-content-between"]
[ span [] [text "
f
onction"]
[ span [] [text "
F
onction"]
, span [className "badge badge-default badge-pill"] [text "Ens
ignent che
cheur"]
, span [className "badge badge-default badge-pill"] [text "Ens
eignant cher
cheur"]
]
]
, li [className "list-group-item justify-content-between"]
, li [className "list-group-item justify-content-between"]
[ span [] [text "Entit
te
, service"]
[ span [] [text "Entit
é
, service"]
, span [className "badge badge-default badge-pill"] [text "Mines Saint
- Etine
ne SPIN -PTSI"]
, span [className "badge badge-default badge-pill"] [text "Mines Saint
-Etien
ne SPIN -PTSI"]
]
]
, li [className "list-group-item justify-content-between"]
, li [className "list-group-item justify-content-between"]
[ span [] [text "T
ele
phone"]
[ span [] [text "T
élé
phone"]
, span [className "badge badge-default badge-pill"] [text "04 77 42 0070"]
, span [className "badge badge-default badge-pill"] [text "
(+33)
04 77 42 0070"]
]
]
, li [className "list-group-item justify-content-between"]
, li [className "list-group-item justify-content-between"]
[ span [] [text "Telephone"]
[ span [] [text "Courriel"]
, span [className "badge badge-default badge-pill"] [text "04 77 42 0070"]
, span [className "badge badge-default badge-pill"] [text "gargantua@rabelais.fr"]
]
, li [className "list-group-item justify-content-between"]
[ span [] [text "courriel"]
, span [className "badge badge-default badge-pill"] [text "veronica@mines-stsi.fr"]
]
]
, li [className "list-group-item justify-content-between"]
, li [className "list-group-item justify-content-between"]
[ span [] [text "Bureau"]
[ span [] [text "Bureau"]
...
@@ -81,11 +78,11 @@ userPageSpec = simpleSpec performAction render
...
@@ -81,11 +78,11 @@ userPageSpec = simpleSpec performAction render
]
]
, li [className "list-group-item justify-content-between"]
, li [className "list-group-item justify-content-between"]
[ span [] [text "Apellation"]
[ span [] [text "Apellation"]
, span [className "badge badge-default badge-pill"] [text "Ma
itre de reherche
(EPA)"]
, span [className "badge badge-default badge-pill"] [text "Ma
ître de conférences
(EPA)"]
]
]
, li [className "list-group-item justify-content-between"]
, li [className "list-group-item justify-content-between"]
[ span [] [text "Lieu"]
[ span [] [text "Lieu"]
, span [className "badge badge-default badge-pill"] [text "Saint
-Etienne, 158 Cours Fauriel"]
, span [className "badge badge-default badge-pill"] [text "Saint-Etienne, 158 Cours Fauriel"]
]
]
]
]
...
@@ -95,62 +92,74 @@ userPageSpec = simpleSpec performAction render
...
@@ -95,62 +92,74 @@ userPageSpec = simpleSpec performAction render
]
]
, div [className "row",_id "user-page-footer"]
, div [className "row",_id "user-page-footer"]
[ div [className "col-md-12"]
[ div [className "col-md-12"]
[ nav []
facets
[ div [className "nav nav-tabs", _id "nav-tab",role "tablist"]
]
[
]
a [className "nav-item nav-link active",_id "nav-home-tab", _data {toggle : "tab"},href "#nav-home",role "tab",aria {controls : "nav-home"},aria {selected:true}] [ text "Publications (12)"]
]
, a [className "nav-item nav-link",_id "nav-profile-tab", _data {toggle : "tab"},href "#nav-profile",role "tab",aria {controls : "nav-profile"},aria {selected:true}] [ text "Brevets (2)"]
,a [className "nav-item nav-link",_id "nav-contact-tab", _data {toggle : "tab"},href "#nav-contact",role "tab",aria {controls : "nav-contact"},aria {selected:true}] [ text "Projets IMT (5)"]
facets = [ nav []
[ div [className "nav nav-tabs", _id "nav-tab",role "tablist"]
[ a [className "nav-item nav-link active",_id "nav-home-tab" , _data {toggle : "tab"},href "#nav-home" ,role "tab",aria {controls : "nav-home"} ,aria {selected:true}] [ text "Publications (12)"]
, a [className "nav-item nav-link" ,_id "nav-profile-tab", _data {toggle : "tab"},href "#nav-profile",role "tab",aria {controls : "nav-profile"},aria {selected:true}] [ text "Brevets (2)"]
, a [className "nav-item nav-link" ,_id "nav-contact-tab", _data {toggle : "tab"},href "#nav-contact",role "tab",aria {controls : "nav-contact"},aria {selected:true}] [ text "Projets (5)"]
, a [className "nav-item nav-link" ,_id "nav-contact-tab", _data {toggle : "tab"},href "#nav-contact",role "tab",aria {controls : "nav-contact"},aria {selected:true}] [ text "All (19)"]
]
]
]
]
, div [className "tab-content" , _id "nav-tabContent"]
, div [className "tab-content" , _id "nav-tabContent"]
[
[
div [className "tab-pane fade show active", role "tabpanel", aria {labelledby : "nav-home-tab"}, _id "nav-home"]
div [ className "tab-pane fade show active"
[
, role "tabpanel"
table [ className "table"]
, aria {labelledby : "nav-home-tab"}
, _id "nav-home"
]
[ facetExample ]
, div [ className "tab-pane fade show"
, role "tabpanel"
, aria {labelledby : "nav-profile-tab"}
, _id "nav-profile"
]
[ ]
, div [ className "tab-pane fade show"
, role "tabpanel"
, aria {labelledby : "nav-contact-tab"}
, _id "nav-contact"
]
[ ]
]
]
facetExample = table [ className "table"]
[ thead [ className "thead-dark"]
[ thead [ className "thead-dark"]
[ tr []
[ tr []
[
[ th [ scope "col"] [ text "Date" ]
th [ scope "col"]
, th [ scope "col"] [ text "Description" ]
[ text "Date"
, th [ scope "col"] [ text "Projects" ]
]
, th [ scope "col"] [ text "Favorite" ]
, th [scope "col"]
, th [ scope "col"] [ text "Delete" ]
[ text "Description"
]
, th [ scope "col"]
[ text "Projects"]
, th [ scope "col"]
[ text " Favorite"]
, th [scope "col"]
[text "Delete"]
]
]
]
]
, tbody []
, tbody []
[ tr []
[ tr [] [ td [] [ text "2012/03/06"]
[ td [] [ text "2012/03/06"]
, td [] [ text "Big data and text mining"]
, td [] [ text "use of acoustic mission"]
, td [] [ text "European funds"]
, td [] [ text "use of acoustic emission"]
, td [] [ text "True"]
, td [] [ text "use of acoustic emission"]
, td [] [ text "False"]
, td [] [ text "use of acoustic emission"]
]
]
, tr [] [ td [] [ text "2013/03/06"]
, td [] [ text "Cryptography"]
, td [] [ text "French funds"]
, td [] [ text "True"]
, td [] [ text "False"]
]
, tr [] [ td [] [ text "2013/03/06"]
, td [] [ text "Artificial Intelligence"]
, td [] [ text "Not found"]
, td [] [ text "True"]
, td [] [ text "False"]
]
]
]
]
]
]
, div [className "tab-pane fade show", role "tabpanel", aria {labelledby : "nav-profile-tab"}, _id "nav-profile"]
[
h3 [] [text "hello1"]
]
, div [className "tab-pane fade show", role "tabpanel", aria {labelledby : "nav-contact-tab"}, _id "nav-contact"]
[
h3 [] [text "hello2"]
]
]
]
]
]
]
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