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
37939c75
Unverified
Commit
37939c75
authored
Oct 11, 2018
by
Nicolas Pouillard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[TABLE] step 1
parent
aa0c76ea
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
32 deletions
+33
-32
Documents.purs
src/Gargantext/Pages/Corpus/Tabs/Documents.purs
+33
-32
No files found.
src/Gargantext/Pages/Corpus/Tabs/Documents.purs
View file @
37939c75
...
...
@@ -145,27 +145,28 @@ layoutDocview = simpleSpec performAction render
[ p [] []
, div [] [ text " Filter ", input []]
, br'
, div [className "row"]
[ div [className "col-md-1"] [b [] [text d.title]]
, div [className "col-md-2"] [sizeDD d.pageSize dispatch]
, div [className "col-md-3"] [textDescription d.currentPage d.pageSize d.totalRecords]
, div [className "col-md-3"] [pagination dispatch d.totalPages d.currentPage]
]
, table [ className "table"]
[thead [ className "thead-dark"]
[tr [] [ th [scope "col"] [ b' [text ""] ]
, th [scope "col"] [ b' [text "Date"]]
, th [scope "col"] [ b' [text "Title"] ]
, th [scope "col"] [ b' [text "Source"] ]
, th [scope "col"] [ b' [text "Delete"] ]
]
]
, tbody [] $ map showRow d.rows
]
, showTable d dispatch
[ ""
, "Date"
, "Title"
, "Source"
, "Delete"
]
((\c ->
let DocumentsView r = c.row in
[ div [className $ fa r.fav <> "fa-star"] []
-- TODO show date: Year-Month-Day only
, text r.date
, a [ href (toUrl Front Url_Document r._id) ] [ text r.title ]
, text r.source
, input [ _type "checkbox"]
]) <$> d.rows)
]
]
]
]
fa true = "fas "
fa false = "far "
performAction :: PerformAction State {} Action
...
...
@@ -260,21 +261,21 @@ initialState = TableData
}
show
Row :: {row :: DocumentsView, delete :: Boolean} -> ReactElement
showRow {row : (DocumentsView c), delete} =
tr [
]
[ td [] [div [className $ fa <> "fa-star"][
]]
-- TODO show date: Year-Month-Day only
, td [] [text c.date
]
, td [] [ a [ href (toUrl Front Url_Document c._id) ] [ text c.title ]
]
, td [] [text c.source
]
, td [] [input [ _type "checkbox"]
]
]
where
fa = case c.fav of
true -> "fas "
false -> "far "
show
Table {title, pageSize, currentPage, totalRecords, totalPages} dispatch colNames rows =
div []
[ div [className "row"
]
[ div [className "col-md-1"] [b [] [text title
]]
, div [className "col-md-2"] [sizeDD pageSize dispatch]
, div [className "col-md-3"] [textDescription currentPage pageSize totalRecords
]
, div [className "col-md-3"] [pagination dispatch totalPages currentPage
]
]
, table [ className "table"
]
[thead [ className "thead-dark"
]
[tr [] ((\colName -> th [scope "col"] [ b' [text colName]]) <$> colNames)
]
, tbody [] $ map (tr [] <<< map (\c -> td [] [c])) rows
]
]
--------------------------------------------------------------
...
...
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