only render note action links when owner
This commit is contained in:
parent
cd450ee312
commit
8c05d05cd2
|
@ -21,7 +21,7 @@ import Halogen.HTML as HH
|
||||||
import Halogen.HTML.Events (onChecked, onClick, onSubmit, onValueChange)
|
import Halogen.HTML.Events (onChecked, onClick, onSubmit, onValueChange)
|
||||||
import Halogen.HTML.Properties (ButtonType(..), InputType(..), checked, for, id_, name, rows, title, type_, value)
|
import Halogen.HTML.Properties (ButtonType(..), InputType(..), checked, for, id_, name, rows, title, type_, value)
|
||||||
import Model (Note)
|
import Model (Note)
|
||||||
import Util (_loc, class_, fromNullableStr, ifElseH)
|
import Util (_loc, class_, fromNullableStr, ifElseH, whenH)
|
||||||
import Web.Event.Event (Event, preventDefault)
|
import Web.Event.Event (Event, preventDefault)
|
||||||
import Web.HTML.Location (setHref)
|
import Web.HTML.Location (setHref)
|
||||||
import Data.Symbol (SProxy(..))
|
import Data.Symbol (SProxy(..))
|
||||||
|
@ -108,9 +108,8 @@ nnote st' =
|
||||||
[ text $ if note.shared then "public" else "private" ]
|
[ text $ if note.shared then "public" else "private" ]
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
]
|
, whenH app.dat.isowner $ \_ ->
|
||||||
<> -- | Render Action Links
|
div [ class_ "edit_links db mt3" ]
|
||||||
[ div [ class_ "edit_links db mt3" ]
|
|
||||||
[ button [ type_ ButtonButton, onClick \_ -> Just (NEdit true), class_ "edit light-silver hover-blue" ] [ text "edit " ]
|
[ button [ type_ ButtonButton, onClick \_ -> Just (NEdit true), class_ "edit light-silver hover-blue" ] [ text "edit " ]
|
||||||
, div [ class_ "delete_link di" ]
|
, div [ class_ "delete_link di" ]
|
||||||
[ button [ type_ ButtonButton, onClick \_ -> Just (NDeleteAsk true), class_ ("delete light-silver hover-blue" <> guard st.deleteAsk " dn") ] [ text "delete" ]
|
[ button [ type_ ButtonButton, onClick \_ -> Just (NDeleteAsk true), class_ ("delete light-silver hover-blue" <> guard st.deleteAsk " dn") ] [ text "delete" ]
|
||||||
|
@ -120,6 +119,7 @@ nnote st' =
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
|
|
||||||
]
|
]
|
||||||
|
|
||||||
renderNote_edit _ =
|
renderNote_edit _ =
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in a new issue