From 01bf0868a98518e616c8c0d4fdac694a4489afa9 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Wed, 31 Oct 2012 18:10:18 -0400 Subject: [PATCH] Rename new_subscription argument to streams. (imported from commit 8024f47564fe580734d5e452f5092520870003a7) --- templates/zephyr/subscriptions.html | 2 +- zephyr/static/js/subs.js | 10 +++++----- zephyr/views.py | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/templates/zephyr/subscriptions.html b/templates/zephyr/subscriptions.html index 69feb64569..0aa19db007 100644 --- a/templates/zephyr/subscriptions.html +++ b/templates/zephyr/subscriptions.html @@ -6,7 +6,7 @@

Subscriptions

{% csrf_token %} -
diff --git a/zephyr/static/js/subs.js b/zephyr/static/js/subs.js index e661453ef8..2760cbd908 100644 --- a/zephyr/static/js/subs.js +++ b/zephyr/static/js/subs.js @@ -44,7 +44,7 @@ exports.fetch = function () { $('#subscriptions_table').append(templates.subscription({subscription: name})); }); } - $('#new_subscription').focus().select(); + $('#streams').focus().select(); }, error: function (xhr) { report_error("Error listing subscriptions", xhr, $("#subscriptions-status")); @@ -62,7 +62,7 @@ exports.add_for_send = function (stream, prompt_button) { $.ajax({ type: 'POST', url: '/json/subscriptions/add', - data: {new_subscription: stream}, + data: {streams: stream}, dataType: 'json', timeout: 10*60*1000, // 10 minutes in ms success: function (response) { @@ -112,17 +112,17 @@ $(function () { $("#add_new_subscription").ajaxForm({ dataType: 'json', // This seems to be ignored. We still get back an xhr. success: function (resp, statusText, xhr, form) { - $("#new_subscription").val(""); + $("#streams").val(""); var name = $.parseJSON(xhr.responseText).data; $('#subscriptions_table').prepend(templates.subscription({subscription: name})); add_to_stream_list(name); report_success("Successfully added subscription to " + name, $("#subscriptions-status")); - $("#new_subscription").focus(); + $("#streams").focus(); }, error: function (xhr) { report_error("Error adding subscription", xhr, $("#subscriptions-status")); - $("#new_subscription").focus(); + $("#streams").focus(); } }); }); diff --git a/zephyr/views.py b/zephyr/views.py index 222fba9a3f..d919b59a38 100644 --- a/zephyr/views.py +++ b/zephyr/views.py @@ -781,9 +781,9 @@ def api_subscribe(request, user_profile): def json_add_subscription(request): user_profile = UserProfile.objects.get(user=request.user) - if "new_subscription" not in request.POST: - return json_error("Missing new_subscription argument") - stream_name = request.POST.get('new_subscription').strip() + if "streams" not in request.POST: + return json_error("Missing streams argument") + stream_name = request.POST.get('streams').strip() if not valid_stream_name(stream_name): return json_error("Invalid characters in stream names") if len(stream_name) > 30: