Initial support for white-labeling Zulip as "Dropbox Chat" or otherwise.

Known issues:
* No support for whitelabeling in the email
* No whitelabeling for any externally-visible branding

(imported from commit 9eab7b0744e56a87007b8621a8bb18bbb1080256)
This commit is contained in:
Waseem Daher
2014-07-15 14:21:03 -07:00
parent 710a802f49
commit 307d367346
10 changed files with 30 additions and 22 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

View File

@@ -143,7 +143,7 @@ exports.redraw_title = function () {
var n; var n;
var new_title = (new_message_count ? ("(" + new_message_count + ") ") : "") var new_title = (new_message_count ? ("(" + new_message_count + ") ") : "")
+ page_params.realm_name + " - Zulip"; + page_params.realm_name + " - " + page_params.product_name;
if (document.title === new_title) { if (document.title === new_title) {
return; return;

View File

@@ -89,7 +89,7 @@
<div> <div>
<div id="notification-settings" class="settings-section"> <div id="notification-settings" class="settings-section">
<div class="settings-section-title"><i class="icon-vector-warning-sign settings-section-icon"></i>Notifications</div> <div class="settings-section-title"><i class="icon-vector-warning-sign settings-section-icon"></i>Notifications</div>
<div class="notification-reminder">You'll receive notifications when a message arrives and Zulip isn't in focus or the message is offscreen.</div> <div class="notification-reminder">You'll receive notifications when a message arrives and {{ page_params.product_name }} isn't in focus or the message is offscreen.</div>
<div class="alert" id="notify-settings-status"></div> <div class="alert" id="notify-settings-status"></div>
<div class="notification-settings-form"> <div class="notification-settings-form">
<h4>Stream messages</h4> <h4>Stream messages</h4>
@@ -314,11 +314,11 @@
{{#if_or page_params.show_autoscroll_forever_option page_params.show_default_desktop_notifications_option}} {{#if_or page_params.show_autoscroll_forever_option page_params.show_default_desktop_notifications_option}}
<div class="ui-settings"> <div class="ui-settings">
<div id="ui-settings" class="settings-section"> <div id="ui-settings" class="settings-section">
<div class="settings-section-title"><i class="icon-vector-beaker settings-section-icon"></i>Zulip Labs</div> <div class="settings-section-title"><i class="icon-vector-beaker settings-section-icon"></i>{{ page_params.product_name }} Labs</div>
<div class="alert" id="ui-settings-status"></div> <div class="alert" id="ui-settings-status"></div>
<div class="ui-settings-form"> <div class="ui-settings-form">
<p> <p>
Zulip Labs is where you can try out some experimental new {{ page_params.product_name }} Labs is where you can try out some experimental new
features we're working on. Let us know what you think! features we're working on. Let us know what you think!
</p> </p>
<div class="control-group"> <div class="control-group">

View File

@@ -9,7 +9,7 @@
<meta charset="UTF-8"> <meta charset="UTF-8">
{% block title %} {% block title %}
{% if user_profile.realm.name %} {% if user_profile.realm.name %}
<title>{{user_profile.realm.name}} - Zulip</title> <title>{{user_profile.realm.name}} - {{product_name}}</title>
{% else %} {% else %}
<title>Zulip</title> <title>Zulip</title>
{% endif %} {% endif %}

View File

@@ -3,7 +3,7 @@
<div id="loading_more_messages_indicator"></div> <div id="loading_more_messages_indicator"></div>
<div id="page_loading_indicator"></div> <div id="page_loading_indicator"></div>
<div id="first_run_message" class="empty_feed_notice"> <div id="first_run_message" class="empty_feed_notice">
<h4>Welcome to Zulip</h4> <h4>Welcome to {{product_name}}</h4>
<p>See, the thing about it is... there aren't any messages <p>See, the thing about it is... there aren't any messages
here for you right now. I'm sure someone will eventually send here for you right now. I'm sure someone will eventually send
you one.</p> you one.</p>

View File

@@ -2,7 +2,7 @@
aria-labelledby="invite-user-label" aria-hidden="true"> aria-labelledby="invite-user-label" aria-hidden="true">
<div class="modal-header"> <div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="invite-user-label">Invite coworkers to Zulip</h3> <h3 id="invite-user-label">Invite coworkers to {{product_name}}</h3>
</div> </div>
<form id="invite_user_form" class="form-horizontal" <form id="invite_user_form" class="form-horizontal"
action="/json/invite_users" method="POST">{% csrf_token %} action="/json/invite_users" method="POST">{% csrf_token %}

View File

@@ -18,8 +18,8 @@
<td><b>bold</b></td> <td><b>bold</b></td>
</tr> </tr>
<tr> <tr>
<td>[Zulip](http://zulip.com)</td> <td>[{{product_name}}](https://zulip.com)</td>
<td><a href="http://zulip.com" target="_blank">Zulip</a></td> <td><a href="https://zulip.com" target="_blank">{{product_name}}</a></td>
</tr> </tr>
<tr> <tr>
<td>* Archimedes<br/> <td>* Archimedes<br/>
@@ -54,19 +54,19 @@
<tr> <tr>
<td class="preserve_spaces">``` <td class="preserve_spaces">```
def zulip(): def zulip():
print "Zulip" print "{{product_name}}"
```</td> ```</td>
<td><pre>def zulip(): <td><pre>def zulip():
print "Zulip"</pre></td> print "{{product_name}}"</pre></td>
</tr> </tr>
<tr> <tr>
<td class="preserve_spaces">``` .py <td class="preserve_spaces">``` .py
def zulip(): def zulip():
print "Zulip" print "{{product_name}}"
```</td> ```</td>
<td> <td>
<div class="codehilite"><pre><span class="k">def</span> <span class="nf">zulip</span><span class="p">():</span> <div class="codehilite"><pre><span class="k">def</span> <span class="nf">zulip</span><span class="p">():</span>
<span class="k">print</span> <span class="s">"Zulip"</span></pre></div> <span class="k">print</span> <span class="s">"{{product_name}}"</span></pre></div>
</td> </td>
</tr> </tr>
<tr> <tr>

View File

@@ -1,7 +1,7 @@
<div class="header"> <div class="header">
<div class="header-main rightside-userlist" id="top_navbar"> <div class="header-main rightside-userlist" id="top_navbar">
<div class="column-left"> <div class="column-left">
<a class="brand logo" href="#"><img src="/static/images/logo/zulipcornerlogo@2x.png" class="logoimage" alt="Zulip" content="Zulip" /></a> <a class="brand logo" href="#"><img src="/static/images/logo/{% if dbx_branding %}dbx{% else %}zulip{% endif %}cornerlogo@2x.png" class="logoimage" alt="{{product_name}}" content="{{product_name}}" /></a>
</div> </div>
<div class="column-middle" id="navbar-middle"> <div class="column-middle" id="navbar-middle">
<div class="column-middle-inner"> <div class="column-middle-inner">
@@ -93,7 +93,7 @@
</a> </a>
</li> </li>
{% if show_invites %} {% if show_invites %}
<li title="Invite coworkers to Zulip"> <li title="Invite coworkers to {{product_name}}">
<a href="#invite-user" role="button" data-toggle="modal"> <a href="#invite-user" role="button" data-toggle="modal">
<i class="icon-vector-plus-sign"></i> Invite coworkers <i class="icon-vector-plus-sign"></i> Invite coworkers
</a> </a>
@@ -108,8 +108,7 @@
{% endif %} {% endif %}
<li class="divider"></li> <li class="divider"></li>
{% if show_webathena %} {% if show_webathena %}
<li title="Grant Zulip the Kerberos tickets needed to run your Zephyr <li title="Grant {{product_name}} the Kerberos tickets needed to run your Zephyr mirror via Webathena" id="webathena_login_menu">
mirror via Webathena" id="webathena_login_menu">
<a href="#webathena" class="webathena_login"> <a href="#webathena" class="webathena_login">
<i class="icon-vector-bolt"></i>Link with Webathena <i class="icon-vector-bolt"></i>Link with Webathena
</a> </a>

View File

@@ -1,17 +1,17 @@
<div class="right-sidebar" id="right-sidebar"> <div class="right-sidebar" id="right-sidebar">
<div class="alert alert_sidebar alert-error home-error-bar" id="connection-error"> <div class="alert alert_sidebar alert-error home-error-bar" id="connection-error">
<strong>Unable to connect to Zulip.</strong> Updates may be delayed. <strong>Unable to connect to {{product_name}}.</strong> Updates may be delayed.
<br /><br /> Retrying soon... <br /><br /> <a class="restart_get_updates_button">Try now</a>. <br /><br /> Retrying soon... <br /><br /> <a class="restart_get_updates_button">Try now</a>.
</div> </div>
<div class="alert alert_sidebar alert-error home-error-bar" id="get_old_messages_error"> <div class="alert alert_sidebar alert-error home-error-bar" id="get_old_messages_error">
<strong>Unable to connect to Zulip.</strong> Could not fetch messages. <strong>Unable to connect to {{product_name}}.</strong> Could not fetch messages.
<br /><br /> Retrying soon... <br /><br /> <br /><br /> Retrying soon... <br /><br />
</div> </div>
<div class="alert alert_sidebar alert-error home-error-bar" id="zephyr-mirror-error"> <div class="alert alert_sidebar alert-error home-error-bar" id="zephyr-mirror-error">
<strong>Your Zephyr mirror is not working.</strong> <strong>Your Zephyr mirror is not working.</strong>
<span id="normal-zephyr-mirror-error-text">We <span id="normal-zephyr-mirror-error-text">We
recommend that you <a class="webathena_login">give recommend that you <a class="webathena_login">give
Zulip the ability to mirror the messages for you via {{product_name}} the ability to mirror the messages for you via
WebAthena</a>. If you'd prefer, you can instead WebAthena</a>. If you'd prefer, you can instead
<a href="/zephyr-mirror" target="_blank">run the Zephyr mirror script yourself</a> <a href="/zephyr-mirror" target="_blank">run the Zephyr mirror script yourself</a>
in a screen session.</span> in a screen session.</span>
@@ -30,11 +30,11 @@
$(function () { $(function () {
if (window.bridge !== undefined) { if (window.bridge !== undefined) {
// Desktop app only supports "prompt", not "alert" or "confirm" :/ // Desktop app only supports "prompt", not "alert" or "confirm" :/
if (window.prompt("You're currently on the production Zulip server, but everyone else is on the staging server.\n\nPress OK to be redirected there now.\n\nGoing forward, please run Zulip with the following flag to use the staging server:", "--site https://staging.zulip.com") !== null) { if (window.prompt("You're currently on the production {{product_name}} server, but everyone else is on the staging server.\n\nPress OK to be redirected there now.\n\nGoing forward, please run {{product_name}} with the following flag to use the staging server:", "--site https://staging.zulip.com") !== null) {
window.location.assign("https://staging.zulip.com"); window.location.assign("https://staging.zulip.com");
} }
} else { } else {
if (window.confirm("You're currently on the production Zulip server, but everyone else is on the staging server. Please use https://staging.zulip.com to use Zulip.\n\nPress OK to be redirected there now.")) { if (window.confirm("You're currently on the production {{product_name}} server, but everyone else is on the staging server. Please use https://staging.zulip.com to use {{product_name}}.\n\nPress OK to be redirected there now.")) {
window.location.assign("https://staging.zulip.com"); window.location.assign("https://staging.zulip.com");
} }
} }

View File

@@ -1005,6 +1005,13 @@ def home(request):
if page_params['domain'] == "zulip.com" and not page_params['staging']: if page_params['domain'] == "zulip.com" and not page_params['staging']:
send_to_staging = True send_to_staging = True
dbx_branding = False
product_name = "Zulip"
if page_params['domain'] == "zulip.com":
dbx_branding = True
product_name = "Dropbox Chat"
page_params['product_name'] = product_name
request._log_data['extra'] = "[%s]" % (register_ret["queue_id"],) request._log_data['extra'] = "[%s]" % (register_ret["queue_id"],)
response = render_to_response('zerver/index.html', response = render_to_response('zerver/index.html',
{'user_profile': user_profile, {'user_profile': user_profile,
@@ -1019,6 +1026,8 @@ def home(request):
'enable_feedback': settings.ENABLE_FEEDBACK, 'enable_feedback': settings.ENABLE_FEEDBACK,
'embedded': narrow_stream is not None, 'embedded': narrow_stream is not None,
'send_to_staging': send_to_staging, 'send_to_staging': send_to_staging,
'dbx_branding': dbx_branding,
'product_name': product_name
}, },
context_instance=RequestContext(request)) context_instance=RequestContext(request))
patch_cache_control(response, no_cache=True, no_store=True, must_revalidate=True) patch_cache_control(response, no_cache=True, no_store=True, must_revalidate=True)