mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 15:03:34 +00:00
[manual] Fetch Handlebars templates using Ajax
...rather than embedding them into index.html. This is only acceptable for dev, but the next commit adds an alternative mechanism for prod. There isn't actually a manual deployment step here. However, this commit won't work on staging / prod without the next one (since we don't serve zephyr/static/templates in prod). (imported from commit dce7ddfe89e07afc3a96699bb972fd124335aa05)
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
// Miscellaneous early setup.
|
||||
|
||||
var templates = {};
|
||||
var csrf_token;
|
||||
$(function () {
|
||||
// Display loading indicator. This disappears after the first
|
||||
@@ -11,15 +10,6 @@ $(function () {
|
||||
util.show_first_run_message();
|
||||
}
|
||||
|
||||
// Compile Handlebars templates.
|
||||
$.each(['message', 'subscription',
|
||||
'actions_popover_title', 'actions_popover_content',
|
||||
'invite_subscription', 'new_stream_users'],
|
||||
function (index, name) {
|
||||
templates[name] = Handlebars.compile($('#template_'+name).html());
|
||||
}
|
||||
);
|
||||
|
||||
// This requires that we used Django's {% csrf_token %} somewhere on the page.
|
||||
csrf_token = $('input[name="csrfmiddlewaretoken"]').attr('value');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user