diff --git a/static/js/admin.js b/static/js/admin.js index bea168b79d..58f2594600 100644 --- a/static/js/admin.js +++ b/static/js/admin.js @@ -87,8 +87,8 @@ exports.setup_page = function () { }); // Populate streams table - channel.post({ - url: '/json/get_public_streams', + channel.get({ + url: '/json/streams?include_public=true&include_subscribed=true', timeout: 10*1000, idempotent: true, success: populate_streams, diff --git a/static/templates/admin_streams_list.handlebars b/static/templates/admin_streams_list.handlebars index 5e2dbc0c4a..4530a746ac 100644 --- a/static/templates/admin_streams_list.handlebars +++ b/static/templates/admin_streams_list.handlebars @@ -1,6 +1,7 @@ {{#with stream}} + {{#if invite_only}}{{/if}} {{name}} diff --git a/templates/zerver/index.html b/templates/zerver/index.html index 364379853b..b5a9ab4bd0 100644 --- a/templates/zerver/index.html +++ b/templates/zerver/index.html @@ -71,11 +71,9 @@ var page_params = {{ page_params }};
{% include "zerver/subscriptions.html" %}
- {% if is_admin %}
{% include "zerver/administration.html" %}
- {% endif %}
{% include "zerver/settings.html" %}
diff --git a/zerver/tests/frontend/node/templates.js b/zerver/tests/frontend/node/templates.js index 4b5790ea0f..1aa1872a0e 100644 --- a/zerver/tests/frontend/node/templates.js +++ b/zerver/tests/frontend/node/templates.js @@ -70,7 +70,7 @@ function render(template_name, args) { var html = ''; var streams = ['devel', 'trac', 'zulip']; _.each(streams, function (stream) { - var args = {stream: {name: stream}}; + var args = {stream: {name: stream, invite_only: false}}; html += render('admin_streams_list', args); }); html += "
"; diff --git a/zerver/views/__init__.py b/zerver/views/__init__.py index 6021c1e669..0b9d09af4e 100644 --- a/zerver/views/__init__.py +++ b/zerver/views/__init__.py @@ -1065,8 +1065,10 @@ def get_streams_backend(request, user_profile, # We're including nothing, so don't bother hitting the DB. query = [] - streams = sorted({"name": stream.name, "description": stream.description} - for stream in query) + streams = sorted([{"name": stream.name, "description": stream.description, + "invite_only": stream.invite_only} for stream in query], + key=lambda elt: elt["name"]) + return json_success({"streams": streams}) def get_public_streams_backend(request, user_profile):