Commit 00cab447 authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski

[docsTable] styling for selected document to highlight it

parent 0519117f
...@@ -22,10 +22,16 @@ ...@@ -22,10 +22,16 @@
top: 50%; top: 50%;
} }
.table .column-tag { .table tr td .active {
font-weight: bold;
}
.table tr td .trash {
text-decoration: line-through;
}
.table tr td .column-tag {
align-items: center; align-items: center;
} }
.table .column-tag .doc-chooser { .table tr td .column-tag .doc-chooser {
cursor: pointer; cursor: pointer;
padding: 10px; padding: 10px;
} }
......
...@@ -19,11 +19,17 @@ ...@@ -19,11 +19,17 @@
top: 50% top: 50%
.table .table
.column-tag tr
align-items: center td
.doc-chooser .active
cursor: pointer font-weight: bold
padding: 10px .trash
text-decoration: line-through
.column-tag
align-items: center
.doc-chooser
cursor: pointer
padding: 10px
.context-menu .context-menu
position: fixed position: fixed
...@@ -347,7 +347,7 @@ pagePaintRawCpt = R.hooksComponentWithModule thisModule "pagePaintRawCpt" cpt wh ...@@ -347,7 +347,7 @@ pagePaintRawCpt = R.hooksComponentWithModule thisModule "pagePaintRawCpt" cpt wh
, mCorpusId , mCorpusId
, nodeId , nodeId
, session , session
, sidePanelTriggers , sidePanelTriggers: sidePanelTriggers@{ currentDocIdRef }
, totalRecords } , totalRecords }
, localCategories , localCategories
, params } _ = do , params } _ = do
...@@ -366,8 +366,9 @@ pagePaintRawCpt = R.hooksComponentWithModule thisModule "pagePaintRawCpt" cpt wh ...@@ -366,8 +366,9 @@ pagePaintRawCpt = R.hooksComponentWithModule thisModule "pagePaintRawCpt" cpt wh
sid = sessionId session sid = sessionId session
gi Favorite = "glyphicon glyphicon-star" gi Favorite = "glyphicon glyphicon-star"
gi _ = "glyphicon glyphicon-star-empty" gi _ = "glyphicon glyphicon-star-empty"
trashStyle Trash = {textDecoration: "line-through"} trashClassName Trash _ = "trasn"
trashStyle _ = {textDecoration: "none"} trashClassName _ true = "active"
trashClassName _ false = ""
corpusDocument corpusDocument
| Just cid <- mCorpusId = Routes.CorpusDocument sid cid listId | Just cid <- mCorpusId = Routes.CorpusDocument sid cid listId
| otherwise = Routes.Document sid listId | otherwise = Routes.Document sid listId
...@@ -381,27 +382,29 @@ pagePaintRawCpt = R.hooksComponentWithModule thisModule "pagePaintRawCpt" cpt wh ...@@ -381,27 +382,29 @@ pagePaintRawCpt = R.hooksComponentWithModule thisModule "pagePaintRawCpt" cpt wh
T.makeRow [ -- H.div {} [ H.a { className, style, on: {click: click Favorite} } [] ] T.makeRow [ -- H.div {} [ H.a { className, style, on: {click: click Favorite} } [] ]
H.div { className: "column-tag flex" } [ H.div { className: "column-tag flex" } [
caroussel { category: cat, nodeId, row: dv, session, setLocalCategories } [] caroussel { category: cat, nodeId, row: dv, session, setLocalCategories } []
, docChooser { listId, mCorpusId, nodeId: r._id, sidePanelTriggers, tableReload: reload } [] , docChooser { listId, mCorpusId, nodeId: r._id, selected, sidePanelTriggers, tableReload: reload } []
] ]
--, H.input { type: "checkbox", defaultValue: checked, on: {click: click Trash} } --, H.input { type: "checkbox", defaultValue: checked, on: {click: click Trash} }
-- TODO show date: Year-Month-Day only -- TODO show date: Year-Month-Day only
, H.div { style } [ R2.showText r.date ] , H.div { className: tClassName } [ R2.showText r.date ]
, H.div { style } [ , H.div { className: tClassName } [
H.a { href: url frontends $ corpusDocument r._id, target: "_blank"} [ H.text r.title ] H.a { href: url frontends $ corpusDocument r._id, target: "_blank"} [ H.text r.title ]
] ]
, H.div { style } [ H.text $ if r.source == "" then "Source" else r.source ] , H.div { className: tClassName } [ H.text $ if r.source == "" then "Source" else r.source ]
] ]
, delete: true } , delete: true }
where where
cat = getCategory lc r cat = getCategory lc r
checked = Trash == cat checked = Trash == cat
style = trashStyle cat tClassName = trashClassName cat selected
className = gi cat className = gi cat
selected = R.readRef currentDocIdRef == Just r._id
type DocChooser = ( type DocChooser = (
listId :: ListId listId :: ListId
, mCorpusId :: Maybe NodeID , mCorpusId :: Maybe NodeID
, nodeId :: NodeID , nodeId :: NodeID
, selected :: Boolean
, sidePanelTriggers :: Record SidePanelTriggers , sidePanelTriggers :: Record SidePanelTriggers
, tableReload :: ReloadS , tableReload :: ReloadS
) )
...@@ -418,14 +421,11 @@ docChooserCpt = R.hooksComponentWithModule thisModule "docChooser" cpt ...@@ -418,14 +421,11 @@ docChooserCpt = R.hooksComponentWithModule thisModule "docChooser" cpt
cpt { listId cpt { listId
, mCorpusId: Just corpusId , mCorpusId: Just corpusId
, nodeId , nodeId
, sidePanelTriggers: { currentDocIdRef , selected
, triggerAnnotatedDocIdChange } , sidePanelTriggers: { triggerAnnotatedDocIdChange }
, tableReload: (_ /\ setReload) } _ = do , tableReload: (_ /\ setReload) } _ = do
let eyeClass = if (R.readRef currentDocIdRef) == Just nodeId then let eyeClass = if selected then "fa-eye" else "fa-eye-slash"
"fa-eye"
else
"fa-eye-slash"
pure $ H.div { className: "doc-chooser" } [ pure $ H.div { className: "doc-chooser" } [
H.span { className: "fa " <> eyeClass H.span { className: "fa " <> eyeClass
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment