Allow disabling of feedback system in UI

(imported from commit ce16b2916784e9cf10a230cb47515ffc65888778)
This commit is contained in:
Leo Franchi 2013-11-13 10:59:03 -05:00
parent cf33d1c512
commit 6274c33f86
4 changed files with 10 additions and 2 deletions

View File

@ -21,11 +21,13 @@
</div>
<div class="alert alert_sidebar alert-error home-error-bar" id="home-error"></div>
<div class="alert alert_sidebar alert-error home-error-bar" id="reloading-application"></div>
{% if enable_feedback %}
<div id="feedback_section">
<button type="button" class="btn btn-large" id="feedback_button">
<i class="icon-vector-comment"></i>&nbsp;&nbsp;Send feedback
</button>
</div>
{% endif %}
<div id="user-list">
<div id="userlist-header">
<h4 class='sidebar-title' id='userlist-title'>USERS</h4>

View File

@ -341,8 +341,9 @@ def do_send_messages(messages):
if message['stream'].invite_only:
data['invite_only'] = True
tornado_callbacks.send_notification(data)
if (message['message'].recipient.type == Recipient.PERSONAL and
"feedback@zulip.com" in [up.email for up in message['recipients']]):
if (settings.ENABLE_FEEDBACK and
message['message'].recipient.type == Recipient.PERSONAL and
settings.FEEDBACK_BOT in [up.email for up in message['recipients']]):
queue_json_publish(
'feedback_messages',
message['message'].to_dict(apply_markdown=False),

View File

@ -725,6 +725,7 @@ def home(request):
'show_invites': show_invites,
'show_admin': user_profile.show_admin,
'show_webathena': user_profile.realm.domain == "mit.edu",
'enable_feedback': settings.ENABLE_FEEDBACK
},
context_instance=RequestContext(request))
patch_cache_control(response, no_cache=True, no_store=True, must_revalidate=True)

View File

@ -22,6 +22,10 @@ EMAIL_HOST_PASSWORD = ''
EMAIL_PORT = 587
EMAIL_USE_TLS = True
# Control whether or not there is a feedback button in the UI,
# which can be used to send feedback directly to Zulip
ENABLE_FEEDBACK = True
# By default uploaded files and avatars are stored directly on the Zulip server
# If file storage to Amazon S3 is desired, please contact Zulip Support
# (support@zulip.com) for further instructions on setting up S3 integration