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
Show 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
...
@@ -145,27 +145,28 @@ layoutDocview = simpleSpec performAction render
[ p [] []
[ p [] []
, div [] [ text " Filter ", input []]
, div [] [ text " Filter ", input []]
, br'
, br'
, div [className "row"]
, showTable d dispatch
[ div [className "col-md-1"] [b [] [text d.title]]
[ ""
, div [className "col-md-2"] [sizeDD d.pageSize dispatch]
, "Date"
, div [className "col-md-3"] [textDescription d.currentPage d.pageSize d.totalRecords]
, "Title"
, div [className "col-md-3"] [pagination dispatch d.totalPages d.currentPage]
, "Source"
]
, "Delete"
, 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
]
]
((\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
performAction :: PerformAction State {} Action
...
@@ -260,21 +261,21 @@ initialState = TableData
...
@@ -260,21 +261,21 @@ initialState = TableData
}
}
showRow :: {row :: DocumentsView, delete :: Boolean} -> ReactElement
showTable {title, pageSize, currentPage, totalRecords, totalPages} dispatch colNames rows =
showRow {row : (DocumentsView c), delete} =
div []
tr []
[ div [className "row"]
[ td [] [div [className $ fa <> "fa-star"][]]
[ div [className "col-md-1"] [b [] [text title]]
-- TODO show date: Year-Month-Day only
, div [className "col-md-2"] [sizeDD pageSize dispatch]
, td [] [text c.date]
, div [className "col-md-3"] [textDescription currentPage pageSize totalRecords]
, td [] [ a [ href (toUrl Front Url_Document c._id) ] [ text c.title ] ]
, div [className "col-md-3"] [pagination dispatch totalPages currentPage]
, td [] [text c.source]
]
, td [] [input [ _type "checkbox"]]
, table [ className "table"]
[thead [ className "thead-dark"]
[tr [] ((\colName -> th [scope "col"] [ b' [text colName]]) <$> colNames)
]
, tbody [] $ map (tr [] <<< map (\c -> td [] [c])) rows
]
]
]
where
fa = case c.fav of
true -> "fas "
false -> "far "
--------------------------------------------------------------
--------------------------------------------------------------
...
...
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