templates: Add new context variables to all templates.

This adds a few new helpful context variables that we can use to
compute URLs in all of our templates:
* external_uri_scheme: http(s)://
* server_uri: The base URL for the server's canonical name
* realm_uri: The base URL for the user's realm

This is preparatory work for making realm_uri != server_uri when we
add support for subdomains.
This commit is contained in:
Tim Abbott
2016-08-13 15:57:45 -07:00
parent 4a46b879ee
commit 4fbb8c3eee
7 changed files with 38 additions and 8 deletions

View File

@@ -158,6 +158,9 @@ class ConfirmationEmailWorker(QueueProcessingWorker):
'referrer': referrer,
'verbose_support_offers': settings.VERBOSE_SUPPORT_OFFERS,
'external_host': settings.EXTERNAL_HOST,
'external_uri_scheme': settings.EXTERNAL_URI_SCHEME,
'server_uri': settings.SERVER_URI,
'realm_uri': referrer.realm.uri,
'support_email': settings.ZULIP_ADMINISTRATOR},
datetime.timedelta(days=2),
tags=["invitation-reminders"],