From 2fde1db83cc0fb4762d45154e4c85dbe0b2e4080 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Wed, 17 Aug 2022 21:08:54 -0500 Subject: [PATCH] Allow user feedback to request email reply back --- tailbone/forms/common.py | 5 ++++- .../themes/falafel/js/tailbone.feedback.js | 9 +++++++++ tailbone/templates/themes/falafel/base.mako | 20 ++++++++++++++++++- tailbone/views/common.py | 6 +++--- 4 files changed, 35 insertions(+), 5 deletions(-) diff --git a/tailbone/forms/common.py b/tailbone/forms/common.py index 26934479..4d58b943 100644 --- a/tailbone/forms/common.py +++ b/tailbone/forms/common.py @@ -2,7 +2,7 @@ ################################################################################ # # Rattail -- Retail Software Framework -# Copyright © 2010-2021 Lance Edgar +# Copyright © 2010-2022 Lance Edgar # # This file is part of Rattail. # @@ -58,4 +58,7 @@ class Feedback(colander.Schema): user_name = colander.SchemaNode(colander.String(), missing=colander.null) + please_reply_to = colander.SchemaNode(colander.String(), + missing=colander.null) + message = colander.SchemaNode(colander.String()) diff --git a/tailbone/static/themes/falafel/js/tailbone.feedback.js b/tailbone/static/themes/falafel/js/tailbone.feedback.js index 11745ab4..6f687b80 100644 --- a/tailbone/static/themes/falafel/js/tailbone.feedback.js +++ b/tailbone/static/themes/falafel/js/tailbone.feedback.js @@ -5,6 +5,12 @@ let FeedbackForm = { mixins: [FormPosterMixin], methods: { + pleaseReplyChanged(value) { + this.$nextTick(() => { + this.$refs.userEmail.focus() + }) + }, + showFeedback() { this.showDialog = true this.$nextTick(function() { @@ -18,6 +24,7 @@ let FeedbackForm = { referrer: this.referrer, user: this.userUUID, user_name: this.userName, + please_reply_to: this.pleaseReply ? this.userEmail : null, message: this.message.trim(), } @@ -41,5 +48,7 @@ let FeedbackFormData = { referrer: null, userUUID: null, userName: null, + pleaseReply: false, + userEmail: null, showDialog: false, } diff --git a/tailbone/templates/themes/falafel/base.mako b/tailbone/templates/themes/falafel/base.mako index 9bd092ab..9b9236fe 100644 --- a/tailbone/templates/themes/falafel/base.mako +++ b/tailbone/templates/themes/falafel/base.mako @@ -487,7 +487,7 @@