Skip to content

Commit

Permalink
Change relative paths to absolute paths when we don't want the subdom…
Browse files Browse the repository at this point in the history
…ain.

Changes relative path to an absolute path (that doesn't contain the
subdomain) for various links to
/create_realm, /api, /apps, /integrations, /hello, /terms, and the logged
out / (the Zulip in the upper left corner of portico)

I typically left links internal to the relevant pages (e.g. a link from
integrations.html to a subpage of integrations/) as relative links, and
changed external links from within the app to the absolute path (e.g. the
link to integrations from the gear menu).
  • Loading branch information
rishig authored and timabbott committed Aug 13, 2016
1 parent dff43fc commit 902a7fb
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions static/js/tutorial.js
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ function finale(skip) {
if (page_params.prompt_for_invites) {
alert_contents = "<i class='icon-vector-heart alert-icon'></i>It's lonely in here! <a href='#invite-user' data-toggle='modal'>Invite some users</a>.";
} else {
alert_contents = "<i class='icon-vector-desktop alert-icon'></i>What's better than " + page_params.product_name + " in your browser? The <a href='/apps' target='_blank'>"+ page_params.product_name + " desktop app</a>!";
alert_contents = "<i class='icon-vector-desktop alert-icon'></i>What's better than " + page_params.product_name + " in your browser? The <a href='" + page_params.server_uri + "/apps' target='_blank'>"+ page_params.product_name + " desktop app</a>!";
}
show_app_alert(alert_contents);

Expand All @@ -384,7 +384,7 @@ function finale(skip) {
if (stream_data.in_home_view(page_params.notifications_stream)) {
send_delayed_stream_message(page_params.notifications_stream, "welcome", "Practice sending sending some messages here, or starting a new topic.", 15);
send_delayed_stream_message(page_params.notifications_stream, page_params.product_name + " tips", "Here's a message on a new topic: `" + page_params.product_name + " tips`.\n\nAs you settle into " + page_params.product_name + ", customize your account and notifications on your [Settings page](#settings).", 30);
send_delayed_stream_message(page_params.notifications_stream, page_params.product_name + " tips", "You might also enjoy:\n\n* Our lightweight !modal_link(#markdown-help, message formatting) (including emoji! :thumbsup:)\n* !modal_link(#keyboard-shortcuts, Keyboard shortcuts)\n* [Desktop and mobile apps](/apps)", 40);
send_delayed_stream_message(page_params.notifications_stream, page_params.product_name + " tips", "You might also enjoy:\n\n* Our lightweight !modal_link(#markdown-help, message formatting) (including emoji! :thumbsup:)\n* !modal_link(#keyboard-shortcuts, Keyboard shortcuts)\n* [Desktop and mobile apps](" + page_params.server_uri + "/apps)", 40);
}

if (work_stream !== undefined) {
Expand Down
4 changes: 2 additions & 2 deletions static/templates/settings_tab.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -308,8 +308,8 @@

<div class="bot-settings-form">
{{#tr this}}
<p class="bot-settings-note">Looking for our <a href="/integrations" target="_blank">Integrations</a>
or <a href="/api" target="_blank">API</a> documentation?</p>
<p class="bot-settings-note">Looking for our <a href="{{ server_uri }}/integrations" target="_blank">Integrations</a>
or <a href="{{ server_uri }}/api" target="_blank">API</a> documentation?</p>
{{/tr}}

<ol id="bots_list">
Expand Down
2 changes: 1 addition & 1 deletion templates/zerver/accounts_accept_terms.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ <h3>{{ _("Accept the terms of service") }}</h3>
#}
<input id="id_terms" class="required" type="checkbox" name="terms"
{% if form.terms.value() %}checked="checked"{% endif %} />
{{ _("I agree to the") }} <a href="/terms">{{ _("Terms of Service") }}</a>.
{{ _("I agree to the") }} <a href="{{ external_uri_scheme }}{{ external_host }}/terms">{{ _("Terms of Service") }}</a>.
</label>
{% if form.terms.errors %}
{% for error in form.terms.errors %}
Expand Down
4 changes: 2 additions & 2 deletions templates/zerver/features.html
Original file line number Diff line number Diff line change
Expand Up @@ -138,13 +138,13 @@ <h4>{{ _("API") }}</h4>
<div class="feature-block left">
<i class="icon-vector-mobile-phone icon-vector-3x feature-icon"></i>
<h4>{% trans %}Mobile apps{% endtrans %}</h4>
<p>{% trans %}Check Zulip on the go with native <a href="/apps">iOS and
<p>{% trans %}Check Zulip on the go with native <a href="{{ external_uri_scheme }}{{ external_host }}/apps">iOS and
Android apps</a>{% endtrans %}.</p>
</div>
<div class="feature-block">
<i class="icon-vector-desktop icon-vector-3x feature-icon"></i>
<h4>{% trans %}Desktop apps{% endtrans %}</h4>
<p>{% trans %}Prefer Zulip in its own window and rich, OS-level notifications?
Enjoy <a href="/apps">Zulip on your desktop</a>{% endtrans %}.</p>
Enjoy <a href="{{ external_uri_scheme }}{{ external_host }}/apps">Zulip on your desktop</a>{% endtrans %}.</p>
</div>
{% endblock %}
6 changes: 3 additions & 3 deletions templates/zerver/navbar.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,17 @@
</li>
<li class="divider"></li>
<li title="Desktop & mobile apps">
<a href="/apps" target="_blank" role="button">
<a href="{{ external_uri_scheme }}{{ external_host }}/apps" target="_blank" role="button">
<i class="icon-vector-desktop"></i> {{ _('Desktop & mobile apps') }}
</a>
</li>
<li title="Integrations">
<a href="/integrations" target="_blank" role="button">
<a href="{{ external_uri_scheme }}{{ external_host }}/integrations" target="_blank" role="button">
<i class="icon-vector-github"></i> {{ _('Integrations') }}
</a>
</li>
<li title="API documentation">
<a href="/api" target="_blank" role="button">
<a href="{{ external_uri_scheme }}{{ external_host }}/api" target="_blank" role="button">
<i class="icon-vector-sitemap"></i> {{ _('API documentation') }}
</a>
</li>
Expand Down
10 changes: 5 additions & 5 deletions templates/zerver/portico.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
<div class="column-left">
<div>
{% if custom_logo_url %}
<a class="brand logo" href="/"><img src="{{ custom_logo_url }}" class="portico-logo" alt="Zulip" content="Zulip" /></a>
<a class="brand logo" href="{{ external_uri_scheme }}{{ external_host }}/"><img src="{{ custom_logo_url }}" class="portico-logo" alt="Zulip" content="Zulip" /></a>
{% else %}
<a class="brand logo" href="/"><img src="/static/images/logo/[email protected]" class="portico-simple-logo" alt="Zulip" content="Zulip" /></a>
<a class="brand logo" href="{{ external_uri_scheme }}{{ external_host }}/"><img src="/static/images/logo/[email protected]" class="portico-simple-logo" alt="Zulip" content="Zulip" /></a>
{% endif %}
</div>
</div>
Expand Down Expand Up @@ -52,10 +52,10 @@
<div class="footer">
<div class="footer-main">
<ul class="footer-navigation">
<li><a href="/hello">{{ _('About') }}</a></li>
<li><a href="{{ external_uri_scheme }}{{ external_host }}/hello">{{ _('About') }}</a></li>
{% if terms_of_service %}
<li><span class="little-bullet">·</span></li>
<li><a href="/terms">{{ _('Legal') }}</a></li>
<li><a href="{{ external_uri_scheme }}{{ external_host }}/terms">{{ _('Legal') }}</a></li>
{% endif %}
<li><span class="little-bullet">·</span></li>
<li><a href="{{login_url}}">{{ _('Log in') }}</a></li>
Expand All @@ -70,7 +70,7 @@
</li>
<li>
{% if open_realm_creation %}
<a href="/create_realm">{{ _('Create new organization') }}</a>
<a href="{{ external_uri_scheme }}{{ external_host }}/create_realm">{{ _('Create new organization') }}</a>
{% endif %}
</li>
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion templates/zerver/register.html
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ <h3>{{ _('Tell us a bit about yourself') }}.</h3>
#}
<input id="id_terms" class="required" type="checkbox" name="terms"
{% if form.terms.value() %}checked="checked"{% endif %} />
{{ _('I agree to the') }} <a href="/terms" target="_blank">{{ _('Terms of Service') }}</a>.
{{ _('I agree to the') }} <a href="{{ external_uri_scheme }}{{ external_host }}/terms" target="_blank">{{ _('Terms of Service') }}</a>.
</label>
{% if form.terms.errors %}
{% for error in form.terms.errors %}
Expand Down

0 comments on commit 902a7fb

Please sign in to comment.