diff --git a/zephyr/static/js/metrics.js b/zephyr/static/js/metrics.js index 4b209f8990..cb2ff7f20e 100644 --- a/zephyr/static/js/metrics.js +++ b/zephyr/static/js/metrics.js @@ -39,7 +39,7 @@ $(function () { var operators = event.filter.operators(); var stream_operands = event.filter.operands('stream'); - var subject_operands = event.filter.operands('subject'); + var subject_operands = event.filter.operands('topic'); var reported_operators; if (operators.length === 1) { reported_operators = operators[0][0]; diff --git a/zephyr/static/js/narrow.js b/zephyr/static/js/narrow.js index 84afdd1309..e0fad5e5eb 100644 --- a/zephyr/static/js/narrow.js +++ b/zephyr/static/js/narrow.js @@ -10,7 +10,7 @@ function Filter(operators) { } } -var canonical_operators = {"from": "sender"}; +var canonical_operators = {"from": "sender", "subject": "topic"}; exports.canonicalize_operator = function (operator) { operator = operator.toLowerCase(); @@ -166,7 +166,7 @@ Filter.prototype = { } break; - case 'subject': + case 'topic': if ((message.type !== 'stream') || (message.subject.toLowerCase() !== operand)) return false; @@ -294,7 +294,7 @@ exports.set_compose_defaults = function (opts) { // Set the stream, subject, and/or PM recipient if they are // uniquely specified in the narrow view. - $.each(['stream', 'subject'], function (idx, key) { + $.each(['stream', 'topic'], function (idx, key) { if (single[key] !== undefined) opts[key] = single[key]; }); @@ -497,7 +497,7 @@ exports.by_subject = function (target_id, opts) { opts = $.extend({}, {then_select_id: target_id}, opts); exports.activate([ ['stream', original.stream], - ['subject', original.subject] + ['topic', original.subject] ], opts); }; @@ -656,7 +656,7 @@ exports.narrowed_by_reply = function () { current_filter.operands("pm-with").length === 1) || (operators.length === 2 && current_filter.operands("stream").length === 1 && - current_filter.operands("subject").length === 1)); + current_filter.operands("topic").length === 1)); }; return exports; diff --git a/zephyr/static/js/search.js b/zephyr/static/js/search.js index 768b8bb1fc..f37cb334db 100644 --- a/zephyr/static/js/search.js +++ b/zephyr/static/js/search.js @@ -60,8 +60,8 @@ function describe(operators) { case 'stream': return 'Narrow to stream ' + operand; - case 'subject': - return 'Narrow to subject ' + operand; + case 'topic': + return 'Narrow to topic ' + operand; case 'sender': return 'Narrow to sender ' + operand; diff --git a/zephyr/static/js/stream_list.js b/zephyr/static/js/stream_list.js index 3f3325c630..3be1aebf6f 100644 --- a/zephyr/static/js/stream_list.js +++ b/zephyr/static/js/stream_list.js @@ -190,7 +190,7 @@ exports.update_streams_sidebar = function () { } var op_stream = narrow.filter().operands('stream'); - var op_subject = narrow.filter().operands('subject'); + var op_subject = narrow.filter().operands('topic'); var subject; if (op_stream.length !== 0) { if (op_subject.length !== 0) { @@ -281,7 +281,7 @@ $(function () { var op_stream = event.filter.operands('stream'); if (op_stream.length !== 0 && subs.is_subscribed(op_stream[0])) { var stream_li = get_filter_li('stream', op_stream[0]); - var op_subject = event.filter.operands('subject'); + var op_subject = event.filter.operands('topic'); var subject; if (op_subject.length !== 0) { subject = op_subject[0]; diff --git a/zephyr/static/js/tab_bar.js b/zephyr/static/js/tab_bar.js index 5e972ca308..82b05d70ef 100644 --- a/zephyr/static/js/tab_bar.js +++ b/zephyr/static/js/tab_bar.js @@ -68,9 +68,9 @@ function make_tab_data() { // Third breadcrumb item for stream-subject naarrows if (filter.has_operator("stream") && - filter.has_operator("subject")) { + filter.has_operator("topic")) { stream = filter.operands("stream")[0]; - var subject = filter.operands("subject")[0]; + var subject = filter.operands("topic")[0]; hashed = hashchange.operators_to_hash(ops.slice(0, 2)); tabs.push(make_tab(subject, hashed, null)); diff --git a/zephyr/static/js/ui.js b/zephyr/static/js/ui.js index 1ace1d105f..853909091a 100644 --- a/zephyr/static/js/ui.js +++ b/zephyr/static/js/ui.js @@ -1205,7 +1205,7 @@ $(function () { var subject = $(e.target).parents('li').attr('data-name'); narrow.activate([['stream', stream], - ['subject', subject]], + ['topic', subject]], {select_first_unread: true, trigger: 'sidebar'}); e.preventDefault(); diff --git a/zephyr/views.py b/zephyr/views.py index 5445c44dcc..257bd05c84 100644 --- a/zephyr/views.py +++ b/zephyr/views.py @@ -702,7 +702,7 @@ class NarrowBuilder(object): recipient = get_recipient(Recipient.STREAM, type_id=stream.id) return self.pQ(recipient=recipient) - def by_subject(self, operand): + def by_topic(self, operand): return self.pQ(subject__iexact=operand) def by_sender(self, operand):