Delete widget now suppressed unless there's a valid record.
This commit is contained in:
parent
7be2225917
commit
9d9a800289
|
@ -201,9 +201,14 @@
|
||||||
|
|
||||||
(defn delete-widget
|
(defn delete-widget
|
||||||
"Return an appropriate 'save' widget for this `form` operating on this
|
"Return an appropriate 'save' widget for this `form` operating on this
|
||||||
`entity` taken from this `application`.
|
`entity` taken from this `application`."
|
||||||
TODO: should be suppressed unless member of a group which can delete."
|
|
||||||
[form entity application]
|
[form entity application]
|
||||||
|
(flatten
|
||||||
|
(list
|
||||||
|
(str "{% if all "
|
||||||
|
(s/join " " (map #(str "params." %) (key-names entity)))
|
||||||
|
" %}")
|
||||||
|
|
||||||
(wrap-in-if-member-of
|
(wrap-in-if-member-of
|
||||||
{:tag :p
|
{:tag :p
|
||||||
:attrs {:class "widget action-dangerous"}
|
:attrs {:class "widget action-dangerous"}
|
||||||
|
@ -222,7 +227,8 @@
|
||||||
:value (str "Delete!")}}]}
|
:value (str "Delete!")}}]}
|
||||||
:editable
|
:editable
|
||||||
entity
|
entity
|
||||||
application))
|
application)
|
||||||
|
"{% endif %}")))
|
||||||
|
|
||||||
|
|
||||||
(defn select-property
|
(defn select-property
|
||||||
|
|
Loading…
Reference in a new issue