diff options
author | Maxime Quandalle <maxime@quandalle.com> | 2015-08-31 15:09:53 +0200 |
---|---|---|
committer | Maxime Quandalle <maxime@quandalle.com> | 2015-08-31 15:52:16 +0200 |
commit | d644cba38ff06369cc43c1ebd08d344fd1d248ea (patch) | |
tree | bad4bcef1f549132792301cf134b3c8234ad1d13 /client/components/cards/cardDetails.jade | |
parent | cc88e78483d2f39048d3558193f0c82b711c12c8 (diff) | |
download | wekan-d644cba38ff06369cc43c1ebd08d344fd1d248ea.tar.gz wekan-d644cba38ff06369cc43c1ebd08d344fd1d248ea.tar.bz2 wekan-d644cba38ff06369cc43c1ebd08d344fd1d248ea.zip |
Replace the component bounded `cachedValue` by a global `UnsavedEdits`
This new draft saving system is currently only implemented for the
card description and comment. We need better a component
inheritance/composition model to support this for all editable fields.
Fixes #186
Diffstat (limited to 'client/components/cards/cardDetails.jade')
-rw-r--r-- | client/components/cards/cardDetails.jade | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/client/components/cards/cardDetails.jade b/client/components/cards/cardDetails.jade index 01b56894..a5dcb47b 100644 --- a/client/components/cards/cardDetails.jade +++ b/client/components/cards/cardDetails.jade @@ -34,11 +34,11 @@ template(name="cardDetails") //- XXX We should use "editable" to avoid repetiting ourselves if currentUser.isBoardMember h3.card-details-item-title Description - +inlinedForm(classNames="card-description js-card-description") + +inlinedCardDescription(classNames="card-description js-card-description") +editor(autofocus=true) - = description + | {{getUnsavedValue 'cardDescription' _id description}} .edit-controls.clearfix - button.primary(type="submit") {{_ 'edit'}} + button.primary(type="submit") {{_ 'save'}} a.fa.fa-times-thin.js-close-inlined-form else a.js-open-inlined-form @@ -47,6 +47,12 @@ template(name="cardDetails") = description else | {{_ 'edit'}} + if (hasUnsavedValue 'cardDescription' _id) + p.quiet + | You have an unsaved description. + a.js-open-inlined-form View it + = ' - ' + a.js-close-inlined-form Discard else if description h3.card-details-item-title Description +viewer |