diff --git a/frontend_tests/node_tests/templates.js b/frontend_tests/node_tests/templates.js index a628015f36..44c2cf07cd 100644 --- a/frontend_tests/node_tests/templates.js +++ b/frontend_tests/node_tests/templates.js @@ -939,7 +939,7 @@ function render(template_name, args) { global.write_handlebars_output("subscription_invites_warning_modal", html); var button = $(html).find(".close-invites-warning-modal").last(); - assert.equal(button.text(), 'Oops! Let me change it'); + assert.equal(button.text(), 'Go back'); }()); (function subscription_settings() { diff --git a/static/js/stream_create.js b/static/js/stream_create.js index ea154b41b7..304c92a2e5 100644 --- a/static/js/stream_create.js +++ b/static/js/stream_create.js @@ -165,13 +165,6 @@ function create_stream() { ); } -function show_large_invites_warning(count) { - var invites_warning_modal = templates.render('subscription_invites_warning_modal'); - $('#stream-creation').append(invites_warning_modal); - var confirm_button = $('#invites-warning-overlay').find('.confirm-invites-warning-modal'); - confirm_button.text(i18n.t('Invite __count__ users!', {count: count})); -} - exports.new_stream_clicked = function (stream) { // this changes the tab switcher (settings/preview) which isn't necessary // to a add new stream title. @@ -328,8 +321,11 @@ $(function () { } var principals = get_principals(); - if (principals.length > 100) { - show_large_invites_warning(principals.length); + if (principals.length >= 50) { + var invites_warning_modal = templates.render('subscription_invites_warning_modal', + {stream_name: stream, + count: principals.length}); + $('#stream-creation').append(invites_warning_modal); } else { create_stream(); } diff --git a/static/templates/subscription_invites_warning_modal.handlebars b/static/templates/subscription_invites_warning_modal.handlebars index d5a8f0781f..9b80e6238d 100644 --- a/static/templates/subscription_invites_warning_modal.handlebars +++ b/static/templates/subscription_invites_warning_modal.handlebars @@ -2,14 +2,14 @@